zyjj-web-sdk 1.0.21 → 1.0.23

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.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/lib/APlayer.min-9ukXWHtq.js +0 -1306
  3. package/lib/DPlayer.min-Cl9WiJp7.js +0 -7739
  4. package/lib/api/api.d.ts +0 -48
  5. package/lib/api/entity.d.ts +0 -66
  6. package/lib/api/request.d.ts +0 -1
  7. package/lib/components/ConcatButton.d.ts +0 -9
  8. package/lib/components/MaterialCard.d.ts +0 -6
  9. package/lib/components/PageTable.d.ts +0 -19
  10. package/lib/components/TokenInput.d.ts +0 -5
  11. package/lib/components/ToolCard.d.ts +0 -10
  12. package/lib/components/UserLogin.d.ts +0 -10
  13. package/lib/components/lab/ElementTypeAlert.d.ts +0 -3
  14. package/lib/components/lab/ElementTypeAudio.d.ts +0 -10
  15. package/lib/components/lab/ElementTypeImage.d.ts +0 -2
  16. package/lib/components/lab/ElementTypeImageList.d.ts +0 -2
  17. package/lib/components/lab/ElementTypeInput.d.ts +0 -3
  18. package/lib/components/lab/ElementTypeNumber.d.ts +0 -3
  19. package/lib/components/lab/ElementTypeSelect.d.ts +0 -3
  20. package/lib/components/lab/ElementTypeSlider.d.ts +0 -3
  21. package/lib/components/lab/ElementTypeText.d.ts +0 -2
  22. package/lib/components/lab/ElementTypeTextArea.d.ts +0 -3
  23. package/lib/components/lab/ElementTypeUpload.d.ts +0 -4
  24. package/lib/components/lab/ElementTypeVideo.d.ts +0 -10
  25. package/lib/components/lab/LabElement.d.ts +0 -7
  26. package/lib/components/lab/common.d.ts +0 -28
  27. package/lib/index-DYCuXcu7.js +0 -6554
  28. package/lib/index-DtMxRUqJ.js +0 -59003
  29. package/lib/index.d.ts +0 -121
  30. package/lib/index.js +0 -16
  31. package/lib/index.umd.cjs +0 -4885
  32. package/lib/pages/MaterialList.d.ts +0 -8
  33. package/lib/pages/SearchBar.d.ts +0 -29
  34. package/lib/pages/TaskList.d.ts +0 -12
  35. package/lib/pages/ToolList.d.ts +0 -10
  36. package/lib/pages/UserInfoPage.d.ts +0 -9
  37. package/lib/store/entity.d.ts +0 -15
  38. package/lib/store/mqtt.d.ts +0 -11
  39. package/lib/store/user.d.ts +0 -11
  40. package/lib/style.css +0 -1
  41. package/lib/tool/db.d.ts +0 -7
  42. package/lib/tool/render.d.ts +0 -3
  43. package/lib/tool/utils.d.ts +0 -21
  44. package/lib/types/cloud.d.ts +0 -78
  45. package/lib/types/config.d.ts +0 -36
  46. package/lib/types/local-task.d.ts +0 -162
  47. package/lib/types/map.d.ts +0 -2
  48. package/lib/types/mqtt.d.ts +0 -16
  49. package/lib/types/tool-task.d.ts +0 -135
@@ -1,1306 +0,0 @@
1
- import { g as E } from "./index-DtMxRUqJ.js";
2
- function S(T, L) {
3
- for (var f = 0; f < L.length; f++) {
4
- const h = L[f];
5
- if (typeof h != "string" && !Array.isArray(h)) {
6
- for (const d in h)
7
- if (d !== "default" && !(d in T)) {
8
- const u = Object.getOwnPropertyDescriptor(h, d);
9
- u && Object.defineProperty(T, d, u.get ? u : {
10
- enumerable: !0,
11
- get: () => h[d]
12
- });
13
- }
14
- }
15
- }
16
- return Object.freeze(Object.defineProperty(T, Symbol.toStringTag, { value: "Module" }));
17
- }
18
- var _ = { exports: {} };
19
- (function(T, L) {
20
- (function(f, h) {
21
- T.exports = h();
22
- })(window, function() {
23
- return function(f) {
24
- var h = {};
25
- function d(u) {
26
- if (h[u])
27
- return h[u].exports;
28
- var c = h[u] = { i: u, l: !1, exports: {} };
29
- return f[u].call(c.exports, c, c.exports, d), c.l = !0, c.exports;
30
- }
31
- return d.m = f, d.c = h, d.d = function(u, c, e) {
32
- d.o(u, c) || Object.defineProperty(u, c, { configurable: !1, enumerable: !0, get: e });
33
- }, d.r = function(u) {
34
- Object.defineProperty(u, "__esModule", { value: !0 });
35
- }, d.n = function(u) {
36
- var c = u && u.__esModule ? function() {
37
- return u.default;
38
- } : function() {
39
- return u;
40
- };
41
- return d.d(c, "a", c), c;
42
- }, d.o = function(u, c) {
43
- return Object.prototype.hasOwnProperty.call(u, c);
44
- }, d.p = "/", d(d.s = 41);
45
- }([function(f, h, d) {
46
- Object.defineProperty(h, "__esModule", { value: !0 });
47
- var u = /mobile/i.test(window.navigator.userAgent), c = { secondToTime: function(e) {
48
- var n = Math.floor(e / 3600), o = Math.floor((e - 3600 * n) / 60), s = Math.floor(e - 3600 * n - 60 * o);
49
- return (n > 0 ? [n, o, s] : [o, s]).map(function(t) {
50
- return t < 10 ? "0" + t : "" + t;
51
- }).join(":");
52
- }, getElementViewLeft: function(e) {
53
- 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;
60
- return n - s;
61
- }, getElementViewTop: function(e, n) {
62
- for (var o, s = e.offsetTop, t = e.offsetParent; t !== null; )
63
- s += t.offsetTop, t = t.offsetParent;
64
- return o = document.body.scrollTop + document.documentElement.scrollTop, n ? s : s - o;
65
- }, isMobile: u, storage: { set: function(e, n) {
66
- localStorage.setItem(e, n);
67
- }, get: function(e) {
68
- return localStorage.getItem(e);
69
- } }, nameMap: { dragStart: u ? "touchstart" : "mousedown", dragMove: u ? "touchmove" : "mousemove", dragEnd: u ? "touchend" : "mouseup" }, randomOrder: function(e) {
70
- return function(n) {
71
- for (var o = n.length - 1; o >= 0; o--) {
72
- var s = Math.floor(Math.random() * (o + 1)), t = n[s];
73
- n[s] = n[o], n[o] = t;
74
- }
75
- return n;
76
- }([].concat(function(n) {
77
- if (Array.isArray(n)) {
78
- for (var o = 0, s = Array(n.length); o < n.length; o++)
79
- s[o] = n[o];
80
- return s;
81
- }
82
- return Array.from(n);
83
- }(Array(e))).map(function(n, o) {
84
- return o;
85
- }));
86
- } };
87
- h.default = c;
88
- }, function(f, h, d) {
89
- var u = d(2);
90
- f.exports = function(c) {
91
- c = c || {};
92
- var e = "", n = u.$each, o = c.audio, s = (c.$value, c.$index, u.$escape), t = c.theme, i = c.index;
93
- return n(o, function(l, p) {
94
- e += `
95
- <li>
96
- <span class="aplayer-list-cur" style="background-color: `, e += s(l.theme || t), e += `;"></span>
97
- <span class="aplayer-list-index">`, e += s(p + i), e += `</span>
98
- <span class="aplayer-list-title">`, e += s(l.name), e += `</span>
99
- <span class="aplayer-list-author">`, e += s(l.artist), e += `</span>
100
- </li>
101
- `;
102
- }), e;
103
- };
104
- }, function(f, h, d) {
105
- f.exports = d(15);
106
- }, function(f, h, d) {
107
- Object.defineProperty(h, "__esModule", { value: !0 });
108
- var u = w(d(33)), c = w(d(32)), e = w(d(31)), n = w(d(30)), o = w(d(29)), s = w(d(28)), t = w(d(27)), i = w(d(26)), l = w(d(25)), p = w(d(24)), r = w(d(23)), y = w(d(22)), x = w(d(21)), g = w(d(20)), b = w(d(19));
109
- function w(a) {
110
- return a && a.__esModule ? a : { default: a };
111
- }
112
- var m = { play: u.default, pause: c.default, volumeUp: e.default, volumeDown: n.default, volumeOff: o.default, orderRandom: s.default, orderList: t.default, menu: i.default, loopAll: l.default, loopOne: p.default, loopNone: r.default, loading: y.default, right: x.default, skip: g.default, lrc: b.default };
113
- h.default = m;
114
- }, function(f, h, d) {
115
- var u, c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
116
- return typeof e;
117
- } : function(e) {
118
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
119
- };
120
- u = /* @__PURE__ */ function() {
121
- return this;
122
- }();
123
- try {
124
- u = u || Function("return this")() || (0, eval)("this");
125
- } catch {
126
- (typeof window > "u" ? "undefined" : c(window)) === "object" && (u = window);
127
- }
128
- f.exports = u;
129
- }, function(f, h, d) {
130
- var u, c, e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
131
- return typeof n;
132
- } : function(n) {
133
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
134
- };
135
- (c = typeof (u = function() {
136
- if ((typeof window > "u" ? "undefined" : e(window)) === "object" && document.querySelectorAll !== void 0 && window.pageYOffset !== void 0 && history.pushState !== void 0) {
137
- var n = function(t, i, l, p) {
138
- return l > p ? i : t + (i - t) * ((r = l / p) < 0.5 ? 4 * r * r * r : (r - 1) * (2 * r - 2) * (2 * r - 2) + 1);
139
- var r;
140
- }, o = function(t, i, l, p) {
141
- i = i || 500;
142
- 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);
149
- var x = Date.now(), g = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(b) {
150
- window.setTimeout(b, 15);
151
- };
152
- (function b() {
153
- var w = Date.now() - x;
154
- p !== window ? p.scrollTop = n(r, y, w, i) : window.scroll(0, n(r, y, w, i)), w > i ? typeof l == "function" && l(t) : g(b);
155
- })();
156
- }, s = function(t) {
157
- if (!t.defaultPrevented) {
158
- t.preventDefault(), location.hash !== this.hash && window.history.pushState(null, null, this.hash);
159
- var i = document.getElementById(this.hash.substring(1));
160
- if (!i)
161
- return;
162
- o(i, 500, function(l) {
163
- location.replace("#" + l.id);
164
- });
165
- }
166
- };
167
- 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);
170
- }), o;
171
- }
172
- }) == "function" ? u.call(h, d, h, f) : u) === void 0 || (f.exports = c);
173
- }, function(f, h, d) {
174
- Object.defineProperty(h, "__esModule", { value: !0 });
175
- var u = /* @__PURE__ */ function() {
176
- function t(i, l) {
177
- for (var p = 0; p < l.length; p++) {
178
- var r = l[p];
179
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(i, r.key, r);
180
- }
181
- }
182
- return function(i, l, p) {
183
- return l && t(i.prototype, l), p && t(i, p), i;
184
- };
185
- }(), c = o(d(1)), e = o(d(0)), n = o(d(5));
186
- function o(t) {
187
- return t && t.__esModule ? t : { default: t };
188
- }
189
- var s = function() {
190
- function t(i) {
191
- (function(l, p) {
192
- if (!(l instanceof p))
193
- throw new TypeError("Cannot call a class as a function");
194
- })(this, t), this.player = i, this.index = 0, this.audios = this.player.options.audio, this.bindEvents();
195
- }
196
- return u(t, [{ key: "bindEvents", value: function() {
197
- var i = this;
198
- this.player.template.list.addEventListener("click", function(l) {
199
- var p = void 0;
200
- p = l.target.tagName.toUpperCase() === "LI" ? l.target : l.target.parentElement;
201
- var r = parseInt(p.getElementsByClassName("aplayer-list-index")[0].innerHTML) - 1;
202
- r !== i.index ? (i.switch(r), i.player.play()) : i.player.toggle();
203
- });
204
- } }, { key: "show", value: function() {
205
- this.player.events.trigger("listshow"), this.player.template.list.classList.remove("aplayer-list-hide"), this.player.template.listOl.scrollTop = 33 * this.index;
206
- } }, { key: "hide", value: function() {
207
- this.player.events.trigger("listhide"), this.player.template.list.classList.add("aplayer-list-hide");
208
- } }, { key: "toggle", value: function() {
209
- this.player.template.list.classList.contains("aplayer-list-hide") ? this.show() : this.hide();
210
- } }, { key: "add", value: function(i) {
211
- this.player.events.trigger("listadd", { audios: i }), Object.prototype.toString.call(i) !== "[object Array]" && (i = [i]), i.map(function(r) {
212
- return r.name = r.name || r.title || "Audio name", r.artist = r.artist || r.author || "Audio artist", r.cover = r.cover || r.pic, r.type = r.type || "normal", r;
213
- });
214
- var l = !(this.audios.length > 1), p = this.audios.length === 0;
215
- 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
- } }, { 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();
226
- } }, { key: "switch", value: function(i) {
227
- if (this.player.events.trigger("listswitch", { index: i }), i !== void 0 && this.audios[i]) {
228
- this.index = i;
229
- var l = this.audios[this.index];
230
- this.player.template.pic.style.backgroundImage = l.cover ? "url('" + l.cover + "')" : "", this.player.theme(this.audios[this.index].theme || this.player.options.theme, this.index, !1), this.player.template.title.innerHTML = l.name, this.player.template.author.innerHTML = l.artist ? " - " + l.artist : "";
231
- var p = this.player.container.getElementsByClassName("aplayer-list-light")[0];
232
- p && p.classList.remove("aplayer-list-light"), this.player.container.querySelectorAll(".aplayer-list li")[this.index].classList.add("aplayer-list-light"), (0, n.default)(33 * this.index, 500, null, this.player.template.listOl), this.player.setAudio(l), this.player.lrc && this.player.lrc.switch(this.index), this.player.lrc && this.player.lrc.update(0), this.player.duration !== 1 && (this.player.template.dtime.innerHTML = e.default.secondToTime(this.player.duration));
233
- }
234
- } }, { key: "clear", value: function() {
235
- 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 = e.default.secondToTime(0);
236
- } }]), t;
237
- }();
238
- h.default = s;
239
- }, function(f, h, d) {
240
- Object.defineProperty(h, "__esModule", { value: !0 });
241
- var u = /* @__PURE__ */ function() {
242
- function e(n, o) {
243
- for (var s = 0; s < o.length; s++) {
244
- var t = o[s];
245
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
246
- }
247
- }
248
- return function(n, o, s) {
249
- return o && e(n.prototype, o), s && e(n, s), n;
250
- };
251
- }(), c = function() {
252
- function e() {
253
- (function(n, o) {
254
- if (!(n instanceof o))
255
- throw new TypeError("Cannot call a class as a function");
256
- })(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
- }
258
- return u(e, [{ key: "on", value: function(n, o) {
259
- this.type(n) && typeof o == "function" && (this.events[n] || (this.events[n] = []), this.events[n].push(o));
260
- } }, { 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);
264
- } }, { key: "type", value: function(n) {
265
- return this.playerEvents.indexOf(n) !== -1 ? "player" : this.audioEvents.indexOf(n) !== -1 ? "audio" : (console.error("Unknown event name: " + n), null);
266
- } }]), e;
267
- }();
268
- h.default = c;
269
- }, function(f, h, d) {
270
- Object.defineProperty(h, "__esModule", { value: !0 });
271
- var u = /* @__PURE__ */ function() {
272
- function e(n, o) {
273
- for (var s = 0; s < o.length; s++) {
274
- var t = o[s];
275
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
276
- }
277
- }
278
- return function(n, o, s) {
279
- return o && e(n.prototype, o), s && e(n, s), n;
280
- };
281
- }(), c = function() {
282
- function e(n) {
283
- (function(o, s) {
284
- if (!(o instanceof s))
285
- throw new TypeError("Cannot call a class as a function");
286
- })(this, e), this.player = n, window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(o) {
287
- window.setTimeout(o, 1e3 / 60);
288
- }, this.types = ["loading"], this.init();
289
- }
290
- return u(e, [{ key: "init", value: function() {
291
- var n = this;
292
- this.types.forEach(function(o) {
293
- n["init" + o + "Checker"]();
294
- });
295
- } }, { key: "initloadingChecker", value: function() {
296
- var n = this, o = 0, s = 0, t = !1;
297
- this.loadingChecker = setInterval(function() {
298
- n.enableloadingChecker && (s = n.player.audio.currentTime, t || s !== o || n.player.audio.paused || (n.player.container.classList.add("aplayer-loading"), t = !0), t && s > o && !n.player.audio.paused && (n.player.container.classList.remove("aplayer-loading"), t = !1), o = s);
299
- }, 100);
300
- } }, { key: "enable", value: function(n) {
301
- this["enable" + n + "Checker"] = !0, n === "fps" && this.initfpsChecker();
302
- } }, { key: "disable", value: function(n) {
303
- this["enable" + n + "Checker"] = !1;
304
- } }, { key: "destroy", value: function() {
305
- var n = this;
306
- this.types.forEach(function(o) {
307
- n["enable" + o + "Checker"] = !1, n[o + "Checker"] && clearInterval(n[o + "Checker"]);
308
- });
309
- } }]), e;
310
- }();
311
- h.default = c;
312
- }, function(f, h, d) {
313
- Object.defineProperty(h, "__esModule", { value: !0 });
314
- var u = /* @__PURE__ */ function() {
315
- function s(t, i) {
316
- for (var l = 0; l < i.length; l++) {
317
- var p = i[l];
318
- p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(t, p.key, p);
319
- }
320
- }
321
- return function(t, i, l) {
322
- return i && s(t.prototype, i), l && s(t, l), t;
323
- };
324
- }(), c = n(d(0)), e = n(d(3));
325
- function n(s) {
326
- return s && s.__esModule ? s : { default: s };
327
- }
328
- var o = function() {
329
- function s(t) {
330
- (function(i, l) {
331
- if (!(i instanceof l))
332
- throw new TypeError("Cannot call a class as a function");
333
- })(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
- }
335
- return u(s, [{ key: "initPlayButton", value: function() {
336
- var t = this;
337
- this.player.template.pic.addEventListener("click", function() {
338
- t.player.toggle();
339
- });
340
- } }, { key: "initPlayBar", value: function() {
341
- var t = this, i = function(p) {
342
- var r = ((p.clientX || p.changedTouches[0].clientX) - c.default.getElementViewLeft(t.player.template.barWrap)) / t.player.template.barWrap.clientWidth;
343
- r = Math.max(r, 0), r = Math.min(r, 1), t.player.bar.set("played", r, "width"), t.player.lrc && t.player.lrc.update(r * t.player.duration), t.player.template.ptime.innerHTML = c.default.secondToTime(r * t.player.duration);
344
- }, l = function p(r) {
345
- document.removeEventListener(c.default.nameMap.dragEnd, p), document.removeEventListener(c.default.nameMap.dragMove, i);
346
- var y = ((r.clientX || r.changedTouches[0].clientX) - c.default.getElementViewLeft(t.player.template.barWrap)) / t.player.template.barWrap.clientWidth;
347
- y = Math.max(y, 0), y = Math.min(y, 1), t.player.bar.set("played", y, "width"), t.player.seek(t.player.bar.get("played", "width") * t.player.duration), t.player.disableTimeupdate = !1;
348
- };
349
- this.player.template.barWrap.addEventListener(c.default.nameMap.dragStart, function() {
350
- t.player.disableTimeupdate = !0, document.addEventListener(c.default.nameMap.dragMove, i), document.addEventListener(c.default.nameMap.dragEnd, l);
351
- });
352
- } }, { key: "initVolumeButton", value: function() {
353
- var t = this;
354
- this.player.template.volumeButton.addEventListener("click", function() {
355
- t.player.audio.muted ? (t.player.audio.muted = !1, t.player.switchVolumeIcon(), t.player.bar.set("volume", t.player.volume(), "height")) : (t.player.audio.muted = !0, t.player.switchVolumeIcon(), t.player.bar.set("volume", 0, "height"));
356
- });
357
- var i = function(p) {
358
- var r = 1 - ((p.clientY || p.changedTouches[0].clientY) - c.default.getElementViewTop(t.player.template.volumeBar, t.player.options.fixed)) / t.player.template.volumeBar.clientHeight;
359
- r = Math.max(r, 0), r = Math.min(r, 1), t.player.volume(r);
360
- }, l = function p(r) {
361
- t.player.template.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"), document.removeEventListener(c.default.nameMap.dragEnd, p), document.removeEventListener(c.default.nameMap.dragMove, i);
362
- var y = 1 - ((r.clientY || r.changedTouches[0].clientY) - c.default.getElementViewTop(t.player.template.volumeBar, t.player.options.fixed)) / t.player.template.volumeBar.clientHeight;
363
- y = Math.max(y, 0), y = Math.min(y, 1), t.player.volume(y);
364
- };
365
- this.player.template.volumeBarWrap.addEventListener(c.default.nameMap.dragStart, function() {
366
- t.player.template.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"), document.addEventListener(c.default.nameMap.dragMove, i), document.addEventListener(c.default.nameMap.dragEnd, l);
367
- });
368
- } }, { key: "initOrderButton", value: function() {
369
- var t = this;
370
- this.player.template.order.addEventListener("click", function() {
371
- t.player.options.order === "list" ? (t.player.options.order = "random", t.player.template.order.innerHTML = e.default.orderRandom) : t.player.options.order === "random" && (t.player.options.order = "list", t.player.template.order.innerHTML = e.default.orderList);
372
- });
373
- } }, { key: "initLoopButton", value: function() {
374
- var t = this;
375
- this.player.template.loop.addEventListener("click", function() {
376
- t.player.list.audios.length > 1 ? t.player.options.loop === "one" ? (t.player.options.loop = "none", t.player.template.loop.innerHTML = e.default.loopNone) : t.player.options.loop === "none" ? (t.player.options.loop = "all", t.player.template.loop.innerHTML = e.default.loopAll) : t.player.options.loop === "all" && (t.player.options.loop = "one", t.player.template.loop.innerHTML = e.default.loopOne) : t.player.options.loop === "one" || t.player.options.loop === "all" ? (t.player.options.loop = "none", t.player.template.loop.innerHTML = e.default.loopNone) : t.player.options.loop === "none" && (t.player.options.loop = "all", t.player.template.loop.innerHTML = e.default.loopAll);
377
- });
378
- } }, { key: "initMenuButton", value: function() {
379
- var t = this;
380
- this.player.template.menu.addEventListener("click", function() {
381
- t.player.list.toggle();
382
- });
383
- } }, { key: "initMiniSwitcher", value: function() {
384
- var t = this;
385
- this.player.template.miniSwitcher.addEventListener("click", function() {
386
- t.player.setMode(t.player.mode === "mini" ? "normal" : "mini");
387
- });
388
- } }, { key: "initSkipButton", value: function() {
389
- var t = this;
390
- this.player.template.skipBackButton.addEventListener("click", function() {
391
- t.player.skipBack();
392
- }), this.player.template.skipForwardButton.addEventListener("click", function() {
393
- t.player.skipForward();
394
- }), this.player.template.skipPlayButton.addEventListener("click", function() {
395
- t.player.toggle();
396
- });
397
- } }, { key: "initLrcButton", value: function() {
398
- var t = this;
399
- this.player.template.lrcButton.addEventListener("click", function() {
400
- t.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity") ? (t.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"), t.player.lrc && t.player.lrc.show()) : (t.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"), t.player.lrc && t.player.lrc.hide());
401
- });
402
- } }]), s;
403
- }();
404
- h.default = o;
405
- }, function(f, h, d) {
406
- var u = d(2);
407
- f.exports = function(c) {
408
- c = c || {};
409
- var e = "", n = u.$each, o = c.lyrics, s = (c.$value, c.$index, u.$escape);
410
- return n(o, function(t, i) {
411
- e += `
412
- <p`, i === 0 && (e += ' class="aplayer-lrc-current"'), e += ">", e += s(t[1]), e += `</p>
413
- `;
414
- }), e;
415
- };
416
- }, function(f, h, d) {
417
- Object.defineProperty(h, "__esModule", { value: !0 });
418
- var u, c = /* @__PURE__ */ function() {
419
- function s(t, i) {
420
- for (var l = 0; l < i.length; l++) {
421
- var p = i[l];
422
- p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(t, p.key, p);
423
- }
424
- }
425
- return function(t, i, l) {
426
- return i && s(t.prototype, i), l && s(t, l), t;
427
- };
428
- }(), e = d(10), n = (u = e) && u.__esModule ? u : { default: u }, o = function() {
429
- function s(t) {
430
- (function(i, l) {
431
- if (!(i instanceof l))
432
- throw new TypeError("Cannot call a class as a function");
433
- })(this, s), this.container = t.container, this.async = t.async, this.player = t.player, this.parsed = [], this.index = 0, this.current = [];
434
- }
435
- return c(s, [{ key: "show", value: function() {
436
- this.player.events.trigger("lrcshow"), this.player.template.lrcWrap.classList.remove("aplayer-lrc-hide");
437
- } }, { key: "hide", value: function() {
438
- this.player.events.trigger("lrchide"), this.player.template.lrcWrap.classList.add("aplayer-lrc-hide");
439
- } }, { key: "toggle", value: function() {
440
- this.player.template.lrcWrap.classList.contains("aplayer-lrc-hide") ? this.show() : this.hide();
441
- } }, { key: "update", value: function() {
442
- 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"));
446
- } }, { key: "switch", value: function(t) {
447
- 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"]];
459
- this.container.innerHTML = (0, n.default)({ lyrics: this.parsed[t] }), this.update(0), this.current = this.parsed[t];
460
- } }, { key: "parse", value: function(t) {
461
- if (t) {
462
- for (var i = (t = t.replace(/([^\]^\n])\[/g, function(a, v) {
463
- return v + `
464
- [`;
465
- })).split(`
466
- `), l = [], p = i.length, r = 0; r < p; r++) {
467
- 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
- }
473
- }
474
- return (l = l.filter(function(a) {
475
- return a[1];
476
- })).sort(function(a, v) {
477
- return a[0] - v[0];
478
- }), l;
479
- }
480
- return [];
481
- } }, { key: "remove", value: function(t) {
482
- this.parsed.splice(t, 1);
483
- } }, { key: "clear", value: function() {
484
- this.parsed = [], this.container.innerHTML = "";
485
- } }]), s;
486
- }();
487
- h.default = o;
488
- }, function(f, h, d) {
489
- Object.defineProperty(h, "__esModule", { value: !0 });
490
- var u, c = /* @__PURE__ */ function() {
491
- function s(t, i) {
492
- for (var l = 0; l < i.length; l++) {
493
- var p = i[l];
494
- p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(t, p.key, p);
495
- }
496
- }
497
- return function(t, i, l) {
498
- return i && s(t.prototype, i), l && s(t, l), t;
499
- };
500
- }(), e = d(0), n = (u = e) && u.__esModule ? u : { default: u }, o = function() {
501
- function s(t) {
502
- (function(i, l) {
503
- if (!(i instanceof l))
504
- throw new TypeError("Cannot call a class as a function");
505
- })(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
- }
507
- return c(s, [{ key: "get", value: function(t) {
508
- return this.data[t];
509
- } }, { key: "set", value: function(t, i) {
510
- this.data[t] = i, n.default.storage.set(this.storageName, JSON.stringify(this.data));
511
- } }]), s;
512
- }();
513
- h.default = o;
514
- }, function(f, h, d) {
515
- Object.defineProperty(h, "__esModule", { value: !0 });
516
- var u = /* @__PURE__ */ function() {
517
- function e(n, o) {
518
- for (var s = 0; s < o.length; s++) {
519
- var t = o[s];
520
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
521
- }
522
- }
523
- return function(n, o, s) {
524
- return o && e(n.prototype, o), s && e(n, s), n;
525
- };
526
- }(), c = function() {
527
- function e(n) {
528
- (function(o, s) {
529
- if (!(o instanceof s))
530
- throw new TypeError("Cannot call a class as a function");
531
- })(this, e), this.elements = {}, this.elements.volume = n.volume, this.elements.played = n.played, this.elements.loaded = n.loaded;
532
- }
533
- return u(e, [{ key: "set", value: function(n, o, s) {
534
- o = Math.max(o, 0), o = Math.min(o, 1), this.elements[n].style[s] = 100 * o + "%";
535
- } }, { key: "get", value: function(n, o) {
536
- return parseFloat(this.elements[n].style[o]) / 100;
537
- } }]), e;
538
- }();
539
- h.default = c;
540
- }, function(f, h, d) {
541
- (function(u) {
542
- f.exports = !1;
543
- try {
544
- f.exports = Object.prototype.toString.call(u.process) === "[object process]";
545
- } catch {
546
- }
547
- }).call(this, d(4));
548
- }, function(f, h, d) {
549
- (function(u) {
550
- var c = d(14), e = Object.create(c ? u : window), n = /["&'<>]/;
551
- e.$escape = function(o) {
552
- return function(s) {
553
- var t = "" + s, i = n.exec(t);
554
- if (!i)
555
- return s;
556
- var l = "", p = void 0, r = void 0, y = void 0;
557
- for (p = i.index, r = 0; p < t.length; p++) {
558
- switch (t.charCodeAt(p)) {
559
- case 34:
560
- y = "&#34;";
561
- break;
562
- case 38:
563
- y = "&#38;";
564
- break;
565
- case 39:
566
- y = "&#39;";
567
- break;
568
- case 60:
569
- y = "&#60;";
570
- break;
571
- case 62:
572
- y = "&#62;";
573
- break;
574
- default:
575
- continue;
576
- }
577
- r !== p && (l += t.substring(r, p)), r = p + 1, l += y;
578
- }
579
- return r !== p ? l + t.substring(r, p) : l;
580
- }(function s(t) {
581
- return typeof t != "string" && (t = t == null ? "" : typeof t == "function" ? s(t.call(t)) : JSON.stringify(t)), t;
582
- }(o));
583
- }, 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);
590
- }, f.exports = e;
591
- }).call(this, d(4));
592
- }, function(f, h, d) {
593
- var u = d(2);
594
- f.exports = function(c) {
595
- var e = "", n = (c = c || {}).options, o = c.cover, s = u.$escape, t = c.icons, i = function(p) {
596
- return e += p;
597
- }, l = c.getObject;
598
- return c.theme, c.audio, c.index, n.fixed ? (e += `
599
- <div class="aplayer-list`, n.listFolded && (e += " aplayer-list-hide"), e += '"', n.listMaxHeight && (e += ' style="max-height: ', e += s(n.listMaxHeight), e += '"'), e += `>
600
- <ol`, n.listMaxHeight && (e += ' style="max-height: ', e += s(n.listMaxHeight), e += '"'), e += `>
601
- `, i(d(1)(l({ theme: n.theme, audio: n.audio, index: 1 }))), e += `
602
- </ol>
603
- </div>
604
- <div class="aplayer-body">
605
- <div class="aplayer-pic" style="`, o && (e += "background-image: url(&quot;", e += s(o), e += "&quot;);"), e += "background-color: ", e += s(n.theme), e += `;">
606
- <div class="aplayer-button aplayer-play">`, e += t.play, e += `</div>
607
- </div>
608
- <div class="aplayer-info" style="display: none;">
609
- <div class="aplayer-music">
610
- <span class="aplayer-title">No audio</span>
611
- <span class="aplayer-author"></span>
612
- </div>
613
- <div class="aplayer-controller">
614
- <div class="aplayer-bar-wrap">
615
- <div class="aplayer-bar">
616
- <div class="aplayer-loaded" style="width: 0"></div>
617
- <div class="aplayer-played" style="width: 0; background: `, e += s(n.theme), e += `;">
618
- <span class="aplayer-thumb" style="background: `, e += s(n.theme), e += `;">
619
- <span class="aplayer-loading-icon">`, e += t.loading, e += `</span>
620
- </span>
621
- </div>
622
- </div>
623
- </div>
624
- <div class="aplayer-time">
625
- <span class="aplayer-time-inner">
626
- <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>
627
- </span>
628
- <span class="aplayer-icon aplayer-icon-back">
629
- `, e += t.skip, e += `
630
- </span>
631
- <span class="aplayer-icon aplayer-icon-play">
632
- `, e += t.play, e += `
633
- </span>
634
- <span class="aplayer-icon aplayer-icon-forward">
635
- `, e += t.skip, e += `
636
- </span>
637
- <div class="aplayer-volume-wrap">
638
- <button type="button" class="aplayer-icon aplayer-icon-volume-down">
639
- `, e += t.volumeDown, e += `
640
- </button>
641
- <div class="aplayer-volume-bar-wrap">
642
- <div class="aplayer-volume-bar">
643
- <div class="aplayer-volume" style="height: 80%; background: `, e += s(n.theme), e += `;"></div>
644
- </div>
645
- </div>
646
- </div>
647
- <button type="button" class="aplayer-icon aplayer-icon-order">
648
- `, n.order === "list" ? e += t.orderList : n.order === "random" && (e += t.orderRandom), e += `
649
- </button>
650
- <button type="button" class="aplayer-icon aplayer-icon-loop">
651
- `, n.loop === "one" ? e += t.loopOne : n.loop === "all" ? e += t.loopAll : n.loop === "none" && (e += t.loopNone), e += `
652
- </button>
653
- <button type="button" class="aplayer-icon aplayer-icon-menu">
654
- `, e += t.menu, e += `
655
- </button>
656
- <button type="button" class="aplayer-icon aplayer-icon-lrc">
657
- `, e += t.lrc, e += `
658
- </button>
659
- </div>
660
- </div>
661
- </div>
662
- <div class="aplayer-notice"></div>
663
- <div class="aplayer-miniswitcher"><button class="aplayer-icon">`, e += t.right, e += `</button></div>
664
- </div>
665
- <div class="aplayer-lrc">
666
- <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>
667
- </div>
668
- `) : (e += `
669
- <div class="aplayer-body">
670
- <div class="aplayer-pic" style="`, o && (e += "background-image: url(&quot;", e += s(o), e += "&quot;);"), e += "background-color: ", e += s(n.theme), e += `;">
671
- <div class="aplayer-button aplayer-play">`, e += t.play, e += `</div>
672
- </div>
673
- <div class="aplayer-info">
674
- <div class="aplayer-music">
675
- <span class="aplayer-title">No audio</span>
676
- <span class="aplayer-author"></span>
677
- </div>
678
- <div class="aplayer-lrc">
679
- <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>
680
- </div>
681
- <div class="aplayer-controller">
682
- <div class="aplayer-bar-wrap">
683
- <div class="aplayer-bar">
684
- <div class="aplayer-loaded" style="width: 0"></div>
685
- <div class="aplayer-played" style="width: 0; background: `, e += s(n.theme), e += `;">
686
- <span class="aplayer-thumb" style="background: `, e += s(n.theme), e += `;">
687
- <span class="aplayer-loading-icon">`, e += t.loading, e += `</span>
688
- </span>
689
- </div>
690
- </div>
691
- </div>
692
- <div class="aplayer-time">
693
- <span class="aplayer-time-inner">
694
- <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>
695
- </span>
696
- <span class="aplayer-icon aplayer-icon-back">
697
- `, e += t.skip, e += `
698
- </span>
699
- <span class="aplayer-icon aplayer-icon-play">
700
- `, e += t.play, e += `
701
- </span>
702
- <span class="aplayer-icon aplayer-icon-forward">
703
- `, e += t.skip, e += `
704
- </span>
705
- <div class="aplayer-volume-wrap">
706
- <button type="button" class="aplayer-icon aplayer-icon-volume-down">
707
- `, e += t.volumeDown, e += `
708
- </button>
709
- <div class="aplayer-volume-bar-wrap">
710
- <div class="aplayer-volume-bar">
711
- <div class="aplayer-volume" style="height: 80%; background: `, e += s(n.theme), e += `;"></div>
712
- </div>
713
- </div>
714
- </div>
715
- <button type="button" class="aplayer-icon aplayer-icon-order">
716
- `, n.order === "list" ? e += t.orderList : n.order === "random" && (e += t.orderRandom), e += `
717
- </button>
718
- <button type="button" class="aplayer-icon aplayer-icon-loop">
719
- `, n.loop === "one" ? e += t.loopOne : n.loop === "all" ? e += t.loopAll : n.loop === "none" && (e += t.loopNone), e += `
720
- </button>
721
- <button type="button" class="aplayer-icon aplayer-icon-menu">
722
- `, e += t.menu, e += `
723
- </button>
724
- <button type="button" class="aplayer-icon aplayer-icon-lrc">
725
- `, e += t.lrc, e += `
726
- </button>
727
- </div>
728
- </div>
729
- </div>
730
- <div class="aplayer-notice"></div>
731
- <div class="aplayer-miniswitcher"><button class="aplayer-icon">`, e += t.right, e += `</button></div>
732
- </div>
733
- <div class="aplayer-list`, n.listFolded && (e += " aplayer-list-hide"), e += '"', n.listMaxHeight && (e += ' style="max-height: ', e += s(n.listMaxHeight), e += '"'), e += `>
734
- <ol`, n.listMaxHeight && (e += ' style="max-height: ', e += s(n.listMaxHeight), e += '"'), e += `>
735
- `, i(d(1)(l({ theme: n.theme, audio: n.audio, index: 1 }))), e += `
736
- </ol>
737
- </div>
738
- `), e;
739
- };
740
- }, function(f, h, d) {
741
- Object.defineProperty(h, "__esModule", { value: !0 });
742
- var u = /* @__PURE__ */ function() {
743
- function s(t, i) {
744
- for (var l = 0; l < i.length; l++) {
745
- var p = i[l];
746
- p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(t, p.key, p);
747
- }
748
- }
749
- return function(t, i, l) {
750
- return i && s(t.prototype, i), l && s(t, l), t;
751
- };
752
- }(), c = n(d(3)), e = n(d(16));
753
- function n(s) {
754
- return s && s.__esModule ? s : { default: s };
755
- }
756
- var o = function() {
757
- function s(t) {
758
- (function(i, l) {
759
- if (!(i instanceof l))
760
- throw new TypeError("Cannot call a class as a function");
761
- })(this, s), this.container = t.container, this.options = t.options, this.randomOrder = t.randomOrder, this.init();
762
- }
763
- return u(s, [{ key: "init", value: function() {
764
- var t = "";
765
- this.options.audio.length && (t = this.options.order === "random" ? this.options.audio[this.randomOrder[0]].cover : this.options.audio[0].cover), this.container.innerHTML = (0, e.default)({ options: this.options, icons: c.default, cover: t, getObject: function(i) {
766
- return i;
767
- } }), 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");
768
- } }]), s;
769
- }();
770
- h.default = o;
771
- }, function(f, h, d) {
772
- Object.defineProperty(h, "__esModule", { value: !0 }), h.default = function(u) {
773
- 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]);
776
- return Object.prototype.toString.call(u.audio) !== "[object Array]" && (u.audio = [u.audio]), u.audio.map(function(n) {
777
- 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
- }), u.audio.length <= 1 && u.loop === "one" && (u.loop = "all"), u;
779
- };
780
- }, function(f, h) {
781
- f.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>';
782
- }, function(f, h) {
783
- f.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>';
784
- }, function(f, h) {
785
- f.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>';
786
- }, function(f, h) {
787
- f.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>';
788
- }, function(f, h) {
789
- f.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>';
790
- }, function(f, h) {
791
- f.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>';
792
- }, function(f, h) {
793
- f.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>';
794
- }, function(f, h) {
795
- f.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>';
796
- }, function(f, h) {
797
- f.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>';
798
- }, function(f, h) {
799
- f.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>';
800
- }, function(f, h) {
801
- f.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>';
802
- }, function(f, h) {
803
- f.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>';
804
- }, function(f, h) {
805
- f.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>';
806
- }, function(f, h) {
807
- f.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>';
808
- }, function(f, h) {
809
- f.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>';
810
- }, function(f, h, d) {
811
- var u, c, e = f.exports = {};
812
- function n() {
813
- throw new Error("setTimeout has not been defined");
814
- }
815
- function o() {
816
- throw new Error("clearTimeout has not been defined");
817
- }
818
- 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);
823
- try {
824
- return u(b, 0);
825
- } catch {
826
- try {
827
- return u.call(null, b, 0);
828
- } catch {
829
- return u.call(this, b, 0);
830
- }
831
- }
832
- }
833
- (function() {
834
- try {
835
- u = typeof setTimeout == "function" ? setTimeout : n;
836
- } catch {
837
- u = n;
838
- }
839
- try {
840
- c = typeof clearTimeout == "function" ? clearTimeout : o;
841
- } catch {
842
- c = o;
843
- }
844
- })();
845
- var t, i = [], l = !1, p = -1;
846
- function r() {
847
- l && t && (l = !1, t.length ? i = t.concat(i) : p = -1, i.length && y());
848
- }
849
- function y() {
850
- if (!l) {
851
- var b = s(r);
852
- l = !0;
853
- for (var w = i.length; w; ) {
854
- for (t = i, i = []; ++p < w; )
855
- t && t[p].run();
856
- p = -1, w = i.length;
857
- }
858
- 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);
863
- try {
864
- c(m);
865
- } catch {
866
- try {
867
- return c.call(null, m);
868
- } catch {
869
- return c.call(this, m);
870
- }
871
- }
872
- }(b);
873
- }
874
- }
875
- function x(b, w) {
876
- this.fun = b, this.array = w;
877
- }
878
- function g() {
879
- }
880
- e.nextTick = function(b) {
881
- 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];
885
- i.push(new x(b, w)), i.length !== 1 || l || s(y);
886
- }, x.prototype.run = function() {
887
- this.fun.apply(null, this.array);
888
- }, e.title = "browser", e.browser = !0, e.env = {}, e.argv = [], e.version = "", e.versions = {}, e.on = g, e.addListener = g, e.once = g, e.off = g, e.removeListener = g, e.removeAllListeners = g, e.emit = g, e.prependListener = g, e.prependOnceListener = g, e.listeners = function(b) {
889
- return [];
890
- }, e.binding = function(b) {
891
- throw new Error("process.binding is not supported");
892
- }, e.cwd = function() {
893
- return "/";
894
- }, e.chdir = function(b) {
895
- throw new Error("process.chdir is not supported");
896
- }, e.umask = function() {
897
- return 0;
898
- };
899
- }, function(f, h, d) {
900
- (function(u, c) {
901
- (function(e, n) {
902
- if (!e.setImmediate) {
903
- var o, s, t, i, l, p = 1, r = {}, y = !1, x = e.document, g = Object.getPrototypeOf && Object.getPrototypeOf(e);
904
- g = g && g.setTimeout ? g : e, {}.toString.call(e.process) === "[object process]" ? o = function(m) {
905
- c.nextTick(function() {
906
- w(m);
907
- });
908
- } : function() {
909
- if (e.postMessage && !e.importScripts) {
910
- var m = !0, a = e.onmessage;
911
- return e.onmessage = function() {
912
- m = !1;
913
- }, e.postMessage("", "*"), e.onmessage = a, m;
914
- }
915
- }() ? (i = "setImmediate$" + Math.random() + "$", l = function(m) {
916
- m.source === e && typeof m.data == "string" && m.data.indexOf(i) === 0 && w(+m.data.slice(i.length));
917
- }, e.addEventListener ? e.addEventListener("message", l, !1) : e.attachEvent("onmessage", l), o = function(m) {
918
- e.postMessage(i + m, "*");
919
- }) : e.MessageChannel ? ((t = new MessageChannel()).port1.onmessage = function(m) {
920
- w(m.data);
921
- }, o = function(m) {
922
- t.port2.postMessage(m);
923
- }) : x && "onreadystatechange" in x.createElement("script") ? (s = x.documentElement, o = function(m) {
924
- var a = x.createElement("script");
925
- a.onreadystatechange = function() {
926
- w(m), a.onreadystatechange = null, s.removeChild(a), a = null;
927
- }, s.appendChild(a);
928
- }) : o = function(m) {
929
- setTimeout(w, 0, m);
930
- }, g.setImmediate = function(m) {
931
- 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];
934
- var k = { callback: m, args: a };
935
- return r[p] = k, o(p), p++;
936
- }, g.clearImmediate = b;
937
- }
938
- function b(m) {
939
- delete r[m];
940
- }
941
- function w(m) {
942
- if (y)
943
- setTimeout(w, 0, m);
944
- else {
945
- var a = r[m];
946
- if (a) {
947
- y = !0;
948
- try {
949
- (function(v) {
950
- var k = v.callback, M = v.args;
951
- switch (M.length) {
952
- case 0:
953
- k();
954
- break;
955
- case 1:
956
- k(M[0]);
957
- break;
958
- case 2:
959
- k(M[0], M[1]);
960
- break;
961
- case 3:
962
- k(M[0], M[1], M[2]);
963
- break;
964
- default:
965
- k.apply(n, M);
966
- }
967
- })(a);
968
- } finally {
969
- b(m), y = !1;
970
- }
971
- }
972
- }
973
- }
974
- })(typeof self > "u" ? u === void 0 ? void 0 : u : self);
975
- }).call(this, d(4), d(34));
976
- }, function(f, h, d) {
977
- var u = Function.prototype.apply;
978
- function c(e, n) {
979
- this._id = e, this._clearFn = n;
980
- }
981
- h.setTimeout = function() {
982
- return new c(u.call(setTimeout, window, arguments), clearTimeout);
983
- }, h.setInterval = function() {
984
- return new c(u.call(setInterval, window, arguments), clearInterval);
985
- }, h.clearTimeout = h.clearInterval = function(e) {
986
- e && e.close();
987
- }, c.prototype.unref = c.prototype.ref = function() {
988
- }, c.prototype.close = function() {
989
- this._clearFn.call(window, this._id);
990
- }, h.enroll = function(e, n) {
991
- clearTimeout(e._idleTimeoutId), e._idleTimeout = n;
992
- }, h.unenroll = function(e) {
993
- clearTimeout(e._idleTimeoutId), e._idleTimeout = -1;
994
- }, h._unrefActive = h.active = function(e) {
995
- clearTimeout(e._idleTimeoutId);
996
- var n = e._idleTimeout;
997
- n >= 0 && (e._idleTimeoutId = setTimeout(function() {
998
- e._onTimeout && e._onTimeout();
999
- }, n));
1000
- }, d(35), h.setImmediate = setImmediate, h.clearImmediate = clearImmediate;
1001
- }, function(f, h, d) {
1002
- (function(u) {
1003
- var c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
1004
- return typeof r;
1005
- } : function(r) {
1006
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
1007
- }, e = setTimeout;
1008
- function n() {
1009
- }
1010
- 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");
1015
- this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], p(r, this);
1016
- }
1017
- function s(r, y) {
1018
- for (; r._state === 3; )
1019
- r = r._value;
1020
- r._state !== 0 ? (r._handled = !0, o._immediateFn(function() {
1021
- var x = r._state === 1 ? y.onFulfilled : y.onRejected;
1022
- if (x !== null) {
1023
- var g;
1024
- try {
1025
- g = x(r._value);
1026
- } catch (b) {
1027
- return void i(y.promise, b);
1028
- }
1029
- t(y.promise, g);
1030
- } else
1031
- (r._state === 1 ? t : i)(y.promise, r._value);
1032
- })) : r._deferreds.push(y);
1033
- }
1034
- function t(r, y) {
1035
- try {
1036
- if (y === r)
1037
- throw new TypeError("A promise cannot be resolved with itself.");
1038
- if (y && ((y === void 0 ? "undefined" : c(y)) === "object" || typeof y == "function")) {
1039
- 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);
1046
- }
1047
- r._state = 1, r._value = y, l(r);
1048
- } catch (w) {
1049
- i(r, w);
1050
- }
1051
- var g, b;
1052
- }
1053
- function i(r, y) {
1054
- r._state = 2, r._value = y, l(r);
1055
- }
1056
- function l(r) {
1057
- r._state === 2 && r._deferreds.length === 0 && o._immediateFn(function() {
1058
- r._handled || o._unhandledRejectionFn(r._value);
1059
- });
1060
- for (var y = 0, x = r._deferreds.length; y < x; y++)
1061
- s(r, r._deferreds[y]);
1062
- r._deferreds = null;
1063
- }
1064
- function p(r, y) {
1065
- var x = !1;
1066
- try {
1067
- r(function(g) {
1068
- x || (x = !0, t(y, g));
1069
- }, function(g) {
1070
- x || (x = !0, i(y, g));
1071
- });
1072
- } catch (g) {
1073
- if (x)
1074
- return;
1075
- x = !0, i(y, g);
1076
- }
1077
- }
1078
- o.prototype.catch = function(r) {
1079
- return this.then(null, r);
1080
- }, o.prototype.then = function(r, y) {
1081
- var x = new this.constructor(n);
1082
- return s(this, new function(g, b, w) {
1083
- this.onFulfilled = typeof g == "function" ? g : null, this.onRejected = typeof b == "function" ? b : null, this.promise = w;
1084
- }(r, y, x)), x;
1085
- }, o.prototype.finally = function(r) {
1086
- var y = this.constructor;
1087
- return this.then(function(x) {
1088
- return y.resolve(r()).then(function() {
1089
- return x;
1090
- });
1091
- }, function(x) {
1092
- return y.resolve(r()).then(function() {
1093
- return y.reject(x);
1094
- });
1095
- });
1096
- }, o.all = function(r) {
1097
- return new o(function(y, x) {
1098
- if (!r || r.length === void 0)
1099
- throw new TypeError("Promise.all accepts an array");
1100
- var g = Array.prototype.slice.call(r);
1101
- if (g.length === 0)
1102
- return y([]);
1103
- var b = g.length;
1104
- function w(a, v) {
1105
- try {
1106
- if (v && ((v === void 0 ? "undefined" : c(v)) === "object" || typeof v == "function")) {
1107
- var k = v.then;
1108
- if (typeof k == "function")
1109
- return void k.call(v, function(M) {
1110
- w(a, M);
1111
- }, x);
1112
- }
1113
- g[a] = v, --b == 0 && y(g);
1114
- } catch (M) {
1115
- x(M);
1116
- }
1117
- }
1118
- for (var m = 0; m < g.length; m++)
1119
- w(m, g[m]);
1120
- });
1121
- }, o.resolve = function(r) {
1122
- return r && (r === void 0 ? "undefined" : c(r)) === "object" && r.constructor === o ? r : new o(function(y) {
1123
- y(r);
1124
- });
1125
- }, o.reject = function(r) {
1126
- return new o(function(y, x) {
1127
- x(r);
1128
- });
1129
- }, o.race = function(r) {
1130
- return new o(function(y, x) {
1131
- for (var g = 0, b = r.length; g < b; g++)
1132
- r[g].then(y, x);
1133
- });
1134
- }, o._immediateFn = typeof u == "function" && function(r) {
1135
- u(r);
1136
- } || function(r) {
1137
- e(r, 0);
1138
- }, o._unhandledRejectionFn = function(r) {
1139
- typeof console < "u" && console && console.warn("Possible Unhandled Promise Rejection:", r);
1140
- }, f.exports = o;
1141
- }).call(this, d(36).setImmediate);
1142
- }, function(f, h, d) {
1143
- Object.defineProperty(h, "__esModule", { value: !0 });
1144
- var u = /* @__PURE__ */ function() {
1145
- function m(a, v) {
1146
- for (var k = 0; k < v.length; k++) {
1147
- var M = v[k];
1148
- M.enumerable = M.enumerable || !1, M.configurable = !0, "value" in M && (M.writable = !0), Object.defineProperty(a, M.key, M);
1149
- }
1150
- }
1151
- return function(a, v, k) {
1152
- return v && m(a.prototype, v), k && m(a, k), a;
1153
- };
1154
- }(), c = g(d(37)), e = g(d(0)), n = g(d(3)), o = g(d(18)), s = g(d(17)), t = g(d(13)), i = g(d(12)), l = g(d(11)), p = g(d(9)), r = g(d(8)), y = g(d(7)), x = g(d(6));
1155
- function g(m) {
1156
- return m && m.__esModule ? m : { default: m };
1157
- }
1158
- var b = [], w = function() {
1159
- function m(a) {
1160
- 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);
1166
- 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
- }
1168
- return u(m, [{ key: "initAudio", value: function() {
1169
- var a = this;
1170
- this.audio = document.createElement("audio"), this.audio.preload = this.options.preload;
1171
- for (var v = function(M) {
1172
- a.audio.addEventListener(a.events.audioEvents[M], function(q) {
1173
- a.events.trigger(a.events.audioEvents[M], q);
1174
- });
1175
- }, k = 0; k < this.events.audioEvents.length; k++)
1176
- v(k);
1177
- this.volume(this.storage.get("volume"), !0);
1178
- } }, { key: "bindEvents", value: function() {
1179
- var a = this;
1180
- this.on("play", function() {
1181
- a.paused && a.setUIPlaying();
1182
- }), this.on("pause", function() {
1183
- a.paused || a.setUIPaused();
1184
- }), this.on("timeupdate", function() {
1185
- if (!a.disableTimeupdate) {
1186
- a.bar.set("played", a.audio.currentTime / a.duration, "width"), a.lrc && a.lrc.update();
1187
- var k = e.default.secondToTime(a.audio.currentTime);
1188
- a.template.ptime.innerHTML !== k && (a.template.ptime.innerHTML = k);
1189
- }
1190
- }), this.on("durationchange", function() {
1191
- a.duration !== 1 && (a.template.dtime.innerHTML = e.default.secondToTime(a.duration));
1192
- }), this.on("progress", function() {
1193
- var k = a.audio.buffered.length ? a.audio.buffered.end(a.audio.buffered.length - 1) / a.duration : 0;
1194
- a.bar.set("loaded", k, "width");
1195
- });
1196
- var v = void 0;
1197
- this.on("error", function() {
1198
- a.list.audios.length > 1 ? (a.notice("An audio error has occurred, player will skip forward in 2 seconds."), v = setTimeout(function() {
1199
- a.skipForward(), a.paused || a.play();
1200
- }, 2e3)) : a.list.audios.length === 1 && a.notice("An audio error has occurred.");
1201
- }), this.events.on("listswitch", function() {
1202
- v && clearTimeout(v);
1203
- }), this.on("ended", function() {
1204
- a.options.loop === "none" ? a.options.order === "list" ? a.list.index < a.list.audios.length - 1 ? (a.list.switch((a.list.index + 1) % a.list.audios.length), a.play()) : (a.list.switch((a.list.index + 1) % a.list.audios.length), a.pause()) : a.options.order === "random" && (a.randomOrder.indexOf(a.list.index) < a.randomOrder.length - 1 ? (a.list.switch(a.nextIndex()), a.play()) : (a.list.switch(a.nextIndex()), a.pause())) : a.options.loop === "one" ? (a.list.switch(a.list.index), a.play()) : a.options.loop === "all" && (a.skipForward(), a.play());
1205
- });
1206
- } }, { key: "setAudio", value: function(a) {
1207
- this.hls && (this.hls.destroy(), this.hls = null);
1208
- var v = a.type;
1209
- this.options.customAudioType && this.options.customAudioType[v] ? Object.prototype.toString.call(this.options.customAudioType[v]) === "[object Function]" ? this.options.customAudioType[v](this.audio, a, this) : console.error("Illegal customType: " + v) : (v && v !== "auto" || (v = /m3u8(#|\?|$)/i.exec(a.url) ? "hls" : "normal"), v === "hls" ? Hls.isSupported() ? (this.hls = new Hls(), this.hls.loadSource(a.url), this.hls.attachMedia(this.audio)) : this.audio.canPlayType("application/x-mpegURL") || this.audio.canPlayType("application/vnd.apple.mpegURL") ? this.audio.src = a.url : this.notice("Error: HLS is not supported.") : v === "normal" && (this.audio.src = a.url)), this.seek(0), this.paused || this.audio.play();
1210
- } }, { key: "theme", value: function() {
1211
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.list.audios[this.list.index].theme || this.options.theme, v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.list.index;
1212
- (!(arguments.length > 2 && arguments[2] !== void 0) || arguments[2]) && this.list.audios[v] && (this.list.audios[v].theme = a), this.template.listCurs[v] && (this.template.listCurs[v].style.backgroundColor = a), v === this.list.index && (this.template.pic.style.backgroundColor = a, this.template.played.style.background = a, this.template.thumb.style.background = a, this.template.volume.style.background = a);
1213
- } }, { key: "seek", value: function(a) {
1214
- a = Math.max(a, 0), a = Math.min(a, this.duration), this.audio.currentTime = a, this.bar.set("played", a / this.duration, "width"), this.template.ptime.innerHTML = e.default.secondToTime(a);
1215
- } }, { key: "setUIPlaying", value: function() {
1216
- var a = this;
1217
- 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
- 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();
1222
- } }, { key: "play", value: function() {
1223
- var a = this;
1224
- this.setUIPlaying();
1225
- var v = this.audio.play();
1226
- v && v.catch(function(k) {
1227
- console.warn(k), k.name === "NotAllowedError" && a.setUIPaused();
1228
- });
1229
- } }, { key: "setUIPaused", value: function() {
1230
- var a = this;
1231
- 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() {
1232
- a.template.button.innerHTML = n.default.play;
1233
- }, 100), this.template.skipPlayButton.innerHTML = n.default.play), this.container.classList.remove("aplayer-loading"), this.timer.disable("loading");
1234
- } }, { key: "pause", value: function() {
1235
- this.setUIPaused(), this.audio.pause();
1236
- } }, { key: "switchVolumeIcon", value: function() {
1237
- this.volume() >= 0.95 ? this.template.volumeButton.innerHTML = n.default.volumeUp : this.volume() > 0 ? this.template.volumeButton.innerHTML = n.default.volumeDown : this.template.volumeButton.innerHTML = n.default.volumeOff;
1238
- } }, { key: "volume", value: function(a, v) {
1239
- return a = parseFloat(a), isNaN(a) || (a = Math.max(a, 0), a = Math.min(a, 1), this.bar.set("volume", a, "height"), v || this.storage.set("volume", a), this.audio.volume = a, this.audio.muted && (this.audio.muted = !1), this.switchVolumeIcon()), this.audio.muted ? 0 : this.audio.volume;
1240
- } }, { key: "on", value: function(a, v) {
1241
- this.events.on(a, v);
1242
- } }, { key: "toggle", value: function() {
1243
- this.template.button.classList.contains("aplayer-play") ? this.play() : this.template.button.classList.contains("aplayer-pause") && this.pause();
1244
- } }, { key: "switchAudio", value: function(a) {
1245
- this.list.switch(a);
1246
- } }, { key: "addAudio", value: function(a) {
1247
- this.list.add(a);
1248
- } }, { key: "removeAudio", value: function(a) {
1249
- this.list.remove(a);
1250
- } }, { key: "destroy", value: function() {
1251
- b.splice(b.indexOf(this), 1), this.pause(), this.container.innerHTML = "", this.audio.src = "", this.timer.destroy(), this.events.trigger("destroy");
1252
- } }, { key: "setMode", value: function() {
1253
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "normal";
1254
- this.mode = a, a === "mini" ? this.container.classList.add("aplayer-narrow") : a === "normal" && this.container.classList.remove("aplayer-narrow");
1255
- } }, { key: "notice", value: function(a) {
1256
- var v = this, k = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2e3, M = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0.8;
1257
- this.template.notice.innerHTML = a, this.template.notice.style.opacity = M, this.noticeTime && clearTimeout(this.noticeTime), this.events.trigger("noticeshow", { text: a }), k && (this.noticeTime = setTimeout(function() {
1258
- v.template.notice.style.opacity = 0, v.events.trigger("noticehide");
1259
- }, k));
1260
- } }, { 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;
1265
- if (this.options.order === "random") {
1266
- var a = this.randomOrder.indexOf(this.list.index);
1267
- return a === 0 ? this.randomOrder[this.randomOrder.length - 1] : this.randomOrder[a - 1];
1268
- }
1269
- } }, { 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;
1274
- if (this.options.order === "random") {
1275
- var a = this.randomOrder.indexOf(this.list.index);
1276
- return a === this.randomOrder.length - 1 ? this.randomOrder[0] : this.randomOrder[a + 1];
1277
- }
1278
- } }, { key: "skipBack", value: function() {
1279
- this.list.switch(this.prevIndex());
1280
- } }, { key: "skipForward", value: function() {
1281
- this.list.switch(this.nextIndex());
1282
- } }, { key: "duration", get: function() {
1283
- return isNaN(this.audio.duration) ? 0 : this.audio.duration;
1284
- } }], [{ key: "version", get: function() {
1285
- return "1.10.1";
1286
- } }]), m;
1287
- }();
1288
- h.default = w;
1289
- }, , function(f, h, d) {
1290
- }, function(f, h, d) {
1291
- Object.defineProperty(h, "__esModule", { value: !0 }), d(40);
1292
- var u, c = d(38), e = (u = c) && u.__esModule ? u : { default: u };
1293
- console.log(`
1294
- %c APlayer v1.10.1 af84efb %c http://aplayer.js.org
1295
- `, "color: #fadfa3; background: #030307; padding:5px 0;", "background: #fadfa3; padding:5px 0;"), h.default = e.default;
1296
- }]).default;
1297
- });
1298
- })(_);
1299
- var O = _.exports;
1300
- const B = /* @__PURE__ */ E(O), A = /* @__PURE__ */ S({
1301
- __proto__: null,
1302
- default: B
1303
- }, [O]);
1304
- export {
1305
- A
1306
- };