1
0

7986.js 43 KB

123
  1. /*! For license information please see 7986.js.LICENSE.txt */
  2. (globalThis.webpackChunksakurairo_scripts=globalThis.webpackChunksakurairo_scripts||[]).push([[7986],{7986:(t,e,i)=>{i.r(e),i.d(e,{aplayerInit:()=>y,destroyAllAplayer:()=>c,pauseAllPlayer:()=>u});var s={800:function(t,e,i){var s=i(90);t.exports=function(t){t=t||{};var e="",i=s.$each,a=t.audio,r=(t.$value,t.$index,s.$escape),o=t.theme,n=t.index;return i(a,(function(t,i){e+=' <li><span class="aplayer-list-cur" style="background-color: ',e+=r(t.theme||o),e+='"></span> <span class="aplayer-list-index">',e+=r(i+n),e+='</span><span class="aplayer-list-title">',e+=r(t.name),e+='</span><span class="aplayer-list-author">',e+=r(t.artist),e+="</span></li> "})),e}},107:function(t,e,i){var s=i(90);t.exports=function(t){t=t||{};var e="",i=s.$each,a=t.lyrics,r=(t.$value,t.$index,s.$escape);return i(a,(function(t,i){e+=" <p ",0===i&&(e+=' class="aplayer-lrc-current" '),e+=">",e+=r(t[1]),e+="</p> "})),e}},336:function(t,e,i){var s=i(90);t.exports=function(t){var e="",a=(t=t||{}).options,r=t.cover,o=s.$escape,n=t.icons,l=function(t){return e+=t},h=t.getObject;return t.theme,t.audio,t.index,a.fixed?(e+=' <ol class="aplayer-list',a.listFolded&&(e+=" aplayer-list-hide"),e+='"> ',l(i(800)(h({theme:a.theme,audio:a.audio,index:1}))),e+=' </ol><div class="aplayer-body"><div class="aplayer-pic" style="',r&&(e+="background-image:url(&quot;",e+=o(r),e+="&quot;);"),e+="background-color: ",e+=o(a.theme),e+='"><div class="aplayer-button aplayer-play">',e+=n.play,e+='</div></div><div class="aplayer-info" style="display:none"><div class="aplayer-music"><span class="aplayer-title">No audio</span> <span class="aplayer-author"></span></div><div class="aplayer-controller"><div class="aplayer-bar-wrap"><div class="aplayer-bar"><div class="aplayer-loaded" style="width:0"></div><div class="aplayer-played" style="width:0;background: ',e+=o(a.theme),e+='"><span class="aplayer-thumb" style="background: ',e+=o(a.theme),e+='"><span class="aplayer-loading-icon">',e+=n.loading,e+='</span></span></div></div></div><div class="aplayer-time"><span class="aplayer-time-inner"><span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span> </span><span class="aplayer-icon aplayer-icon-back"> ',e+=n.skip,e+=' </span><span class="aplayer-icon aplayer-icon-play"> ',e+=n.play,e+=' </span><span class="aplayer-icon aplayer-icon-forward"> ',e+=n.skip,e+=' </span><div class="aplayer-volume-wrap"><button type="button" class="aplayer-icon aplayer-icon-volume-down"> ',e+=n.volumeDown,e+=' </button><div class="aplayer-volume-bar-wrap"><div class="aplayer-volume-bar"><div class="aplayer-volume" style="height:80%;background: ',e+=o(a.theme),e+='"></div></div></div></div><button type="button" class="aplayer-icon aplayer-icon-order"> ',"list"===a.order?e+=n.orderList:"random"===a.order&&(e+=n.orderRandom),e+=' </button> <button type="button" class="aplayer-icon aplayer-icon-loop"> ',"one"===a.loop?e+=n.loopOne:"all"===a.loop?e+=n.loopAll:"none"===a.loop&&(e+=n.loopNone),e+=' </button> <button type="button" class="aplayer-icon aplayer-icon-menu"> ',e+=n.menu,e+=' </button> <button type="button" class="aplayer-icon aplayer-icon-lrc"> ',e+=n.lrc,e+=' </button></div></div></div><div class="aplayer-notice"></div><div class="aplayer-miniswitcher"><button class="aplayer-icon">',e+=n.right,e+='</button></div></div><div class="aplayer-lrc"><div class="aplayer-lrc-contents" style="transform:translateY(0);-webkit-transform:translateY(0)"></div></div> '):(e+=' <div class="aplayer-body"><div class="aplayer-pic" style="',r&&(e+="background-image:url(&quot;",e+=o(r),e+="&quot;);"),e+="background-color: ",e+=o(a.theme),e+='"><div class="aplayer-button aplayer-play">',e+=n.play,e+='</div></div><div class="aplayer-info"><div class="aplayer-music"><span class="aplayer-title">No audio</span> <span class="aplayer-author"></span></div><div class="aplayer-lrc"><div class="aplayer-lrc-contents" style="transform:translateY(0);-webkit-transform:translateY(0)"></div></div><div class="aplayer-controller"><div class="aplayer-bar-wrap"><div class="aplayer-bar"><div class="aplayer-loaded" style="width:0"></div><div class="aplayer-played" style="width:0;background: ',e+=o(a.theme),e+='"><span class="aplayer-thumb" style="background: ',e+=o(a.theme),e+='"><span class="aplayer-loading-icon">',e+=n.loading,e+='</span></span></div></div></div><div class="aplayer-time"><span class="aplayer-time-inner"><span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span> </span><span class="aplayer-icon aplayer-icon-back"> ',e+=n.skip,e+=' </span><span class="aplayer-icon aplayer-icon-play"> ',e+=n.play,e+=' </span><span class="aplayer-icon aplayer-icon-forward"> ',e+=n.skip,e+=' </span><div class="aplayer-volume-wrap"><button type="button" class="aplayer-icon aplayer-icon-volume-down"> ',e+=n.volumeDown,e+=' </button><div class="aplayer-volume-bar-wrap"><div class="aplayer-volume-bar"><div class="aplayer-volume" style="height:80%;background: ',e+=o(a.theme),e+='"></div></div></div></div><button type="button" class="aplayer-icon aplayer-icon-order"> ',"list"===a.order?e+=n.orderList:"random"===a.order&&(e+=n.orderRandom),e+=' </button> <button type="button" class="aplayer-icon aplayer-icon-loop"> ',"one"===a.loop?e+=n.loopOne:"all"===a.loop?e+=n.loopAll:"none"===a.loop&&(e+=n.loopNone),e+=' </button> <button type="button" class="aplayer-icon aplayer-icon-menu"> ',e+=n.menu,e+=' </button> <button type="button" class="aplayer-icon aplayer-icon-lrc"> ',e+=n.lrc,e+=' </button></div></div></div><div class="aplayer-notice"></div><div class="aplayer-miniswitcher"><button class="aplayer-icon">',e+=n.right,e+='</button></div></div><ol class="aplayer-list',a.listFolded&&(e+=" aplayer-list-hide"),e+='"> ',l(i(800)(h({theme:a.theme,audio:a.audio,index:1}))),e+=" </ol> "),e}},42:function(t,e,i){var s="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i.g?i.g:{},a=Object.create(s),r=/["&'<>]/;function o(t){return"string"!=typeof t&&(t=null==t?"":"function"==typeof t?o(t.call(t)):JSON.stringify(t)),t}a.$escape=function(t){return function(t){var e=""+t,i=r.exec(e);if(!i)return t;var s="",a=void 0,o=void 0,n=void 0;for(a=i.index,o=0;a<e.length;a++){switch(e.charCodeAt(a)){case 34:n="&#34;";break;case 38:n="&#38;";break;case 39:n="&#39;";break;case 60:n="&#60;";break;case 62:n="&#62;";break;default:continue}o!==a&&(s+=e.substring(o,a)),o=a+1,s+=n}return o!==a?s+e.substring(o,a):s}(o(t))},a.$each=function(t,e){if(Array.isArray(t))for(var i=0,s=t.length;i<s;i++)e(t[i],i);else for(var a in t)e(t[a],a)},t.exports=a},90:function(t,e,i){t.exports=i(42)},160:function(t,e,i){var s,a;s=function(){if("object"==typeof window&&void 0!==document.querySelectorAll&&void 0!==window.pageYOffset&&void 0!==history.pushState){var t=function(t,e,i,s){return i>s?e:t+(e-t)*function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}(i/s)},e=function(e,i,s,a){i=i||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof e)var o=parseInt(e);else o=function(t,e){return"HTML"===t.nodeName?-e:t.getBoundingClientRect().top+e}(e,r);var n=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,15)},h=function(){var p=Date.now()-n;a!==window?a.scrollTop=t(r,o,p,i):window.scroll(0,t(r,o,p,i)),p>i?"function"==typeof s&&s(e):l(h)};h()},i=function(t){if(!t.defaultPrevented){t.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var i=document.getElementById(this.hash.substring(1));if(!i)return;e(i,500,(function(t){location.replace("#"+t.id)}))}};return document.addEventListener("DOMContentLoaded",(function(){for(var t,e=document.querySelectorAll('a[href^="#"]:not([href="#"])'),s=e.length;t=e[--s];)t.addEventListener("click",i,!1)})),e}},void 0===(a=s.call(e,i,e,t))||(t.exports=a)},112:function(t){t.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>'},133:function(t){t.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>'},537:function(t){t.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>'},155:function(t){t.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>'},812:function(t){t.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>'},440:function(t){t.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>'},690:function(t){t.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>'},343:function(t){t.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>'},723:function(t){t.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>'},7:function(t){t.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>'},381:function(t){t.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>'},632:function(t){t.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>'},813:function(t){t.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>'},480:function(t){t.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>'},848:function(t){t.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>'}},a={};function r(t){var e=a[t];if(void 0!==e)return e.exports;var i=a[t]={exports:{}};return s[t].call(i.exports,i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};!function(){r.d(o,{Z:function(){return _}});const t=/mobile/i.test(window.navigator.userAgent);var e={secondToTime:t=>{const e=Math.floor(t/3600),i=Math.floor((t-3600*e)/60),s=Math.floor(t-3600*e-60*i);return(e>0?[e,i,s]:[i,s]).map((t=>t<10?"0"+t:""+t)).join(":")},isMobile:t,storage:{set:(t,e)=>{localStorage.setItem(t,e)},get:t=>localStorage.getItem(t)},nameMap:{dragStart:t?"touchstart":"mousedown",dragMove:t?"touchmove":"mousemove",dragEnd:t?"touchend":"mouseup"},randomOrder:t=>function(t){for(let e=t.length-1;e>=0;e--){const i=Math.floor(Math.random()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}([...Array(t)].map((function(t,e){return e})))},i=r(7),s=r.n(i),a=r(723),n=r.n(a),l=r(848),h=r.n(l),p=r(813),d=r.n(p),c=r(480),u=r.n(c),y=r(343),m=r.n(y),v=r(690),g=r.n(v),w=r(440),f=r.n(w),b=r(133),x=r.n(b),M=r(155),L=r.n(M),T=r(537),q=r.n(T),k=r(112),B=r.n(k),S=r(381),E=r.n(S),A=r(632),O=r.n(A),H=r(812),C=r.n(H),P={play:s(),pause:n(),volumeUp:h(),volumeDown:d(),volumeOff:u(),orderRandom:m(),orderList:g(),menu:f(),loopAll:x(),loopOne:L(),loopNone:q(),loading:B(),right:E(),skip:O(),lrc:C()},N=r(336),z=r.n(N),I=r(107),$=r.n(I),F=r(800),R=r.n(F),W=r(160),j=r.n(W);const U=[];console.log("\n %c APlayer v1.10.1 1.10.3-1-g6879c78 %c http://aplayer.js.org \n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");var _=class{constructor(t){if(this.options=(t=>{const e={container:t.element||document.getElementsByClassName("aplayer")[0],mini:t.narrow||t.fixed||!1,fixed:!1,autoplay:!1,mutex:!0,lrcType:t.showlrc||t.lrc||0,preload:"metadata",theme:"#b7daff",loop:"all",order:"list",volume:.7,listFolded:t.fixed,listMaxHeight:t.listmaxheight||250,audio:t.music||[],storageName:"aplayer-setting"};for(const i in e)e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=e[i]);return t.listMaxHeight=parseFloat(t.listMaxHeight),"[object Array]"!==Object.prototype.toString.call(t.audio)&&(t.audio=[t.audio]),t.audio.map((t=>(t.name=t.name||t.title||"Audio name",t.artist=t.artist||t.author||"Audio artist",t.cover=t.cover||t.pic,t.type=t.type||"normal",t))),t.audio.length<=1&&"one"===t.loop&&(t.loop="all"),t})(t),this.container=this.options.container,this.paused=!0,this.playedPromise=Promise.resolve(),this.mode="normal",this.randomOrder=e.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"),e.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),2===this.options.lrcType||!0===this.options.lrcType){const t=this.container.getElementsByClassName("aplayer-lrc-content");for(let e=0;e<t.length;e++)this.options.audio[e]&&(this.options.audio[e].lrc=t[e].innerHTML)}this.template=new class{constructor(t){this.container=t.container,this.options=t.options,this.randomOrder=t.randomOrder,this.init()}init(){let t="";this.options.audio.length&&(t="random"===this.options.order?this.options.audio[this.randomOrder[0]].cover:this.options.audio[0].cover),this.container.innerHTML=z()({options:this.options,icons:P,cover:t,getObject:t=>t}),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.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")}}({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 class{constructor(t){this.container=t.container,this.async=t.async,this.player=t.player,this.parsed=[],this.index=0,this.current=[]}show(){this.player.events.trigger("lrcshow"),this.player.template.lrcWrap.classList.remove("aplayer-lrc-hide")}hide(){this.player.events.trigger("lrchide"),this.player.template.lrcWrap.classList.add("aplayer-lrc-hide")}toggle(){this.player.template.lrcWrap.classList.contains("aplayer-lrc-hide")?this.show():this.hide()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||t<this.current[this.index][0]||!this.current[this.index+1]||t>=this.current[this.index+1][0])for(let e=0;e<this.current.length;e++)t>=this.current[e][0]&&(!this.current[e+1]||t<this.current[e+1][0])&&(this.index=e,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")[e].classList.add("aplayer-lrc-current"))}switch(t){if(!this.parsed[t])if(this.async){this.parsed[t]=[["00:00","Loading"]];const e=new XMLHttpRequest;e.onreadystatechange=()=>{t===this.player.list.index&&4===e.readyState&&(e.status>=200&&e.status<300||304===e.status?this.parsed[t]=this.parse(e.responseText):(this.player.notice(`LRC file request fails: status ${e.status}`),this.parsed[t]=[["00:00","Not available"]]),this.container.innerHTML=$()({lyrics:this.parsed[t]}),this.update(0),this.current=this.parsed[t])};const i=this.player.list.audios[t].lrc;e.open("get",i,!0),e.send(null)}else this.player.list.audios[t].lrc?this.parsed[t]=this.parse(this.player.list.audios[t].lrc):this.parsed[t]=[["00:00","Not available"]];this.container.innerHTML=$()({lyrics:this.parsed[t]}),this.current=this.parsed[t],this.update(0)}parse(t){if(t){t.startsWith('"')&&t.endsWith('"')&&(t=JSON.parse(t));const e=(t=t.replace(/([^\]^\n])\[/g,((t,e)=>e+"\n["))).split("\n");let i=[];const s=e.length;for(let t=0;t<s;t++){const s=e[t].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g),a=e[t].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g,"").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g,"").replace(/^\s+|\s+$/g,"");if(s){const t=s.length;for(let e=0;e<t;e++){const t=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(s[e]),r=60*t[1]+parseInt(t[2])+(t[4]?parseInt(t[4])/(2===(t[4]+"").length?100:1e3):0);i.push([r,a])}}}return i=i.filter((t=>t[1])),i.sort(((t,e)=>t[0]-e[0])),i}return[]}remove(t){this.parsed.splice(t,1)}clear(){this.parsed=[],this.container.innerHTML=""}}({container:this.template.lrc,async:3===this.options.lrcType,player:this})),this.events=new class{constructor(){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"]}on(t,e){this.type(t)&&"function"==typeof e&&(this.events[t]||(this.events[t]=[]),this.events[t].push(e))}trigger(t,e){if(this.events[t]&&this.events[t].length)for(let i=0;i<this.events[t].length;i++)this.events[t][i](e)}type(t){return-1!==this.playerEvents.indexOf(t)?"player":-1!==this.audioEvents.indexOf(t)?"audio":(console.error(`Unknown event name: ${t}`),null)}},this.storage=new class{constructor(t){this.storageName=t.options.storageName,this.data=JSON.parse(e.storage.get(this.storageName)),this.data||(this.data={}),this.data.volume=this.data.volume||t.options.volume}get(t){return this.data[t]}set(t,i){this.data[t]=i,e.storage.set(this.storageName,JSON.stringify(this.data))}}(this),this.bar=new class{constructor(t){this.elements={},this.elements.volume=t.volume,this.elements.played=t.played,this.elements.loaded=t.loaded}set(t,e,i){e=Math.max(e,0),e=Math.min(e,1),this.elements[t].style[i]=100*e+"%"}get(t,e){return parseFloat(this.elements[t].style[e])/100}}(this.template),this.controller=new class{constructor(t){this.player=t,this.initPlayButton(),this.initPlayBar(),this.initOrderButton(),this.initLoopButton(),this.initMenuButton(),e.isMobile||this.initVolumeButton(),this.initMiniSwitcher(),this.initSkipButton(),this.initLrcButton()}initPlayButton(){this.player.template.pic.addEventListener("click",(()=>{this.player.toggle()}))}initPlayBar(){const t=t=>{let i=((t.clientX||t.changedTouches[0].clientX)-this.player.template.barWrap.getBoundingClientRect().left)/this.player.template.barWrap.clientWidth;i=Math.max(i,0),i=Math.min(i,1),this.player.bar.set("played",i,"width"),this.player.lrc&&this.player.lrc.update(i*this.player.duration),this.player.template.ptime.innerHTML=e.secondToTime(i*this.player.duration)},i=s=>{document.removeEventListener(e.nameMap.dragEnd,i),document.removeEventListener(e.nameMap.dragMove,t);let a=((s.clientX||s.changedTouches[0].clientX)-this.player.template.barWrap.getBoundingClientRect().left)/this.player.template.barWrap.clientWidth;a=Math.max(a,0),a=Math.min(a,1),this.player.bar.set("played",a,"width"),this.player.seek(a*this.player.duration),this.player.disableTimeupdate=!1};this.player.template.barWrap.addEventListener(e.nameMap.dragStart,(()=>{this.player.disableTimeupdate=!0,document.addEventListener(e.nameMap.dragMove,t),document.addEventListener(e.nameMap.dragEnd,i)}))}initVolumeButton(){this.player.template.volumeButton.addEventListener("click",(()=>{this.player.audio.muted?this.player.volume(this.player.audio.volume,!0):(this.player.audio.muted=!0,this.player.switchVolumeIcon(),this.player.bar.set("volume",0,"height"))}));const t=t=>{let e=1-((t.clientY||t.changedTouches[0].clientY)-this.player.template.volumeBar.getBoundingClientRect().top)/this.player.template.volumeBar.clientHeight;e=Math.max(e,0),e=Math.min(e,1),this.player.volume(e)},i=s=>{this.player.template.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"),document.removeEventListener(e.nameMap.dragEnd,i),document.removeEventListener(e.nameMap.dragMove,t);let a=1-((s.clientY||s.changedTouches[0].clientY)-this.player.template.volumeBar.getBoundingClientRect().top)/this.player.template.volumeBar.clientHeight;a=Math.max(a,0),a=Math.min(a,1),this.player.volume(a)};this.player.template.volumeBarWrap.addEventListener(e.nameMap.dragStart,(()=>{this.player.template.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"),document.addEventListener(e.nameMap.dragMove,t),document.addEventListener(e.nameMap.dragEnd,i)}))}initOrderButton(){this.player.template.order.addEventListener("click",(()=>{"list"===this.player.options.order?(this.player.options.order="random",this.player.template.order.innerHTML=P.orderRandom):"random"===this.player.options.order&&(this.player.options.order="list",this.player.template.order.innerHTML=P.orderList)}))}initLoopButton(){this.player.template.loop.addEventListener("click",(()=>{this.player.list.audios.length>1?"one"===this.player.options.loop?(this.player.options.loop="none",this.player.template.loop.innerHTML=P.loopNone):"none"===this.player.options.loop?(this.player.options.loop="all",this.player.template.loop.innerHTML=P.loopAll):"all"===this.player.options.loop&&(this.player.options.loop="one",this.player.template.loop.innerHTML=P.loopOne):"one"===this.player.options.loop||"all"===this.player.options.loop?(this.player.options.loop="none",this.player.template.loop.innerHTML=P.loopNone):"none"===this.player.options.loop&&(this.player.options.loop="all",this.player.template.loop.innerHTML=P.loopAll)}))}initMenuButton(){this.player.template.menu.addEventListener("click",(()=>{this.player.list.toggle()}))}initMiniSwitcher(){this.player.template.miniSwitcher.addEventListener("click",(()=>{this.player.setMode("mini"===this.player.mode?"normal":"mini")}))}initSkipButton(){this.player.template.skipBackButton.addEventListener("click",(()=>{this.player.skipBack()})),this.player.template.skipForwardButton.addEventListener("click",(()=>{this.player.skipForward()})),this.player.template.skipPlayButton.addEventListener("click",(()=>{this.player.toggle()}))}initLrcButton(){this.player.template.lrcButton.addEventListener("click",(()=>{this.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(this.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),this.player.lrc&&this.player.lrc.show()):(this.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),this.player.lrc&&this.player.lrc.hide())}))}}(this),this.timer=new class{constructor(t){this.player=t,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},this.types=["loading"],this.init()}init(){this.types.forEach((t=>{this[`init${t}Checker`]()}))}initloadingChecker(){let t=0,e=0,i=!1;this.loadingChecker=setInterval((()=>{this.enableloadingChecker&&(e=this.player.audio.currentTime,i||e!==t||this.player.audio.paused||(this.player.container.classList.add("aplayer-loading"),i=!0),i&&e>t&&!this.player.audio.paused&&(this.player.container.classList.remove("aplayer-loading"),i=!1),t=e)}),100)}enable(t){this[`enable${t}Checker`]=!0,"fps"===t&&this.initfpsChecker()}disable(t){this[`enable${t}Checker`]=!1}destroy(){this.types.forEach((t=>{this[`enable${t}Checker`]=!1,this[`${t}Checker`]&&clearInterval(this[`${t}Checker`])}))}}(this),this.list=new class{constructor(t){this.player=t,this.index=0,this.audios=this.player.options.audio,this.showing=!0,this.player.template.list.style.height=`${Math.min(this.player.template.list.scrollHeight,this.player.options.listMaxHeight)}px`,this.bindEvents()}bindEvents(){this.player.template.list.addEventListener("click",(t=>{let e;e="LI"===t.target.tagName.toUpperCase()?t.target:t.target.parentElement;const i=parseInt(e.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;i!==this.index?(this.switch(i),this.player.play()):this.player.toggle()}))}show(){this.showing=!0,this.player.template.list.scrollTop=33*this.index,this.player.template.list.style.height=`${Math.min(this.player.template.list.scrollHeight,this.player.options.listMaxHeight)}px`,this.player.events.trigger("listshow")}hide(){this.showing=!1,this.player.template.list.style.height=`${Math.min(this.player.template.list.scrollHeight,this.player.options.listMaxHeight)}px`,setTimeout((()=>{this.player.template.list.style.height="0px",this.player.events.trigger("listhide")}),0)}toggle(){this.showing?this.hide():this.show()}add(t){this.player.events.trigger("listadd",{audios:t}),"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]),t.map((t=>(t.name=t.name||t.title||"Audio name",t.artist=t.artist||t.author||"Audio artist",t.cover=t.cover||t.pic,t.type=t.type||"normal",t)));const i=!(this.audios.length>1),s=0===this.audios.length;this.player.template.list.innerHTML+=R()({theme:this.player.options.theme,audio:t,index:this.audios.length+1}),this.audios=this.audios.concat(t),i&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=e.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=t.theme||this.player.options.theme,s&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}remove(t){if(this.player.events.trigger("listremove",{index:t}),this.audios[t])if(this.audios.length>1){const e=this.player.container.querySelectorAll(".aplayer-list li");e[t].remove(),this.audios.splice(t,1),this.player.lrc&&this.player.lrc.remove(t),t===this.index&&(this.audios[t]?this.switch(t):this.switch(t-1)),this.index>t&&this.index--;for(let i=t;i<e.length;i++)e[i].getElementsByClassName("aplayer-list-index")[0].textContent=i;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()}switch(t){if(this.player.events.trigger("listswitch",{index:t}),void 0!==t&&this.audios[t]){this.index=t;const i=this.audios[this.index];this.player.template.pic.style.backgroundImage=i.cover?`url('${i.cover}')`:"",this.player.theme(this.audios[this.index].theme||this.player.options.theme,this.index,!1),this.player.template.title.innerHTML=i.name,this.player.template.author.innerHTML=i.artist?" - "+i.artist:"";const s=this.player.container.getElementsByClassName("aplayer-list-light")[0];s&&s.classList.remove("aplayer-list-light"),this.player.container.querySelectorAll(".aplayer-list li")[this.index].classList.add("aplayer-list-light"),j()(33*this.index,500,null,this.player.template.list),this.player.setAudio(i),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=e.secondToTime(this.player.duration))}}clear(){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.list.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=e.secondToTime(0)}}(this),this.initAudio(),this.bindEvents(),"random"===this.options.order?this.list.switch(this.randomOrder[0]):this.list.switch(0),this.options.autoplay&&this.play(),U.push(this)}initAudio(){this.audio=document.createElement("audio"),this.audio.preload=this.options.preload;for(let t=0;t<this.events.audioEvents.length;t++)this.audio.addEventListener(this.events.audioEvents[t],(e=>{this.events.trigger(this.events.audioEvents[t],e)}));this.volume(this.storage.get("volume"),!0)}bindEvents(){let t;this.on("play",(()=>{this.paused&&this.setUIPlaying()})),this.on("pause",(()=>{this.paused||this.setUIPaused()})),this.on("timeupdate",(()=>{if(!this.disableTimeupdate){this.bar.set("played",this.audio.currentTime/this.duration,"width"),this.lrc&&this.lrc.update();const t=e.secondToTime(this.audio.currentTime);this.template.ptime.innerHTML!==t&&(this.template.ptime.innerHTML=t)}})),this.on("durationchange",(()=>{1!==this.duration&&(this.template.dtime.innerHTML=e.secondToTime(this.duration))})),this.on("loadedmetadata",(()=>{this.seek(0),this.paused||this.audio.play()})),this.on("canplay",(()=>{const t=this.audio.buffered.length?this.audio.buffered.end(this.audio.buffered.length-1)/this.duration:0;this.bar.set("loaded",t,"width")})),this.on("progress",(()=>{const t=this.audio.buffered.length?this.audio.buffered.end(this.audio.buffered.length-1)/this.duration:0;this.bar.set("loaded",t,"width")})),this.on("error",(()=>{this.list.audios.length>1?(this.notice("An audio error has occurred, player will skip forward in 2 seconds."),t=setTimeout((()=>{this.skipForward(),this.paused||this.play()}),2e3)):1===this.list.audios.length&&this.notice("An audio error has occurred.")})),this.events.on("listswitch",(()=>{t&&clearTimeout(t)})),this.on("ended",(()=>{"none"===this.options.loop?"list"===this.options.order?this.list.index<this.list.audios.length-1?(this.list.switch((this.list.index+1)%this.list.audios.length),this.play()):(this.list.switch((this.list.index+1)%this.list.audios.length),this.pause()):"random"===this.options.order&&(this.randomOrder.indexOf(this.list.index)<this.randomOrder.length-1?(this.list.switch(this.nextIndex()),this.play()):(this.list.switch(this.nextIndex()),this.pause())):"one"===this.options.loop?(this.list.switch(this.list.index),this.play()):"all"===this.options.loop&&(this.skipForward(),this.play())}))}setAudio(t){this.hls&&(this.hls.destroy(),this.hls=null);let e=t.type;this.options.customAudioType&&this.options.customAudioType[e]?"[object Function]"===Object.prototype.toString.call(this.options.customAudioType[e])?this.options.customAudioType[e](this.audio,t,this):console.error(`Illegal customType: ${e}`):(e&&"auto"!==e||(e=/m3u8(#|\?|$)/i.exec(t.url)?"hls":"normal"),"hls"===e?window.Hls.isSupported()?(this.hls=new window.Hls,this.hls.loadSource(t.url),this.hls.attachMedia(this.audio)):this.audio.canPlayType("application/x-mpegURL")||this.audio.canPlayType("application/vnd.apple.mpegURL")?this.audio.src=t.url:this.notice("Error: HLS is not supported."):"normal"===e&&(this.audio.src=t.url))}theme(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[e]&&(this.list.audios[e].theme=t),this.template.listCurs[e]&&(this.template.listCurs[e].style.backgroundColor=t),e===this.list.index&&(this.template.pic.style.backgroundColor=t,this.template.played.style.background=t,this.template.thumb.style.background=t,this.template.volume.style.background=t)}seek(t){t=Math.max(t,0),t=Math.min(t,this.duration),this.audio.currentTime=t,this.bar.set("played",t/this.duration,"width"),this.template.ptime.innerHTML=e.secondToTime(t)}get duration(){return isNaN(this.audio.duration)?0:this.audio.duration}setUIPlaying(){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((()=>{this.template.button.innerHTML=P.pause}),100),this.template.skipPlayButton.innerHTML=P.pause),this.timer.enable("loading"),this.options.mutex)for(let t=0;t<U.length;t++)this!==U[t]&&U[t].pause()}play(){this.setUIPlaying();const t=this.audio.play();t&&t.catch((t=>{console.warn(t),"NotAllowedError"===t.name&&this.setUIPaused()}))}setUIPaused(){this.paused||(this.paused=!0,this.template.button.classList.remove("aplayer-pause"),this.template.button.classList.add("aplayer-play"),this.template.button.innerHTML="",setTimeout((()=>{this.template.button.innerHTML=P.play}),100),this.template.skipPlayButton.innerHTML=P.play),this.container.classList.remove("aplayer-loading"),this.timer.disable("loading")}pause(){this.setUIPaused(),this.audio.pause()}switchVolumeIcon(){this.volume()>=.95?this.template.volumeButton.innerHTML=P.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=P.volumeDown:this.template.volumeButton.innerHTML=P.volumeOff}volume(t,e){return t=parseFloat(t),isNaN(t)||(t=Math.max(t,0),t=Math.min(t,1),this.bar.set("volume",t,"height"),e||this.storage.set("volume",t),this.audio.volume=t,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}on(t,e){this.events.on(t,e)}toggle(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}switchAudio(t){this.list.switch(t)}addAudio(t){this.list.add(t)}removeAudio(t){this.list.remove(t)}destroy(){U.splice(U.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}setMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=t,"mini"===t?this.container.classList.add("aplayer-narrow"):"normal"===t&&this.container.classList.remove("aplayer-narrow")}notice(t){let e=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=t,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:t}),e&&(this.noticeTime=setTimeout((()=>{this.template.notice.style.opacity=0,this.events.trigger("noticehide")}),e))}prevIndex(){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){const t=this.randomOrder.indexOf(this.list.index);return 0===t?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[t-1]}}nextIndex(){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){const t=this.randomOrder.indexOf(this.list.index);return t===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[t+1]}}skipBack(){this.list.switch(this.prevIndex())}skipForward(){this.list.switch(this.nextIndex())}static get version(){return"1.10.1"}}}();var n=o.Z,l=i(8487),h=i(1431);let p=[];function d(t,e){const i={container:t,audio:e,mini:null,fixed:null,autoplay:!1,mutex:!0,lrcType:3,listFolded:1,preload:"auto",theme:"#2980b9",loop:"all",order:"list",volume:null,listMaxHeight:null,customAudioType:null,storageName:"metingjs"};if(e.length){e[0].lrc||(i.lrcType=0);let s={};for(const e in i){let a=e.toLowerCase();(t.dataset.hasOwnProperty(a)||t.dataset.hasOwnProperty(e)||null!==i[e])&&(s[e]=t.dataset[a]||t.dataset[e]||i[e],"true"!==s[e]&&"false"!==s[e]||(s[e]="true"==s[e]))}p.push(new n(s))}for(let t=0;t<p.length;t++)try{p[t].lrc.hide()}catch(t){console.log(t)}let s=1;document.querySelector(".aplayer.aplayer-fixed").addEventListener("click",(()=>{if(1==s)for(let t=0;t<p.length;t++)try{p[t].lrc.show()}catch(t){console.log(t)}s=2}));let a=0,r=document.querySelector(".aplayer.aplayer-fixed .aplayer-body"),o=document.querySelector(".aplayer-miniswitcher");r&&r.classList.add("ap-hover"),o&&o.addEventListener("click",(()=>{0==a?(r&&r.classList.remove("ap-hover"),document.getElementById("secondary")&&document.getElementById("secondary").classList.add("active"),a=1):(r&&r.classList.add("ap-hover"),document.getElementById("secondary")&&document.getElementById("secondary").classList.remove("active"),a=0)}))}function c(){try{for(let t=0;t<p.length;t++)p[t].destroy();p=[]}catch(t){console.warn(t)}}function u(){const t=[];try{for(const e of p)e.paused||t.push(e),e.pause()}catch(t){console.warn(t)}return t}function y(){let t;_iro.ext_shared_lib?(0,l.loadCSS)("https://s.nmxc.ltd/aplayer/dist/APlayer.min.css"):Promise.resolve().then(i.bind(i,5176)),"string"==typeof meting_api?t=new URL(meting_api):(t=new URL(_iro.meting_api_url),t.searchParams.set("_wpnonce",_iro.nonce)),c();let e=document.getElementsByClassName("aplayer");for(let i=0;i<e.length;i++){let s=e[i];if(s.dataset.id){const e=s.dataset.api?new URL(s.dataset.api):t,i=e.searchParams;i.set("server",s.dataset.server),i.set("type",s.dataset.type),i.set("id",s.dataset.id),fetch(e.toString()).then((async t=>{t.ok?d(s,await t.json()):console.warn(`(APlayer) HTTP ${t.status}:${t.statusText}`)})).catch(console.error)}else if(s.dataset.url){const t=[{name:s.dataset.name||s.dataset.title||"Audio name",artist:s.dataset.artist||s.dataset.author||"Audio artist",url:s.dataset.url,cover:s.dataset.cover||s.dataset.pic,lrc:s.dataset.lrc,type:s.dataset.type||"auto"}];d(s,t)}}(0,h.t)("pauseAllPlayer",u),(0,h.t)("destroyAllAplayer",c),(0,h.t)("loadAPlayer",m),(0,h.t)("getAPlayers",(()=>p))}function m(t){let e=document.getElementsByClassName("aplayer");for(const i of e)d(i,t)}},5176:(t,e,i)=>{i.r(e)}}]);
  3. //# sourceMappingURL=7986.js.map