mycpen-blog 0.0.0-wjbgetcphi → 0.0.0-wjbrdpunvk
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index.css +1 -1
- package/gallery/fe32.top/download.sh +1144 -0
- package/img/loading.svg +1 -0
- package/js/APlayer.js +1 -1
- package/js/custom.js +1 -1
- package/js/fcircle.js +1 -1
- package/js/fcircle_manage_panel.js +16 -0
- package/js/home_page_swiper.js +1 -1
- package/js/people.js +1 -1
- package/js/random.js +1 -1
- package/js/tianli_gpt.js +1 -1
- package/js/utils.js +1 -1
- package/json/friend.json +1 -0
- package/json/link.json +1 -0
- package/json/tianli_gpt.json +1 -0
- package/manifest.json +1 -1
- package/music1/main.css +1 -1
- package/music1/manifest.json +2 -2
- package/package.json +1 -1
- package/search.xml +48 -48
- package/sitemap.xml +102 -102
- package/wechatOA/main.css +1 -1
- package/friend.json +0 -1
- package/link.json +0 -1
- package/song/AZA/345/276/256/345/224/261/345/233/242//344/273/216/345/210/253/345/220/216/song.lrc +0 -43
- package/song/S.H.E//344/270/200/347/234/274/344/270/207/345/271/264/song.lrc +0 -51
- package/song/The Chainsmokers/Something Just Like This/song.lrc +0 -65
- package/song//345/221/250/346/235/260/344/274/246//344/270/203/351/207/214/351/246/231/song.lrc +0 -39
- package/song//345/221/250/346/235/260/344/274/246//345/217/215/346/226/271/345/220/221/347/232/204/351/222/237/song.lrc +0 -61
- package/song//345/221/250/346/235/260/344/274/246//346/230/216/346/230/216/345/260/261/song.lrc +0 -46
- package/song//345/221/250/346/235/260/344/274/246//346/234/200/351/225/277/347/232/204/347/224/265/345/275/261/song.lrc +0 -51
- package/song//345/221/250/346/235/260/344/274/246//347/250/273/351/246/231/song.lrc +0 -53
- package/song//345/221/250/346/235/260/344/274/246//347/272/242/351/242/234/345/246/202/351/234/234/song.lrc +0 -57
- package/song//345/221/250/346/235/260/344/274/246//350/257/264/345/245/275/347/232/204/345/271/270/347/246/217/345/221/242/song.lrc +0 -70
- package/song//345/221/250/346/235/260/344/274/246//351/235/222/350/212/261/347/223/267/song.lrc +0 -45
- package/song//346/242/201/351/223/255/347/220/233//351/241/273/350/207/276/song.lrc +0 -71
- package/song//350/214/203/347/216/256/347/220/252//346/234/200/345/210/235/347/232/204/346/242/246/346/203/263/song.lrc +0 -63
- package/song//350/221/243/347/234/237//346/200/235/345/246/202/351/233/252/song.lrc +0 -48
package/img/loading.svg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="margin:auto;background:0 0" width="60" height="60" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" display="block"><circle cx="50" cy="50" r="20" stroke-width="4" stroke="#a5a5a5" stroke-dasharray="31.416 31.416" fill="none" stroke-linecap="round" transform="rotate(67.21 50 50)"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="0 50 50;360 50 50"/></circle></svg>
|
package/js/APlayer.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=41)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=/mobile/i.test(window.navigator.userAgent),a={secondToTime:function(e){var t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),i=Math.floor(e-3600*t-60*n);return(t>0?[t,n,i]:[n,i]).map((function(e){return e<10?"0"+e:""+e})).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,i=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-i},getElementViewTop:function(e,t){for(var n,i=e.offsetTop,a=e.offsetParent;null!==a;)i+=a.offsetTop,a=a.offsetParent;return n=document.body.scrollTop+document.documentElement.scrollTop,t?i:i-n},isMobile:i,storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},nameMap:{dragStart:i?"touchstart":"mousedown",dragMove:i?"touchmove":"mousemove",dragEnd:i?"touchend":"mouseup"},randomOrder:function(e){return function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*(t+1)),i=e[n];e[n]=e[t],e[t]=i}return e}([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Array(e))).map((function(e,t){return t})))}};t.default=a},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.audio,r=(e.$value,e.$index,i.$escape),o=e.theme,s=e.index;return n(a,(function(e,n){t+='\n<li>\n <span class="aplayer-list-cur" style="background-color: ',t+=r(e.theme||o),t+=';"></span>\n <span class="aplayer-list-index">',t+=r(n+s),t+='</span>\n <span class="aplayer-list-title">',t+=r(e.name),t+='</span>\n <span class="aplayer-list-author">',t+=r(e.artist),t+="</span>\n</li>\n"})),t}},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=g(n(33)),a=g(n(32)),r=g(n(31)),o=g(n(30)),s=g(n(29)),l=g(n(28)),u=g(n(27)),c=g(n(26)),p=g(n(25)),d=g(n(24)),h=g(n(23)),y=g(n(22)),f=g(n(21)),v=g(n(20)),m=g(n(19));function g(e){return e&&e.__esModule?e:{default:e}}var w={play:i.default,pause:a.default,volumeUp:r.default,volumeDown:o.default,volumeOff:s.default,orderRandom:l.default,orderList:u.default,menu:c.default,loopAll:p.default,loopOne:d.default,loopNone:h.default,loading:y.default,right:f.default,skip:v.default,lrc:m.default};t.default=w},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";var i,a,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};void 0===(a="function"==typeof(i=function(){if("object"===("undefined"==typeof window?"undefined":r(window))&&void 0!==document.querySelectorAll&&void 0!==window.pageYOffset&&void 0!==history.pushState){var e=function(e,t,n,i){return n>i?t:e+(t-e)*((a=n/i)<.5?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1);var a},t=function(t,n,i,a){n=n||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof t)var o=parseInt(t);else o=function(e,t){return"HTML"===e.nodeName?-t:e.getBoundingClientRect().top+t}(t,r);var s=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,15)};!function u(){var c=Date.now()-s;a!==window?a.scrollTop=e(r,o,c,n):window.scroll(0,e(r,o,c,n)),c>n?"function"==typeof i&&i(t):l(u)}()},n=function(e){if(!e.defaultPrevented){e.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var n=document.getElementById(this.hash.substring(1));if(!n)return;t(n,500,(function(e){location.replace("#"+e.id)}))}};return document.addEventListener("DOMContentLoaded",(function(){for(var e,t=document.querySelectorAll('a[href^="#"]:not([href="#"])'),i=t.length;e=t[--i];)e.addEventListener("click",n,!1)})),t}})?i.call(t,n,t,e):i)||(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=s(n(1)),r=s(n(0)),o=s(n(5));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.index=0,this.audios=this.player.options.audio,this.bindEvents()}return i(e,[{key:"bindEvents",value:function(){var e=this;this.player.template.list.addEventListener("click",(function(t){var n=void 0;n="LI"===t.target.tagName.toUpperCase()?t.target:t.target.parentElement;var i=parseInt(n.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;i!==e.index?(e.switch(i),e.player.play()):e.player.toggle()}))}},{key:"show",value:function(){this.player.events.trigger("listshow"),this.player.template.list.classList.remove("aplayer-list-hide"),this.player.template.listOl.scrollTop=33*this.index}},{key:"hide",value:function(){this.player.events.trigger("listhide"),this.player.template.list.classList.add("aplayer-list-hide")}},{key:"toggle",value:function(){this.player.template.list.classList.contains("aplayer-list-hide")?this.show():this.hide()}},{key:"add",value:function(e){this.player.events.trigger("listadd",{audios:e}),"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),e.map((function(e){return e.name=e.name||e.title||"Audio name",e.artist=e.artist||e.author||"Audio artist",e.cover=e.cover||e.pic,e.type=e.type||"normal",e}));var t=!(this.audios.length>1),n=0===this.audios.length;this.player.template.listOl.innerHTML+=(0,a.default)({theme:this.player.options.theme,audio:e,index:this.audios.length+1}),this.audios=this.audios.concat(e),t&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=r.default.randomOrder(this.audios.length),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur"),this.player.template.listCurs[this.audios.length-1].style.backgroundColor=e.theme||this.player.options.theme,n&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}},{key:"remove",value:function(e){if(this.player.events.trigger("listremove",{index:e}),this.audios[e])if(this.audios.length>1){var t=this.player.container.querySelectorAll(".aplayer-list li");t[e].remove(),this.audios.splice(e,1),this.player.lrc&&this.player.lrc.remove(e),e===this.index&&(this.audios[e]?this.switch(e):this.switch(e-1)),this.index>e&&this.index--;for(var n=e;n<t.length;n++)t[n].getElementsByClassName("aplayer-list-index")[0].textContent=n;1===this.audios.length&&this.player.container.classList.remove("aplayer-withlist"),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur")}else this.clear()}},{key:"switch",value:function(e){if(this.player.events.trigger("listswitch",{index:e}),void 0!==e&&this.audios[e]){this.index=e;var t=this.audios[this.index];this.player.template.pic.style.backgroundImage=t.cover?"url('"+t.cover+"')":"",this.player.theme(this.audios[this.index].theme||this.player.options.theme,this.index,!1),this.player.template.title.innerHTML=t.name,this.player.template.author.innerHTML=t.artist?" - "+t.artist:"";var n=this.player.container.getElementsByClassName("aplayer-list-light")[0];n&&n.classList.remove("aplayer-list-light"),this.player.container.querySelectorAll(".aplayer-list li")[this.index].classList.add("aplayer-list-light"),(0,o.default)(33*this.index,500,null,this.player.template.listOl),this.player.setAudio(t),this.player.lrc&&this.player.lrc.switch(this.index),this.player.lrc&&this.player.lrc.update(0),1!==this.player.duration&&(this.player.template.dtime.innerHTML=r.default.secondToTime(this.player.duration))}}},{key:"clear",value:function(){this.player.events.trigger("listclear"),this.index=0,this.player.container.classList.remove("aplayer-withlist"),this.player.pause(),this.audios=[],this.player.lrc&&this.player.lrc.clear(),this.player.audio.src="",this.player.template.listOl.innerHTML="",this.player.template.pic.style.backgroundImage="",this.player.theme(this.player.options.theme,this.index,!1),this.player.template.title.innerHTML="No audio",this.player.template.author.innerHTML="",this.player.bar.set("loaded",0,"width"),this.player.template.dtime.innerHTML=r.default.secondToTime(0)}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={},this.audioEvents=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","mozaudioavailable","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],this.playerEvents=["destroy","listshow","listhide","listadd","listremove","listswitch","listclear","noticeshow","noticehide","lrcshow","lrchide"]}return i(e,[{key:"on",value:function(e,t){this.type(e)&&"function"==typeof t&&(this.events[e]||(this.events[e]=[]),this.events[e].push(t))}},{key:"trigger",value:function(e,t){if(this.events[e]&&this.events[e].length)for(var n=0;n<this.events[e].length;n++)this.events[e][n](t)}},{key:"type",value:function(e){return-1!==this.playerEvents.indexOf(e)?"player":-1!==this.audioEvents.indexOf(e)?"audio":(console.error("Unknown event name: "+e),null)}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},this.types=["loading"],this.init()}return i(e,[{key:"init",value:function(){var e=this;this.types.forEach((function(t){e["init"+t+"Checker"]()}))}},{key:"initloadingChecker",value:function(){var e=this,t=0,n=0,i=!1;this.loadingChecker=setInterval((function(){e.enableloadingChecker&&(n=e.player.audio.currentTime,i||n!==t||e.player.audio.paused||(e.player.container.classList.add("aplayer-loading"),i=!0),i&&n>t&&!e.player.audio.paused&&(e.player.container.classList.remove("aplayer-loading"),i=!1),t=n)}),100)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(){var e=this;this.types.forEach((function(t){e["enable"+t+"Checker"]=!1,e[t+"Checker"]&&clearInterval(e[t+"Checker"])}))}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=o(n(0)),r=o(n(3));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.initPlayButton(),this.initPlayBar(),this.initOrderButton(),this.initLoopButton(),this.initMenuButton(),a.default.isMobile||this.initVolumeButton(),this.initMiniSwitcher(),this.initSkipButton(),this.initLrcButton()}return i(e,[{key:"initPlayButton",value:function(){var e=this;this.player.template.pic.addEventListener("click",(function(){e.player.toggle()}))}},{key:"initPlayBar",value:function(){var e=this,t=function(t){var n=((t.clientX||t.changedTouches[0].clientX)-a.default.getElementViewLeft(e.player.template.barWrap))/e.player.template.barWrap.clientWidth;n=Math.max(n,0),n=Math.min(n,1),e.player.bar.set("played",n,"width"),e.player.lrc&&e.player.lrc.update(n*e.player.duration),e.player.template.ptime.innerHTML=a.default.secondToTime(n*e.player.duration)},n=function n(i){document.removeEventListener(a.default.nameMap.dragEnd,n),document.removeEventListener(a.default.nameMap.dragMove,t);var r=((i.clientX||i.changedTouches[0].clientX)-a.default.getElementViewLeft(e.player.template.barWrap))/e.player.template.barWrap.clientWidth;r=Math.max(r,0),r=Math.min(r,1),e.player.bar.set("played",r,"width"),e.player.seek(e.player.bar.get("played","width")*e.player.duration),e.player.disableTimeupdate=!1};this.player.template.barWrap.addEventListener(a.default.nameMap.dragStart,(function(){e.player.disableTimeupdate=!0,document.addEventListener(a.default.nameMap.dragMove,t),document.addEventListener(a.default.nameMap.dragEnd,n)}))}},{key:"initVolumeButton",value:function(){var e=this;this.player.template.volumeButton.addEventListener("click",(function(){e.player.audio.muted?(e.player.audio.muted=!1,e.player.switchVolumeIcon(),e.player.bar.set("volume",e.player.volume(),"height")):(e.player.audio.muted=!0,e.player.switchVolumeIcon(),e.player.bar.set("volume",0,"height"))}));var t=function(t){var n=1-((t.clientY||t.changedTouches[0].clientY)-a.default.getElementViewTop(e.player.template.volumeBar,e.player.options.fixed))/e.player.template.volumeBar.clientHeight;n=Math.max(n,0),n=Math.min(n,1),e.player.volume(n)},n=function n(i){e.player.template.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"),document.removeEventListener(a.default.nameMap.dragEnd,n),document.removeEventListener(a.default.nameMap.dragMove,t);var r=1-((i.clientY||i.changedTouches[0].clientY)-a.default.getElementViewTop(e.player.template.volumeBar,e.player.options.fixed))/e.player.template.volumeBar.clientHeight;r=Math.max(r,0),r=Math.min(r,1),e.player.volume(r)};this.player.template.volumeBarWrap.addEventListener(a.default.nameMap.dragStart,(function(){e.player.template.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"),document.addEventListener(a.default.nameMap.dragMove,t),document.addEventListener(a.default.nameMap.dragEnd,n)}))}},{key:"initOrderButton",value:function(){var e=this;this.player.template.order.addEventListener("click",(function(){"list"===e.player.options.order?(e.player.options.order="random",e.player.template.order.innerHTML=r.default.orderRandom):"random"===e.player.options.order&&(e.player.options.order="list",e.player.template.order.innerHTML=r.default.orderList)}))}},{key:"initLoopButton",value:function(){var e=this;this.player.template.loop.addEventListener("click",(function(){e.player.list.audios.length>1?"one"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop?(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll):"all"===e.player.options.loop&&(e.player.options.loop="one",e.player.template.loop.innerHTML=r.default.loopOne):"one"===e.player.options.loop||"all"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop&&(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll)}))}},{key:"initMenuButton",value:function(){var e=this;this.player.template.menu.addEventListener("click",(function(){e.player.list.toggle()}))}},{key:"initMiniSwitcher",value:function(){var e=this;this.player.template.miniSwitcher.addEventListener("click",(function(){e.player.setMode("mini"===e.player.mode?"normal":"mini")}))}},{key:"initSkipButton",value:function(){var e=this;this.player.template.skipBackButton.addEventListener("click",(function(){e.player.skipBack()})),this.player.template.skipForwardButton.addEventListener("click",(function(){e.player.skipForward()})),this.player.template.skipPlayButton.addEventListener("click",(function(){e.player.toggle()}))}},{key:"initLrcButton",value:function(){var e=this;this.player.template.lrcButton.addEventListener("click",(function(){e.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(e.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.show()):(e.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.hide())}))}}]),e}();t.default=s},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.lyrics,r=(e.$value,e.$index,i.$escape);return n(a,(function(e,n){t+="\n <p",0===n&&(t+=' class="aplayer-lrc-current"'),t+=">",t+=r(e[1]),t+="</p>\n"})),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(10))&&i.__esModule?i:{default:i},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t.container,this.async=t.async,this.player=t.player,this.parsed=[],this.index=0,this.current=[]}return a(e,[{key:"show",value:function(){this.player.events.trigger("lrcshow"),this.player.template.lrcWrap.classList.remove("aplayer-lrc-hide")}},{key:"hide",value:function(){this.player.events.trigger("lrchide"),this.player.template.lrcWrap.classList.add("aplayer-lrc-hide")}},{key:"toggle",value:function(){this.player.template.lrcWrap.classList.contains("aplayer-lrc-hide")?this.show():this.hide()}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||e<this.current[this.index][0]||!this.current[this.index+1]||e>=this.current[this.index+1][0])for(var t=0;t<this.current.length;t++)e>=this.current[t][0]&&(!this.current[t+1]||e<this.current[t+1][0])&&(this.index=t,this.container.style.transform="translateY("+16*-this.index+"px)",this.container.style.webkitTransform="translateY("+16*-this.index+"px)",this.container.getElementsByClassName("aplayer-lrc-current")[0].classList.remove("aplayer-lrc-current"),this.container.getElementsByTagName("p")[t].classList.add("aplayer-lrc-current"))}},{key:"switch",value:function(e){var t=this;if(!this.parsed[e])if(this.async){this.parsed[e]=[["00:00","Loading"]];var n=new XMLHttpRequest;n.onreadystatechange=function(){e===t.player.list.index&&4===n.readyState&&(n.status>=200&&n.status<300||304===n.status?t.parsed[e]=t.parse(n.responseText):(t.player.notice("LRC file request fails: status "+n.status),t.parsed[e]=[["00:00","Not available"]]),t.container.innerHTML=(0,r.default)({lyrics:t.parsed[e]}),t.update(0),t.current=t.parsed[e])};var i=this.player.list.audios[e].lrc;n.open("get",i,!0),n.send(null)}else this.player.list.audios[e].lrc?this.parsed[e]=this.parse(this.player.list.audios[e].lrc):this.parsed[e]=[["00:00","Not available"]];this.container.innerHTML=(0,r.default)({lyrics:this.parsed[e]}),this.update(0),this.current=this.parsed[e]}},{key:"parse",value:function(e){if(e){for(var t=(e=e.replace(/([^\]^\n])\[/g,(function(e,t){return t+"\n["}))).split("\n"),n=[],i=t.length,a=0;a<i;a++){var r=t[a].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g),o=t[a].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g,"").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g,"").replace(/^\s+|\s+$/g,"");if(r)for(var s=r.length,l=0;l<s;l++){var u=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(r[l]),c=60*u[1]+parseInt(u[2])+(u[4]?parseInt(u[4])/(2===(u[4]+"").length?100:1e3):0);n.push([c,o])}}return(n=n.filter((function(e){return e[1]}))).sort((function(e,t){return e[0]-t[0]})),n}return[]}},{key:"remove",value:function(e){this.parsed.splice(e,1)}},{key:"clear",value:function(){this.parsed=[],this.container.innerHTML=""}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(0))&&i.__esModule?i:{default:i},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storageName=t.options.storageName,this.data=JSON.parse(r.default.storage.get(this.storageName)),this.data||(this.data={}),this.data.volume=this.data.volume||t.options.volume}return a(e,[{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t,r.default.storage.set(this.storageName,JSON.stringify(this.data))}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elements={},this.elements.volume=t.volume,this.elements.played=t.played,this.elements.loaded=t.loaded}return i(e,[{key:"set",value:function(e,t,n){t=Math.max(t,0),t=Math.min(t,1),this.elements[e].style[n]=100*t+"%"}},{key:"get",value:function(e,t){return parseFloat(this.elements[e].style[t])/100}}]),e}();t.default=a},function(e,t,n){"use strict";(function(t){e.exports=!1;try{e.exports="[object process]"===Object.prototype.toString.call(t.process)}catch(e){}}).call(this,n(4))},function(e,t,n){"use strict";(function(t){var i=n(14),a=Object.create(i?t:window),r=/["&'<>]/;a.$escape=function(e){return function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i="",a=void 0,o=void 0,s=void 0;for(a=n.index,o=0;a<t.length;a++){switch(t.charCodeAt(a)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=s}return o!==a?i+t.substring(o,a):i}(function e(t){return"string"!=typeof t&&(t=null==t?"":"function"==typeof t?e(t.call(t)):JSON.stringify(t)),t}(e))},a.$each=function(e,t){if(Array.isArray(e))for(var n=0,i=e.length;n<i;n++)t(e[n],n);else for(var a in e)t(e[a],a)},e.exports=a}).call(this,n(4))},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";var t="",a=(e=e||{}).options,r=e.cover,o=i.$escape,s=e.icons,l=function(e){return t+=e},u=e.getObject;return e.theme,e.audio,e.index,a.fixed?(t+='\n<div class="aplayer-list',a.listFolded&&(t+=" aplayer-list-hide"),t+='"',a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n <ol",a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+='\n </ol>\n</div>\n<div class="aplayer-body">\n <div class="aplayer-pic" style="',r&&(t+="background-image: url("",t+=o(r),t+="");"),t+="background-color: ",t+=o(a.theme),t+=';">\n <div class="aplayer-button aplayer-play">',t+=s.play,t+='</div>\n </div>\n <div class="aplayer-info" style="display: none;">\n <div class="aplayer-music">\n <span class="aplayer-title">No audio</span>\n <span class="aplayer-author"></span>\n </div>\n <div class="aplayer-controller">\n <div class="aplayer-bar-wrap">\n <div class="aplayer-bar">\n <div class="aplayer-loaded" style="width: 0"></div>\n <div class="aplayer-played" style="width: 0; background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-thumb" style="background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-loading-icon">',t+=s.loading,t+='</span>\n </span>\n </div>\n </div>\n </div>\n <div class="aplayer-time">\n <span class="aplayer-time-inner">\n <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>\n </span>\n <span class="aplayer-icon aplayer-icon-back">\n ',t+=s.skip,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-play">\n ',t+=s.play,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-forward">\n ',t+=s.skip,t+='\n </span>\n <div class="aplayer-volume-wrap">\n <button type="button" class="aplayer-icon aplayer-icon-volume-down">\n ',t+=s.volumeDown,t+='\n </button>\n <div class="aplayer-volume-bar-wrap">\n <div class="aplayer-volume-bar">\n <div class="aplayer-volume" style="height: 80%; background: ',t+=o(a.theme),t+=';"></div>\n </div>\n </div>\n </div>\n <button type="button" class="aplayer-icon aplayer-icon-order">\n ',"list"===a.order?t+=s.orderList:"random"===a.order&&(t+=s.orderRandom),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-loop">\n ',"one"===a.loop?t+=s.loopOne:"all"===a.loop?t+=s.loopAll:"none"===a.loop&&(t+=s.loopNone),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-menu">\n ',t+=s.menu,t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-lrc">\n ',t+=s.lrc,t+='\n </button>\n </div>\n </div>\n </div>\n <div class="aplayer-notice"></div>\n <div class="aplayer-miniswitcher"><button class="aplayer-icon">',t+=s.right,t+='</button></div>\n</div>\n<div class="aplayer-lrc">\n <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>\n</div>\n'):(t+='\n<div class="aplayer-body">\n <div class="aplayer-pic" style="',r&&(t+="background-image: url("",t+=o(r),t+="");"),t+="background-color: ",t+=o(a.theme),t+=';">\n <div class="aplayer-button aplayer-play">',t+=s.play,t+='</div>\n </div>\n <div class="aplayer-info">\n <div class="aplayer-music">\n <span class="aplayer-title">No audio</span>\n <span class="aplayer-author"></span>\n </div>\n <div class="aplayer-lrc">\n <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>\n </div>\n <div class="aplayer-controller">\n <div class="aplayer-bar-wrap">\n <div class="aplayer-bar">\n <div class="aplayer-loaded" style="width: 0"></div>\n <div class="aplayer-played" style="width: 0; background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-thumb" style="background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-loading-icon">',t+=s.loading,t+='</span>\n </span>\n </div>\n </div>\n </div>\n <div class="aplayer-time">\n <span class="aplayer-time-inner">\n <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>\n </span>\n <span class="aplayer-icon aplayer-icon-back">\n ',t+=s.skip,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-play">\n ',t+=s.play,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-forward">\n ',t+=s.skip,t+='\n </span>\n <div class="aplayer-volume-wrap">\n <button type="button" class="aplayer-icon aplayer-icon-volume-down">\n ',t+=s.volumeDown,t+='\n </button>\n <div class="aplayer-volume-bar-wrap">\n <div class="aplayer-volume-bar">\n <div class="aplayer-volume" style="height: 80%; background: ',t+=o(a.theme),t+=';"></div>\n </div>\n </div>\n </div>\n <button type="button" class="aplayer-icon aplayer-icon-order">\n ',"list"===a.order?t+=s.orderList:"random"===a.order&&(t+=s.orderRandom),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-loop">\n ',"one"===a.loop?t+=s.loopOne:"all"===a.loop?t+=s.loopAll:"none"===a.loop&&(t+=s.loopNone),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-menu">\n ',t+=s.menu,t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-lrc">\n ',t+=s.lrc,t+='\n </button>\n </div>\n </div>\n </div>\n <div class="aplayer-notice"></div>\n <div class="aplayer-miniswitcher"><button class="aplayer-icon">',t+=s.right,t+='</button></div>\n</div>\n<div class="aplayer-list',a.listFolded&&(t+=" aplayer-list-hide"),t+='"',a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n <ol",a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+="\n </ol>\n</div>\n"),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=o(n(3)),r=o(n(16));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t.container,this.options=t.options,this.randomOrder=t.randomOrder,this.init()}return i(e,[{key:"init",value:function(){var e="";this.options.audio.length&&(e="random"===this.options.order?this.options.audio[this.randomOrder[0]].cover:this.options.audio[0].cover),this.container.innerHTML=(0,r.default)({options:this.options,icons:a.default,cover:e,getObject:function(e){return e}}),this.lrc=this.container.querySelector(".aplayer-lrc-contents"),this.lrcWrap=this.container.querySelector(".aplayer-lrc"),this.ptime=this.container.querySelector(".aplayer-ptime"),this.info=this.container.querySelector(".aplayer-info"),this.time=this.container.querySelector(".aplayer-time"),this.barWrap=this.container.querySelector(".aplayer-bar-wrap"),this.button=this.container.querySelector(".aplayer-button"),this.body=this.container.querySelector(".aplayer-body"),this.list=this.container.querySelector(".aplayer-list"),this.listOl=this.container.querySelector(".aplayer-list ol"),this.listCurs=this.container.querySelectorAll(".aplayer-list-cur"),this.played=this.container.querySelector(".aplayer-played"),this.loaded=this.container.querySelector(".aplayer-loaded"),this.thumb=this.container.querySelector(".aplayer-thumb"),this.volume=this.container.querySelector(".aplayer-volume"),this.volumeBar=this.container.querySelector(".aplayer-volume-bar"),this.volumeButton=this.container.querySelector(".aplayer-time button"),this.volumeBarWrap=this.container.querySelector(".aplayer-volume-bar-wrap"),this.loop=this.container.querySelector(".aplayer-icon-loop"),this.order=this.container.querySelector(".aplayer-icon-order"),this.menu=this.container.querySelector(".aplayer-icon-menu"),this.pic=this.container.querySelector(".aplayer-pic"),this.title=this.container.querySelector(".aplayer-title"),this.author=this.container.querySelector(".aplayer-author"),this.dtime=this.container.querySelector(".aplayer-dtime"),this.notice=this.container.querySelector(".aplayer-notice"),this.miniSwitcher=this.container.querySelector(".aplayer-miniswitcher"),this.skipBackButton=this.container.querySelector(".aplayer-icon-back"),this.skipForwardButton=this.container.querySelector(".aplayer-icon-forward"),this.skipPlayButton=this.container.querySelector(".aplayer-icon-play"),this.lrcButton=this.container.querySelector(".aplayer-icon-lrc")}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={container:e.element||document.getElementsByClassName("aplayer")[0],mini:e.narrow||e.fixed||!1,fixed:!1,autoplay:!1,mutex:!0,lrcType:e.showlrc||e.lrc||0,preload:"auto",theme:"#b7daff",loop:"all",order:"list",volume:.7,listFolded:e.fixed,listMaxHeight:e.listmaxheight||"250px",audio:e.music||[],storageName:"aplayer-setting"};for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);return"[object Array]"!==Object.prototype.toString.call(e.audio)&&(e.audio=[e.audio]),e.audio.map((function(e){return e.name=e.name||e.title||"Audio name",e.artist=e.artist||e.author||"Audio artist",e.cover=e.cover||e.pic,e.type=e.type||"normal",e})),e.audio.length<=1&&"one"===e.loop&&(e.loop="all"),e}},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M26.667 5.333h-21.333c-0 0-0.001 0-0.001 0-1.472 0-2.666 1.194-2.666 2.666 0 0 0 0.001 0 0.001v-0 16c0 0 0 0.001 0 0.001 0 1.472 1.194 2.666 2.666 2.666 0 0 0.001 0 0.001 0h21.333c0 0 0.001 0 0.001 0 1.472 0 2.666-1.194 2.666-2.666 0-0 0-0.001 0-0.001v0-16c0-0 0-0.001 0-0.001 0-1.472-1.194-2.666-2.666-2.666-0 0-0.001 0-0.001 0h0zM5.333 16h5.333v2.667h-5.333v-2.667zM18.667 24h-13.333v-2.667h13.333v2.667zM26.667 24h-5.333v-2.667h5.333v2.667zM26.667 18.667h-13.333v-2.667h13.333v2.667z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M25.468 6.947c-0.326-0.172-0.724-0.151-1.030 0.057l-6.438 4.38v-3.553c0-0.371-0.205-0.71-0.532-0.884-0.326-0.172-0.724-0.151-1.030 0.057l-12 8.164c-0.274 0.186-0.438 0.496-0.438 0.827s0.164 0.641 0.438 0.827l12 8.168c0.169 0.115 0.365 0.174 0.562 0.174 0.16 0 0.321-0.038 0.468-0.116 0.327-0.173 0.532-0.514 0.532-0.884v-3.556l6.438 4.382c0.169 0.115 0.365 0.174 0.562 0.174 0.16 0 0.321-0.038 0.468-0.116 0.327-0.173 0.532-0.514 0.532-0.884v-16.333c0-0.371-0.205-0.71-0.532-0.884z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M4 16c0-6.6 5.4-12 12-12s12 5.4 12 12c0 1.2-0.8 2-2 2s-2-0.8-2-2c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8c1.2 0 2 0.8 2 2s-0.8 2-2 2c-6.6 0-12-5.4-12-12z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 29 32"><path d="M2.667 7.027l1.707-1.693 22.293 22.293-1.693 1.707-4-4h-11.64v4l-5.333-5.333 5.333-5.333v4h8.973l-8.973-8.973v0.973h-2.667v-3.64l-4-4zM22.667 17.333h2.667v5.573l-2.667-2.667v-2.907zM22.667 6.667v-4l5.333 5.333-5.333 5.333v-4h-10.907l-2.667-2.667h13.573z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 33 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333zM17.333 20v-8h-1.333l-2.667 1.333v1.333h2v5.333h2z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 29 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 22 32"><path d="M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M0.622 18.334h19.54v7.55l11.052-9.412-11.052-9.413v7.549h-19.54v3.725z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22.667 4l7 6-7 6 7 6-7 6v-4h-3.653l-3.76-3.76 2.827-2.827 2.587 2.587h2v-8h-2l-12 12h-6v-4h4.347l12-12h3.653v-4zM2.667 8h6l3.76 3.76-2.827 2.827-2.587-2.587h-4.347v-4z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 17 32"><path d="M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 31"><path d="M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z"></path></svg>'},function(e,t,n){"use strict";var i,a,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var u,c=[],p=!1,d=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):d=-1,c.length&&y())}function y(){if(!p){var e=l(h);p=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,p=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function v(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||p||l(y)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var i,a,r,o,s,l=1,u={},c=!1,p=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){y(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&y(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),i=function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){y(e.data)},i=function(e){r.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(a=p.documentElement,i=function(e){var t=p.createElement("script");t.onreadystatechange=function(){y(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):i=function(e){setTimeout(y,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,i(l),l++},d.clearImmediate=h}function h(e){delete u[e]}function y(e){if(c)setTimeout(y,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(undefined,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(4),n(34))},function(e,t,n){"use strict";var i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(35),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=setTimeout;function a(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void l(t.promise,e)}s(t.promise,i)}else(1===e._state?s:l)(t.promise,e._value)}))):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":n(t))||"function"==typeof t)){var i=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof i)return void c((a=i,o=t,function(){a.apply(o,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){l(e,t)}var a,o}function l(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn((function(){e._handled||r._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t){var n=!1;try{e((function(e){n||(n=!0,s(t,e))}),(function(e){n||(n=!0,l(t,e))}))}catch(e){if(n)return;n=!0,l(t,e)}}r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var n=new this.constructor(a);return o(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},r.prototype.finally=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))},r.all=function(e){return new r((function(t,i){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var a=Array.prototype.slice.call(e);if(0===a.length)return t([]);var r=a.length;function o(e,s){try{if(s&&("object"===(void 0===s?"undefined":n(s))||"function"==typeof s)){var l=s.then;if("function"==typeof l)return void l.call(s,(function(t){o(e,t)}),i)}a[e]=s,0==--r&&t(a)}catch(e){i(e)}}for(var s=0;s<a.length;s++)o(s,a[s])}))},r.resolve=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&e.constructor===r?e:new r((function(t){t(e)}))},r.reject=function(e){return new r((function(t,n){n(e)}))},r.race=function(e){return new r((function(t,n){for(var i=0,a=e.length;i<a;i++)e[i].then(t,n)}))},r._immediateFn="function"==typeof t&&function(e){t(e)}||function(e){i(e,0)},r._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},e.exports=r}).call(this,n(36).setImmediate)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=v(n(37)),r=v(n(0)),o=v(n(3)),s=v(n(18)),l=v(n(17)),u=v(n(13)),c=v(n(12)),p=v(n(11)),d=v(n(9)),h=v(n(8)),y=v(n(7)),f=v(n(6));function v(e){return e&&e.__esModule?e:{default:e}}var m=[],g=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=(0,s.default)(t),this.container=this.options.container,this.paused=!0,this.playedPromise=a.default.resolve(),this.mode="normal",this.randomOrder=r.default.randomOrder(this.options.audio.length),this.container.classList.add("aplayer"),this.options.lrcType&&!this.options.fixed&&this.container.classList.add("aplayer-withlrc"),this.options.audio.length>1&&this.container.classList.add("aplayer-withlist"),r.default.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),this.container=this.options.container,2===this.options.lrcType||!0===this.options.lrcType)for(var n=this.container.getElementsByClassName("aplayer-lrc-content"),i=0;i<n.length;i++)this.options.audio[i]&&(this.options.audio[i].lrc=n[i].innerHTML);this.template=new l.default({container:this.container,options:this.options,randomOrder:this.randomOrder}),this.options.fixed&&(this.container.classList.add("aplayer-fixed"),this.template.body.style.width=this.template.body.offsetWidth-18+"px"),this.options.mini&&(this.setMode("mini"),this.template.info.style.display="block"),this.template.info.offsetWidth<200&&this.template.time.classList.add("aplayer-time-narrow"),this.options.lrcType&&(this.lrc=new p.default({container:this.template.lrc,async:3===this.options.lrcType,player:this})),this.events=new y.default,this.storage=new c.default(this),this.bar=new u.default(this.template),this.controller=new d.default(this),this.timer=new h.default(this),this.list=new f.default(this),this.initAudio(),this.bindEvents(),"random"===this.options.order?this.list.switch(this.randomOrder[0]):this.list.switch(0),this.options.autoplay&&this.play(),m.push(this)}return i(e,[{key:"initAudio",value:function(){var e=this;this.audio=document.createElement("audio"),this.audio.preload=this.options.preload;for(var t=function(t){e.audio.addEventListener(e.events.audioEvents[t],(function(n){e.events.trigger(e.events.audioEvents[t],n)}))},n=0;n<this.events.audioEvents.length;n++)t(n);this.volume(this.storage.get("volume"),!0)}},{key:"bindEvents",value:function(){var e=this;this.on("play",(function(){e.paused&&e.setUIPlaying()})),this.on("pause",(function(){e.paused||e.setUIPaused()})),this.on("timeupdate",(function(){if(!e.disableTimeupdate){e.bar.set("played",e.audio.currentTime/e.duration,"width"),e.lrc&&e.lrc.update();var t=r.default.secondToTime(e.audio.currentTime);e.template.ptime.innerHTML!==t&&(e.template.ptime.innerHTML=t)}})),this.on("durationchange",(function(){1!==e.duration&&(e.template.dtime.innerHTML=r.default.secondToTime(e.duration))})),this.on("progress",(function(){var t=e.audio.buffered.length?e.audio.buffered.end(e.audio.buffered.length-1)/e.duration:0;e.bar.set("loaded",t,"width")}));var t=void 0;this.on("error",(function(){e.list.audios.length>1?(e.notice("An audio error has occurred, player will skip forward in 2 seconds."),t=setTimeout((function(){e.skipForward(),e.paused||e.play()}),2e3)):1===e.list.audios.length&&e.notice("An audio error has occurred.")})),this.events.on("listswitch",(function(){t&&clearTimeout(t)})),this.on("ended",(function(){"none"===e.options.loop?"list"===e.options.order?e.list.index<e.list.audios.length-1?(e.list.switch((e.list.index+1)%e.list.audios.length),e.play()):(e.list.switch((e.list.index+1)%e.list.audios.length),e.pause()):"random"===e.options.order&&(e.randomOrder.indexOf(e.list.index)<e.randomOrder.length-1?(e.list.switch(e.nextIndex()),e.play()):(e.list.switch(e.nextIndex()),e.pause())):"one"===e.options.loop?(e.list.switch(e.list.index),e.play()):"all"===e.options.loop&&(e.skipForward(),e.play())}))}},{key:"setAudio",value:function(e){this.hls&&(this.hls.destroy(),this.hls=null);var t=e.type;this.options.customAudioType&&this.options.customAudioType[t]?"[object Function]"===Object.prototype.toString.call(this.options.customAudioType[t])?this.options.customAudioType[t](this.audio,e,this):console.error("Illegal customType: "+t):(t&&"auto"!==t||(t=/m3u8(#|\?|$)/i.exec(e.url)?"hls":"normal"),"hls"===t?Hls.isSupported()?(this.hls=new Hls,this.hls.loadSource(e.url),this.hls.attachMedia(this.audio)):this.audio.canPlayType("application/x-mpegURL")||this.audio.canPlayType("application/vnd.apple.mpegURL")?this.audio.src=e.url:this.notice("Error: HLS is not supported."):"normal"===t&&(this.audio.src=e.url)),this.seek(0),this.paused||this.audio.play()}},{key:"theme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[t]&&(this.list.audios[t].theme=e),this.template.listCurs[t]&&(this.template.listCurs[t].style.backgroundColor=e),t===this.list.index&&(this.template.pic.style.backgroundColor=e,this.template.played.style.background=e,this.template.thumb.style.background=e,this.template.volume.style.background=e)}},{key:"seek",value:function(e){e=Math.max(e,0),e=Math.min(e,this.duration),this.audio.currentTime=e,this.bar.set("played",e/this.duration,"width"),this.template.ptime.innerHTML=r.default.secondToTime(e)}},{key:"setUIPlaying",value:function(){var e=this;if(this.paused&&(this.paused=!1,this.template.button.classList.remove("aplayer-play"),this.template.button.classList.add("aplayer-pause"),this.template.button.innerHTML="",setTimeout((function(){e.template.button.innerHTML=o.default.pause}),100),this.template.skipPlayButton.innerHTML=o.default.pause),this.timer.enable("loading"),this.options.mutex)for(var t=0;t<m.length;t++)this!==m[t]&&m[t].pause()}},{key:"play",value:function(){var e=this;this.setUIPlaying();var t=this.audio.play();t&&t.catch((function(t){console.warn(t),"NotAllowedError"===t.name&&e.setUIPaused()}))}},{key:"setUIPaused",value:function(){var e=this;this.paused||(this.paused=!0,this.template.button.classList.remove("aplayer-pause"),this.template.button.classList.add("aplayer-play"),this.template.button.innerHTML="",setTimeout((function(){e.template.button.innerHTML=o.default.play}),100),this.template.skipPlayButton.innerHTML=o.default.play),this.container.classList.remove("aplayer-loading"),this.timer.disable("loading")}},{key:"pause",value:function(){this.setUIPaused(),this.audio.pause()}},{key:"switchVolumeIcon",value:function(){this.volume()>=.95?this.template.volumeButton.innerHTML=o.default.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=o.default.volumeDown:this.template.volumeButton.innerHTML=o.default.volumeOff}},{key:"volume",value:function(e,t){return e=parseFloat(e),isNaN(e)||(e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"height"),t||this.storage.set("volume",e),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"toggle",value:function(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"switchAudio",value:function(e){this.list.switch(e)}},{key:"addAudio",value:function(e){this.list.add(e)}},{key:"removeAudio",value:function(e){this.list.remove(e)}},{key:"destroy",value:function(){m.splice(m.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}},{key:"setMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=e,"mini"===e?this.container.classList.add("aplayer-narrow"):"normal"===e&&this.container.classList.remove("aplayer-narrow")}},{key:"notice",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=e,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:e}),n&&(this.noticeTime=setTimeout((function(){t.template.notice.style.opacity=0,t.events.trigger("noticehide")}),n))}},{key:"prevIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return this.list.index-1<0?this.list.audios.length-1:this.list.index-1;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return 0===e?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[e-1]}}},{key:"nextIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return(this.list.index+1)%this.list.audios.length;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return e===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[e+1]}}},{key:"skipBack",value:function(){this.list.switch(this.prevIndex())}},{key:"skipForward",value:function(){this.list.switch(this.nextIndex())}},{key:"duration",get:function(){return isNaN(this.audio.duration)?0:this.audio.duration}}],[{key:"version",get:function(){return"1.10.1"}}]),e}();t.default=g},,function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(40);var i,a=(i=n(38))&&i.__esModule?i:{default:i};t.default=a.default}]).default}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=41)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=/mobile/i.test(window.navigator.userAgent),a={secondToTime:function(e){var t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),i=Math.floor(e-3600*t-60*n);return(t>0?[t,n,i]:[n,i]).map((function(e){return e<10?"0"+e:""+e})).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,i=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-i},getElementViewTop:function(e,t){for(var n,i=e.offsetTop,a=e.offsetParent;null!==a;)i+=a.offsetTop,a=a.offsetParent;return n=document.body.scrollTop+document.documentElement.scrollTop,t?i:i-n},isMobile:i,storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},nameMap:{dragStart:i?"touchstart":"mousedown",dragMove:i?"touchmove":"mousemove",dragEnd:i?"touchend":"mouseup"},randomOrder:function(e){return function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*(t+1)),i=e[n];e[n]=e[t],e[t]=i}return e}([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Array(e))).map((function(e,t){return t})))}};t.default=a},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.audio,r=(e.$value,e.$index,i.$escape),o=e.theme,s=e.index;return n(a,(function(e,n){t+='\n<li>\n <span class="aplayer-list-cur" style="background-color: ',t+=r(e.theme||o),t+=';"></span>\n <span class="aplayer-list-index">',t+=r(n+s),t+='</span>\n <span class="aplayer-list-title">',t+=r(e.name),t+='</span>\n <span class="aplayer-list-author">',t+=r(e.artist),t+="</span>\n</li>\n"})),t}},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=g(n(33)),a=g(n(32)),r=g(n(31)),o=g(n(30)),s=g(n(29)),l=g(n(28)),u=g(n(27)),c=g(n(26)),p=g(n(25)),d=g(n(24)),h=g(n(23)),y=g(n(22)),f=g(n(21)),v=g(n(20)),m=g(n(19));function g(e){return e&&e.__esModule?e:{default:e}}var w={play:i.default,pause:a.default,volumeUp:r.default,volumeDown:o.default,volumeOff:s.default,orderRandom:l.default,orderList:u.default,menu:c.default,loopAll:p.default,loopOne:d.default,loopNone:h.default,loading:y.default,right:f.default,skip:v.default,lrc:m.default};t.default=w},function(e,t,n){"use strict";var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";var i,a,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};void 0===(a="function"==typeof(i=function(){if("object"===("undefined"==typeof window?"undefined":r(window))&&void 0!==document.querySelectorAll&&void 0!==window.pageYOffset&&void 0!==history.pushState){var e=function(e,t,n,i){return n>i?t:e+(t-e)*((a=n/i)<.5?4*a*a*a:(a-1)*(2*a-2)*(2*a-2)+1);var a},t=function(t,n,i,a){n=n||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof t)var o=parseInt(t);else o=function(e,t){return"HTML"===e.nodeName?-t:e.getBoundingClientRect().top+t}(t,r);var s=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,15)};!function u(){var c=Date.now()-s;a!==window?a.scrollTop=e(r,o,c,n):window.scroll(0,e(r,o,c,n)),c>n?"function"==typeof i&&i(t):l(u)}()},n=function(e){if(!e.defaultPrevented){e.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var n=document.getElementById(this.hash.substring(1));if(!n)return;t(n,500,(function(e){location.replace("#"+e.id)}))}};return document.addEventListener("DOMContentLoaded",(function(){for(var e,t=document.querySelectorAll('.aplayer a[href^="#"]:not([href="#"])'),i=t.length;e=t[--i];)e.addEventListener("click",n,!1)})),t}})?i.call(t,n,t,e):i)||(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=s(n(1)),r=s(n(0)),o=s(n(5));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.index=0,this.audios=this.player.options.audio,this.bindEvents()}return i(e,[{key:"bindEvents",value:function(){var e=this;this.player.template.list.addEventListener("click",(function(t){var n=void 0;n="LI"===t.target.tagName.toUpperCase()?t.target:t.target.parentElement;var i=parseInt(n.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;i!==e.index?(e.switch(i),e.player.play()):e.player.toggle()}))}},{key:"show",value:function(){this.player.events.trigger("listshow"),this.player.template.list.classList.remove("aplayer-list-hide"),this.player.template.listOl.scrollTop=33*this.index}},{key:"hide",value:function(){this.player.events.trigger("listhide"),this.player.template.list.classList.add("aplayer-list-hide")}},{key:"toggle",value:function(){this.player.template.list.classList.contains("aplayer-list-hide")?this.show():this.hide()}},{key:"add",value:function(e){this.player.events.trigger("listadd",{audios:e}),"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),e.map((function(e){return e.name=e.name||e.title||"Audio name",e.artist=e.artist||e.author||"Audio artist",e.cover=e.cover||e.pic,e.type=e.type||"normal",e}));var t=!(this.audios.length>1),n=0===this.audios.length;this.player.template.listOl.innerHTML+=(0,a.default)({theme:this.player.options.theme,audio:e,index:this.audios.length+1}),this.audios=this.audios.concat(e),t&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=r.default.randomOrder(this.audios.length),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur"),this.player.template.listCurs[this.audios.length-1].style.backgroundColor=e.theme||this.player.options.theme,n&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}},{key:"remove",value:function(e){if(this.player.events.trigger("listremove",{index:e}),this.audios[e])if(this.audios.length>1){var t=this.player.container.querySelectorAll(".aplayer-list li");t[e].remove(),this.audios.splice(e,1),this.player.lrc&&this.player.lrc.remove(e),e===this.index&&(this.audios[e]?this.switch(e):this.switch(e-1)),this.index>e&&this.index--;for(var n=e;n<t.length;n++)t[n].getElementsByClassName("aplayer-list-index")[0].textContent=n;1===this.audios.length&&this.player.container.classList.remove("aplayer-withlist"),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur")}else this.clear()}},{key:"switch",value:function(e){if(this.player.events.trigger("listswitch",{index:e}),void 0!==e&&this.audios[e]){this.index=e;var t=this.audios[this.index];this.player.template.pic.style.backgroundImage=t.cover?"url('"+t.cover+"')":"",this.player.theme(this.audios[this.index].theme||this.player.options.theme,this.index,!1),this.player.template.title.innerHTML=t.name,this.player.template.author.innerHTML=t.artist?" - "+t.artist:"";var n=this.player.container.getElementsByClassName("aplayer-list-light")[0];n&&n.classList.remove("aplayer-list-light"),this.player.container.querySelectorAll(".aplayer-list li")[this.index].classList.add("aplayer-list-light"),(0,o.default)(33*this.index,500,null,this.player.template.listOl),this.player.setAudio(t),this.player.lrc&&this.player.lrc.switch(this.index),this.player.lrc&&this.player.lrc.update(0),1!==this.player.duration&&(this.player.template.dtime.innerHTML=r.default.secondToTime(this.player.duration))}}},{key:"clear",value:function(){this.player.events.trigger("listclear"),this.index=0,this.player.container.classList.remove("aplayer-withlist"),this.player.pause(),this.audios=[],this.player.lrc&&this.player.lrc.clear(),this.player.audio.src="",this.player.template.listOl.innerHTML="",this.player.template.pic.style.backgroundImage="",this.player.theme(this.player.options.theme,this.index,!1),this.player.template.title.innerHTML="No audio",this.player.template.author.innerHTML="",this.player.bar.set("loaded",0,"width"),this.player.template.dtime.innerHTML=r.default.secondToTime(0)}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={},this.audioEvents=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","mozaudioavailable","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],this.playerEvents=["destroy","listshow","listhide","listadd","listremove","listswitch","listclear","noticeshow","noticehide","lrcshow","lrchide"]}return i(e,[{key:"on",value:function(e,t){this.type(e)&&"function"==typeof t&&(this.events[e]||(this.events[e]=[]),this.events[e].push(t))}},{key:"trigger",value:function(e,t){if(this.events[e]&&this.events[e].length)for(var n=0;n<this.events[e].length;n++)this.events[e][n](t)}},{key:"type",value:function(e){return-1!==this.playerEvents.indexOf(e)?"player":-1!==this.audioEvents.indexOf(e)?"audio":(console.error("Unknown event name: "+e),null)}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},this.types=["loading"],this.init()}return i(e,[{key:"init",value:function(){var e=this;this.types.forEach((function(t){e["init"+t+"Checker"]()}))}},{key:"initloadingChecker",value:function(){var e=this,t=0,n=0,i=!1;this.loadingChecker=setInterval((function(){e.enableloadingChecker&&(n=e.player.audio.currentTime,i||n!==t||e.player.audio.paused||(e.player.container.classList.add("aplayer-loading"),i=!0),i&&n>t&&!e.player.audio.paused&&(e.player.container.classList.remove("aplayer-loading"),i=!1),t=n)}),100)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(){var e=this;this.types.forEach((function(t){e["enable"+t+"Checker"]=!1,e[t+"Checker"]&&clearInterval(e[t+"Checker"])}))}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=o(n(0)),r=o(n(3));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.initPlayButton(),this.initPlayBar(),this.initOrderButton(),this.initLoopButton(),this.initMenuButton(),a.default.isMobile||this.initVolumeButton(),this.initMiniSwitcher(),this.initSkipButton(),this.initLrcButton()}return i(e,[{key:"initPlayButton",value:function(){var e=this;this.player.template.pic.addEventListener("click",(function(){e.player.toggle()}))}},{key:"initPlayBar",value:function(){var e=this,t=function(t){var n=((t.clientX||t.changedTouches[0].clientX)-a.default.getElementViewLeft(e.player.template.barWrap))/e.player.template.barWrap.clientWidth;n=Math.max(n,0),n=Math.min(n,1),e.player.bar.set("played",n,"width"),e.player.lrc&&e.player.lrc.update(n*e.player.duration),e.player.template.ptime.innerHTML=a.default.secondToTime(n*e.player.duration)},n=function n(i){document.removeEventListener(a.default.nameMap.dragEnd,n),document.removeEventListener(a.default.nameMap.dragMove,t);var r=((i.clientX||i.changedTouches[0].clientX)-a.default.getElementViewLeft(e.player.template.barWrap))/e.player.template.barWrap.clientWidth;r=Math.max(r,0),r=Math.min(r,1),e.player.bar.set("played",r,"width"),e.player.seek(e.player.bar.get("played","width")*e.player.duration),e.player.disableTimeupdate=!1};this.player.template.barWrap.addEventListener(a.default.nameMap.dragStart,(function(){e.player.disableTimeupdate=!0,document.addEventListener(a.default.nameMap.dragMove,t),document.addEventListener(a.default.nameMap.dragEnd,n)}))}},{key:"initVolumeButton",value:function(){var e=this;this.player.template.volumeButton.addEventListener("click",(function(){e.player.audio.muted?(e.player.audio.muted=!1,e.player.switchVolumeIcon(),e.player.bar.set("volume",e.player.volume(),"height")):(e.player.audio.muted=!0,e.player.switchVolumeIcon(),e.player.bar.set("volume",0,"height"))}));var t=function(t){var n=1-((t.clientY||t.changedTouches[0].clientY)-a.default.getElementViewTop(e.player.template.volumeBar,e.player.options.fixed))/e.player.template.volumeBar.clientHeight;n=Math.max(n,0),n=Math.min(n,1),e.player.volume(n)},n=function n(i){e.player.template.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"),document.removeEventListener(a.default.nameMap.dragEnd,n),document.removeEventListener(a.default.nameMap.dragMove,t);var r=1-((i.clientY||i.changedTouches[0].clientY)-a.default.getElementViewTop(e.player.template.volumeBar,e.player.options.fixed))/e.player.template.volumeBar.clientHeight;r=Math.max(r,0),r=Math.min(r,1),e.player.volume(r)};this.player.template.volumeBarWrap.addEventListener(a.default.nameMap.dragStart,(function(){e.player.template.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"),document.addEventListener(a.default.nameMap.dragMove,t),document.addEventListener(a.default.nameMap.dragEnd,n)}))}},{key:"initOrderButton",value:function(){var e=this;this.player.template.order.addEventListener("click",(function(){"list"===e.player.options.order?(e.player.options.order="random",e.player.template.order.innerHTML=r.default.orderRandom):"random"===e.player.options.order&&(e.player.options.order="list",e.player.template.order.innerHTML=r.default.orderList)}))}},{key:"initLoopButton",value:function(){var e=this;this.player.template.loop.addEventListener("click",(function(){e.player.list.audios.length>1?"one"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop?(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll):"all"===e.player.options.loop&&(e.player.options.loop="one",e.player.template.loop.innerHTML=r.default.loopOne):"one"===e.player.options.loop||"all"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=r.default.loopNone):"none"===e.player.options.loop&&(e.player.options.loop="all",e.player.template.loop.innerHTML=r.default.loopAll)}))}},{key:"initMenuButton",value:function(){var e=this;this.player.template.menu.addEventListener("click",(function(){e.player.list.toggle()}))}},{key:"initMiniSwitcher",value:function(){var e=this;this.player.template.miniSwitcher.addEventListener("click",(function(){e.player.setMode("mini"===e.player.mode?"normal":"mini")}))}},{key:"initSkipButton",value:function(){var e=this;this.player.template.skipBackButton.addEventListener("click",(function(){e.player.skipBack()})),this.player.template.skipForwardButton.addEventListener("click",(function(){e.player.skipForward()})),this.player.template.skipPlayButton.addEventListener("click",(function(){e.player.toggle()}))}},{key:"initLrcButton",value:function(){var e=this;this.player.template.lrcButton.addEventListener("click",(function(){e.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(e.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.show()):(e.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),e.player.lrc&&e.player.lrc.hide())}))}}]),e}();t.default=s},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$each,a=e.lyrics,r=(e.$value,e.$index,i.$escape);return n(a,(function(e,n){t+="\n <p",0===n&&(t+=' class="aplayer-lrc-current"'),t+=">",t+=r(e[1]),t+="</p>\n"})),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(10))&&i.__esModule?i:{default:i},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t.container,this.async=t.async,this.player=t.player,this.parsed=[],this.index=0,this.current=[]}return a(e,[{key:"show",value:function(){this.player.events.trigger("lrcshow"),this.player.template.lrcWrap.classList.remove("aplayer-lrc-hide")}},{key:"hide",value:function(){this.player.events.trigger("lrchide"),this.player.template.lrcWrap.classList.add("aplayer-lrc-hide")}},{key:"toggle",value:function(){this.player.template.lrcWrap.classList.contains("aplayer-lrc-hide")?this.show():this.hide()}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||e<this.current[this.index][0]||!this.current[this.index+1]||e>=this.current[this.index+1][0])for(var t=0;t<this.current.length;t++)e>=this.current[t][0]&&(!this.current[t+1]||e<this.current[t+1][0])&&(this.index=t,this.container.style.transform="translateY("+16*-this.index+"px)",this.container.style.webkitTransform="translateY("+16*-this.index+"px)",this.container.getElementsByClassName("aplayer-lrc-current")[0].classList.remove("aplayer-lrc-current"),this.container.getElementsByTagName("p")[t].classList.add("aplayer-lrc-current"))}},{key:"switch",value:function(e){var t=this;if(!this.parsed[e])if(this.async){this.parsed[e]=[["00:00","Loading"]];var n=new XMLHttpRequest;n.onreadystatechange=function(){e===t.player.list.index&&4===n.readyState&&(n.status>=200&&n.status<300||304===n.status?t.parsed[e]=t.parse(n.responseText):(t.player.notice("LRC file request fails: status "+n.status),t.parsed[e]=[["00:00","Not available"]]),t.container.innerHTML=(0,r.default)({lyrics:t.parsed[e]}),t.update(0),t.current=t.parsed[e])};var i=this.player.list.audios[e].lrc;n.open("get",i,!0),n.send(null)}else this.player.list.audios[e].lrc?this.parsed[e]=this.parse(this.player.list.audios[e].lrc):this.parsed[e]=[["00:00","Not available"]];this.container.innerHTML=(0,r.default)({lyrics:this.parsed[e]}),this.update(0),this.current=this.parsed[e]}},{key:"parse",value:function(e){if(e){for(var t=(e=e.replace(/([^\]^\n])\[/g,(function(e,t){return t+"\n["}))).split("\n"),n=[],i=t.length,a=0;a<i;a++){var r=t[a].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g),o=t[a].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g,"").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g,"").replace(/^\s+|\s+$/g,"");if(r)for(var s=r.length,l=0;l<s;l++){var u=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(r[l]),c=60*u[1]+parseInt(u[2])+(u[4]?parseInt(u[4])/(2===(u[4]+"").length?100:1e3):0);n.push([c,o])}}return(n=n.filter((function(e){return e[1]}))).sort((function(e,t){return e[0]-t[0]})),n}return[]}},{key:"remove",value:function(e){this.parsed.splice(e,1)}},{key:"clear",value:function(){this.parsed=[],this.container.innerHTML=""}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=(i=n(0))&&i.__esModule?i:{default:i},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.storageName=t.options.storageName,this.data=JSON.parse(r.default.storage.get(this.storageName)),this.data||(this.data={}),this.data.volume=this.data.volume||t.options.volume}return a(e,[{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t,r.default.storage.set(this.storageName,JSON.stringify(this.data))}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elements={},this.elements.volume=t.volume,this.elements.played=t.played,this.elements.loaded=t.loaded}return i(e,[{key:"set",value:function(e,t,n){t=Math.max(t,0),t=Math.min(t,1),this.elements[e].style[n]=100*t+"%"}},{key:"get",value:function(e,t){return parseFloat(this.elements[e].style[t])/100}}]),e}();t.default=a},function(e,t,n){"use strict";(function(t){e.exports=!1;try{e.exports="[object process]"===Object.prototype.toString.call(t.process)}catch(e){}}).call(this,n(4))},function(e,t,n){"use strict";(function(t){var i=n(14),a=Object.create(i?t:window),r=/["&'<>]/;a.$escape=function(e){return function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i="",a=void 0,o=void 0,s=void 0;for(a=n.index,o=0;a<t.length;a++){switch(t.charCodeAt(a)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=s}return o!==a?i+t.substring(o,a):i}(function e(t){return"string"!=typeof t&&(t=null==t?"":"function"==typeof t?e(t.call(t)):JSON.stringify(t)),t}(e))},a.$each=function(e,t){if(Array.isArray(e))for(var n=0,i=e.length;n<i;n++)t(e[n],n);else for(var a in e)t(e[a],a)},e.exports=a}).call(this,n(4))},function(e,t,n){var i=n(2);e.exports=function(e){"use strict";var t="",a=(e=e||{}).options,r=e.cover,o=i.$escape,s=e.icons,l=function(e){return t+=e},u=e.getObject;return e.theme,e.audio,e.index,a.fixed?(t+='\n<div class="aplayer-list',a.listFolded&&(t+=" aplayer-list-hide"),t+='"',a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n <ol",a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+='\n </ol>\n</div>\n<div class="aplayer-body">\n <div class="aplayer-pic" style="',r&&(t+="background-image: url("",t+=o(r),t+="");"),t+="background-color: ",t+=o(a.theme),t+=';">\n <div class="aplayer-button aplayer-play">',t+=s.play,t+='</div>\n </div>\n <div class="aplayer-info" style="display: none;">\n <div class="aplayer-music">\n <span class="aplayer-title">No audio</span>\n <span class="aplayer-author"></span>\n </div>\n <div class="aplayer-controller">\n <div class="aplayer-bar-wrap">\n <div class="aplayer-bar">\n <div class="aplayer-loaded" style="width: 0"></div>\n <div class="aplayer-played" style="width: 0; background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-thumb" style="background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-loading-icon">',t+=s.loading,t+='</span>\n </span>\n </div>\n </div>\n </div>\n <div class="aplayer-time">\n <span class="aplayer-time-inner">\n <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>\n </span>\n <span class="aplayer-icon aplayer-icon-back">\n ',t+=s.skip,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-play">\n ',t+=s.play,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-forward">\n ',t+=s.skip,t+='\n </span>\n <div class="aplayer-volume-wrap">\n <button type="button" class="aplayer-icon aplayer-icon-volume-down">\n ',t+=s.volumeDown,t+='\n </button>\n <div class="aplayer-volume-bar-wrap">\n <div class="aplayer-volume-bar">\n <div class="aplayer-volume" style="height: 80%; background: ',t+=o(a.theme),t+=';"></div>\n </div>\n </div>\n </div>\n <button type="button" class="aplayer-icon aplayer-icon-order">\n ',"list"===a.order?t+=s.orderList:"random"===a.order&&(t+=s.orderRandom),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-loop">\n ',"one"===a.loop?t+=s.loopOne:"all"===a.loop?t+=s.loopAll:"none"===a.loop&&(t+=s.loopNone),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-menu">\n ',t+=s.menu,t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-lrc">\n ',t+=s.lrc,t+='\n </button>\n </div>\n </div>\n </div>\n <div class="aplayer-notice"></div>\n <div class="aplayer-miniswitcher"><button class="aplayer-icon">',t+=s.right,t+='</button></div>\n</div>\n<div class="aplayer-lrc">\n <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>\n</div>\n'):(t+='\n<div class="aplayer-body">\n <div class="aplayer-pic" style="',r&&(t+="background-image: url("",t+=o(r),t+="");"),t+="background-color: ",t+=o(a.theme),t+=';">\n <div class="aplayer-button aplayer-play">',t+=s.play,t+='</div>\n </div>\n <div class="aplayer-info">\n <div class="aplayer-music">\n <span class="aplayer-title">No audio</span>\n <span class="aplayer-author"></span>\n </div>\n <div class="aplayer-lrc">\n <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>\n </div>\n <div class="aplayer-controller">\n <div class="aplayer-bar-wrap">\n <div class="aplayer-bar">\n <div class="aplayer-loaded" style="width: 0"></div>\n <div class="aplayer-played" style="width: 0; background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-thumb" style="background: ',t+=o(a.theme),t+=';">\n <span class="aplayer-loading-icon">',t+=s.loading,t+='</span>\n </span>\n </div>\n </div>\n </div>\n <div class="aplayer-time">\n <span class="aplayer-time-inner">\n <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>\n </span>\n <span class="aplayer-icon aplayer-icon-back">\n ',t+=s.skip,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-play">\n ',t+=s.play,t+='\n </span>\n <span class="aplayer-icon aplayer-icon-forward">\n ',t+=s.skip,t+='\n </span>\n <div class="aplayer-volume-wrap">\n <button type="button" class="aplayer-icon aplayer-icon-volume-down">\n ',t+=s.volumeDown,t+='\n </button>\n <div class="aplayer-volume-bar-wrap">\n <div class="aplayer-volume-bar">\n <div class="aplayer-volume" style="height: 80%; background: ',t+=o(a.theme),t+=';"></div>\n </div>\n </div>\n </div>\n <button type="button" class="aplayer-icon aplayer-icon-order">\n ',"list"===a.order?t+=s.orderList:"random"===a.order&&(t+=s.orderRandom),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-loop">\n ',"one"===a.loop?t+=s.loopOne:"all"===a.loop?t+=s.loopAll:"none"===a.loop&&(t+=s.loopNone),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-menu">\n ',t+=s.menu,t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-lrc">\n ',t+=s.lrc,t+='\n </button>\n </div>\n </div>\n </div>\n <div class="aplayer-notice"></div>\n <div class="aplayer-miniswitcher"><button class="aplayer-icon">',t+=s.right,t+='</button></div>\n</div>\n<div class="aplayer-list',a.listFolded&&(t+=" aplayer-list-hide"),t+='"',a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n <ol",a.listMaxHeight&&(t+=' style="max-height: ',t+=o(a.listMaxHeight),t+='"'),t+=">\n ",l(n(1)(u({theme:a.theme,audio:a.audio,index:1}))),t+="\n </ol>\n</div>\n"),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=o(n(3)),r=o(n(16));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t.container,this.options=t.options,this.randomOrder=t.randomOrder,this.init()}return i(e,[{key:"init",value:function(){var e="";this.options.audio.length&&(e="random"===this.options.order?this.options.audio[this.randomOrder[0]].cover:this.options.audio[0].cover),this.container.innerHTML=(0,r.default)({options:this.options,icons:a.default,cover:e,getObject:function(e){return e}}),this.lrc=this.container.querySelector(".aplayer-lrc-contents"),this.lrcWrap=this.container.querySelector(".aplayer-lrc"),this.ptime=this.container.querySelector(".aplayer-ptime"),this.info=this.container.querySelector(".aplayer-info"),this.time=this.container.querySelector(".aplayer-time"),this.barWrap=this.container.querySelector(".aplayer-bar-wrap"),this.button=this.container.querySelector(".aplayer-button"),this.body=this.container.querySelector(".aplayer-body"),this.list=this.container.querySelector(".aplayer-list"),this.listOl=this.container.querySelector(".aplayer-list ol"),this.listCurs=this.container.querySelectorAll(".aplayer-list-cur"),this.played=this.container.querySelector(".aplayer-played"),this.loaded=this.container.querySelector(".aplayer-loaded"),this.thumb=this.container.querySelector(".aplayer-thumb"),this.volume=this.container.querySelector(".aplayer-volume"),this.volumeBar=this.container.querySelector(".aplayer-volume-bar"),this.volumeButton=this.container.querySelector(".aplayer-time button"),this.volumeBarWrap=this.container.querySelector(".aplayer-volume-bar-wrap"),this.loop=this.container.querySelector(".aplayer-icon-loop"),this.order=this.container.querySelector(".aplayer-icon-order"),this.menu=this.container.querySelector(".aplayer-icon-menu"),this.pic=this.container.querySelector(".aplayer-pic"),this.title=this.container.querySelector(".aplayer-title"),this.author=this.container.querySelector(".aplayer-author"),this.dtime=this.container.querySelector(".aplayer-dtime"),this.notice=this.container.querySelector(".aplayer-notice"),this.miniSwitcher=this.container.querySelector(".aplayer-miniswitcher"),this.skipBackButton=this.container.querySelector(".aplayer-icon-back"),this.skipForwardButton=this.container.querySelector(".aplayer-icon-forward"),this.skipPlayButton=this.container.querySelector(".aplayer-icon-play"),this.lrcButton=this.container.querySelector(".aplayer-icon-lrc")}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={container:e.element||document.getElementsByClassName("aplayer")[0],mini:e.narrow||e.fixed||!1,fixed:!1,autoplay:!1,mutex:!0,lrcType:e.showlrc||e.lrc||0,preload:"auto",theme:"#b7daff",loop:"all",order:"list",volume:.7,listFolded:e.fixed,listMaxHeight:e.listmaxheight||"250px",audio:e.music||[],storageName:"aplayer-setting"};for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);return"[object Array]"!==Object.prototype.toString.call(e.audio)&&(e.audio=[e.audio]),e.audio.map((function(e){return e.name=e.name||e.title||"Audio name",e.artist=e.artist||e.author||"Audio artist",e.cover=e.cover||e.pic,e.type=e.type||"normal",e})),e.audio.length<=1&&"one"===e.loop&&(e.loop="all"),e}},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M26.667 5.333h-21.333c-0 0-0.001 0-0.001 0-1.472 0-2.666 1.194-2.666 2.666 0 0 0 0.001 0 0.001v-0 16c0 0 0 0.001 0 0.001 0 1.472 1.194 2.666 2.666 2.666 0 0 0.001 0 0.001 0h21.333c0 0 0.001 0 0.001 0 1.472 0 2.666-1.194 2.666-2.666 0-0 0-0.001 0-0.001v0-16c0-0 0-0.001 0-0.001 0-1.472-1.194-2.666-2.666-2.666-0 0-0.001 0-0.001 0h0zM5.333 16h5.333v2.667h-5.333v-2.667zM18.667 24h-13.333v-2.667h13.333v2.667zM26.667 24h-5.333v-2.667h5.333v2.667zM26.667 18.667h-13.333v-2.667h13.333v2.667z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M25.468 6.947c-0.326-0.172-0.724-0.151-1.030 0.057l-6.438 4.38v-3.553c0-0.371-0.205-0.71-0.532-0.884-0.326-0.172-0.724-0.151-1.030 0.057l-12 8.164c-0.274 0.186-0.438 0.496-0.438 0.827s0.164 0.641 0.438 0.827l12 8.168c0.169 0.115 0.365 0.174 0.562 0.174 0.16 0 0.321-0.038 0.468-0.116 0.327-0.173 0.532-0.514 0.532-0.884v-3.556l6.438 4.382c0.169 0.115 0.365 0.174 0.562 0.174 0.16 0 0.321-0.038 0.468-0.116 0.327-0.173 0.532-0.514 0.532-0.884v-16.333c0-0.371-0.205-0.71-0.532-0.884z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M4 16c0-6.6 5.4-12 12-12s12 5.4 12 12c0 1.2-0.8 2-2 2s-2-0.8-2-2c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8c1.2 0 2 0.8 2 2s-0.8 2-2 2c-6.6 0-12-5.4-12-12z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 29 32"><path d="M2.667 7.027l1.707-1.693 22.293 22.293-1.693 1.707-4-4h-11.64v4l-5.333-5.333 5.333-5.333v4h8.973l-8.973-8.973v0.973h-2.667v-3.64l-4-4zM22.667 17.333h2.667v5.573l-2.667-2.667v-2.907zM22.667 6.667v-4l5.333 5.333-5.333 5.333v-4h-10.907l-2.667-2.667h13.573z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 33 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333zM17.333 20v-8h-1.333l-2.667 1.333v1.333h2v5.333h2z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 29 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 22 32"><path d="M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M0.622 18.334h19.54v7.55l11.052-9.412-11.052-9.413v7.549h-19.54v3.725z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22.667 4l7 6-7 6 7 6-7 6v-4h-3.653l-3.76-3.76 2.827-2.827 2.587 2.587h2v-8h-2l-12 12h-6v-4h4.347l12-12h3.653v-4zM2.667 8h6l3.76 3.76-2.827 2.827-2.587-2.587h-4.347v-4z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 17 32"><path d="M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 31"><path d="M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z"></path></svg>'},function(e,t,n){"use strict";var i,a,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(i===setTimeout)return setTimeout(e,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(e){i=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var u,c=[],p=!1,d=-1;function h(){p&&u&&(p=!1,u.length?c=u.concat(c):d=-1,c.length&&y())}function y(){if(!p){var e=l(h);p=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,p=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function v(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||p||l(y)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var i,a,r,o,s,l=1,u={},c=!1,p=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){y(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&y(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),i=function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){y(e.data)},i=function(e){r.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(a=p.documentElement,i=function(e){var t=p.createElement("script");t.onreadystatechange=function(){y(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):i=function(e){setTimeout(y,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,i(l),l++},d.clearImmediate=h}function h(e){delete u[e]}function y(e){if(c)setTimeout(y,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(undefined,n)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(4),n(34))},function(e,t,n){"use strict";var i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(35),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=setTimeout;function a(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void l(t.promise,e)}s(t.promise,i)}else(1===e._state?s:l)(t.promise,e._value)}))):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":n(t))||"function"==typeof t)){var i=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof i)return void c((a=i,o=t,function(){a.apply(o,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){l(e,t)}var a,o}function l(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn((function(){e._handled||r._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t){var n=!1;try{e((function(e){n||(n=!0,s(t,e))}),(function(e){n||(n=!0,l(t,e))}))}catch(e){if(n)return;n=!0,l(t,e)}}r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var n=new this.constructor(a);return o(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},r.prototype.finally=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))},r.all=function(e){return new r((function(t,i){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var a=Array.prototype.slice.call(e);if(0===a.length)return t([]);var r=a.length;function o(e,s){try{if(s&&("object"===(void 0===s?"undefined":n(s))||"function"==typeof s)){var l=s.then;if("function"==typeof l)return void l.call(s,(function(t){o(e,t)}),i)}a[e]=s,0==--r&&t(a)}catch(e){i(e)}}for(var s=0;s<a.length;s++)o(s,a[s])}))},r.resolve=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&e.constructor===r?e:new r((function(t){t(e)}))},r.reject=function(e){return new r((function(t,n){n(e)}))},r.race=function(e){return new r((function(t,n){for(var i=0,a=e.length;i<a;i++)e[i].then(t,n)}))},r._immediateFn="function"==typeof t&&function(e){t(e)}||function(e){i(e,0)},r._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},e.exports=r}).call(this,n(36).setImmediate)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=v(n(37)),r=v(n(0)),o=v(n(3)),s=v(n(18)),l=v(n(17)),u=v(n(13)),c=v(n(12)),p=v(n(11)),d=v(n(9)),h=v(n(8)),y=v(n(7)),f=v(n(6));function v(e){return e&&e.__esModule?e:{default:e}}var m=[],g=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=(0,s.default)(t),this.container=this.options.container,this.paused=!0,this.playedPromise=a.default.resolve(),this.mode="normal",this.randomOrder=r.default.randomOrder(this.options.audio.length),this.container.classList.add("aplayer"),this.options.lrcType&&!this.options.fixed&&this.container.classList.add("aplayer-withlrc"),this.options.audio.length>1&&this.container.classList.add("aplayer-withlist"),r.default.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),this.container=this.options.container,2===this.options.lrcType||!0===this.options.lrcType)for(var n=this.container.getElementsByClassName("aplayer-lrc-content"),i=0;i<n.length;i++)this.options.audio[i]&&(this.options.audio[i].lrc=n[i].innerHTML);this.template=new l.default({container:this.container,options:this.options,randomOrder:this.randomOrder}),this.options.fixed&&(this.container.classList.add("aplayer-fixed"),this.template.body.style.width=this.template.body.offsetWidth-18+"px"),this.options.mini&&(this.setMode("mini"),this.template.info.style.display="block"),this.template.info.offsetWidth<200&&this.template.time.classList.add("aplayer-time-narrow"),this.options.lrcType&&(this.lrc=new p.default({container:this.template.lrc,async:3===this.options.lrcType,player:this})),this.events=new y.default,this.storage=new c.default(this),this.bar=new u.default(this.template),this.controller=new d.default(this),this.timer=new h.default(this),this.list=new f.default(this),this.initAudio(),this.bindEvents(),"random"===this.options.order?this.list.switch(this.randomOrder[0]):this.list.switch(0),this.options.autoplay&&this.play(),m.push(this)}return i(e,[{key:"initAudio",value:function(){var e=this;this.audio=document.createElement("audio"),this.audio.preload=this.options.preload;for(var t=function(t){e.audio.addEventListener(e.events.audioEvents[t],(function(n){e.events.trigger(e.events.audioEvents[t],n)}))},n=0;n<this.events.audioEvents.length;n++)t(n);this.volume(this.storage.get("volume"),!0)}},{key:"bindEvents",value:function(){var e=this;this.on("play",(function(){e.paused&&e.setUIPlaying()})),this.on("pause",(function(){e.paused||e.setUIPaused()})),this.on("timeupdate",(function(){if(!e.disableTimeupdate){e.bar.set("played",e.audio.currentTime/e.duration,"width"),e.lrc&&e.lrc.update();var t=r.default.secondToTime(e.audio.currentTime);e.template.ptime.innerHTML!==t&&(e.template.ptime.innerHTML=t)}})),this.on("durationchange",(function(){1!==e.duration&&(e.template.dtime.innerHTML=r.default.secondToTime(e.duration))})),this.on("progress",(function(){var t=e.audio.buffered.length?e.audio.buffered.end(e.audio.buffered.length-1)/e.duration:0;e.bar.set("loaded",t,"width")}));var t=void 0;this.on("error",(function(){e.list.audios.length>1?(e.notice("An audio error has occurred, player will skip forward in 2 seconds."),t=setTimeout((function(){e.skipForward(),e.paused||e.play()}),2e3)):1===e.list.audios.length&&e.notice("An audio error has occurred.")})),this.events.on("listswitch",(function(){t&&clearTimeout(t)})),this.on("ended",(function(){"none"===e.options.loop?"list"===e.options.order?e.list.index<e.list.audios.length-1?(e.list.switch((e.list.index+1)%e.list.audios.length),e.play()):(e.list.switch((e.list.index+1)%e.list.audios.length),e.pause()):"random"===e.options.order&&(e.randomOrder.indexOf(e.list.index)<e.randomOrder.length-1?(e.list.switch(e.nextIndex()),e.play()):(e.list.switch(e.nextIndex()),e.pause())):"one"===e.options.loop?(e.list.switch(e.list.index),e.play()):"all"===e.options.loop&&(e.skipForward(),e.play())}))}},{key:"setAudio",value:function(e){this.hls&&(this.hls.destroy(),this.hls=null);var t=e.type;this.options.customAudioType&&this.options.customAudioType[t]?"[object Function]"===Object.prototype.toString.call(this.options.customAudioType[t])?this.options.customAudioType[t](this.audio,e,this):console.error("Illegal customType: "+t):(t&&"auto"!==t||(t=/m3u8(#|\?|$)/i.exec(e.url)?"hls":"normal"),"hls"===t?Hls.isSupported()?(this.hls=new Hls,this.hls.loadSource(e.url),this.hls.attachMedia(this.audio)):this.audio.canPlayType("application/x-mpegURL")||this.audio.canPlayType("application/vnd.apple.mpegURL")?this.audio.src=e.url:this.notice("Error: HLS is not supported."):"normal"===t&&(this.audio.src=e.url)),this.seek(0),this.paused||this.audio.play()}},{key:"theme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[t]&&(this.list.audios[t].theme=e),this.template.listCurs[t]&&(this.template.listCurs[t].style.backgroundColor=e),t===this.list.index&&(this.template.pic.style.backgroundColor=e,this.template.played.style.background=e,this.template.thumb.style.background=e,this.template.volume.style.background=e)}},{key:"seek",value:function(e){e=Math.max(e,0),e=Math.min(e,this.duration),this.audio.currentTime=e,this.bar.set("played",e/this.duration,"width"),this.template.ptime.innerHTML=r.default.secondToTime(e)}},{key:"setUIPlaying",value:function(){var e=this;if(this.paused&&(this.paused=!1,this.template.button.classList.remove("aplayer-play"),this.template.button.classList.add("aplayer-pause"),this.template.button.innerHTML="",setTimeout((function(){e.template.button.innerHTML=o.default.pause}),100),this.template.skipPlayButton.innerHTML=o.default.pause),this.timer.enable("loading"),this.options.mutex)for(var t=0;t<m.length;t++)this!==m[t]&&m[t].pause()}},{key:"play",value:function(){var e=this;this.setUIPlaying();var t=this.audio.play();t&&t.catch((function(t){console.warn(t),"NotAllowedError"===t.name&&e.setUIPaused()}))}},{key:"setUIPaused",value:function(){var e=this;this.paused||(this.paused=!0,this.template.button.classList.remove("aplayer-pause"),this.template.button.classList.add("aplayer-play"),this.template.button.innerHTML="",setTimeout((function(){e.template.button.innerHTML=o.default.play}),100),this.template.skipPlayButton.innerHTML=o.default.play),this.container.classList.remove("aplayer-loading"),this.timer.disable("loading")}},{key:"pause",value:function(){this.setUIPaused(),this.audio.pause()}},{key:"switchVolumeIcon",value:function(){this.volume()>=.95?this.template.volumeButton.innerHTML=o.default.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=o.default.volumeDown:this.template.volumeButton.innerHTML=o.default.volumeOff}},{key:"volume",value:function(e,t){return e=parseFloat(e),isNaN(e)||(e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"height"),t||this.storage.set("volume",e),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"toggle",value:function(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"switchAudio",value:function(e){this.list.switch(e)}},{key:"addAudio",value:function(e){this.list.add(e)}},{key:"removeAudio",value:function(e){this.list.remove(e)}},{key:"destroy",value:function(){m.splice(m.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}},{key:"setMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=e,"mini"===e?this.container.classList.add("aplayer-narrow"):"normal"===e&&this.container.classList.remove("aplayer-narrow")}},{key:"notice",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=e,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:e}),n&&(this.noticeTime=setTimeout((function(){t.template.notice.style.opacity=0,t.events.trigger("noticehide")}),n))}},{key:"prevIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return this.list.index-1<0?this.list.audios.length-1:this.list.index-1;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return 0===e?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[e-1]}}},{key:"nextIndex",value:function(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return(this.list.index+1)%this.list.audios.length;if("random"===this.options.order){var e=this.randomOrder.indexOf(this.list.index);return e===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[e+1]}}},{key:"skipBack",value:function(){this.list.switch(this.prevIndex())}},{key:"skipForward",value:function(){this.list.switch(this.nextIndex())}},{key:"duration",get:function(){return isNaN(this.audio.duration)?0:this.audio.duration}}],[{key:"version",get:function(){return"1.10.1"}}]),e}();t.default=g},,function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(40);var i,a=(i=n(38))&&i.__esModule?i:{default:i};t.default=a.default}]).default}));
|
package/js/custom.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var mycpen1js={changeNavPageNameTitle(){"Mycpen - Personal Blog"==document.title?document.getElementById("page-name").innerText=document.title:document.getElementById("page-name").innerText=document.title.split(" | Mycpen")[0]},getNavRightPagePercent(){let e=document.documentElement.scrollTop||window.pageYOffset,t=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-document.documentElement.clientHeight,n=Math.round(e/t*100),a=document.querySelector("#percent");n<=99||(n=99),a.innerHTML=n,r=window.scrollY+document.documentElement.clientHeight,p=document.getElementById("post-comment")||document.getElementById("footer"),p.offsetTop+p.offsetHeight/2<r||90<n?(document.querySelector("#nav-totop").classList.add("long"),a.innerHTML="返回顶部"):(document.querySelector("#nav-totop").classList.remove("long"),a.innerHTML=n)},share(){let e=window.location.origin+window.location.pathname;new ClipboardJS(".share",{text:function(){return"标题:"+document.title+"\n链接:"+e}}),btf.snackbarShow("复制成功")},getFooterRandomFlink(){var e={saveData:(e,t)=>{localStorage.setItem(e,JSON.stringify({time:Date.now(),data:t}))},loadData:(e,t)=>{let n=JSON.parse(localStorage.getItem(e));if(n){let e=Date.now()-n.time;if(e<60*t*1e3&&e>-1)return n.data}return 0},randomLink:()=>{let t=e.loadData("links",30);if(t){let e=document.querySelectorAll("#friend-links-in-footer .footer-item");if(!e.length)return;for(let n=0;n<3;n++){let a;do{a=parseInt(Math.random()*t.length)}while("失联"===t[a].tag);e[n].innerText=t[a].name,e[n].href=t[a].link,e[n].title=t[a].name,e[n].target="_blank",e[n].rel="noopener external nofollow noreferrer",t.splice(a,1)}}else fetch("https://registry.npmmirror.com/mycpen-blog/0.0.0-wjbgetcphi/files/link.json").then((e=>e.json())).then((t=>{e.saveData("links",t.link_list),e.randomLink()}))}};e.randomLink()},newYearCountdownCard(){(()=>{if(clearTimeout(null),!document.querySelector("#newYear"))return;let e=new Date(`${(new Date).getFullYear()+1}-01-01 00:00:00`).getTime()/1e3,t={0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"};!function(){let n=new Date,a=n.getMonth()+1,o=n.getDate();a=a>9?a:"0"+a,o=o>9?o:"0"+o,document.querySelector("#newYear .today").innerHTML=n.getFullYear()+"-"+a+"-"+o+" "+t[n.getDay()];let c=e-Math.round(n.getTime()/1e3);c<0?(document.querySelector("#newYear .title").innerHTML="Happy New Year!",document.querySelector("#newYear .newYear-time").innerHTML='<span class="happyNewYear">新年快乐</span>'):(document.querySelector("#newYear .title").innerHTML=`<i class="fa-solid fa-clock"></i> <span>距离</span> ${(new Date).getFullYear()+1} <span>年</span>`,document.querySelector("#newYear .newYear-time").innerHTML=`<span class="day">${Math.ceil(c/86400)}<span class="unit">天</span></span>`)}()})()},removeBodyPaceClass:function(){$("body").removeClass(),$("body").addClass("pace-done")},toPage:function(){var e=document.querySelectorAll(".page-number"),t=parseInt(e[e.length-1].innerHTML),n=document.getElementById("toPageText"),a=parseInt(n.value);if(!isNaN(a)&&a>0&&"0"!==(""+a)[0]&&a<=t){var o,c=window.location.href.replace(/\/page\/\d+\/$/,"/");o=1===a?c:c+(c.endsWith("/")?"":"/")+"page/"+a+"/",document.getElementById("toPageButton").href=o}},listenToPageInputPress(){var e=document.getElementById("toPageText"),t=document.getElementById("toPageButton");e&&(e.addEventListener("keydown",(e=>{13===e.keyCode&&(mycpen1js.toPage(),pjax.loadUrl(t.href))})),e.addEventListener("input",(function(){""===e.value||"0"===e.value?t.classList.remove("haveValue"):t.classList.add("haveValue");var n=document.querySelectorAll(".page-number"),a=+n[n.length-1].innerHTML;+document.getElementById("toPageText").value>a&&(e.value=a)})))},showConsole:function(){document.querySelector("#console").classList.add("show"),mycpen1js.initConsoleState()},hideConsole:function(){document.querySelector("#console").classList.remove("show")},hideAsideBtn:()=>{const e=document.documentElement.classList;e.contains("hide-aside")?saveToLocal.set("aside-status","show",2):saveToLocal.set("aside-status","hide",2),e.toggle("hide-aside"),e.contains("hide-aside")?document.querySelector("#consoleHideAside").classList.add("on"):document.querySelector("#consoleHideAside").classList.remove("on")},initConsoleState:function(){document.documentElement.classList.contains("hide-aside")?document.querySelector("#consoleHideAside").classList.add("on"):document.querySelector("#consoleHideAside").classList.remove("on")},tagPageActive:function(){var e=window.location.pathname;if(/\/tags\/.*?\//.test(e=decodeURIComponent(e))){var t=e.split("/")[2];if(document.querySelector(".page .layout #tag #tag-page-tags")){$("a").removeClass("select");var n=document.getElementById("mycpen1-tags-page-cloudTags-"+t);n&&n.classList.add("select")}}},categoryPageActive:function(){var e=window.location.pathname;if(/\/categories\/.*?\//.test(e=decodeURIComponent(e))){var t=e.split("/")[2];if(document.querySelector(".page .layout #category #category-page-categories")){$("a").removeClass("select");var n=document.getElementById("mycpen1-categories-page-cloudCategories-"+t);n&&n.classList.add("select")}}},addRandomCommentInfo:function(){const e=["美丽的","英俊的","聪明的","勇敢的","可爱的","慷慨的","善良的","可靠的","开朗的","成熟的","稳重的","真诚的","幽默的","豁达的","有趣的","活泼的","优雅的","敏捷的","温柔的","温暖的","敬业的","细心的","耐心的","深沉的","朴素的","含蓄的","率直的","开放的","务实的","坚强的","自信的","谦虚的","文静的","深刻的","纯真的","朝气蓬勃的","慎重的","大方的","顽强的","迷人的","机智的","善解人意的","富有想象力的","有魅力的","独立的","好奇的","干净的","宽容的","尊重他人的","体贴的","守信的","有耐性的","有责任心的","有担当的","有远见的","有智慧的","有眼光的","有冒险精神的","有爱心的","有同情心的","喜欢思考的","喜欢学习的","具有批判性思维的","善于表达的","善于沟通的","善于合作的","善于领导的","有激情的","有幽默感的","有思想的","有个性的","有正义感的","有责任感的","有创造力的","有想象力的","有艺术细胞的","有团队精神的","有协调能力的","有决策能力的","有组织能力的","有学习能力的","有执行能力的","有分析能力的","有逻辑思维的","有创新能力的","有专业素养的","有商业头脑的"],t=["萝卜","白菜","芹菜","生菜","青椒","辣椒","茄子","豆角","黄瓜","西红柿","洋葱","大蒜","土豆","南瓜","豆腐","韭菜","花菜","西兰花","蘑菇","金针菇","苹果","香蕉","橙子","柠檬","猕猴桃","草莓","葡萄","桃子","杏子","李子","石榴","西瓜","哈密瓜","蜜瓜","樱桃","蓝莓","柿子","橄榄","柚子","火龙果"],n=`${e[Math.floor(Math.random()*e.length)]}${t[Math.floor(Math.random()*t.length)]}`;!function(){for(var e=["#author","input[name='comname']","#inpName","input[name='author']","#ds-dialog-name","#name","input[name='nick']","#comment_author"],t=["#mail","#email","input[name='commail']","#inpEmail","input[name='email']","#ds-dialog-email","input[name='mail']","#comment_email"],a=0;a<e.length;a++){var o=document.querySelector(e[a]);if(null!=o){o.value=n,o.dispatchEvent(new Event("input")),o.dispatchEvent(new Event("change"));break}}for(var c=0;c<t.length;c++){var s=document.querySelector(t[c]);if(null!=s){s.value="visitor@mycpen.cn",s.dispatchEvent(new Event("input")),s.dispatchEvent(new Event("change"));break}}}();var a=document.getElementsByClassName("el-textarea__inner")[0];a.focus(),a.setSelectionRange(-1,-1)},owoBigfunc(){document.getElementById("post-comment")&&function(){let e=1,t="",n=document.createElement("div"),a=document.querySelector("body");n.id="owo-big",a.appendChild(n),new MutationObserver((o=>{for(let c=0;c<o.length;c++){let s=o[c].addedNodes,r="";2==s.length&&"OwO-body"==s[1].className&&(r=s[1],document.body.clientWidth<=768&&r.addEventListener("contextmenu",(e=>e.preventDefault())),r.onmouseover=o=>{e&&"IMG"==o.target.tagName&&(e=0,t=setTimeout((()=>{let e=3*o.target.clientHeight,t=3*o.target.clientWidth,c=o.x-o.offsetX-(t-o.target.clientWidth)/2,s=o.y-o.offsetY;c+t>a.clientWidth&&(c-=c+t-a.clientWidth+10),c<0&&(c=10),n.style.cssText=`display:flex; height:${e}px; width:${t}px; left:${c}px; top:${s}px;`,n.innerHTML=`<img src="${o.target.src}">`}),300))},r.onmouseout=()=>{n.style.display="none",e=1,clearTimeout(t)})}})).observe(document.getElementById("post-comment"),{subtree:!0,childList:!0})}()},removeaAlayerFixedLrc(){function e(){const e=document.querySelector(".aplayer-fixed .aplayer-icon.aplayer-icon-lrc");e&&(t.disconnect(),setTimeout((()=>{e.click()}),1))}const t=new MutationObserver(((t,n)=>{for(let n of t)"childList"===n.type&&e()}));t.observe(document,{childList:!0,subtree:!0})},switchDarkMode(){"light"===("dark"===document.documentElement.getAttribute("data-theme")?"dark":"light")?(activateDarkMode(),saveToLocal.set("theme","dark",2),void 0!==GLOBAL_CONFIG.Snackbar&&btf.snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night)):(activateLightMode(),saveToLocal.set("theme","light",2),void 0!==GLOBAL_CONFIG.Snackbar&&btf.snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day)),"function"==typeof utterancesTheme&&utterancesTheme(),"object"==typeof FB&&window.loadFBComment(),window.DISQUS&&document.getElementById("disqus_thread").children.length&&setTimeout((()=>window.disqusReset()),200)},essayUnknownPart(){},essayReplaceAll:(e,t,n)=>e.split(t).join(n),essayDiffDate:function(e,t=!1){const n=new Date,a=new Date(e),o=n.getTime()-a.getTime(),c=36e5,s=24*c;let r;if(t){const e=o/s,t=o/c,n=o/6e4;r=o/2592e6>=1?a.toLocaleDateString().replace(/\//g,"-"):e>=1?parseInt(e)+" "+GLOBAL_CONFIG.date_suffix.day:t>=1?parseInt(t)+" "+GLOBAL_CONFIG.date_suffix.hour:n>=1?parseInt(n)+" "+GLOBAL_CONFIG.date_suffix.min:GLOBAL_CONFIG.date_suffix.just}else r=parseInt(o/s);return r},essayChangeTimeInEssay:function(){document.querySelector("#bber")&&document.querySelectorAll("#bber time").forEach((function(e){var t=e,n=t.getAttribute("datetime");t.innerText=mycpen1js.essayDiffDate(n,!0),t.style.display="inline"}))},essayReflashEssayWaterFall:function(){document.querySelector("#waterfall")&&setTimeout((function(){waterfall("#waterfall"),document.getElementById("waterfall").classList.add("show")}),500)},essayCommentText:function(e){var t=document.querySelector("#post-comment").offsetTop;window.scrollTo(0,t-80),"undefined"!=e&&"null"!=e||(e="好棒!"),function t(){setTimeout((()=>{var n=document.getElementsByClassName("el-textarea__inner")[0];n||t();let a=document.createEvent("HTMLEvents");a.initEvent("input",!0,!0);let o=mycpen1js.essayReplaceAll(e,"\n","\n> ");n.value="> "+o+"\n\n",n.dispatchEvent(a),n.focus(),n.setSelectionRange(-1,-1),document.getElementById("comment-tips")&&document.getElementById("comment-tips").classList.add("show")}),100)}()},essayInitIndexEssay:function(){setTimeout((()=>{let e=new Swiper(".essay_bar_swiper_container",{passiveListeners:!0,direction:"vertical",loop:!0,autoplay:{disableOnInteraction:!0,delay:3e3},mousewheel:!0}),t=document.getElementById("bbtalk");null!==t&&(t.onmouseenter=function(){e.autoplay.stop()},t.onmouseleave=function(){e.autoplay.start()})}),100)},essayChangeTimeInEssayByMycpen:function(){for(var e=document.getElementsByTagName("time"),t=0;t<e.length;t++){var n,a=e[t].getAttribute("datetime"),o=new Date(a),c=(new Date).getTime()-o.getTime(),s=Math.floor(c/864e5);0===s?n="最近":1===s?n="昨天":2===s?n="前天":s<=7?n=s+"天前":o.getFullYear()!==(new Date).getFullYear()?(Essaymonth=o.getMonth()+1,EssayDay=o.getDate(),Essaymonth=Essaymonth>9?Essaymonth:"0"+Essaymonth,EssayDay=EssayDay>9?EssayDay:"0"+EssayDay,n=o.getFullYear()+"-"+Essaymonth+"-"+EssayDay):(Essaymonth=o.getMonth()+1,EssayDay=o.getDate(),Essaymonth=Essaymonth>9?Essaymonth:"0"+Essaymonth,EssayDay=EssayDay>9?EssayDay:"0"+EssayDay,n=Essaymonth+"-"+EssayDay),e[t].textContent=n}},switchPostChart:function(){let e="light"===document.documentElement.getAttribute("data-theme")?"#4C4948":"rgba(255,255,255,0.7)";if(document.getElementById("posts-chart")&&postsOption)try{let t=postsOption;t.title.textStyle.color=e,t.xAxis.nameTextStyle.color=e,t.yAxis.nameTextStyle.color=e,t.xAxis.axisLabel.color=e,t.yAxis.axisLabel.color=e,t.xAxis.axisLine.lineStyle.color=e,t.yAxis.axisLine.lineStyle.color=e,t.series[0].markLine.data[0].label.color=e,postsChart.setOption(t)}catch(e){console.log(e)}if(document.getElementById("tags-chart")&&tagsOption)try{let t=tagsOption;t.title.textStyle.color=e,t.xAxis.nameTextStyle.color=e,t.yAxis.nameTextStyle.color=e,t.xAxis.axisLabel.color=e,t.yAxis.axisLabel.color=e,t.xAxis.axisLine.lineStyle.color=e,t.yAxis.axisLine.lineStyle.color=e,t.series[0].markLine.data[0].label.color=e,tagsChart.setOption(t)}catch(e){console.log(e)}if(document.getElementById("categories-chart")&&categoriesOption)try{let t=categoriesOption;t.title.textStyle.color=e,t.legend.textStyle.color=e,categoryParentFlag||(t.series[0].label.color=e),categoriesChart.setOption(t)}catch(e){console.log(e)}},cpRemind(){document.addEventListener("copy",(function(e){window.getSelection().toString().trim().length>0&&btf.snackbarShow("复制成功")}))},closeAboutAplayer(){if(!document.getElementById("mycpen1-about-page-tag"))try{about_page_ap.pause(),about_page_ap=void 0,about_page_weekSong=void 0,about_page_now=void 0,about_page_weekSong_today=void 0}catch(e){}},grey(){var e=new Date,t=e.getMonth()+1,n=e.getDate();for(var a of["04.04","05.12","07.07","08.14","09.09","09.18","09.30","11.30","12.13"]){var o=a.split(".");if(t==o[0]&&n==o[1]){var c="grayscale(100%)";$("html").css({filter:"gray !important;",filter:"progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)",filter:c,"-webkit-filter":c,"-moz-filter":c,"-ms-filter":c,"-o-filter":c});break}}},console(){var e=new Date,t=console.log;queueMicrotask((function(){var n=new Date(`${atob("MDgvMjgvMjAyMiA=")}${atob("MDA6MDA6MDA=")}`),a=new Date(`${atob("MTAvMjIvMTk5OCAwMA==")}:${atob("MDA6MDA=")}`),o=new Date(`${atob("MTAvMjIvMjA=")}${atob("MjggMDA6MDA6MDA=")}`),c=new Date(`${atob("MTA=")}/${atob("MjIvMjA1OCAwMDowMA==")}${atob("OjAw")}`),s=new Date("05/23/2025 00:00:00");e.setTime(e.getTime()+250);n=[" MYCPEN BLOG ",` ${window.location.origin} `,"\n\n███╗ ███╗██╗ ██╗ ██████╗██████╗ ███████╗███╗ ██╗\n████╗ ████║╚██╗ ██╔╝██╔════╝██╔══██╗██╔════╝████╗ ██║\n██╔████╔██║ ╚████╔╝ ██║ ██████╔╝█████╗ ██╔██╗ ██║\n██║╚██╔╝██║ ╚██╔╝ ██║ ██╔═══╝ ██╔══╝ ██║╚██╗██║\n██║ ╚═╝ ██║ ██║ ╚██████╗██║ ███████╗██║ ╚████║\n╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚══════╝╚═╝ ╚═══╝\n","距 2022-08-28 上线",Math.floor(Math.abs(e-n)/1e3/60/60/24+(e-n<0?1:0)).toString().padEnd(5," "),"天","距 1998-00-00 计时",Math.floor(Math.abs(e-a)/1e3/60/60/24+(e-a<0?1:0)).toString().padEnd(5," "),"天","距 2028-00-00 计时",Math.floor(Math.abs(e-o)/1e3/60/60/24+(e-o<0?1:0)).toString().padEnd(5," "),"天","距 2058-00-00 计时",Math.floor(Math.abs(e-c)/1e3/60/60/24+(e-c<0?1:0)).toString().padEnd(5," "),"天","距 2025-05-23 计时",Math.floor(Math.abs(e-s)/1e3/60/60/24+(e-s<0?1:0)).toString().padEnd(5," "),"天 (阿里云)"];setTimeout(function(){t.apply(console,arguments)}.bind(console,"\n%c".concat(n[0],"%c").concat(n[1],"%c").concat(n[2],"%c").concat(n[3],"%c ").concat(n[4],"%c ").concat(n[5],"\n").concat(n[6],"%c ").concat(n[7],"%c ").concat(n[8],"\n").concat(n[9],"%c ").concat(n[10],"%c ").concat(n[11],"\n").concat(n[12],"%c ").concat(n[13],"%c ").concat(n[14],"\n").concat(n[15],"%c ").concat(n[16],"%c ").concat(n[17],"\n").concat("\n"),"color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;","color:#fadfa3","","color:#030307","","color:#030307","","color:#030307","","color:#030307","","color:#030307",""))}))},cardRefreshTimes(){const e=(new Date).getFullYear(),t=function(e){return e%4==0&&e%100!=0||e%400==0}(e)?366:365;var n=new Date,a=new Date(`${(new Date).getFullYear()}-01-01 00:00:00`),o=document.getElementById("card-widget-schedule");o&&(asideDay=(n-a)/1e3/60/60/24,o.querySelector("#pBar_year").value=asideDay,o.querySelector("#pBar_year").max=t,yearPercentage=(asideDay/t*100).toFixed(2),displayYearPercentage="100.00"===yearPercentage?"100%":yearPercentage+"%",o.querySelector("#p_span_year").innerHTML=displayYearPercentage,o.querySelector(".schedule-r0 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(t-asideDay))/10).toFixed(1)+" / "+t,currentDateMonth=new Date,currentDateMonth.setDate(1),currentDateMonth.setHours(0,0,0,0),currentMonthTimestamp=currentDateMonth.getTime(),asideMonthDay=(n-currentMonthTimestamp)/1e3/60/60/24,currentDateMonthTotal=new Date,currentMonth=currentDateMonthTotal.getMonth(),currentDateMonthTotal.setMonth(currentMonth+1,1),currentDateMonthTotal.setDate(0),asideMonthDays=currentDateMonthTotal.getDate(),o.querySelector("#pBar_month").value=asideMonthDay,o.querySelector("#pBar_month").max=asideMonthDays,monthPercentage=(asideMonthDay/asideMonthDays*100).toFixed(2),displayMonthPercentage="100.00"===monthPercentage?"100%":monthPercentage+"%",o.querySelector("#p_span_month").innerHTML=displayMonthPercentage,o.querySelector(".schedule-r1 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(asideMonthDays-asideMonthDay))/10).toFixed(1)+" / "+asideMonthDays.toString().padStart(3,"0"),currentDateWeek=new Date,currentDayOfWeek=currentDateWeek.getDay(),currentWeekTimestamp=currentDateWeek.setHours(0,0,0,0),firstDayOfWeekTimestamp=currentWeekTimestamp-24*(0===currentDayOfWeek?6:currentDayOfWeek-1)*60*60*1e3,pastWeekTimestamp=n-firstDayOfWeekTimestamp,asideWeekDay=pastWeekTimestamp/1e3/60/60/24,o.querySelector("#pBar_week").value=asideWeekDay,weekPercentage=(asideWeekDay/7*100).toFixed(2),displayWeekPercentage="100.00"===weekPercentage?"100%":weekPercentage+"%",o.querySelector("#p_span_week").innerHTML=displayWeekPercentage,o.querySelector(".schedule-r2 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(7-asideWeekDay))/10).toFixed(1)+" / 007",currentTimeStamp=(new Date).getTime(),startOfDay=new Date,startOfDay.setHours(0,0,0,0),startOfDayTimeStamp=startOfDay.getTime(),timeDifferenceToday=currentTimeStamp-startOfDayTimeStamp,asideToday=timeDifferenceToday/1e3/60/60/24,asideTodayHour=timeDifferenceToday/36e5,o.querySelector("#pBar_day").value=asideTodayHour,dayPercentage=(100*asideToday).toFixed(2),displayDayPercentage="100.00"===dayPercentage?"100%":dayPercentage+"%",o.querySelector("#p_span_day").innerHTML=displayDayPercentage,o.querySelector(".schedule-r3 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(24-asideTodayHour))/10).toFixed(1)+" / 024",month=n.getMonth()+1,day=n.getDate(),month=month>9?month:"0"+month,day=day>9?day:"0"+day,week={0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},document.querySelector("#aside-content .sticky_layout .card-widget#card-widget-schedule .item-content .schedule-today").innerHTML=n.getFullYear()+"-"+month+"-"+day+" "+week[n.getDay()])},PressEscapeKey(e){27===e.keyCode&&(document.getElementById("console")&&mycpen1js.hideConsole(),document.getElementById("cf-overlay")&&document.getElementById("cf-overshow")&&(document.querySelector(".cf-overshow-close")||document.querySelector(".cf-overshow"))&&(document.getElementById("mycpen1-fcircle-page-tag")&&closeShow(),document.getElementById("mycpen1-link-page-tag")&&mycpen1js.linkPageCloseShow()))},linkPageOpenMeShow(e){var t="ok",n=document.getElementById("mycpen1-link-page-tag");n&&(document.getElementById("cf-overlay")||n.insertAdjacentHTML("afterend",'\n <div id="cf-overlay" class="cf-new-add" onclick="mycpen1js.linkPageCloseShow()"></div>\n <div id="cf-overshow" class="cf-new-add"></div>\n ')),e.preventDefault();var a;a="https://www.cpen.top:8002/post?link="+e.currentTarget.dataset.link.replace(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,"$1:$2$3"),"ok"==t&&(t="no",mycpen1js.linkPageFetchShow(a))},linkPageCloseShow(){document.getElementById("cf-overlay").className-="cf-show-now",document.getElementById("cf-overshow").className-="cf-show-now",setTimeout((function(){var e=document.querySelectorAll("#cf-overshow > :not(.cf-overshow-close)"),t=document.querySelectorAll("#cf-overshow > .cf-overshow-close");e.forEach((function(e){e.remove()}));for(var n=1;n<t.length;n++)t[n].remove()}),100)},linkPageFetchShow(url){var closeHtml='\n <div class="cf-overshow-close" onclick="mycpen1js.linkPageCloseShow()"></div>\n ';fetch(url).then((e=>e.json())).then((json=>{noClick="ok";var statisticalData=json.statistical_data,articleData=eval(json.article_data);0!==statisticalData.article_num?(mycpen1js.linkPageLoadFcircleShow(statisticalData,articleData),document.getElementById("cf-overlay").className="cf-show-now",document.getElementById("cf-overshow").insertAdjacentHTML("afterbegin",closeHtml)):btf.snackbarShow("未获取到订阅内容")})).catch((e=>{btf.snackbarShow("未获取到文章卡片")}))},linkPageLoadFcircleShow(e,t){for(var n=`\n <div class="cf-overshow">\n <div class="cf-overshow-head">\n <img class="cf-img-avatar avatar" src="${e.avatar}" alt="avatar" onerror="this.src='/img/flink404.svg'; this.onerror = null;">\n <a class="" target="_blank" rel="noopener nofollow" href="${e.link}">${e.name}</a>\n </div>\n <div class="cf-overshow-content">\n `,a=0;a<e.article_num;a++){var o=t[a];let e="";Date.now()-new Date(o.created+" 00:00:00").getTime()<=1728e5&&(e='style="color: var(--mycpen1-main); opacity: 1;"'),n+=`\n <p><a class="cf-article-title" href="${o.link}" target="_blank" rel="noopener nofollow" data-title="${o.title}">${o.title}</a><span ${e}>${o.created}</span></p>\n `}n+="</div></div>",document.getElementById("cf-overshow").insertAdjacentHTML("beforeend",n),document.getElementById("cf-overshow").className="cf-show-now"},linkPageRssAliveCheck(){apiurl="https://www.cpen.top:8002/",rssAliveCheckUrl=apiurl+"friendstatus",fetch(rssAliveCheckUrl).then((e=>e.json())).then((e=>{var t=e.lost_friends,n=e.not_lost_friends,a=e.total_friend_num;let o=[];for(const e in t){let n=t[e];n=n.replace(/^https?:\/\//,""),n=n.replace(/\/$/,""),o.push(n)}let c=[];for(const e in n){let t=n[e];t=t.replace(/^https?:\/\//,""),t=t.replace(/\/$/,""),c.push(t)}document.querySelectorAll("#article-container .flink#mycpen1-link-page-tag-2 .flink-list>.flink-list-item a .flink-item-icon").forEach((e=>{if(e){let t=e.getAttribute("data-link").replace(/^https?:\/\//,"");t=t.replace(/\/$/,""),a>0?c.includes(t)?e.classList.add("flink-mycpen1-rss-not-lost-friends"):o.includes(t)?e.classList.add("flink-mycpen1-rss-lost-friends"):e.classList.add("flink-mycpen1-rss-unknown-friends"):0===a&&e.classList.add("flink-mycpen1-rss-lost-friends")}}))}))},NzcheckLink:async e=>{const t=document.querySelectorAll(e);if(t){let e=new RegExp(/^[#].*/);for(let n=0;n<t.length;n++){const a=t[n];let o=a.getAttribute("href"),c=a.getAttribute("data-download"),s=a.getAttribute("rel");e.test(o)||"prev"===s||"next"===s||"category"===s||"tag"===s||"javascript:void(0);"===o||(await mycpen1js.NzcheckLocalSite(o)||c?await mycpen1js.NzcheckLocalSite(o)||"goDown"!==c||a.setAttribute("href","/redirect.html?url="+btoa(o)+"&type=goDown"):a.setAttribute("href","/redirect.html?url="+btoa(o))),a.classList.add("already-redirect-link")}}},NzcheckLocalSite:async e=>{try{const t=["localhost:4000","cpen.top","mycpen.cn"];let n=!1;for(let a=0;a<t.length;a++){const o=t[a];if(e.includes(o)){n=!0;break}}return n}catch(e){return!0}},cookieConsent(){window.addEventListener("load",(()=>{window.cookieconsent.initialise({type:"info",theme:"edgeless",static:!1,position:"bottom-right",content:{message:"我们使用 cookie 来确保在我们的网站上为您提供最佳体验。",dismiss:"接受",allow:"接受",deny:"拒绝",link:!1},palette:{popup:{background:"#edeff5",text:"#838391"},button:{background:"#4b81e8"}}})}))}};function whenDOMReadyMycpen1JS(){mycpen1js.changeNavPageNameTitle(),mycpen1js.getFooterRandomFlink(),mycpen1js.removeBodyPaceClass(),mycpen1js.tagPageActive(),mycpen1js.categoryPageActive(),mycpen1js.listenToPageInputPress(),mycpen1js.owoBigfunc(),document.getElementById("mycpen1-essay-page-tag")&&(mycpen1js.essayChangeTimeInEssayByMycpen(),mycpen1js.essayReflashEssayWaterFall(),window.onresize=()=>{document.getElementById("mycpen1-essay-page-tag")&&(mycpen1js.essayReflashEssayWaterFall(),setTimeout((()=>{mycpen1js.essayReflashEssayWaterFall()}),300))}),document.getElementById("darkmode").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),document.getElementById("darkmode_navswitch").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),document.getElementById("darkmode_consoleSwitch").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),document.getElementById("darkmode_sidebarSwitch").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),mycpen1js.cpRemind(),mycpen1js.closeAboutAplayer(),document.getElementById("card-widget-schedule")&&(mycpen1js.cardRefreshTimes(),setInterval((()=>{mycpen1js.cardRefreshTimes()}),1e3)),document.getElementById("mycpen1-link-page-tag-2")&&mycpen1js.linkPageRssAliveCheck(),mycpen1js.NzcheckLink("#article-container .flink .flink-list > .flink-list-item.单向 > a "),mycpen1js.NzcheckLink("#article-container .flink .flink-list > .flink-list-item.失联 > a "),document.getElementById("post-comment")&&setInterval((()=>{if(document.querySelector(".tk-comments-container")){mycpen1js.NzcheckLink(".tk-comments-container a:not(.already-redirect-link)");document.querySelectorAll(".tk-avatar.tk-clickable:not(.already-clear-clickEvent)").forEach((e=>{e.classList.add("already-clear-clickEvent");const t=document.createElement("a");for(Array.from(e.attributes).forEach((e=>{t.setAttribute(e.name,e.value)}));e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e);const n=t.nextElementSibling.firstElementChild.firstElementChild.firstElementChild.getAttribute("href");t.setAttribute("href",n),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener external nofollow noreferrer")}))}}),1e3)}mycpen1js.console(),document.removeEventListener("keydown",mycpen1js.PressEscapeKey),document.addEventListener("keydown",mycpen1js.PressEscapeKey),window.onscroll=mycpen1js.getNavRightPagePercent,mycpen1js.removeaAlayerFixedLrc(),whenDOMReadyMycpen1JS(),document.addEventListener("pjax:complete",whenDOMReadyMycpen1JS);
|
1
|
+
var mycpen1js={changeNavPageNameTitle(){"Mycpen - Personal Blog"==document.title?document.getElementById("page-name").innerText=document.title:document.getElementById("page-name").innerText=document.title.split(" | Mycpen")[0]},getNavRightPagePercent(){let e=document.documentElement.scrollTop||window.pageYOffset,t=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-document.documentElement.clientHeight,n=Math.round(e/t*100),a=document.querySelector("#percent");n<=99||(n=99),a.innerHTML=n,r=window.scrollY+document.documentElement.clientHeight,p=document.getElementById("post-comment")||document.getElementById("footer"),p.offsetTop+p.offsetHeight/2<r||90<n?(document.querySelector("#nav-totop").classList.add("long"),a.innerHTML="返回顶部"):(document.querySelector("#nav-totop").classList.remove("long"),a.innerHTML=n)},share(){let e=window.location.origin+window.location.pathname;new ClipboardJS(".share",{text:function(){return"标题:"+document.title+"\n链接:"+e}}),btf.snackbarShow("复制成功")},getFooterRandomFlink(){var e={saveData:(e,t)=>{localStorage.setItem(e,JSON.stringify({time:Date.now(),data:t}))},loadData:(e,t)=>{let n=JSON.parse(localStorage.getItem(e));if(n){let e=Date.now()-n.time;if(e<60*t*1e3&&e>-1)return n.data}return 0},randomLink:()=>{let t=e.loadData("links",30);if(t){let e=document.querySelectorAll("#friend-links-in-footer .footer-item");if(!e.length)return;for(let n=0;n<3;n++){let a;do{a=parseInt(Math.random()*t.length)}while("失联"===t[a].tag);e[n].innerText=t[a].name,e[n].href=t[a].link,e[n].title=t[a].name,e[n].target="_blank",e[n].rel="noopener external nofollow noreferrer",t.splice(a,1)}}else fetch("https://cdn.jsdmirror.com/npm/mycpen-blog@0.0.0-wjbrdpunvk/json/link.json").then((e=>e.json())).then((t=>{e.saveData("links",t.link_list),e.randomLink()}))}};e.randomLink()},newYearCountdownCard(){(()=>{if(clearTimeout(null),!document.querySelector("#newYear"))return;let e=new Date(`${(new Date).getFullYear()+1}-01-01 00:00:00`).getTime()/1e3,t={0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"};!function(){let n=new Date,a=n.getMonth()+1,o=n.getDate();a=a>9?a:"0"+a,o=o>9?o:"0"+o,document.querySelector("#newYear .today").innerHTML=n.getFullYear()+"-"+a+"-"+o+" "+t[n.getDay()];let c=e-Math.round(n.getTime()/1e3);c<0?(document.querySelector("#newYear .title").innerHTML="Happy New Year!",document.querySelector("#newYear .newYear-time").innerHTML='<span class="happyNewYear">新年快乐</span>'):(document.querySelector("#newYear .title").innerHTML=`<i class="fa-solid fa-clock"></i> <span>距离</span> ${(new Date).getFullYear()+1} <span>年</span>`,document.querySelector("#newYear .newYear-time").innerHTML=`<span class="day">${Math.ceil(c/86400)}<span class="unit">天</span></span>`)}()})()},removeBodyPaceClass:function(){$("body").removeClass(),$("body").addClass("pace-done")},toPage:function(){var e=document.querySelectorAll(".page-number"),t=parseInt(e[e.length-1].innerHTML),n=document.getElementById("toPageText"),a=parseInt(n.value);if(!isNaN(a)&&a>0&&"0"!==(""+a)[0]&&a<=t){var o,c=window.location.href.replace(/\/page\/\d+\/$/,"/");o=1===a?c:c+(c.endsWith("/")?"":"/")+"page/"+a+"/",document.getElementById("toPageButton").href=o}},listenToPageInputPress(){var e=document.getElementById("toPageText"),t=document.getElementById("toPageButton");e&&(e.addEventListener("keydown",(e=>{13===e.keyCode&&(mycpen1js.toPage(),pjax.loadUrl(t.href))})),e.addEventListener("input",(function(){""===e.value||"0"===e.value?t.classList.remove("haveValue"):t.classList.add("haveValue");var n=document.querySelectorAll(".page-number"),a=+n[n.length-1].innerHTML;+document.getElementById("toPageText").value>a&&(e.value=a)})))},showConsole:function(){document.querySelector("#console").classList.add("show"),mycpen1js.initConsoleState()},hideConsole:function(){document.querySelector("#console").classList.remove("show")},hideAsideBtn:()=>{const e=document.documentElement.classList;e.contains("hide-aside")?saveToLocal.set("aside-status","show",2):saveToLocal.set("aside-status","hide",2),e.toggle("hide-aside"),e.contains("hide-aside")?document.querySelector("#consoleHideAside").classList.add("on"):document.querySelector("#consoleHideAside").classList.remove("on")},initConsoleState:function(){document.documentElement.classList.contains("hide-aside")?document.querySelector("#consoleHideAside").classList.add("on"):document.querySelector("#consoleHideAside").classList.remove("on")},tagPageActive:function(){var e=window.location.pathname;if(/\/tags\/.*?\//.test(e=decodeURIComponent(e))){var t=e.split("/")[2];if(document.querySelector(".page .layout #tag #tag-page-tags")){$("a").removeClass("select");var n=document.getElementById("mycpen1-tags-page-cloudTags-"+t);n&&n.classList.add("select")}}},categoryPageActive:function(){var e=window.location.pathname;if(/\/categories\/.*?\//.test(e=decodeURIComponent(e))){var t=e.split("/")[2];if(document.querySelector(".page .layout #category #category-page-categories")){$("a").removeClass("select");var n=document.getElementById("mycpen1-categories-page-cloudCategories-"+t);n&&n.classList.add("select")}}},addRandomCommentInfo:function(){const e=["美丽的","英俊的","聪明的","勇敢的","可爱的","慷慨的","善良的","可靠的","开朗的","成熟的","稳重的","真诚的","幽默的","豁达的","有趣的","活泼的","优雅的","敏捷的","温柔的","温暖的","敬业的","细心的","耐心的","深沉的","朴素的","含蓄的","率直的","开放的","务实的","坚强的","自信的","谦虚的","文静的","深刻的","纯真的","朝气蓬勃的","慎重的","大方的","顽强的","迷人的","机智的","善解人意的","富有想象力的","有魅力的","独立的","好奇的","干净的","宽容的","尊重他人的","体贴的","守信的","有耐性的","有责任心的","有担当的","有远见的","有智慧的","有眼光的","有冒险精神的","有爱心的","有同情心的","喜欢思考的","喜欢学习的","具有批判性思维的","善于表达的","善于沟通的","善于合作的","善于领导的","有激情的","有幽默感的","有思想的","有个性的","有正义感的","有责任感的","有创造力的","有想象力的","有艺术细胞的","有团队精神的","有协调能力的","有决策能力的","有组织能力的","有学习能力的","有执行能力的","有分析能力的","有逻辑思维的","有创新能力的","有专业素养的","有商业头脑的"],t=["萝卜","白菜","芹菜","生菜","青椒","辣椒","茄子","豆角","黄瓜","西红柿","洋葱","大蒜","土豆","南瓜","豆腐","韭菜","花菜","西兰花","蘑菇","金针菇","苹果","香蕉","橙子","柠檬","猕猴桃","草莓","葡萄","桃子","杏子","李子","石榴","西瓜","哈密瓜","蜜瓜","樱桃","蓝莓","柿子","橄榄","柚子","火龙果"],n=`${e[Math.floor(Math.random()*e.length)]}${t[Math.floor(Math.random()*t.length)]}`;!function(){for(var e=["#author","input[name='comname']","#inpName","input[name='author']","#ds-dialog-name","#name","input[name='nick']","#comment_author"],t=["#mail","#email","input[name='commail']","#inpEmail","input[name='email']","#ds-dialog-email","input[name='mail']","#comment_email"],a=0;a<e.length;a++){var o=document.querySelector(e[a]);if(null!=o){o.value=n,o.dispatchEvent(new Event("input")),o.dispatchEvent(new Event("change"));break}}for(var c=0;c<t.length;c++){var s=document.querySelector(t[c]);if(null!=s){s.value="donotreply@mycpen.cn",s.dispatchEvent(new Event("input")),s.dispatchEvent(new Event("change"));break}}}();var a=document.getElementsByClassName("el-textarea__inner")[0];a.focus(),a.setSelectionRange(-1,-1)},owoBigfunc(){document.getElementById("post-comment")&&function(){let e=1,t="",n=document.createElement("div"),a=document.querySelector("body");n.id="owo-big",a.appendChild(n),new MutationObserver((o=>{for(let c=0;c<o.length;c++){let s=o[c].addedNodes,r="";2==s.length&&"OwO-body"==s[1].className&&(r=s[1],document.body.clientWidth<=768&&r.addEventListener("contextmenu",(e=>e.preventDefault())),r.onmouseover=o=>{e&&"IMG"==o.target.tagName&&(e=0,t=setTimeout((()=>{let e=3*o.target.clientHeight,t=3*o.target.clientWidth,c=o.x-o.offsetX-(t-o.target.clientWidth)/2,s=o.y-o.offsetY;c+t>a.clientWidth&&(c-=c+t-a.clientWidth+10),c<0&&(c=10),n.style.cssText=`display:flex; height:${e}px; width:${t}px; left:${c}px; top:${s}px;`,n.innerHTML=`<img src="${o.target.src}">`}),300))},r.onmouseout=()=>{n.style.display="none",e=1,clearTimeout(t)})}})).observe(document.getElementById("post-comment"),{subtree:!0,childList:!0})}()},removeaAlayerFixedLrc(){function e(){const e=document.querySelector(".aplayer-fixed .aplayer-icon.aplayer-icon-lrc");e&&(t.disconnect(),setTimeout((()=>{e.click()}),1))}const t=new MutationObserver(((t,n)=>{for(let n of t)"childList"===n.type&&e()}));t.observe(document,{childList:!0,subtree:!0})},switchDarkMode(){"light"===("dark"===document.documentElement.getAttribute("data-theme")?"dark":"light")?(activateDarkMode(),saveToLocal.set("theme","dark",2),void 0!==GLOBAL_CONFIG.Snackbar&&btf.snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night)):(activateLightMode(),saveToLocal.set("theme","light",2),void 0!==GLOBAL_CONFIG.Snackbar&&btf.snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day)),"function"==typeof utterancesTheme&&utterancesTheme(),"object"==typeof FB&&window.loadFBComment(),window.DISQUS&&document.getElementById("disqus_thread").children.length&&setTimeout((()=>window.disqusReset()),200)},essayUnknownPart(){},essayReplaceAll:(e,t,n)=>e.split(t).join(n),essayDiffDate:function(e,t=!1){const n=new Date,a=new Date(e),o=n.getTime()-a.getTime(),c=36e5,s=24*c;let r;if(t){const e=o/s,t=o/c,n=o/6e4;r=o/(30*s)>=1?a.toLocaleDateString().replace(/\//g,"-"):e>=1?parseInt(e)+" "+GLOBAL_CONFIG.date_suffix.day:t>=1?parseInt(t)+" "+GLOBAL_CONFIG.date_suffix.hour:n>=1?parseInt(n)+" "+GLOBAL_CONFIG.date_suffix.min:GLOBAL_CONFIG.date_suffix.just}else r=parseInt(o/s);return r},essayChangeTimeInEssay:function(){document.querySelector("#bber")&&document.querySelectorAll("#bber time").forEach((function(e){var t=e,n=t.getAttribute("datetime");t.innerText=mycpen1js.essayDiffDate(n,!0),t.style.display="inline"}))},essayReflashEssayWaterFall:function(){document.querySelector("#waterfall")&&setTimeout((function(){waterfall("#waterfall"),document.getElementById("waterfall").classList.add("show")}),500)},essayCommentText:function(e){var t=document.querySelector("#post-comment").offsetTop;window.scrollTo(0,t-80),"undefined"!=e&&"null"!=e||(e="好棒!"),function t(){setTimeout((()=>{var n=document.getElementsByClassName("el-textarea__inner")[0];n||t();let a=document.createEvent("HTMLEvents");a.initEvent("input",!0,!0);let o=mycpen1js.essayReplaceAll(e,"\n","\n> ");n.value="> "+o+"\n\n",n.dispatchEvent(a),n.focus(),n.setSelectionRange(-1,-1),document.getElementById("comment-tips")&&document.getElementById("comment-tips").classList.add("show")}),100)}()},essayInitIndexEssay:function(){setTimeout((()=>{let e=new Swiper(".essay_bar_swiper_container",{passiveListeners:!0,direction:"vertical",loop:!0,autoplay:{disableOnInteraction:!0,delay:3e3},mousewheel:!0}),t=document.getElementById("bbtalk");null!==t&&(t.onmouseenter=function(){e.autoplay.stop()},t.onmouseleave=function(){e.autoplay.start()})}),100)},essayChangeTimeInEssayByMycpen:function(){for(var e=document.getElementsByTagName("time"),t=0;t<e.length;t++){var n,a=e[t].getAttribute("datetime"),o=new Date(a),c=(new Date).getTime()-o.getTime(),s=Math.floor(c/864e5);0===s?n="最近":1===s?n="昨天":2===s?n="前天":s<=7?n=s+"天前":o.getFullYear()!==(new Date).getFullYear()?(Essaymonth=o.getMonth()+1,EssayDay=o.getDate(),Essaymonth=Essaymonth>9?Essaymonth:"0"+Essaymonth,EssayDay=EssayDay>9?EssayDay:"0"+EssayDay,n=o.getFullYear()+"-"+Essaymonth+"-"+EssayDay):(Essaymonth=o.getMonth()+1,EssayDay=o.getDate(),Essaymonth=Essaymonth>9?Essaymonth:"0"+Essaymonth,EssayDay=EssayDay>9?EssayDay:"0"+EssayDay,n=Essaymonth+"-"+EssayDay),e[t].textContent=n}},switchPostChart:function(){let e="light"===document.documentElement.getAttribute("data-theme")?"#4C4948":"rgba(255,255,255,0.7)";if(document.getElementById("posts-chart")&&postsOption)try{let t=postsOption;t.title.textStyle.color=e,t.xAxis.nameTextStyle.color=e,t.yAxis.nameTextStyle.color=e,t.xAxis.axisLabel.color=e,t.yAxis.axisLabel.color=e,t.xAxis.axisLine.lineStyle.color=e,t.yAxis.axisLine.lineStyle.color=e,t.series[0].markLine.data[0].label.color=e,postsChart.setOption(t)}catch(e){console.log(e)}if(document.getElementById("tags-chart")&&tagsOption)try{let t=tagsOption;t.title.textStyle.color=e,t.xAxis.nameTextStyle.color=e,t.yAxis.nameTextStyle.color=e,t.xAxis.axisLabel.color=e,t.yAxis.axisLabel.color=e,t.xAxis.axisLine.lineStyle.color=e,t.yAxis.axisLine.lineStyle.color=e,t.series[0].markLine.data[0].label.color=e,tagsChart.setOption(t)}catch(e){console.log(e)}if(document.getElementById("categories-chart")&&categoriesOption)try{let t=categoriesOption;t.title.textStyle.color=e,t.legend.textStyle.color=e,categoryParentFlag||(t.series[0].label.color=e),categoriesChart.setOption(t)}catch(e){console.log(e)}},cpRemind(){document.addEventListener("copy",(function(e){window.getSelection().toString().trim().length>0&&btf.snackbarShow("复制成功")}))},closeAboutAplayer(){if(!document.getElementById("mycpen1-about-page-tag"))try{about_page_ap.pause(),about_page_ap=void 0,about_page_weekSong=void 0,about_page_now=void 0,about_page_weekSong_today=void 0}catch(e){}},grey(){var e=new Date,t=e.getMonth()+1,n=e.getDate();for(var a of["04.04","05.12","07.07","08.14","09.09","09.18","09.30","11.30","12.13"]){var o=a.split(".");if(t==o[0]&&n==o[1]){var c="grayscale(100%)";$("html").css({filter:"gray !important;",filter:"progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)",filter:c,"-webkit-filter":c,"-moz-filter":c,"-ms-filter":c,"-o-filter":c});break}}},console(){var e=new Date,t=console.log;queueMicrotask((function(){var n=new Date(`${atob("MDgvMjgvMjAyMiA=")}${atob("MDA6MDA6MDA=")}`),a=new Date(`${atob("MTAvMjIvMTk5OCAwMA==")}:${atob("MDA6MDA=")}`),o=new Date(`${atob("MTAvMjIvMjA=")}${atob("MjggMDA6MDA6MDA=")}`),c=new Date(`${atob("MTA=")}/${atob("MjIvMjA1OCAwMDowMA==")}${atob("OjAw")}`),s=new Date("05/23/2025 00:00:00");e.setTime(e.getTime()+250);n=[" MYCPEN BLOG ",` ${window.location.origin} `,"\n\n███╗ ███╗██╗ ██╗ ██████╗██████╗ ███████╗███╗ ██╗\n████╗ ████║╚██╗ ██╔╝██╔════╝██╔══██╗██╔════╝████╗ ██║\n██╔████╔██║ ╚████╔╝ ██║ ██████╔╝█████╗ ██╔██╗ ██║\n██║╚██╔╝██║ ╚██╔╝ ██║ ██╔═══╝ ██╔══╝ ██║╚██╗██║\n██║ ╚═╝ ██║ ██║ ╚██████╗██║ ███████╗██║ ╚████║\n╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚══════╝╚═╝ ╚═══╝\n","距 2022-08-28 上线",Math.floor(Math.abs(e-n)/1e3/60/60/24+(e-n<0?1:0)).toString().padEnd(5," "),"天","距 1998-00-00 计时",Math.floor(Math.abs(e-a)/1e3/60/60/24+(e-a<0?1:0)).toString().padEnd(5," "),"天","距 2028-00-00 计时",Math.floor(Math.abs(e-o)/1e3/60/60/24+(e-o<0?1:0)).toString().padEnd(5," "),"天","距 2058-00-00 计时",Math.floor(Math.abs(e-c)/1e3/60/60/24+(e-c<0?1:0)).toString().padEnd(5," "),"天","距 2025-05-23 计时",Math.floor(Math.abs(e-s)/1e3/60/60/24+(e-s<0?1:0)).toString().padEnd(5," "),"天 (阿里云)"];setTimeout(function(){t.apply(console,arguments)}.bind(console,"\n%c".concat(n[0],"%c").concat(n[1],"%c").concat(n[2],"%c").concat(n[3],"%c ").concat(n[4],"%c ").concat(n[5],"\n").concat(n[6],"%c ").concat(n[7],"%c ").concat(n[8],"\n").concat(n[9],"%c ").concat(n[10],"%c ").concat(n[11],"\n").concat(n[12],"%c ").concat(n[13],"%c ").concat(n[14],"\n").concat(n[15],"%c ").concat(n[16],"%c ").concat(n[17],"\n").concat("\n"),"color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;","color:#fadfa3","","color:#030307","","color:#030307","","color:#030307","","color:#030307","","color:#030307",""))}))},cardRefreshTimes(){const e=(new Date).getFullYear(),t=function(e){return e%4==0&&e%100!=0||e%400==0}(e)?366:365;var n=new Date,a=new Date(`${(new Date).getFullYear()}-01-01 00:00:00`),o=document.getElementById("card-widget-schedule");o&&(asideDay=(n-a)/1e3/60/60/24,o.querySelector("#pBar_year").value=asideDay,o.querySelector("#pBar_year").max=t,yearPercentage=(asideDay/t*100).toFixed(2),displayYearPercentage="100.00"===yearPercentage?"100%":yearPercentage+"%",o.querySelector("#p_span_year").innerHTML=displayYearPercentage,o.querySelector(".schedule-r0 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(t-asideDay))/10).toFixed(1)+" / "+t,currentDateMonth=new Date,currentDateMonth.setDate(1),currentDateMonth.setHours(0,0,0,0),currentMonthTimestamp=currentDateMonth.getTime(),asideMonthDay=(n-currentMonthTimestamp)/1e3/60/60/24,currentDateMonthTotal=new Date,currentMonth=currentDateMonthTotal.getMonth(),currentDateMonthTotal.setMonth(currentMonth+1,1),currentDateMonthTotal.setDate(0),asideMonthDays=currentDateMonthTotal.getDate(),o.querySelector("#pBar_month").value=asideMonthDay,o.querySelector("#pBar_month").max=asideMonthDays,monthPercentage=(asideMonthDay/asideMonthDays*100).toFixed(2),displayMonthPercentage="100.00"===monthPercentage?"100%":monthPercentage+"%",o.querySelector("#p_span_month").innerHTML=displayMonthPercentage,o.querySelector(".schedule-r1 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(asideMonthDays-asideMonthDay))/10).toFixed(1)+" / "+asideMonthDays.toString().padStart(3,"0"),currentDateWeek=new Date,currentDayOfWeek=currentDateWeek.getDay(),currentWeekTimestamp=currentDateWeek.setHours(0,0,0,0),firstDayOfWeekTimestamp=currentWeekTimestamp-24*(0===currentDayOfWeek?6:currentDayOfWeek-1)*60*60*1e3,pastWeekTimestamp=n-firstDayOfWeekTimestamp,asideWeekDay=pastWeekTimestamp/1e3/60/60/24,o.querySelector("#pBar_week").value=asideWeekDay,weekPercentage=(asideWeekDay/7*100).toFixed(2),displayWeekPercentage="100.00"===weekPercentage?"100%":weekPercentage+"%",o.querySelector("#p_span_week").innerHTML=displayWeekPercentage,o.querySelector(".schedule-r2 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(7-asideWeekDay))/10).toFixed(1)+" / 007",currentTimeStamp=(new Date).getTime(),startOfDay=new Date,startOfDay.setHours(0,0,0,0),startOfDayTimeStamp=startOfDay.getTime(),timeDifferenceToday=currentTimeStamp-startOfDayTimeStamp,asideToday=timeDifferenceToday/1e3/60/60/24,asideTodayHour=timeDifferenceToday/36e5,o.querySelector("#pBar_day").value=asideTodayHour,dayPercentage=(100*asideToday).toFixed(2),displayDayPercentage="100.00"===dayPercentage?"100%":dayPercentage+"%",o.querySelector("#p_span_day").innerHTML=displayDayPercentage,o.querySelector(".schedule-r3 .schedule-d1 .aside-span2").innerHTML=(Math.floor(10*(24-asideTodayHour))/10).toFixed(1)+" / 024",month=n.getMonth()+1,day=n.getDate(),month=month>9?month:"0"+month,day=day>9?day:"0"+day,week={0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},document.querySelector("#aside-content .card-widget#card-widget-schedule .item-content .schedule-today").innerHTML=n.getFullYear()+"-"+month+"-"+day+" "+week[n.getDay()])},PressEscapeKey(e){27===e.keyCode&&(document.getElementById("console")&&mycpen1js.hideConsole(),document.getElementById("cf-overlay")&&document.getElementById("cf-overshow")&&(document.querySelector(".cf-overshow-close")||document.querySelector(".cf-overshow"))&&(document.getElementById("mycpen1-fcircle-page-tag")&&closeShow(),document.getElementById("mycpen1-link-page-tag")&&mycpen1js.linkPageCloseShow()))},linkPageOpenMeShow(e){var t="ok",n=document.getElementById("mycpen1-link-page-tag");n&&(document.getElementById("cf-overlay")||n.insertAdjacentHTML("afterend",'\n <div id="cf-overlay" class="cf-new-add" onclick="mycpen1js.linkPageCloseShow()"></div>\n <div id="cf-overshow" class="cf-new-add"></div>\n ')),e.preventDefault();var a;a="https://www.cpen.top:8002/post?link="+e.currentTarget.dataset.link.replace(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,"$1:$2$3"),"ok"==t&&(t="no",mycpen1js.linkPageFetchShow(a))},linkPageOpenMeShowV2(e){var t="ok",n=document.getElementById("mycpen1-link-page-tag");n&&(document.getElementById("cf-overlay")||n.insertAdjacentHTML("afterend",'\n <div id="cf-overlay" class="cf-new-add" onclick="mycpen1js.linkPageCloseShow()"></div>\n <div id="cf-overshow" class="cf-new-add"></div>\n ')),e.preventDefault();var a;a="https://www.cpen.top:8002/postv2?name="+encodeURIComponent(e.currentTarget.dataset.name),"ok"==t&&(t="no",mycpen1js.linkPageFetchShow(a))},linkPageCloseShow(){document.getElementById("cf-overlay").className-="cf-show-now",document.getElementById("cf-overshow").className-="cf-show-now",setTimeout((function(){var e=document.querySelectorAll("#cf-overshow > :not(.cf-overshow-close)"),t=document.querySelectorAll("#cf-overshow > .cf-overshow-close");e.forEach((function(e){e.remove()}));for(var n=1;n<t.length;n++)t[n].remove()}),100)},linkPageFetchShow(url){var closeHtml='\n <div class="cf-overshow-close" onclick="mycpen1js.linkPageCloseShow()"></div>\n ';fetch(url).then((e=>e.json())).then((json=>{noClick="ok";var statisticalData=json.statistical_data,articleData=eval(json.article_data);0!==statisticalData.article_num?(mycpen1js.linkPageLoadFcircleShow(statisticalData,articleData),document.getElementById("cf-overlay").className="cf-show-now",document.getElementById("cf-overshow").insertAdjacentHTML("afterbegin",closeHtml)):btf.snackbarShow("未获取到订阅内容")})).catch((e=>{btf.snackbarShow("未获取到文章卡片")}))},linkPageLoadFcircleShow(e,t){for(var n=`\n <div class="cf-overshow">\n <div class="cf-overshow-head">\n <img class="cf-img-avatar avatar" src="${e.avatar}" alt="avatar" onerror="this.src='https://cdn.jsdmirror.com/npm/mycpen-blog@0.0.0-wjbrdpunvk/img/flink404.svg'; this.onerror = null;">\n <a class="" target="_blank" rel="noopener nofollow" href="${e.link}">${e.name}</a>\n </div>\n <div class="cf-overshow-content">\n `,a=0;a<e.article_num;a++){var o=t[a];let e="";Date.now()-new Date(o.created+" 00:00:00").getTime()<=1728e5&&(e='style="color: var(--mycpen1-main); opacity: 1;"'),n+=`\n <p><a class="cf-article-title" href="${o.link}" target="_blank" rel="noopener nofollow" data-title="${o.title}">${o.title}</a><span ${e}>${o.created}</span></p>\n `}n+="</div></div>",document.getElementById("cf-overshow").insertAdjacentHTML("beforeend",n),document.getElementById("cf-overshow").className="cf-show-now"},linkPageRssAliveCheck(){apiurl="https://www.cpen.top:8002/",rssAliveCheckUrl=apiurl+"friendstatus",fetch(rssAliveCheckUrl).then((e=>e.json())).then((e=>{var t=e.lost_friends,n=e.not_lost_friends,a=e.total_friend_num;let o=[];for(const e in t){let n=t[e];n=n.replace(/^https?:\/\//,""),n=n.replace(/\/$/,""),o.push(n)}let c=[];for(const e in n){let t=n[e];t=t.replace(/^https?:\/\//,""),t=t.replace(/\/$/,""),c.push(t)}document.querySelectorAll("#article-container .flink#mycpen1-link-page-tag-2 .flink-list>.flink-list-item a .flink-item-icon").forEach((e=>{if(e){let t=e.getAttribute("data-link").replace(/^https?:\/\//,"");t=t.replace(/\/$/,""),a>0?c.includes(t)?e.classList.add("flink-mycpen1-rss-not-lost-friends"):o.includes(t)?e.classList.add("flink-mycpen1-rss-lost-friends"):e.classList.add("flink-mycpen1-rss-unknown-friends"):0===a&&e.classList.add("flink-mycpen1-rss-lost-friends")}}))}))},NzcheckLink:async e=>{const t=document.querySelectorAll(e);if(t){let e=new RegExp(/^[#].*/);for(let o=0;o<t.length;o++){const c=t[o];var n=c.hasAttribute("data-fancybox"),a=c.classList.contains("already-redirect-link");if(!n&&!a){let t=c.getAttribute("href"),n=c.getAttribute("data-download"),a=c.getAttribute("rel");e.test(t)||"prev"===a||"next"===a||"category"===a||"tag"===a||"javascript:void(0);"===t||(await mycpen1js.NzcheckLocalSite(t)||n?await mycpen1js.NzcheckLocalSite(t)||"goDown"!==n||c.setAttribute("href","/redirect.html?url="+btoa(t)+"&type=goDown"):c.setAttribute("href","/redirect.html?url="+btoa(t)))}c.classList.add("already-redirect-link")}}},NzcheckLocalSite:async e=>{try{const t=["localhost:4000","cpen.top","mycpen.cn"];let n=!1;for(let a=0;a<t.length;a++){const o=t[a];if(e.includes(o)){n=!0;break}}return n}catch(e){return!0}},cookieConsent(){window.addEventListener("load",(()=>{window.cookieconsent.initialise({type:"info",theme:"edgeless",static:!1,position:"bottom-right",content:{message:"我们使用 cookie 来确保在我们的网站上为您提供最佳体验。",dismiss:"接受",allow:"接受",deny:"拒绝",link:!1},palette:{popup:{background:"#edeff5",text:"#838391"},button:{background:"#4b81e8"}}})}))}};function whenDOMReadyMycpen1JS(){mycpen1js.changeNavPageNameTitle(),mycpen1js.getFooterRandomFlink(),mycpen1js.removeBodyPaceClass(),mycpen1js.tagPageActive(),mycpen1js.categoryPageActive(),mycpen1js.listenToPageInputPress(),mycpen1js.owoBigfunc(),document.getElementById("mycpen1-essay-page-tag")&&(mycpen1js.essayChangeTimeInEssayByMycpen(),mycpen1js.essayReflashEssayWaterFall(),window.onresize=()=>{document.getElementById("mycpen1-essay-page-tag")&&(mycpen1js.essayReflashEssayWaterFall(),setTimeout((()=>{mycpen1js.essayReflashEssayWaterFall()}),300))}),document.getElementById("darkmode").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),document.getElementById("darkmode_navswitch").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),document.getElementById("darkmode_consoleSwitch").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),document.getElementById("darkmode_sidebarSwitch").addEventListener("click",(function(){setTimeout(mycpen1js.switchPostChart,100)})),mycpen1js.cpRemind(),mycpen1js.closeAboutAplayer(),document.getElementById("card-widget-schedule")&&(mycpen1js.cardRefreshTimes(),setInterval((()=>{mycpen1js.cardRefreshTimes()}),1e3)),document.getElementById("mycpen1-link-page-tag-2")&&mycpen1js.linkPageRssAliveCheck(),document.getElementById("mycpen1-link-page-tag")&&(mycpen1js.NzcheckLink("#article-container .flink .flink-list > .flink-list-item.单向 > a"),mycpen1js.NzcheckLink("#article-container .flink .flink-list > .flink-list-item.失联 > a")),document.getElementById("mycpen1-about-page-tag")&&mycpen1js.NzcheckLink("#article-container #mycpen1-about-page-tag-sponsor-part a"),document.getElementById("post-comment")&&setInterval((()=>{if(document.querySelector(".tk-comments-container")){mycpen1js.NzcheckLink(".tk-comments-container a:not(.already-redirect-link)");document.querySelectorAll(".tk-avatar.tk-clickable:not(.already-clear-clickEvent)").forEach((e=>{e.classList.add("already-clear-clickEvent");const t=document.createElement("a");for(Array.from(e.attributes).forEach((e=>{t.setAttribute(e.name,e.value)}));e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e);const n=t.nextElementSibling.firstElementChild.firstElementChild.firstElementChild.getAttribute("href");t.setAttribute("href",n),t.setAttribute("target","_blank"),t.setAttribute("rel","noopener external nofollow noreferrer")}))}}),1e3)}mycpen1js.console(),document.removeEventListener("keydown",mycpen1js.PressEscapeKey),document.addEventListener("keydown",mycpen1js.PressEscapeKey),window.onscroll=mycpen1js.getNavRightPagePercent,mycpen1js.removeaAlayerFixedLrc(),whenDOMReadyMycpen1JS(),document.addEventListener("pjax:complete",whenDOMReadyMycpen1JS);
|
package/js/fcircle.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var frdata={apiurl:"https://www.cpen.top:8002/",defaultFish:100,hungryFish:100},fdatalist=JSON.parse(localStorage.getItem("fdatalist")),fcdata={jsonurl:"",apiurl:"",apipublicurl:fdatalist.apiurl,initnumber:fdatalist.initnumber,stepnumber:fdatalist.stepnumber,article_sort:"created",error_img:"/img/flink404.svg"};if("undefined"!=typeof fdataUser)for(var key in fdataUser)fdataUser[key]&&(fdata[key]=fdataUser[key]);var article_num="",sortNow="",UrlNow="",friends_num="",container=document.getElementById("fcircleContainer")||document.getElementById("cf-container"),localSortNow=localStorage.getItem("sortNow"),localUrlNow=localStorage.getItem("urlNow");function loadStatistical(e){article_num=e.article_num,friends_num=e.friends_num;e.friends_num,e.active_num,e.article_num;var a=`\n <div id="cf-more" class="cf-new-add" onclick="loadNextArticle()"><i class="fas fa-angle-double-down"></i></div>\n <div id="cf-footer" class="cf-new-add">\n <span id="cf-version-up" onclick="checkVersion()"></span>\n <span class="cf-data-lastupdated">Powered by <a href="https://github.com/Rock-Candy-Tea/hexo-circle-of-friends" target="_blank" rel="noopener external nofollow noreferrer">FriendCircle</a></span>\n <span class="cf-data-lastupdated">订阅:${e.friends_num} 活跃:${e.active_num} 日志:${e.article_num}</span>\n <span class="cf-data-lastupdated">更新于:${e.last_updated_time}</span>\n 排序:<span id="cf-change-created" data-sort="created" onclick="changeSort(event)" class="${"created"==sortNow?"cf-change-now":""}">创建时间</span> | <span id="cf-change-updated" data-sort="updated" onclick="changeSort(event)" class="${"updated"==sortNow?"cf-change-now":""}" >更新时间</span>\n </div>\n <div id="cf-overlay" class="cf-new-add" onclick="closeShow()"></div>\n <div id="cf-overshow" class="cf-new-add"></div>\n `;container&&(container.insertAdjacentHTML("afterend",a),setTimeout((function(){document.getElementById("hexo-circle-of-friends-root-notice").innerHTML=""}),0))}function loadArticleItem(e,a,t){var r="",o=t;if(t>article_num&&(o=article_num),a<article_num){for(var l=a;l<o;l++){var c=e[l];r+=`\n <div class="cf-article">\n <a class="cf-article-title" href="${c.link}" target="_blank" rel="noopener nofollow" data-title="${c.title}">${c.title}</a>\n <span class="cf-article-floor">${c.floor}</span>\n <div class="cf-article-avatar no-lightbox flink-item-icon">\n <a onclick="openMeShow(event)" data-link="${c.link}" class="" target="_blank" rel="noopener nofollow" href="javascript:;"><img class="cf-img-avatar avatar" src="${c.avatar}" alt="avatar" onerror="this.src='${fcdata.error_img}'; this.onerror = null;"><span class="cf-article-author">${c.author}</span></a>\n <span class="cf-article-time">\n <span class="cf-time-created" style="${"created"==sortNow?"":"display:none"}">${c.created}</span>\n <span class="cf-time-updated" style="${"updated"==sortNow?"":"display:none"}">${c.updated}</span>\n </span>\n </div>\n </div>\n `}container.insertAdjacentHTML("beforeend",r),fetchNextArticle()}else document.getElementById("cf-more").outerHTML='<div id="cf-more" class="cf-new-add" onclick="loadNoArticle()"><small>一切皆有尽头!</small></div>'}function loadFcircleShow(e,a){for(var t=`\n <div class="cf-overshow">\n <div class="cf-overshow-head">\n <img class="cf-img-avatar avatar" src="${e.avatar}" alt="avatar" onerror="this.src='${fcdata.error_img}'; this.onerror = null;">\n <a class="" target="_blank" rel="noopener nofollow" href="${e.link}">${e.name}</a>\n </div>\n <div class="cf-overshow-content">\n `,r=0;r<e.article_num;r++){var o=a[r];let e="";Date.now()-new Date(o.created+" 00:00:00").getTime()<=1728e5&&(e='style="color: var(--mycpen1-main); opacity: 1;"'),t+=`\n <p><a class="cf-article-title" href="${o.link}" target="_blank" rel="noopener nofollow" data-title="${o.title}">${o.title}</a><span ${e}>${o.created}</span></p>\n `}t+="</div></div>",document.getElementById("cf-overshow").insertAdjacentHTML("beforeend",t),document.getElementById("cf-overshow").className="cf-show-now"}function fetchNextArticle(){var start=document.getElementsByClassName("cf-article").length,end=start+fcdata.stepnumber,articleNum=article_num;if(end>articleNum&&(end=articleNum),start<articleNum){UrlNow=localStorage.getItem("urlNow");var fetchUrl=UrlNow+"rule="+sortNow+"&start="+start+"&end="+end;fetch(fetchUrl).then((e=>e.json())).then((json=>{var nextArticle=eval(json.article_data);localStorage.setItem("nextArticle",JSON.stringify(nextArticle))}))}else(start=articleNum)&&(document.getElementById("cf-more").outerHTML='<div id="cf-more" class="cf-new-add" onclick="loadNoArticle()"><small>一切皆有尽头!</small></div>')}function loadNextArticle(){for(var e=JSON.parse(localStorage.getItem("nextArticle")),a="",t=0;t<e.length;t++){var r=e[t];a+=`\n <div class="cf-article">\n <a class="cf-article-title" href="${r.link}" target="_blank" rel="noopener nofollow" data-title="${r.title}">${r.title}</a>\n <span class="cf-article-floor">${r.floor}</span>\n <div class="cf-article-avatar no-lightbox flink-item-icon">\n <a onclick="openMeShow(event)" data-link="${r.link}" class="" target="_blank" rel="noopener nofollow" href="javascript:;"><img class="cf-img-avatar avatar" src="${r.avatar}" alt="avatar" onerror="this.src='${fcdata.error_img}'; this.onerror = null;"><span class="cf-article-author">${r.author}</span></a>\n <span class="cf-article-time">\n <span class="cf-time-created" style="${"created"==sortNow?"":"display:none"}">${r.created}</span>\n <span class="cf-time-updated" style="${"updated"==sortNow?"":"display:none"}">${r.updated}</span>\n </span>\n </div>\n </div>\n `}container.insertAdjacentHTML("beforeend",a),lazyLoadInstance.update(),fetchNextArticle()}function loadNoArticle(){var e=sortNow+"ArticleData";localStorage.removeItem(e),localStorage.removeItem("statisticalData"),document.getElementById("cf-more").remove(),window.scrollTo(0,document.getElementsByClassName("cf-state").offsetTop)}function clearLocal(){localStorage.removeItem("updatedArticleData"),localStorage.removeItem("createdArticleData"),localStorage.removeItem("nextArticle"),localStorage.removeItem("statisticalData"),localStorage.removeItem("sortNow"),localStorage.removeItem("urlNow"),location.reload()}function checkVersion(){var e=fcdata.apiurl+"version";fetch(e).then((e=>e.json())).then((e=>{var a=e.status,t=e.current_version,r=e.latest_version,o=document.getElementById("cf-version-up");o.innerHTML=0==a?"当前版本:v"+t:1==a?"发现新版本:v"+t+" ↦ "+r:"网络错误,检测失败!"}))}function changeEgg(){if(fcdata.jsonurl||fcdata.apiurl){document.querySelectorAll(".cf-new-add").forEach((e=>e.remove())),localStorage.removeItem("updatedArticleData"),localStorage.removeItem("createdArticleData"),localStorage.removeItem("nextArticle"),localStorage.removeItem("statisticalData"),container.innerHTML="",UrlNow=localStorage.getItem("urlNow");var e=fcdata.apipublicurl+"all?";UrlNow!==e?changeUrl=fcdata.apipublicurl+"all?":fcdata.jsonurl?changeUrl=fcdata.apipublicurl+"postjson?jsonlink="+fcdata.jsonurl+"&":fcdata.apiurl&&(changeUrl=fcdata.apiurl+"all?"),localStorage.setItem("urlNow",changeUrl),FetchFriendCircle(sortNow,changeUrl)}else clearLocal()}function FetchFriendCircle(sortNow,changeUrl){var end=fcdata.initnumber,fetchUrl=UrlNow+"rule="+sortNow+"&start=0&end="+end;changeUrl&&(fetchUrl=changeUrl+"rule="+sortNow+"&start=0&end="+end),fetch(fetchUrl).then((e=>e.json())).then((json=>{var statisticalData=json.statistical_data,articleData=eval(json.article_data),articleSortData=sortNow+"ArticleData";loadStatistical(statisticalData),loadArticleItem(articleData,0,end),localStorage.setItem("statisticalData",JSON.stringify(statisticalData)),localStorage.setItem(articleSortData,JSON.stringify(articleData))}))}function changeSort(e){sortNow=e.currentTarget.dataset.sort,localStorage.setItem("sortNow",sortNow),document.querySelectorAll(".cf-new-add").forEach((e=>e.remove())),container.innerHTML="",changeUrl=localStorage.getItem("urlNow"),container.style.opacity=0,document.getElementById("hexo-circle-of-friends-root-notice").innerHTML="与主机通讯中......",setTimeout((function(){container.innerHTML="",initFriendCircle(sortNow,changeUrl),container.style.opacity=1}),300),fcdata.apiurl&&checkVersion()}function openMeShow(e){e.preventDefault();var a=e.currentTarget.dataset.link.replace(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,"$1:$2$3"),t="";t=fcdata.apiurl?fcdata.apiurl+"post?link="+a:fcdata.apipublicurl+"post?link="+a,"ok"==noClick&&(noClick="no",fetchShow(t))}function closeShow(){document.getElementById("cf-overlay").className-="cf-show-now",document.getElementById("cf-overshow").className-="cf-show-now",setTimeout((function(){var e=document.querySelectorAll("#cf-overshow > :not(.cf-overshow-close)"),a=document.querySelectorAll("#cf-overshow > .cf-overshow-close");e.forEach((function(e){e.remove()}));for(var t=1;t<a.length;t++)a[t].remove()}),100)}localSortNow&&localUrlNow?(sortNow=localSortNow,UrlNow=localUrlNow):(sortNow=fcdata.article_sort,UrlNow=fcdata.jsonurl?fcdata.apipublicurl+"postjson?jsonlink="+fcdata.jsonurl+"&":fcdata.apiurl?fcdata.apiurl+"all?":fcdata.apipublicurl+"all?",localStorage.setItem("urlNow",UrlNow),localStorage.setItem("sortNow",sortNow));var noClick="ok";function openToShow(){var e="";e=fcdata.apiurl?fcdata.apiurl+"post":fcdata.apipublicurl+"post","ok"==noClick&&(noClick="no",fetchShow(e))}function fetchShow(url){var closeHtml='\n <div class="cf-overshow-close" onclick="closeShow()"></div>\n ';fetch(url).then((e=>e.json())).then((json=>{noClick="ok";var statisticalData=json.statistical_data,articleData=eval(json.article_data);loadFcircleShow(statisticalData,articleData),document.getElementById("cf-overlay").className="cf-show-now",document.getElementById("cf-overshow").insertAdjacentHTML("afterbegin",closeHtml)})).catch((e=>{btf.snackbarShow("未获取到文章卡片")}))}function initFriendCircle(e,a){var t=e+"ArticleData";JSON.parse(localStorage.getItem("statisticalData")),JSON.parse(localStorage.getItem(t));container.innerHTML="",FetchFriendCircle(e,a)}initFriendCircle(sortNow);
|
1
|
+
var frdata={apiurl:"https://www.cpen.top:8002/",defaultFish:100,hungryFish:100},fdatalist=JSON.parse(localStorage.getItem("fdatalist")),fcdata={jsonurl:"",apiurl:"",apipublicurl:fdatalist.apiurl,initnumber:fdatalist.initnumber,stepnumber:fdatalist.stepnumber,article_sort:"created",error_img:"https://cdn.jsdmirror.com/npm/mycpen-blog@0.0.0-wjbrdpunvk/img/flink404.svg"};if("undefined"!=typeof fdataUser)for(var key in fdataUser)fdataUser[key]&&(fdata[key]=fdataUser[key]);var article_num="",sortNow="",UrlNow="",friends_num="",container=document.getElementById("fcircleContainer")||document.getElementById("cf-container"),localSortNow=localStorage.getItem("sortNow"),localUrlNow=localStorage.getItem("urlNow");function loadStatistical(a){article_num=a.article_num,friends_num=a.friends_num;a.friends_num,a.active_num,a.article_num;var e=`\n <div id="cf-more" class="cf-new-add" onclick="loadNextArticle()"><i class="fas fa-angle-double-down"></i></div>\n <div id="cf-footer" class="cf-new-add">\n <span id="cf-version-up" onclick="checkVersion()"></span>\n <span class="cf-data-lastupdated">Powered by <a href="https://github.com/Rock-Candy-Tea/hexo-circle-of-friends" target="_blank" rel="noopener external nofollow noreferrer">FriendCircle</a></span>\n <span class="cf-data-lastupdated">订阅:${a.friends_num} 活跃:${a.active_num} 日志:${a.article_num}</span>\n <span class="cf-data-lastupdated">更新于:${a.last_updated_time}</span>\n 排序:<span id="cf-change-created" data-sort="created" onclick="changeSort(event)" class="${"created"==sortNow?"cf-change-now":""}">创建时间</span> | <span id="cf-change-updated" data-sort="updated" onclick="changeSort(event)" class="${"updated"==sortNow?"cf-change-now":""}" >更新时间</span>\n </div>\n <div id="cf-overlay" class="cf-new-add" onclick="closeShow()"></div>\n <div id="cf-overshow" class="cf-new-add"></div>\n `;container&&(container.insertAdjacentHTML("afterend",e),setTimeout((function(){document.getElementById("hexo-circle-of-friends-root-notice").innerHTML=""}),0))}function loadArticleItem(a,e,t){var r="",o=t;if(t>article_num&&(o=article_num),e<article_num){for(var l=e;l<o;l++){var n=a[l];r+=`\n <div class="cf-article">\n <a class="cf-article-title" href="${n.link}" target="_blank" rel="noopener nofollow" data-title="${n.title}">${n.title}</a>\n <span class="cf-article-floor">${n.floor}</span>\n <div class="cf-article-avatar no-lightbox flink-item-icon">\n <a onclick="openMeShowV2(event)" data-link="${n.link}" data-name="${n.author}" class="" target="_blank" rel="noopener nofollow" href="javascript:;"><img class="cf-img-avatar avatar" src="${n.avatar}" alt="avatar" onerror="this.src='${fcdata.error_img}'; this.onerror = null;"><span class="cf-article-author">${n.author}</span></a>\n <span class="cf-article-time">\n <span class="cf-time-created" style="${"created"==sortNow?"":"display:none"}">${n.created}</span>\n <span class="cf-time-updated" style="${"updated"==sortNow?"":"display:none"}">${n.updated}</span>\n </span>\n </div>\n </div>\n `}container.insertAdjacentHTML("beforeend",r),fetchNextArticle()}else document.getElementById("cf-more").outerHTML='<div id="cf-more" class="cf-new-add" onclick="loadNoArticle()"><small>一切皆有尽头!</small></div>'}function loadFcircleShow(a,e){for(var t=`\n <div class="cf-overshow">\n <div class="cf-overshow-head">\n <img class="cf-img-avatar avatar" src="${a.avatar}" alt="avatar" onerror="this.src='${fcdata.error_img}'; this.onerror = null;">\n <a class="" target="_blank" rel="noopener nofollow" href="${a.link}">${a.name}</a>\n </div>\n <div class="cf-overshow-content">\n `,r=0;r<a.article_num;r++){var o=e[r];let a="";Date.now()-new Date(o.created+" 00:00:00").getTime()<=1728e5&&(a='style="color: var(--mycpen1-main); opacity: 1;"'),t+=`\n <p><a class="cf-article-title" href="${o.link}" target="_blank" rel="noopener nofollow" data-title="${o.title}">${o.title}</a><span ${a}>${o.created}</span></p>\n `}t+="</div></div>",document.getElementById("cf-overshow").insertAdjacentHTML("beforeend",t),document.getElementById("cf-overshow").className="cf-show-now"}function fetchNextArticle(){var start=document.getElementsByClassName("cf-article").length,end=start+fcdata.stepnumber,articleNum=article_num;if(end>articleNum&&(end=articleNum),start<articleNum){UrlNow=localStorage.getItem("urlNow");var fetchUrl=UrlNow+"rule="+sortNow+"&start="+start+"&end="+end;fetch(fetchUrl).then((a=>a.json())).then((json=>{var nextArticle=eval(json.article_data);localStorage.setItem("nextArticle",JSON.stringify(nextArticle))}))}else(start=articleNum)&&(document.getElementById("cf-more").outerHTML='<div id="cf-more" class="cf-new-add" onclick="loadNoArticle()"><small>一切皆有尽头!</small></div>')}function loadNextArticle(){for(var a=JSON.parse(localStorage.getItem("nextArticle")),e="",t=0;t<a.length;t++){var r=a[t];e+=`\n <div class="cf-article">\n <a class="cf-article-title" href="${r.link}" target="_blank" rel="noopener nofollow" data-title="${r.title}">${r.title}</a>\n <span class="cf-article-floor">${r.floor}</span>\n <div class="cf-article-avatar no-lightbox flink-item-icon">\n <a onclick="openMeShowV2(event)" data-link="${r.link}" data-name="${r.author}" class="" target="_blank" rel="noopener nofollow" href="javascript:;"><img class="cf-img-avatar avatar" src="${r.avatar}" alt="avatar" onerror="this.src='${fcdata.error_img}'; this.onerror = null;"><span class="cf-article-author">${r.author}</span></a>\n <span class="cf-article-time">\n <span class="cf-time-created" style="${"created"==sortNow?"":"display:none"}">${r.created}</span>\n <span class="cf-time-updated" style="${"updated"==sortNow?"":"display:none"}">${r.updated}</span>\n </span>\n </div>\n </div>\n `}container.insertAdjacentHTML("beforeend",e),lazyLoadInstance.update(),fetchNextArticle()}function loadNoArticle(){var a=sortNow+"ArticleData";localStorage.removeItem(a),localStorage.removeItem("statisticalData"),document.getElementById("cf-more").remove(),window.scrollTo(0,document.getElementsByClassName("cf-state").offsetTop)}function clearLocal(){localStorage.removeItem("updatedArticleData"),localStorage.removeItem("createdArticleData"),localStorage.removeItem("nextArticle"),localStorage.removeItem("statisticalData"),localStorage.removeItem("sortNow"),localStorage.removeItem("urlNow"),location.reload()}function checkVersion(){var a=fcdata.apiurl+"version";fetch(a).then((a=>a.json())).then((a=>{var e=a.status,t=a.current_version,r=a.latest_version,o=document.getElementById("cf-version-up");o.innerHTML=0==e?"当前版本:v"+t:1==e?"发现新版本:v"+t+" ↦ "+r:"网络错误,检测失败!"}))}function changeEgg(){if(fcdata.jsonurl||fcdata.apiurl){document.querySelectorAll(".cf-new-add").forEach((a=>a.remove())),localStorage.removeItem("updatedArticleData"),localStorage.removeItem("createdArticleData"),localStorage.removeItem("nextArticle"),localStorage.removeItem("statisticalData"),container.innerHTML="",UrlNow=localStorage.getItem("urlNow");var a=fcdata.apipublicurl+"all?";UrlNow!==a?changeUrl=fcdata.apipublicurl+"all?":fcdata.jsonurl?changeUrl=fcdata.apipublicurl+"postjson?jsonlink="+fcdata.jsonurl+"&":fcdata.apiurl&&(changeUrl=fcdata.apiurl+"all?"),localStorage.setItem("urlNow",changeUrl),FetchFriendCircle(sortNow,changeUrl)}else clearLocal()}function FetchFriendCircle(sortNow,changeUrl){var end=fcdata.initnumber,fetchUrl=UrlNow+"rule="+sortNow+"&start=0&end="+end;changeUrl&&(fetchUrl=changeUrl+"rule="+sortNow+"&start=0&end="+end),fetch(fetchUrl).then((a=>a.json())).then((json=>{var statisticalData=json.statistical_data,articleData=eval(json.article_data),articleSortData=sortNow+"ArticleData";loadStatistical(statisticalData),loadArticleItem(articleData,0,end),localStorage.setItem("statisticalData",JSON.stringify(statisticalData)),localStorage.setItem(articleSortData,JSON.stringify(articleData))}))}function changeSort(a){sortNow=a.currentTarget.dataset.sort,localStorage.setItem("sortNow",sortNow),document.querySelectorAll(".cf-new-add").forEach((a=>a.remove())),container.innerHTML="",changeUrl=localStorage.getItem("urlNow"),container.style.opacity=0,document.getElementById("hexo-circle-of-friends-root-notice").innerHTML="与主机通讯中......",setTimeout((function(){container.innerHTML="",initFriendCircle(sortNow,changeUrl),container.style.opacity=1}),300),fcdata.apiurl&&checkVersion()}function openMeShow(a){a.preventDefault();var e=a.currentTarget.dataset.link.replace(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,"$1:$2$3"),t="";t=fcdata.apiurl?fcdata.apiurl+"post?link="+e:fcdata.apipublicurl+"post?link="+e,"ok"==noClick&&(noClick="no",fetchShow(t))}function openMeShowV2(a){a.preventDefault();var e=encodeURIComponent(a.currentTarget.dataset.name),t="";t=fcdata.apiurl?fcdata.apiurl+"postv2?name="+e:fcdata.apipublicurl+"postv2?name="+e,"ok"==noClick&&(noClick="no",fetchShow(t))}function closeShow(){document.getElementById("cf-overlay").className-="cf-show-now",document.getElementById("cf-overshow").className-="cf-show-now",setTimeout((function(){var a=document.querySelectorAll("#cf-overshow > :not(.cf-overshow-close)"),e=document.querySelectorAll("#cf-overshow > .cf-overshow-close");a.forEach((function(a){a.remove()}));for(var t=1;t<e.length;t++)e[t].remove()}),100)}localSortNow&&localUrlNow?(sortNow=localSortNow,UrlNow=localUrlNow):(sortNow=fcdata.article_sort,UrlNow=fcdata.jsonurl?fcdata.apipublicurl+"postjson?jsonlink="+fcdata.jsonurl+"&":fcdata.apiurl?fcdata.apiurl+"all?":fcdata.apipublicurl+"all?",localStorage.setItem("urlNow",UrlNow),localStorage.setItem("sortNow",sortNow));var noClick="ok";function openToShow(){var a="";a=fcdata.apiurl?fcdata.apiurl+"post":fcdata.apipublicurl+"post","ok"==noClick&&(noClick="no",fetchShow(a))}function fetchShow(url){var closeHtml='\n <div class="cf-overshow-close" onclick="closeShow()"></div>\n ';fetch(url).then((a=>a.json())).then((json=>{noClick="ok";var statisticalData=json.statistical_data,articleData=eval(json.article_data);loadFcircleShow(statisticalData,articleData),document.getElementById("cf-overlay").className="cf-show-now",document.getElementById("cf-overshow").insertAdjacentHTML("afterbegin",closeHtml)})).catch((a=>{btf.snackbarShow("未获取到文章卡片")}))}function initFriendCircle(a,e){var t=a+"ArticleData";JSON.parse(localStorage.getItem("statisticalData")),JSON.parse(localStorage.getItem(t));container.innerHTML="",FetchFriendCircle(a,e)}initFriendCircle(sortNow);
|