zyjj-web-sdk 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { w as E } from "./index-DHkE5AiB.js";
1
+ import { g as E } from "./index-Cb5QHnRK.js";
2
2
  function S(T, L) {
3
3
  for (var f = 0; f < L.length; f++) {
4
4
  const h = L[f];
@@ -23,8 +23,7 @@ var _ = { exports: {} };
23
23
  return function(f) {
24
24
  var h = {};
25
25
  function d(u) {
26
- if (h[u])
27
- return h[u].exports;
26
+ if (h[u]) return h[u].exports;
28
27
  var c = h[u] = { i: u, l: !1, exports: {} };
29
28
  return f[u].call(c.exports, c, c.exports, d), c.l = !0, c.exports;
30
29
  }
@@ -51,16 +50,11 @@ var _ = { exports: {} };
51
50
  }).join(":");
52
51
  }, getElementViewLeft: function(e) {
53
52
  var n = e.offsetLeft, o = e.offsetParent, s = document.body.scrollLeft + document.documentElement.scrollLeft;
54
- if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement)
55
- for (; o !== null && o !== e; )
56
- n += o.offsetLeft, o = o.offsetParent;
57
- else
58
- for (; o !== null; )
59
- n += o.offsetLeft, o = o.offsetParent;
53
+ if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement) for (; o !== null && o !== e; ) n += o.offsetLeft, o = o.offsetParent;
54
+ else for (; o !== null; ) n += o.offsetLeft, o = o.offsetParent;
60
55
  return n - s;
61
56
  }, getElementViewTop: function(e, n) {
62
- for (var o, s = e.offsetTop, t = e.offsetParent; t !== null; )
63
- s += t.offsetTop, t = t.offsetParent;
57
+ for (var o, s = e.offsetTop, t = e.offsetParent; t !== null; ) s += t.offsetTop, t = t.offsetParent;
64
58
  return o = document.body.scrollTop + document.documentElement.scrollTop, n ? s : s - o;
65
59
  }, isMobile: u, storage: { set: function(e, n) {
66
60
  localStorage.setItem(e, n);
@@ -75,8 +69,7 @@ var _ = { exports: {} };
75
69
  return n;
76
70
  }([].concat(function(n) {
77
71
  if (Array.isArray(n)) {
78
- for (var o = 0, s = Array(n.length); o < n.length; o++)
79
- s[o] = n[o];
72
+ for (var o = 0, s = Array(n.length); o < n.length; o++) s[o] = n[o];
80
73
  return s;
81
74
  }
82
75
  return Array.from(n);
@@ -140,12 +133,10 @@ var _ = { exports: {} };
140
133
  }, o = function(t, i, l, p) {
141
134
  i = i || 500;
142
135
  var r = (p = p || window).scrollTop || window.pageYOffset;
143
- if (typeof t == "number")
144
- var y = parseInt(t);
145
- else
146
- var y = function(b, w) {
147
- return b.nodeName === "HTML" ? -w : b.getBoundingClientRect().top + w;
148
- }(t, r);
136
+ if (typeof t == "number") var y = parseInt(t);
137
+ else var y = function(b, w) {
138
+ return b.nodeName === "HTML" ? -w : b.getBoundingClientRect().top + w;
139
+ }(t, r);
149
140
  var x = Date.now(), g = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(b) {
150
141
  window.setTimeout(b, 15);
151
142
  };
@@ -157,16 +148,14 @@ var _ = { exports: {} };
157
148
  if (!t.defaultPrevented) {
158
149
  t.preventDefault(), location.hash !== this.hash && window.history.pushState(null, null, this.hash);
159
150
  var i = document.getElementById(this.hash.substring(1));
160
- if (!i)
161
- return;
151
+ if (!i) return;
162
152
  o(i, 500, function(l) {
163
153
  location.replace("#" + l.id);
164
154
  });
165
155
  }
166
156
  };
167
157
  return document.addEventListener("DOMContentLoaded", function() {
168
- for (var t, i = document.querySelectorAll('a[href^="#"]:not([href="#"])'), l = i.length; t = i[--l]; )
169
- t.addEventListener("click", s, !1);
158
+ for (var t, i = document.querySelectorAll('a[href^="#"]:not([href="#"])'), l = i.length; t = i[--l]; ) t.addEventListener("click", s, !1);
170
159
  }), o;
171
160
  }
172
161
  }) == "function" ? u.call(h, d, h, f) : u) === void 0 || (f.exports = c);
@@ -189,8 +178,7 @@ var _ = { exports: {} };
189
178
  var s = function() {
190
179
  function t(i) {
191
180
  (function(l, p) {
192
- if (!(l instanceof p))
193
- throw new TypeError("Cannot call a class as a function");
181
+ if (!(l instanceof p)) throw new TypeError("Cannot call a class as a function");
194
182
  })(this, t), this.player = i, this.index = 0, this.audios = this.player.options.audio, this.bindEvents();
195
183
  }
196
184
  return u(t, [{ key: "bindEvents", value: function() {
@@ -214,15 +202,12 @@ var _ = { exports: {} };
214
202
  var l = !(this.audios.length > 1), p = this.audios.length === 0;
215
203
  this.player.template.listOl.innerHTML += (0, c.default)({ theme: this.player.options.theme, audio: i, index: this.audios.length + 1 }), this.audios = this.audios.concat(i), l && this.audios.length > 1 && this.player.container.classList.add("aplayer-withlist"), this.player.randomOrder = e.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 = i.theme || this.player.options.theme, p && (this.player.options.order === "random" ? this.switch(this.player.randomOrder[0]) : this.switch(0));
216
204
  } }, { key: "remove", value: function(i) {
217
- if (this.player.events.trigger("listremove", { index: i }), this.audios[i])
218
- if (this.audios.length > 1) {
219
- var l = this.player.container.querySelectorAll(".aplayer-list li");
220
- l[i].remove(), this.audios.splice(i, 1), this.player.lrc && this.player.lrc.remove(i), i === this.index && (this.audios[i] ? this.switch(i) : this.switch(i - 1)), this.index > i && this.index--;
221
- for (var p = i; p < l.length; p++)
222
- l[p].getElementsByClassName("aplayer-list-index")[0].textContent = p;
223
- this.audios.length === 1 && this.player.container.classList.remove("aplayer-withlist"), this.player.template.listCurs = this.player.container.querySelectorAll(".aplayer-list-cur");
224
- } else
225
- this.clear();
205
+ if (this.player.events.trigger("listremove", { index: i }), this.audios[i]) if (this.audios.length > 1) {
206
+ var l = this.player.container.querySelectorAll(".aplayer-list li");
207
+ l[i].remove(), this.audios.splice(i, 1), this.player.lrc && this.player.lrc.remove(i), i === this.index && (this.audios[i] ? this.switch(i) : this.switch(i - 1)), this.index > i && this.index--;
208
+ for (var p = i; p < l.length; p++) l[p].getElementsByClassName("aplayer-list-index")[0].textContent = p;
209
+ this.audios.length === 1 && this.player.container.classList.remove("aplayer-withlist"), this.player.template.listCurs = this.player.container.querySelectorAll(".aplayer-list-cur");
210
+ } else this.clear();
226
211
  } }, { key: "switch", value: function(i) {
227
212
  if (this.player.events.trigger("listswitch", { index: i }), i !== void 0 && this.audios[i]) {
228
213
  this.index = i;
@@ -251,16 +236,13 @@ var _ = { exports: {} };
251
236
  }(), c = function() {
252
237
  function e() {
253
238
  (function(n, o) {
254
- if (!(n instanceof o))
255
- throw new TypeError("Cannot call a class as a function");
239
+ if (!(n instanceof o)) throw new TypeError("Cannot call a class as a function");
256
240
  })(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"];
257
241
  }
258
242
  return u(e, [{ key: "on", value: function(n, o) {
259
243
  this.type(n) && typeof o == "function" && (this.events[n] || (this.events[n] = []), this.events[n].push(o));
260
244
  } }, { key: "trigger", value: function(n, o) {
261
- if (this.events[n] && this.events[n].length)
262
- for (var s = 0; s < this.events[n].length; s++)
263
- this.events[n][s](o);
245
+ if (this.events[n] && this.events[n].length) for (var s = 0; s < this.events[n].length; s++) this.events[n][s](o);
264
246
  } }, { key: "type", value: function(n) {
265
247
  return this.playerEvents.indexOf(n) !== -1 ? "player" : this.audioEvents.indexOf(n) !== -1 ? "audio" : (console.error("Unknown event name: " + n), null);
266
248
  } }]), e;
@@ -281,8 +263,7 @@ var _ = { exports: {} };
281
263
  }(), c = function() {
282
264
  function e(n) {
283
265
  (function(o, s) {
284
- if (!(o instanceof s))
285
- throw new TypeError("Cannot call a class as a function");
266
+ if (!(o instanceof s)) throw new TypeError("Cannot call a class as a function");
286
267
  })(this, e), this.player = n, window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(o) {
287
268
  window.setTimeout(o, 1e3 / 60);
288
269
  }, this.types = ["loading"], this.init();
@@ -328,8 +309,7 @@ var _ = { exports: {} };
328
309
  var o = function() {
329
310
  function s(t) {
330
311
  (function(i, l) {
331
- if (!(i instanceof l))
332
- throw new TypeError("Cannot call a class as a function");
312
+ if (!(i instanceof l)) throw new TypeError("Cannot call a class as a function");
333
313
  })(this, s), this.player = t, this.initPlayButton(), this.initPlayBar(), this.initOrderButton(), this.initLoopButton(), this.initMenuButton(), c.default.isMobile || this.initVolumeButton(), this.initMiniSwitcher(), this.initSkipButton(), this.initLrcButton();
334
314
  }
335
315
  return u(s, [{ key: "initPlayButton", value: function() {
@@ -428,8 +408,7 @@ var _ = { exports: {} };
428
408
  }(), e = d(10), n = (u = e) && u.__esModule ? u : { default: u }, o = function() {
429
409
  function s(t) {
430
410
  (function(i, l) {
431
- if (!(i instanceof l))
432
- throw new TypeError("Cannot call a class as a function");
411
+ if (!(i instanceof l)) throw new TypeError("Cannot call a class as a function");
433
412
  })(this, s), this.container = t.container, this.async = t.async, this.player = t.player, this.parsed = [], this.index = 0, this.current = [];
434
413
  }
435
414
  return c(s, [{ key: "show", value: function() {
@@ -440,22 +419,18 @@ var _ = { exports: {} };
440
419
  this.player.template.lrcWrap.classList.contains("aplayer-lrc-hide") ? this.show() : this.hide();
441
420
  } }, { key: "update", value: function() {
442
421
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.player.audio.currentTime;
443
- 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])
444
- for (var i = 0; i < this.current.length; i++)
445
- t >= this.current[i][0] && (!this.current[i + 1] || t < this.current[i + 1][0]) && (this.index = i, 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")[i].classList.add("aplayer-lrc-current"));
422
+ 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 (var i = 0; i < this.current.length; i++) t >= this.current[i][0] && (!this.current[i + 1] || t < this.current[i + 1][0]) && (this.index = i, 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")[i].classList.add("aplayer-lrc-current"));
446
423
  } }, { key: "switch", value: function(t) {
447
424
  var i = this;
448
- if (!this.parsed[t])
449
- if (this.async) {
450
- this.parsed[t] = [["00:00", "Loading"]];
451
- var l = new XMLHttpRequest();
452
- l.onreadystatechange = function() {
453
- t === i.player.list.index && l.readyState === 4 && (l.status >= 200 && l.status < 300 || l.status === 304 ? i.parsed[t] = i.parse(l.responseText) : (i.player.notice("LRC file request fails: status " + l.status), i.parsed[t] = [["00:00", "Not available"]]), i.container.innerHTML = (0, n.default)({ lyrics: i.parsed[t] }), i.update(0), i.current = i.parsed[t]);
454
- };
455
- var p = this.player.list.audios[t].lrc;
456
- l.open("get", p, !0), l.send(null);
457
- } else
458
- this.player.list.audios[t].lrc ? this.parsed[t] = this.parse(this.player.list.audios[t].lrc) : this.parsed[t] = [["00:00", "Not available"]];
425
+ if (!this.parsed[t]) if (this.async) {
426
+ this.parsed[t] = [["00:00", "Loading"]];
427
+ var l = new XMLHttpRequest();
428
+ l.onreadystatechange = function() {
429
+ t === i.player.list.index && l.readyState === 4 && (l.status >= 200 && l.status < 300 || l.status === 304 ? i.parsed[t] = i.parse(l.responseText) : (i.player.notice("LRC file request fails: status " + l.status), i.parsed[t] = [["00:00", "Not available"]]), i.container.innerHTML = (0, n.default)({ lyrics: i.parsed[t] }), i.update(0), i.current = i.parsed[t]);
430
+ };
431
+ var p = this.player.list.audios[t].lrc;
432
+ l.open("get", p, !0), l.send(null);
433
+ } 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"]];
459
434
  this.container.innerHTML = (0, n.default)({ lyrics: this.parsed[t] }), this.update(0), this.current = this.parsed[t];
460
435
  } }, { key: "parse", value: function(t) {
461
436
  if (t) {
@@ -465,11 +440,10 @@ var _ = { exports: {} };
465
440
  })).split(`
466
441
  `), l = [], p = i.length, r = 0; r < p; r++) {
467
442
  var y = i[r].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g), x = i[r].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g, "").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g, "").replace(/^\s+|\s+$/g, "");
468
- if (y)
469
- for (var g = y.length, b = 0; b < g; b++) {
470
- var w = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(y[b]), m = 60 * w[1] + parseInt(w[2]) + (w[4] ? parseInt(w[4]) / ((w[4] + "").length === 2 ? 100 : 1e3) : 0);
471
- l.push([m, x]);
472
- }
443
+ if (y) for (var g = y.length, b = 0; b < g; b++) {
444
+ var w = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(y[b]), m = 60 * w[1] + parseInt(w[2]) + (w[4] ? parseInt(w[4]) / ((w[4] + "").length === 2 ? 100 : 1e3) : 0);
445
+ l.push([m, x]);
446
+ }
473
447
  }
474
448
  return (l = l.filter(function(a) {
475
449
  return a[1];
@@ -500,8 +474,7 @@ var _ = { exports: {} };
500
474
  }(), e = d(0), n = (u = e) && u.__esModule ? u : { default: u }, o = function() {
501
475
  function s(t) {
502
476
  (function(i, l) {
503
- if (!(i instanceof l))
504
- throw new TypeError("Cannot call a class as a function");
477
+ if (!(i instanceof l)) throw new TypeError("Cannot call a class as a function");
505
478
  })(this, s), this.storageName = t.options.storageName, this.data = JSON.parse(n.default.storage.get(this.storageName)), this.data || (this.data = {}), this.data.volume = this.data.volume || t.options.volume;
506
479
  }
507
480
  return c(s, [{ key: "get", value: function(t) {
@@ -526,8 +499,7 @@ var _ = { exports: {} };
526
499
  }(), c = function() {
527
500
  function e(n) {
528
501
  (function(o, s) {
529
- if (!(o instanceof s))
530
- throw new TypeError("Cannot call a class as a function");
502
+ if (!(o instanceof s)) throw new TypeError("Cannot call a class as a function");
531
503
  })(this, e), this.elements = {}, this.elements.volume = n.volume, this.elements.played = n.played, this.elements.loaded = n.loaded;
532
504
  }
533
505
  return u(e, [{ key: "set", value: function(n, o, s) {
@@ -551,8 +523,7 @@ var _ = { exports: {} };
551
523
  e.$escape = function(o) {
552
524
  return function(s) {
553
525
  var t = "" + s, i = n.exec(t);
554
- if (!i)
555
- return s;
526
+ if (!i) return s;
556
527
  var l = "", p = void 0, r = void 0, y = void 0;
557
528
  for (p = i.index, r = 0; p < t.length; p++) {
558
529
  switch (t.charCodeAt(p)) {
@@ -581,12 +552,8 @@ var _ = { exports: {} };
581
552
  return typeof t != "string" && (t = t == null ? "" : typeof t == "function" ? s(t.call(t)) : JSON.stringify(t)), t;
582
553
  }(o));
583
554
  }, e.$each = function(o, s) {
584
- if (Array.isArray(o))
585
- for (var t = 0, i = o.length; t < i; t++)
586
- s(o[t], t);
587
- else
588
- for (var l in o)
589
- s(o[l], l);
555
+ if (Array.isArray(o)) for (var t = 0, i = o.length; t < i; t++) s(o[t], t);
556
+ else for (var l in o) s(o[l], l);
590
557
  }, f.exports = e;
591
558
  }).call(this, d(4));
592
559
  }, function(f, h, d) {
@@ -756,8 +723,7 @@ var _ = { exports: {} };
756
723
  var o = function() {
757
724
  function s(t) {
758
725
  (function(i, l) {
759
- if (!(i instanceof l))
760
- throw new TypeError("Cannot call a class as a function");
726
+ if (!(i instanceof l)) throw new TypeError("Cannot call a class as a function");
761
727
  })(this, s), this.container = t.container, this.options = t.options, this.randomOrder = t.randomOrder, this.init();
762
728
  }
763
729
  return u(s, [{ key: "init", value: function() {
@@ -771,8 +737,7 @@ var _ = { exports: {} };
771
737
  }, function(f, h, d) {
772
738
  Object.defineProperty(h, "__esModule", { value: !0 }), h.default = function(u) {
773
739
  var c = { container: u.element || document.getElementsByClassName("aplayer")[0], mini: u.narrow || u.fixed || !1, fixed: !1, autoplay: !1, mutex: !0, lrcType: u.showlrc || u.lrc || 0, preload: "auto", theme: "#b7daff", loop: "all", order: "list", volume: 0.7, listFolded: u.fixed, listMaxHeight: u.listmaxheight || "250px", audio: u.music || [], storageName: "aplayer-setting" };
774
- for (var e in c)
775
- c.hasOwnProperty(e) && !u.hasOwnProperty(e) && (u[e] = c[e]);
740
+ for (var e in c) c.hasOwnProperty(e) && !u.hasOwnProperty(e) && (u[e] = c[e]);
776
741
  return Object.prototype.toString.call(u.audio) !== "[object Array]" && (u.audio = [u.audio]), u.audio.map(function(n) {
777
742
  return n.name = n.name || n.title || "Audio name", n.artist = n.artist || n.author || "Audio artist", n.cover = n.cover || n.pic, n.type = n.type || "normal", n;
778
743
  }), u.audio.length <= 1 && u.loop === "one" && (u.loop = "all"), u;
@@ -816,10 +781,8 @@ var _ = { exports: {} };
816
781
  throw new Error("clearTimeout has not been defined");
817
782
  }
818
783
  function s(b) {
819
- if (u === setTimeout)
820
- return setTimeout(b, 0);
821
- if ((u === n || !u) && setTimeout)
822
- return u = setTimeout, setTimeout(b, 0);
784
+ if (u === setTimeout) return setTimeout(b, 0);
785
+ if ((u === n || !u) && setTimeout) return u = setTimeout, setTimeout(b, 0);
823
786
  try {
824
787
  return u(b, 0);
825
788
  } catch {
@@ -851,15 +814,12 @@ var _ = { exports: {} };
851
814
  var b = s(r);
852
815
  l = !0;
853
816
  for (var w = i.length; w; ) {
854
- for (t = i, i = []; ++p < w; )
855
- t && t[p].run();
817
+ for (t = i, i = []; ++p < w; ) t && t[p].run();
856
818
  p = -1, w = i.length;
857
819
  }
858
820
  t = null, l = !1, function(m) {
859
- if (c === clearTimeout)
860
- return clearTimeout(m);
861
- if ((c === o || !c) && clearTimeout)
862
- return c = clearTimeout, clearTimeout(m);
821
+ if (c === clearTimeout) return clearTimeout(m);
822
+ if ((c === o || !c) && clearTimeout) return c = clearTimeout, clearTimeout(m);
863
823
  try {
864
824
  c(m);
865
825
  } catch {
@@ -879,9 +839,7 @@ var _ = { exports: {} };
879
839
  }
880
840
  e.nextTick = function(b) {
881
841
  var w = new Array(arguments.length - 1);
882
- if (arguments.length > 1)
883
- for (var m = 1; m < arguments.length; m++)
884
- w[m - 1] = arguments[m];
842
+ if (arguments.length > 1) for (var m = 1; m < arguments.length; m++) w[m - 1] = arguments[m];
885
843
  i.push(new x(b, w)), i.length !== 1 || l || s(y);
886
844
  }, x.prototype.run = function() {
887
845
  this.fun.apply(null, this.array);
@@ -929,8 +887,7 @@ var _ = { exports: {} };
929
887
  setTimeout(w, 0, m);
930
888
  }, g.setImmediate = function(m) {
931
889
  typeof m != "function" && (m = new Function("" + m));
932
- for (var a = new Array(arguments.length - 1), v = 0; v < a.length; v++)
933
- a[v] = arguments[v + 1];
890
+ for (var a = new Array(arguments.length - 1), v = 0; v < a.length; v++) a[v] = arguments[v + 1];
934
891
  var k = { callback: m, args: a };
935
892
  return r[p] = k, o(p), p++;
936
893
  }, g.clearImmediate = b;
@@ -939,8 +896,7 @@ var _ = { exports: {} };
939
896
  delete r[m];
940
897
  }
941
898
  function w(m) {
942
- if (y)
943
- setTimeout(w, 0, m);
899
+ if (y) setTimeout(w, 0, m);
944
900
  else {
945
901
  var a = r[m];
946
902
  if (a) {
@@ -1008,15 +964,12 @@ var _ = { exports: {} };
1008
964
  function n() {
1009
965
  }
1010
966
  function o(r) {
1011
- if (!(this instanceof o))
1012
- throw new TypeError("Promises must be constructed via new");
1013
- if (typeof r != "function")
1014
- throw new TypeError("not a function");
967
+ if (!(this instanceof o)) throw new TypeError("Promises must be constructed via new");
968
+ if (typeof r != "function") throw new TypeError("not a function");
1015
969
  this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], p(r, this);
1016
970
  }
1017
971
  function s(r, y) {
1018
- for (; r._state === 3; )
1019
- r = r._value;
972
+ for (; r._state === 3; ) r = r._value;
1020
973
  r._state !== 0 ? (r._handled = !0, o._immediateFn(function() {
1021
974
  var x = r._state === 1 ? y.onFulfilled : y.onRejected;
1022
975
  if (x !== null) {
@@ -1027,22 +980,18 @@ var _ = { exports: {} };
1027
980
  return void i(y.promise, b);
1028
981
  }
1029
982
  t(y.promise, g);
1030
- } else
1031
- (r._state === 1 ? t : i)(y.promise, r._value);
983
+ } else (r._state === 1 ? t : i)(y.promise, r._value);
1032
984
  })) : r._deferreds.push(y);
1033
985
  }
1034
986
  function t(r, y) {
1035
987
  try {
1036
- if (y === r)
1037
- throw new TypeError("A promise cannot be resolved with itself.");
988
+ if (y === r) throw new TypeError("A promise cannot be resolved with itself.");
1038
989
  if (y && ((y === void 0 ? "undefined" : c(y)) === "object" || typeof y == "function")) {
1039
990
  var x = y.then;
1040
- if (y instanceof o)
1041
- return r._state = 3, r._value = y, void l(r);
1042
- if (typeof x == "function")
1043
- return void p((g = x, b = y, function() {
1044
- g.apply(b, arguments);
1045
- }), r);
991
+ if (y instanceof o) return r._state = 3, r._value = y, void l(r);
992
+ if (typeof x == "function") return void p((g = x, b = y, function() {
993
+ g.apply(b, arguments);
994
+ }), r);
1046
995
  }
1047
996
  r._state = 1, r._value = y, l(r);
1048
997
  } catch (w) {
@@ -1057,8 +1006,7 @@ var _ = { exports: {} };
1057
1006
  r._state === 2 && r._deferreds.length === 0 && o._immediateFn(function() {
1058
1007
  r._handled || o._unhandledRejectionFn(r._value);
1059
1008
  });
1060
- for (var y = 0, x = r._deferreds.length; y < x; y++)
1061
- s(r, r._deferreds[y]);
1009
+ for (var y = 0, x = r._deferreds.length; y < x; y++) s(r, r._deferreds[y]);
1062
1010
  r._deferreds = null;
1063
1011
  }
1064
1012
  function p(r, y) {
@@ -1070,8 +1018,7 @@ var _ = { exports: {} };
1070
1018
  x || (x = !0, i(y, g));
1071
1019
  });
1072
1020
  } catch (g) {
1073
- if (x)
1074
- return;
1021
+ if (x) return;
1075
1022
  x = !0, i(y, g);
1076
1023
  }
1077
1024
  }
@@ -1095,28 +1042,24 @@ var _ = { exports: {} };
1095
1042
  });
1096
1043
  }, o.all = function(r) {
1097
1044
  return new o(function(y, x) {
1098
- if (!r || r.length === void 0)
1099
- throw new TypeError("Promise.all accepts an array");
1045
+ if (!r || r.length === void 0) throw new TypeError("Promise.all accepts an array");
1100
1046
  var g = Array.prototype.slice.call(r);
1101
- if (g.length === 0)
1102
- return y([]);
1047
+ if (g.length === 0) return y([]);
1103
1048
  var b = g.length;
1104
1049
  function w(a, v) {
1105
1050
  try {
1106
1051
  if (v && ((v === void 0 ? "undefined" : c(v)) === "object" || typeof v == "function")) {
1107
1052
  var k = v.then;
1108
- if (typeof k == "function")
1109
- return void k.call(v, function(M) {
1110
- w(a, M);
1111
- }, x);
1053
+ if (typeof k == "function") return void k.call(v, function(M) {
1054
+ w(a, M);
1055
+ }, x);
1112
1056
  }
1113
1057
  g[a] = v, --b == 0 && y(g);
1114
1058
  } catch (M) {
1115
1059
  x(M);
1116
1060
  }
1117
1061
  }
1118
- for (var m = 0; m < g.length; m++)
1119
- w(m, g[m]);
1062
+ for (var m = 0; m < g.length; m++) w(m, g[m]);
1120
1063
  });
1121
1064
  }, o.resolve = function(r) {
1122
1065
  return r && (r === void 0 ? "undefined" : c(r)) === "object" && r.constructor === o ? r : new o(function(y) {
@@ -1128,8 +1071,7 @@ var _ = { exports: {} };
1128
1071
  });
1129
1072
  }, o.race = function(r) {
1130
1073
  return new o(function(y, x) {
1131
- for (var g = 0, b = r.length; g < b; g++)
1132
- r[g].then(y, x);
1074
+ for (var g = 0, b = r.length; g < b; g++) r[g].then(y, x);
1133
1075
  });
1134
1076
  }, o._immediateFn = typeof u == "function" && function(r) {
1135
1077
  u(r);
@@ -1158,11 +1100,8 @@ var _ = { exports: {} };
1158
1100
  var b = [], w = function() {
1159
1101
  function m(a) {
1160
1102
  if (function(M, q) {
1161
- if (!(M instanceof q))
1162
- throw new TypeError("Cannot call a class as a function");
1163
- }(this, m), this.options = (0, o.default)(a), this.container = this.options.container, this.paused = !0, this.playedPromise = c.default.resolve(), this.mode = "normal", this.randomOrder = e.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"), e.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, this.options.lrcType === 2 || this.options.lrcType === !0)
1164
- for (var v = this.container.getElementsByClassName("aplayer-lrc-content"), k = 0; k < v.length; k++)
1165
- this.options.audio[k] && (this.options.audio[k].lrc = v[k].innerHTML);
1103
+ if (!(M instanceof q)) throw new TypeError("Cannot call a class as a function");
1104
+ }(this, m), this.options = (0, o.default)(a), this.container = this.options.container, this.paused = !0, this.playedPromise = c.default.resolve(), this.mode = "normal", this.randomOrder = e.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"), e.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, this.options.lrcType === 2 || this.options.lrcType === !0) for (var v = this.container.getElementsByClassName("aplayer-lrc-content"), k = 0; k < v.length; k++) this.options.audio[k] && (this.options.audio[k].lrc = v[k].innerHTML);
1166
1105
  this.template = new s.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 l.default({ container: this.template.lrc, async: this.options.lrcType === 3, player: this })), this.events = new y.default(), this.storage = new i.default(this), this.bar = new t.default(this.template), this.controller = new p.default(this), this.timer = new r.default(this), this.list = new x.default(this), this.initAudio(), this.bindEvents(), this.options.order === "random" ? this.list.switch(this.randomOrder[0]) : this.list.switch(0), this.options.autoplay && this.play(), b.push(this);
1167
1106
  }
1168
1107
  return u(m, [{ key: "initAudio", value: function() {
@@ -1172,8 +1111,7 @@ var _ = { exports: {} };
1172
1111
  a.audio.addEventListener(a.events.audioEvents[M], function(q) {
1173
1112
  a.events.trigger(a.events.audioEvents[M], q);
1174
1113
  });
1175
- }, k = 0; k < this.events.audioEvents.length; k++)
1176
- v(k);
1114
+ }, k = 0; k < this.events.audioEvents.length; k++) v(k);
1177
1115
  this.volume(this.storage.get("volume"), !0);
1178
1116
  } }, { key: "bindEvents", value: function() {
1179
1117
  var a = this;
@@ -1216,9 +1154,7 @@ var _ = { exports: {} };
1216
1154
  var a = this;
1217
1155
  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() {
1218
1156
  a.template.button.innerHTML = n.default.pause;
1219
- }, 100), this.template.skipPlayButton.innerHTML = n.default.pause), this.timer.enable("loading"), this.options.mutex)
1220
- for (var v = 0; v < b.length; v++)
1221
- this !== b[v] && b[v].pause();
1157
+ }, 100), this.template.skipPlayButton.innerHTML = n.default.pause), this.timer.enable("loading"), this.options.mutex) for (var v = 0; v < b.length; v++) this !== b[v] && b[v].pause();
1222
1158
  } }, { key: "play", value: function() {
1223
1159
  var a = this;
1224
1160
  this.setUIPlaying();
@@ -1258,19 +1194,15 @@ var _ = { exports: {} };
1258
1194
  v.template.notice.style.opacity = 0, v.events.trigger("noticehide");
1259
1195
  }, k));
1260
1196
  } }, { key: "prevIndex", value: function() {
1261
- if (!(this.list.audios.length > 1))
1262
- return 0;
1263
- if (this.options.order === "list")
1264
- return this.list.index - 1 < 0 ? this.list.audios.length - 1 : this.list.index - 1;
1197
+ if (!(this.list.audios.length > 1)) return 0;
1198
+ if (this.options.order === "list") return this.list.index - 1 < 0 ? this.list.audios.length - 1 : this.list.index - 1;
1265
1199
  if (this.options.order === "random") {
1266
1200
  var a = this.randomOrder.indexOf(this.list.index);
1267
1201
  return a === 0 ? this.randomOrder[this.randomOrder.length - 1] : this.randomOrder[a - 1];
1268
1202
  }
1269
1203
  } }, { key: "nextIndex", value: function() {
1270
- if (!(this.list.audios.length > 1))
1271
- return 0;
1272
- if (this.options.order === "list")
1273
- return (this.list.index + 1) % this.list.audios.length;
1204
+ if (!(this.list.audios.length > 1)) return 0;
1205
+ if (this.options.order === "list") return (this.list.index + 1) % this.list.audios.length;
1274
1206
  if (this.options.order === "random") {
1275
1207
  var a = this.randomOrder.indexOf(this.list.index);
1276
1208
  return a === this.randomOrder.length - 1 ? this.randomOrder[0] : this.randomOrder[a + 1];