xgplayer 2.31.8 → 2.32.1

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.
package/dist/index.js CHANGED
@@ -1221,7 +1221,7 @@ module.exports = exports["default"];
1221
1221
  /* 8 */
1222
1222
  /***/ (function(module) {
1223
1223
 
1224
- module.exports = JSON.parse("{\"version\":\"2.31.8\"}");
1224
+ module.exports = JSON.parse("{\"version\":\"2.32.1\"}");
1225
1225
 
1226
1226
  /***/ }),
1227
1227
  /* 9 */
@@ -11261,6 +11261,7 @@ module.exports = exports['default'];
11261
11261
 
11262
11262
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
11263
11263
 
11264
+ /*! Built @Mon, 17 Oct 2022 06:40:43 GMT */
11264
11265
  !function (e, t) {
11265
11266
  "object" == ( false ? undefined : _typeof(exports)) && "object" == ( false ? undefined : _typeof(module)) ? module.exports = t() : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (t),
11266
11267
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
@@ -11291,72 +11292,81 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11291
11292
  }, n.p = "", n(n.s = 4);
11292
11293
  }([function (e, t, n) {
11293
11294
  "use strict";
11294
- Object.defineProperty(t, "__esModule", { value: !0 });var i = { createDom: function createDom() {
11295
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "div",
11296
- t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
11297
- n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
11298
- i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "",
11299
- o = document.createElement(e);return o.className = i, o.innerHTML = t, Object.keys(n).forEach(function (t) {
11300
- var i = t,
11301
- r = n[t];"video" === e || "audio" === e ? r && o.setAttribute(i, r) : o.setAttribute(i, r);
11302
- }), o;
11303
- }, hasClass: function hasClass(e, t) {
11304
- return e.classList ? Array.prototype.some.call(e.classList, function (e) {
11305
- return e === t;
11306
- }) : !!e.className.match(new RegExp("(\\s|^)" + t + "(\\s|$)"));
11307
- }, addClass: function addClass(e, t) {
11308
- e.classList ? t.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function (t) {
11309
- t && e.classList.add(t);
11310
- }) : i.hasClass(e, t) || (e.className += " " + t);
11311
- }, removeClass: function removeClass(e, t) {
11312
- e.classList ? t.split(/\s+/g).forEach(function (t) {
11313
- e.classList.remove(t);
11314
- }) : i.hasClass(e, t) && t.split(/\s+/g).forEach(function (t) {
11315
- var n = new RegExp("(\\s|^)" + t + "(\\s|$)");e.className = e.className.replace(n, " ");
11316
- });
11317
- }, toggleClass: function toggleClass(e, t) {
11318
- t.split(/\s+/g).forEach(function (t) {
11319
- i.hasClass(e, t) ? i.removeClass(e, t) : i.addClass(e, t);
11320
- });
11321
- }, findDom: function findDom() {
11322
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : document,
11323
- t = arguments[1],
11324
- n = void 0;try {
11325
- n = e.querySelector(t);
11326
- } catch (i) {
11327
- t.startsWith("#") && (n = e.getElementById(t.slice(1)));
11328
- }return n;
11329
- }, deepCopy: function deepCopy(e, t) {
11330
- if ("Object" === i.typeOf(t) && "Object" === i.typeOf(e)) return Object.keys(t).forEach(function (n) {
11331
- "Object" !== i.typeOf(t[n]) || t[n] instanceof Node ? "Array" === i.typeOf(t[n]) ? e[n] = "Array" === i.typeOf(e[n]) ? e[n].concat(t[n]) : t[n] : e[n] = t[n] : e[n] ? i.deepCopy(e[n], t[n]) : e[n] = t[n];
11332
- }), e;
11333
- }, typeOf: function typeOf(e) {
11334
- return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0];
11335
- }, copyDom: function copyDom(e) {
11336
- if (e && 1 === e.nodeType) {
11337
- var t = document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes, function (e) {
11338
- t.setAttribute(e.name, e.value);
11339
- }), e.innerHTML && (t.innerHTML = e.innerHTML), t;
11340
- }return "";
11341
- }, formatTime: function formatTime(e) {
11342
- var t = Math.floor(e);return 1e3 * t + (e - t);
11343
- }, offInDestroy: function offInDestroy(e, t, n, i) {
11295
+ function i(e, t) {
11296
+ return e.classList ? Array.prototype.some.call(e.classList, function (e) {
11297
+ return e === t;
11298
+ }) : !!e.className.match(new RegExp("(\\s|^)" + t + "(\\s|$)"));
11299
+ }function o(e, t) {
11300
+ e.classList ? t.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function (t) {
11301
+ t && e.classList.add(t);
11302
+ }) : i(e, t) || (e.className += " " + t);
11303
+ }function r(e, t) {
11304
+ e.classList ? t.split(/\s+/g).forEach(function (t) {
11305
+ e.classList.remove(t);
11306
+ }) : i(e, t) && t.split(/\s+/g).forEach(function (t) {
11307
+ var n = new RegExp("(\\s|^)" + t + "(\\s|$)");e.className = e.className.replace(n, " ");
11308
+ });
11309
+ }function a(e) {
11310
+ return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0];
11311
+ }Object.defineProperty(t, "__esModule", { value: !0 }), t.createDom = function () {
11312
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "div",
11313
+ t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
11314
+ n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
11315
+ i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "",
11316
+ o = document.createElement(e);return o.className = i, o.innerHTML = t, Object.keys(n).forEach(function (t) {
11317
+ var i = t,
11318
+ r = n[t];"video" === e || "audio" === e ? r && o.setAttribute(i, r) : o.setAttribute(i, r);
11319
+ }), o;
11320
+ }, t.hasClass = i, t.addClass = o, t.removeClass = r, t.toggleClass = function (e, t) {
11321
+ t.split(/\s+/g).forEach(function (t) {
11322
+ i(e, t) ? r(e, t) : o(e, t);
11323
+ });
11324
+ }, t.findDom = function () {
11325
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : document,
11326
+ t = arguments[1],
11327
+ n = void 0;try {
11328
+ n = e.querySelector(t);
11329
+ } catch (i) {
11330
+ t.startsWith("#") && (n = e.getElementById(t.slice(1)));
11331
+ }return n;
11332
+ }, t.deepCopy = function e(t, n) {
11333
+ if ("Object" === a(n) && "Object" === a(t)) return Object.keys(n).forEach(function (i) {
11334
+ "Object" !== a(n[i]) || n[i] instanceof Node ? "Array" === a(n[i]) ? t[i] = "Array" === a(t[i]) ? t[i].concat(n[i]) : n[i] : t[i] = n[i] : t[i] ? e(t[i], n[i]) : t[i] = n[i];
11335
+ }), t;
11336
+ }, t.typeOf = a, t.copyDom = function (e) {
11337
+ if (e && 1 === e.nodeType) {
11338
+ var t = document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes, function (e) {
11339
+ t.setAttribute(e.name, e.value);
11340
+ }), e.innerHTML && (t.innerHTML = e.innerHTML), t;
11341
+ }return "";
11342
+ }, t.attachEventListener = function (e, t, n, i) {
11343
+ if (i) e.on(t, n), function (e, t, n, i) {
11344
11344
  e.once(i, function o() {
11345
11345
  e.off(t, n), e.off(i, o);
11346
11346
  });
11347
- }, on: function on(e, t, n, o) {
11348
- if (o) e.on(t, n), i.offInDestroy(e, t, n, o);else {
11349
- e.on(t, function i(o) {
11350
- n(o), e.off(t, i);
11351
- });
11352
- }
11353
- }, style: function style(e, t, n) {
11354
- var i = e.style;try {
11355
- i[t] = n;
11356
- } catch (e) {
11357
- i.setProperty(t, n);
11358
- }
11359
- } };t.default = i, e.exports = t.default;
11347
+ }(e, t, n, i);else {
11348
+ e.on(t, function i(o) {
11349
+ n(o), e.off(t, i);
11350
+ });
11351
+ }
11352
+ }, t.styleUtil = function (e, t, n) {
11353
+ var i = e.style;try {
11354
+ i[t] = n;
11355
+ } catch (e) {
11356
+ i.setProperty(t, n);
11357
+ }
11358
+ }, t.isNumber = function (e) {
11359
+ return "number" == typeof e && !Number.isNaN(e);
11360
+ }, t.throttle = function (e, t) {
11361
+ var n = this,
11362
+ i = 0;return function () {
11363
+ for (var o = arguments.length, r = Array(o), a = 0; a < o; a++) {
11364
+ r[a] = arguments[a];
11365
+ }clearTimeout(i), i = setTimeout(function () {
11366
+ return e.apply(n, r);
11367
+ }, t);
11368
+ };
11369
+ };t.hasOwnProperty = Object.prototype.hasOwnProperty;
11360
11370
  }, function (e, t, n) {
11361
11371
  "use strict";
11362
11372
  Object.defineProperty(t, "__esModule", { value: !0 });var i,
@@ -11381,7 +11391,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11381
11391
  }();t.default = s, e.exports = t.default;
11382
11392
  }, function (e, t, n) {
11383
11393
  "use strict";
11384
- var i = n(19)();e.exports = function (e) {
11394
+ var i = n(18)();e.exports = function (e) {
11385
11395
  return e !== i && null !== e;
11386
11396
  };
11387
11397
  }, function (e, t, n) {
@@ -11389,16 +11399,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11389
11399
  e.exports = function (e) {
11390
11400
  return null != e;
11391
11401
  };
11392
- }, function (e, t, n) {
11393
- e.exports = n(5);
11394
11402
  }, function (e, t, n) {
11395
11403
  "use strict";
11396
11404
  Object.defineProperty(t, "__esModule", { value: !0 });var i,
11397
- o = n(6),
11405
+ o = n(5),
11398
11406
  r = (i = o) && i.__esModule ? i : { default: i };n(34), t.default = r.default, e.exports = t.default;
11399
11407
  }, function (e, t, n) {
11400
11408
  "use strict";
11401
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
11409
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.DanmuJs = void 0;var i = function () {
11402
11410
  function e(e, t) {
11403
11411
  for (var n = 0; n < t.length; n++) {
11404
11412
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -11407,103 +11415,147 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11407
11415
  return n && e(t.prototype, n), i && e(t, i), t;
11408
11416
  };
11409
11417
  }(),
11410
- o = f(n(7)),
11411
- r = f(n(1)),
11412
- a = f(n(27)),
11413
- s = f(n(31)),
11414
- l = f(n(0)),
11415
- u = n(32),
11416
- c = n(33);function f(e) {
11418
+ o = f(n(6)),
11419
+ r = n(25),
11420
+ a = f(n(1)),
11421
+ s = f(n(27)),
11422
+ l = f(n(32)),
11423
+ u = n(33),
11424
+ c = n(0);function f(e) {
11417
11425
  return e && e.__esModule ? e : { default: e };
11418
11426
  }function h(e, t) {
11419
11427
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11420
- }var d = function (e) {
11428
+ }var d = t.DanmuJs = function (e) {
11421
11429
  function t(e) {
11422
11430
  !function (e, t) {
11423
11431
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11424
- }(this, t);var n = h(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));n.setLogger("danmu"), n.logger && n.logger.info("danmu.js version: " + u.version);var i = n;if (i.config = l.default.deepCopy({ overlap: !1, area: { start: 0, end: 1 }, live: !1, comments: [], direction: "r2l", needResizeObserver: !1 }, e), i.hideArr = [], i.domObj = new s.default(), (0, o.default)(i), i.config.comments.forEach(function (e) {
11432
+ }(this, t);var n = h(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this)),
11433
+ i = n;i.setLogger("danmu"), i.logger && i.logger.info("danmu.js version: " + r.version);var a = i.config = { overlap: !1, area: { start: 0, end: 1, lines: void 0 }, live: !1, comments: [], direction: "r2l", needResizeObserver: !1, dropStaleComments: !1, channelSize: void 0, maxCommentsLength: void 0, bulletOffset: void 0, interval: 2e3 };if ((0, c.deepCopy)(a, e), (0, o.default)(i), i.hideArr = [], i.domObj = new l.default(), i.freezeId = null, a.comments.forEach(function (e) {
11425
11434
  e.duration = e.duration ? e.duration : 5e3, e.mode || (e.mode = "scroll");
11426
- }), !i.config.container || 1 !== i.config.container.nodeType) return i.emit("error", "container id can't be empty"), !1, h(n, !1);if (i.container = i.config.container, i.config.containerStyle) {
11427
- var r = i.config.containerStyle;Object.keys(r).forEach(function (e) {
11428
- i.container.style[e] = r[e];
11435
+ }), i.container = a.container && 1 === a.container.nodeType ? a.container : null, !i.container) return i.emit("error", "container id can't be empty"), !1, h(n, !1);if (a.containerStyle) {
11436
+ var u = a.containerStyle;Object.keys(u).forEach(function (e) {
11437
+ i.container.style[e] = u[e];
11429
11438
  });
11430
- }return i.live = i.config.live, i.player = i.config.player, i.direction = i.config.direction, l.default.addClass(i.container, "danmu"), i.bulletBtn = new a.default(i), i.isReady = !0, i.emit("ready"), n.logger && n.logger.info("ready"), n.addResizeObserver(), n;
11439
+ }return i.live = a.live, i.player = a.player, i.direction = a.direction, (0, c.addClass)(i.container, "danmu"), i.bulletBtn = new s.default(i), i.main = i.bulletBtn.main, i.isReady = !0, i.emit("ready"), n.logger && n.logger.info("ready"), n.addResizeObserver(), n;
11431
11440
  }return function (e, t) {
11432
11441
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11433
11442
  }(t, e), i(t, [{ key: "addResizeObserver", value: function value() {
11434
- var e = this;this.config.needResizeObserver && (0, c.addObserver)(this.container, function () {
11443
+ var e = this;this.config.needResizeObserver && (0, u.addObserver)(this.container, function () {
11435
11444
  e.logger && e.logger.info("needResizeObserver"), e.resize();
11436
11445
  });
11437
11446
  } }, { key: "start", value: function value() {
11438
- this.logger && this.logger.info("start"), this.bulletBtn.main.start();
11447
+ this.logger && this.logger.info("start"), this.main.start();
11439
11448
  } }, { key: "pause", value: function value() {
11440
- this.logger && this.logger.info("pause"), this.bulletBtn.main.pause();
11449
+ this.logger && this.logger.info("pause"), this.main.pause();
11441
11450
  } }, { key: "play", value: function value() {
11442
- this.logger && this.logger.info("play"), this.bulletBtn.main.play();
11451
+ this.logger && this.logger.info("play"), this.main.play();
11443
11452
  } }, { key: "stop", value: function value() {
11444
- this.logger && this.logger.info("stop"), this.bulletBtn.main.stop();
11453
+ this.logger && this.logger.info("stop"), this.main.stop();
11445
11454
  } }, { key: "clear", value: function value() {
11446
- this.logger && this.logger.info("clear"), this.bulletBtn.main.clear();
11455
+ this.logger && this.logger.info("clear"), this.main.clear();
11447
11456
  } }, { key: "destroy", value: function value() {
11448
- for (var e in (0, c.unObserver)(this.container), this.logger && this.logger.info("destroy"), this.stop(), this.bulletBtn.destroy(), this.domObj.destroy(), this) {
11457
+ for (var e in (0, u.unObserver)(this.container), this.logger && this.logger.info("destroy"), this.stop(), this.bulletBtn.destroy(), this.domObj.destroy(), this) {
11449
11458
  delete this[e];
11450
11459
  }this.emit("destroy");
11451
11460
  } }, { key: "sendComment", value: function value(e) {
11452
- this.logger && this.logger.info("sendComment: " + (e.txt || "[DOM Element]")), e.duration || (e.duration = 15e3), e && e.id && e.duration && (e.el || e.txt) && (e.duration = e.duration ? e.duration : 5e3, e.style || (e.style = { opacity: void 0, fontSize: void 0 }), e.style && (this.opacity && this.opacity !== e.style.opacity && (e.style.opacity = this.opacity), this.fontSize && this.fontSize !== e.style.fontSize && (e.style.fontSize = this.fontSize), this.like && (e.like = e.like ? e.like : this.like)), e.prior || e.realTime ? (this.bulletBtn.main.data.unshift(e), e.realTime && (this.bulletBtn.main.readData(), this.bulletBtn.main.dataHandle())) : this.bulletBtn.main.data.push(e));
11461
+ this.logger && this.logger.info("sendComment: " + (e.txt || "[DOM Element]")), e.duration || (e.duration = 15e3), e && e.id && e.duration && (e.el || e.txt) && (e.duration = e.duration ? e.duration : 5e3, e.style || (e.style = { opacity: void 0, fontSize: void 0 }), e.style && (this.opacity && this.opacity !== e.style.opacity && (e.style.opacity = this.opacity), this.fontSize && this.fontSize !== e.style.fontSize && (e.style.fontSize = this.fontSize)), e.prior || e.realTime ? (this.main.data.unshift(e), e.realTime && (this.main.readData(), this.main.dataHandle())) : this.main.data.push(e));
11453
11462
  } }, { key: "setCommentID", value: function value(e, t) {
11454
- var n = this;this.logger && this.logger.info("setCommentID: oldID " + e + " newID " + t);var i = this.container.getBoundingClientRect();e && t && (this.bulletBtn.main.data.some(function (n) {
11463
+ var n = this;this.logger && this.logger.info("setCommentID: oldID " + e + " newID " + t), e && t && (this.main.data.some(function (n) {
11455
11464
  return n.id === e && (n.id = t, !0);
11456
- }), this.bulletBtn.main.queue.some(function (o) {
11457
- return o.id === e && (o.id = t, o.pauseMove(i), "paused" !== n.bulletBtn.main.status && o.startMove(i), !0);
11465
+ }), this.main.queue.some(function (i) {
11466
+ return i.id === e && (i.id = t, i.pauseMove(), "paused" !== n.main.status && i.startMove(), !0);
11458
11467
  }));
11459
11468
  } }, { key: "setCommentDuration", value: function value(e, t) {
11460
- var n = this;this.logger && this.logger.info("setCommentDuration: id " + e + " duration " + t);var i = this.container.getBoundingClientRect();e && t && (t = t || 5e3, this.bulletBtn.main.data.some(function (n) {
11469
+ var n = this;this.logger && this.logger.info("setCommentDuration: id " + e + " duration " + t), e && t && (t = t || 5e3, this.main.data.some(function (n) {
11461
11470
  return n.id === e && (n.duration = t, !0);
11462
- }), this.bulletBtn.main.queue.some(function (o) {
11463
- return o.id === e && (o.duration = t, o.pauseMove(i), "paused" !== n.bulletBtn.main.status && o.startMove(i), !0);
11471
+ }), this.main.queue.some(function (i) {
11472
+ return i.id === e && (i.duration = t, i.pauseMove(), "paused" !== n.main.status && i.startMove(), !0);
11464
11473
  }));
11465
11474
  } }, { key: "setCommentLike", value: function value(e, t) {
11466
- this.logger && this.logger.info("setCommentLike: id " + e + " like " + t);var n = this.container.getBoundingClientRect();this.like = t, e && t && (this.bulletBtn.main.data.some(function (n) {
11475
+ this.logger && this.logger.info("setCommentLike: id " + e + " like " + t), e && t && (this.main.data.some(function (n) {
11467
11476
  return n.id === e && (n.like = t, !0);
11468
- }), this.bulletBtn.main.queue.some(function (i) {
11469
- return i.id === e && (i.pauseMove(n), i.setLikeDom(t.el, t.style), "paused" !== i.danmu.bulletBtn.main.status && i.startMove(n), !0);
11477
+ }), this.main.queue.some(function (n) {
11478
+ return n.id === e && (n.pauseMove(), n.setLikeDom(t.el, t.style), "paused" !== n.danmu.main.status && n.startMove(), !0);
11470
11479
  }));
11471
11480
  } }, { key: "restartComment", value: function value(e) {
11472
- this.logger && this.logger.info("restartComment: id " + e), this.mouseControl = !1;var t = this.container.getBoundingClientRect();e && this.bulletBtn.main.queue.some(function (n) {
11473
- return n.id === e && ("paused" !== n.danmu.bulletBtn.main.status ? n.startMove(t, !0) : n.status = "paused", !0);
11474
- });
11481
+ if (this.logger && this.logger.info("restartComment: id " + e), e) {
11482
+ var t = this.main;if (this._releaseCtrl(e), "closed" === t.status) return;t.queue.some(function (n) {
11483
+ return n.id === e && ("paused" !== t.status ? n.startMove(!0) : n.status = "paused", !0);
11484
+ });
11485
+ }
11486
+ } }, { key: "_releaseCtrl", value: function value(e) {
11487
+ this.freezeId && e === this.freezeId && (this.mouseControl = !1, this.freezeId = null);
11488
+ } }, { key: "_freezeCtrl", value: function value(e) {
11489
+ this.mouseControl = !0, this.freezeId = e;
11475
11490
  } }, { key: "freezeComment", value: function value(e) {
11476
- this.logger && this.logger.info("freezeComment: id " + e), this.mouseControl = !0;var t = this.container.getBoundingClientRect();e && this.bulletBtn.main.queue.some(function (n) {
11477
- return n.id === e && (n.status = "forcedPause", n.pauseMove(t), n.el && n.el.style && l.default.style(n.el, "zIndex", 10), !0);
11478
- });
11491
+ if (this.logger && this.logger.info("freezeComment: id " + e), e) {
11492
+ this._freezeCtrl(e), this.main.queue.some(function (t) {
11493
+ return t.id === e && (t.status = "forcedPause", t.pauseMove(), t.el && t.el.style && (0, c.styleUtil)(t.el, "zIndex", 10), !0);
11494
+ });
11495
+ }
11479
11496
  } }, { key: "removeComment", value: function value(e) {
11480
- this.logger && this.logger.info("removeComment: id " + e), e && (this.bulletBtn.main.queue.some(function (t) {
11481
- return t.id === e && (t.remove(), !0);
11482
- }), this.bulletBtn.main.data = this.bulletBtn.main.data.filter(function (t) {
11483
- return t.id !== e;
11484
- }));
11497
+ if (this.logger && this.logger.info("removeComment: id " + e), e) {
11498
+ this._releaseCtrl(e), this.main.queue.some(function (t) {
11499
+ return t.id === e && (t.remove(), !0);
11500
+ }), this.main.data = this.main.data.filter(function (t) {
11501
+ return t.id !== e;
11502
+ });
11503
+ }
11485
11504
  } }, { key: "updateComments", value: function value(e) {
11486
- var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];t && (this.bulletBtn.main.data = []), this.bulletBtn.main.data = this.bulletBtn.main.data.concat(e);
11505
+ var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
11506
+ n = this.config,
11507
+ i = this.main,
11508
+ o = this.player,
11509
+ r = [],
11510
+ a = 0;if (this.logger && this.logger.info("updateComments: " + e.length + ", isClear " + t), "boolean" == typeof t && t && (i.data = []), i.data = i.data.concat(e), i.sortData(), "number" == typeof n.maxCommentsLength && i.data.length > n.maxCommentsLength) {
11511
+ a = i.data.length - n.maxCommentsLength;for (var s, l = 0; l < a; l++) {
11512
+ (s = i.data[l]).prior && !s.attached_ && r.push(i.data[l]);
11513
+ }
11514
+ } else if (n.dropStaleComments && o && o.currentTime) {
11515
+ var u = Math.floor(1e3 * o.currentTime),
11516
+ c = u - n.interval;if (c > 0) for (var f, h = 0; h < i.data.length; h++) {
11517
+ if ((f = i.data[h]).prior && !f.attached_ && r.push(i.data[h]), f.start > c) {
11518
+ a = h;break;
11519
+ }
11520
+ }a > 0 && (i.data.splice(0, a), i.data = r.concat(i.data));
11521
+ }
11522
+ } }, { key: "willChange", value: function value() {
11523
+ var e = this.container,
11524
+ t = this.main;e.style.willChange = "opacity", t.willChanges.push("contents"), t.queue.forEach(function (e) {
11525
+ e.willChange();
11526
+ });
11527
+ } }, { key: "stopWillChange", value: function value() {
11528
+ this.container.style.willChange = "", this.main.willChanges.splice(0), this.main.queue.forEach(function (e) {
11529
+ e.willChange();
11530
+ });
11487
11531
  } }, { key: "setAllDuration", value: function value() {
11488
11532
  var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll",
11489
- t = arguments[1],
11490
- n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];this.logger && this.logger.info("setAllDuration: mode " + e + " duration " + t + " force " + n);var i = this.container.getBoundingClientRect();t && (t = t || 5e3, n && (this.bulletBtn.main.forceDuration = t), this.bulletBtn.main.data.forEach(function (n) {
11491
- e === n.mode && (n.duration = t);
11492
- }), this.bulletBtn.main.queue.forEach(function (n) {
11493
- e === n.mode && (n.duration = t, n.pauseMove(i), "paused" !== n.danmu.bulletBtn.main.status && n.startMove(i));
11533
+ t = this,
11534
+ n = arguments[1],
11535
+ i = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];this.logger && this.logger.info("setAllDuration: mode " + e + " duration " + n + " force " + i), n && (n = n || 5e3, i && (this.main.forceDuration = n), this.main.data.forEach(function (t) {
11536
+ e === t.mode && (t.duration = n);
11537
+ }), this.main.queue.forEach(function (i) {
11538
+ e === i.mode && (i.duration = n, i.pauseMove(), "paused" !== t.main.status && i.startMove());
11539
+ }));
11540
+ } }, { key: "setPlayRate", value: function value() {
11541
+ var e = this,
11542
+ t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll",
11543
+ n = arguments[1];this.logger && this.logger.info("setPlayRate: " + n), (0, c.isNumber)(n) && n > 0 && (this.main.playRate = n, this.main.queue.forEach(function (n) {
11544
+ t === n.mode && (n.pauseMove(), "paused" !== e.main.status && n.startMove());
11494
11545
  }));
11495
11546
  } }, { key: "setOpacity", value: function value(e) {
11496
11547
  this.logger && this.logger.info("setOpacity: opacity " + e), this.container.style.opacity = e;
11497
11548
  } }, { key: "setFontSize", value: function value(e, t) {
11498
- var n = this;this.logger && this.logger.info("setFontSize: size " + e + " channelSize " + t), this.fontSize = e + "px", e && (this.bulletBtn.main.data.forEach(function (e) {
11549
+ var n = this,
11550
+ i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { reflow: !0 };this.logger && this.logger.info("setFontSize: size " + e + " channelSize " + t), this.fontSize = e + "px", e && (this.main.data.forEach(function (e) {
11499
11551
  e.style && (e.style.fontSize = n.fontSize);
11500
- }), this.bulletBtn.main.queue.forEach(function (e) {
11552
+ }), this.main.queue.forEach(function (e) {
11501
11553
  e.options.style || (e.options.style = {}), e.options.style.fontSize = n.fontSize, e.setFontSize(n.fontSize), t && (e.top = e.channel_id[0] * t, e.topInit());
11502
- })), t && (this.config.channelSize = t, this.bulletBtn.main.channel.resize(!0));
11554
+ })), t && (this.config.channelSize = t, i.reflow && this.main.channel.resizeSync());
11503
11555
  } }, { key: "setArea", value: function value(e) {
11504
- this.logger && this.logger.info("setArea: area " + e), this.config.area = e, this.bulletBtn.main.channel.resize(!0);
11556
+ this.logger && this.logger.info("setArea: area " + e), this.config.area = e, !1 !== e.reflow && this.main.channel.resizeSync();
11505
11557
  } }, { key: "hide", value: function value() {
11506
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll";this.logger && this.logger.info("hide: mode " + e), this.hideArr.indexOf(e) < 0 && this.hideArr.push(e);var t = this.bulletBtn.main.queue.filter(function (t) {
11558
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll";this.logger && this.logger.info("hide: mode " + e), this.hideArr.indexOf(e) < 0 && this.hideArr.push(e);var t = this.main.queue.filter(function (t) {
11507
11559
  return e === t.mode || "color" === e && t.color;
11508
11560
  });t.forEach(function (e) {
11509
11561
  return e.remove();
@@ -11514,8 +11566,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11514
11566
  var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "r2l";this.logger && this.logger.info("setDirection: direction " + e), this.emit("changeDirection", e);
11515
11567
  } }, { key: "resize", value: function value() {
11516
11568
  this.logger && this.logger.info("resize"), this.emit("channel_resize");
11569
+ } }, { key: "status", get: function get() {
11570
+ return this.main.status;
11571
+ } }, { key: "state", get: function get() {
11572
+ var e = this.main;return { status: e.status, comments: e.data, bullets: e.queue };
11573
+ } }, { key: "containerPos", get: function get() {
11574
+ return this.main.channel.containerPos;
11517
11575
  } }]), t;
11518
- }(r.default);t.default = d, e.exports = t.default;
11576
+ }(a.default);t.default = d;
11519
11577
  }, function (e, t, n) {
11520
11578
  "use strict";
11521
11579
  var i,
@@ -11525,20 +11583,20 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11525
11583
  s,
11526
11584
  l,
11527
11585
  u,
11528
- c = n(8),
11529
- f = n(25),
11586
+ c = n(7),
11587
+ f = n(24),
11530
11588
  h = Function.prototype.apply,
11531
11589
  d = Function.prototype.call,
11532
- g = Object.create,
11533
- p = Object.defineProperty,
11590
+ p = Object.create,
11591
+ g = Object.defineProperty,
11534
11592
  m = Object.defineProperties,
11535
11593
  v = Object.prototype.hasOwnProperty,
11536
- b = { configurable: !0, enumerable: !1, writable: !0 };o = function o(e, t) {
11594
+ y = { configurable: !0, enumerable: !1, writable: !0 };o = function o(e, t) {
11537
11595
  var _n, o;return f(t), o = this, i.call(this, e, _n = function n() {
11538
11596
  r.call(o, e, _n), h.call(t, this, arguments);
11539
11597
  }), _n.__eeOnceListener__ = t, this;
11540
11598
  }, s = { on: i = function i(e, t) {
11541
- var n;return f(t), v.call(this, "__ee__") ? n = this.__ee__ : (n = b.value = g(null), p(this, "__ee__", b), b.value = null), n[e] ? "object" == _typeof(n[e]) ? n[e].push(t) : n[e] = [n[e], t] : n[e] = t, this;
11599
+ var n;return f(t), v.call(this, "__ee__") ? n = this.__ee__ : (n = y.value = p(null), g(this, "__ee__", y), y.value = null), n[e] ? "object" == _typeof(n[e]) ? n[e].push(t) : n[e] = [n[e], t] : n[e] = t, this;
11542
11600
  }, once: o, off: r = function r(e, t) {
11543
11601
  var n, i, o, r;if (f(t), !v.call(this, "__ee__")) return this;if (!(n = this.__ee__)[e]) return this;if ("object" == _typeof(i = n[e])) for (r = 0; o = i[r]; ++r) {
11544
11602
  o !== t && o.__eeOnceListener__ !== t || (2 === i.length ? n[e] = i[r ? 0 : 1] : i.splice(r, 1));
@@ -11558,29 +11616,29 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11558
11616
  r[t - 1] = arguments[t];
11559
11617
  }h.call(o, this, r);}
11560
11618
  } }, l = { on: c(i), once: c(o), off: c(r), emit: c(a) }, u = m({}, l), e.exports = t = function t(e) {
11561
- return null == e ? g(u) : m(Object(e), l);
11619
+ return null == e ? p(u) : m(Object(e), l);
11562
11620
  }, t.methods = s;
11563
11621
  }, function (e, t, n) {
11564
11622
  "use strict";
11565
11623
  var i = n(3),
11566
- o = n(9),
11567
- r = n(13),
11568
- a = n(21),
11569
- s = n(22);(e.exports = function (e, t) {
11624
+ o = n(8),
11625
+ r = n(12),
11626
+ a = n(20),
11627
+ s = n(21);(e.exports = function (e, t) {
11570
11628
  var n, o, l, u, c;return arguments.length < 2 || "string" != typeof e ? (u = t, t = e, e = null) : u = arguments[2], i(e) ? (n = s.call(e, "c"), o = s.call(e, "e"), l = s.call(e, "w")) : (n = l = !0, o = !1), c = { value: t, configurable: n, enumerable: o, writable: l }, u ? r(a(u), c) : c;
11571
11629
  }).gs = function (e, t, n) {
11572
11630
  var l, u, c, f;return "string" != typeof e ? (c = n, n = t, t = e, e = null) : c = arguments[3], i(t) ? o(t) ? i(n) ? o(n) || (c = n, n = void 0) : n = void 0 : (c = t, t = n = void 0) : t = void 0, i(e) ? (l = s.call(e, "c"), u = s.call(e, "e")) : (l = !0, u = !1), f = { get: t, set: n, configurable: l, enumerable: u }, c ? r(a(c), f) : f;
11573
11631
  };
11574
11632
  }, function (e, t, n) {
11575
11633
  "use strict";
11576
- var i = n(10),
11634
+ var i = n(9),
11577
11635
  o = /^\s*class[\s{/}]/,
11578
11636
  r = Function.prototype.toString;e.exports = function (e) {
11579
11637
  return !!i(e) && !o.test(r.call(e));
11580
11638
  };
11581
11639
  }, function (e, t, n) {
11582
11640
  "use strict";
11583
- var i = n(11);e.exports = function (e) {
11641
+ var i = n(10);e.exports = function (e) {
11584
11642
  if ("function" != typeof e) return !1;if (!hasOwnProperty.call(e, "length")) return !1;try {
11585
11643
  if ("number" != typeof e.length) return !1;if ("function" != typeof e.call) return !1;if ("function" != typeof e.apply) return !1;
11586
11644
  } catch (e) {
@@ -11589,7 +11647,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11589
11647
  };
11590
11648
  }, function (e, t, n) {
11591
11649
  "use strict";
11592
- var i = n(12);e.exports = function (e) {
11650
+ var i = n(11);e.exports = function (e) {
11593
11651
  if (!i(e)) return !1;try {
11594
11652
  return !!e.constructor && e.constructor.prototype === e;
11595
11653
  } catch (e) {
@@ -11604,7 +11662,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11604
11662
  };
11605
11663
  }, function (e, t, n) {
11606
11664
  "use strict";
11607
- e.exports = n(14)() ? Object.assign : n(15);
11665
+ e.exports = n(13)() ? Object.assign : n(14);
11608
11666
  }, function (e, t, n) {
11609
11667
  "use strict";
11610
11668
  e.exports = function () {
@@ -11613,8 +11671,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11613
11671
  };
11614
11672
  }, function (e, t, n) {
11615
11673
  "use strict";
11616
- var i = n(16),
11617
- o = n(20),
11674
+ var i = n(15),
11675
+ o = n(19),
11618
11676
  r = Math.max;e.exports = function (e, t) {
11619
11677
  var n,
11620
11678
  a,
@@ -11631,7 +11689,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11631
11689
  };
11632
11690
  }, function (e, t, n) {
11633
11691
  "use strict";
11634
- e.exports = n(17)() ? Object.keys : n(18);
11692
+ e.exports = n(16)() ? Object.keys : n(17);
11635
11693
  }, function (e, t, n) {
11636
11694
  "use strict";
11637
11695
  e.exports = function () {
@@ -11671,7 +11729,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11671
11729
  };
11672
11730
  }, function (e, t, n) {
11673
11731
  "use strict";
11674
- e.exports = n(23)() ? String.prototype.contains : n(24);
11732
+ e.exports = n(22)() ? String.prototype.contains : n(23);
11675
11733
  }, function (e, t, n) {
11676
11734
  "use strict";
11677
11735
  var i = "razdwatrzy";e.exports = function () {
@@ -11687,6 +11745,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11687
11745
  e.exports = function (e) {
11688
11746
  if ("function" != typeof e) throw new TypeError(e + " is not a function");return e;
11689
11747
  };
11748
+ }, function (e) {
11749
+ e.exports = JSON.parse('{"version":"1.1.2"}');
11690
11750
  }, function (e, t, n) {
11691
11751
  "use strict";
11692
11752
  Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
@@ -11721,8 +11781,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11721
11781
  };
11722
11782
  }(),
11723
11783
  o = s(n(1)),
11724
- r = s(n(0)),
11725
- a = s(n(28));function s(e) {
11784
+ r = s(n(28)),
11785
+ a = n(0);function s(e) {
11726
11786
  return e && e.__esModule ? e : { default: e };
11727
11787
  }var l = function (e) {
11728
11788
  function t(e) {
@@ -11730,14 +11790,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11730
11790
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11731
11791
  }(this, t);var n = function (e, t) {
11732
11792
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11733
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.setLogger("control"), n.danmu = e, n.main = new a.default(e), e.config.defaultOff || n.main.start(), n;
11793
+ }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.setLogger("control"), n.danmu = e, n.main = new r.default(e), e.config.defaultOff || n.main.start(), n;
11734
11794
  }return function (e, t) {
11735
11795
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11736
11796
  }(t, e), i(t, [{ key: "createSwitch", value: function value() {
11737
- var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];return this.logger && this.logger.info("createSwitch"), this.switchBtn = r.default.createDom("dk-switch", '<span class="txt">弹</span>', {}, "danmu-switch " + (e ? "danmu-switch-active" : "")), this.switchBtn;
11797
+ var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];return this.logger && this.logger.info("createSwitch"), this.switchBtn = (0, a.createDom)("dk-switch", '<span class="txt">弹</span>', {}, "danmu-switch " + (e ? "danmu-switch-active" : "")), this.switchBtn;
11738
11798
  } }, { key: "destroy", value: function value() {
11739
11799
  for (var e in this.logger && this.logger.info("destroy"), this.main.destroy(), this) {
11740
- delete this[e];
11800
+ a.hasOwnProperty.call(this, e) && delete this[e];
11741
11801
  }
11742
11802
  } }]), t;
11743
11803
  }(o.default);t.default = l, e.exports = t.default;
@@ -11755,7 +11815,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11755
11815
  o = l(n(1)),
11756
11816
  r = l(n(29)),
11757
11817
  a = l(n(30)),
11758
- s = l(n(0));function l(e) {
11818
+ s = n(0);function l(e) {
11759
11819
  return e && e.__esModule ? e : { default: e };
11760
11820
  }var u = function (e) {
11761
11821
  function t(e) {
@@ -11763,80 +11823,97 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11763
11823
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11764
11824
  }(this, t);var n = function (e, t) {
11765
11825
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11766
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));n.setLogger("main"), n.danmu = e, n.container = e.container, n.channel = new r.default(e), n.data = [].concat(e.config.comments), n.playedData = [], n.queue = [], n.timer = null, n.retryTimer = null, n.retryStatus = "normal", n.interval = e.config.interval || 2e3, n.status = "idle", s.default.on(e, "bullet_remove", n.updateQueue.bind(n), "destroy");var i = n;return s.default.on(n.danmu, "changeDirection", function (e) {
11767
- i.danmu.direction = e;
11768
- }, "destroy"), n.nums = 0, n;
11826
+ }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.setLogger("main"), n.danmu = e, n.container = e.container, n.channel = new a.default(e), n.data = [].concat(e.config.comments), n.playedData = [], n.queue = [], n.timer = null, n.playRate = 1, n.retryStatus = "normal", n.interval = e.config.interval, n.willChanges = [], n._status = "idle", (0, s.attachEventListener)(e, "bullet_remove", n.updateQueue.bind(n), "destroy"), (0, s.attachEventListener)(e, "changeDirection", function (e) {
11827
+ n.danmu.direction = e;
11828
+ }, "destroy"), n;
11769
11829
  }return function (e, t) {
11770
11830
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11771
- }(t, e), i(t, [{ key: "destroy", value: function value() {
11772
- for (var e in this.logger && this.logger.info("destroy"), clearTimeout(this.dataHandleTimer), this.channel.destroy(), this.data = [], this) {
11831
+ }(t, e), i(t, [{ key: "_cancelDataHandleTimer", value: function value() {
11832
+ this.handleId && (clearTimeout(this.handleId), this.handleId = null), this.handleTimer && (clearTimeout(this.handleTimer), this.handleTimer = null);
11833
+ } }, { key: "destroy", value: function value() {
11834
+ for (var e in this.logger && this.logger.info("destroy"), this._cancelDataHandleTimer(), this.channel.destroy(), this.data = [], this) {
11773
11835
  delete this[e];
11774
11836
  }
11775
11837
  } }, { key: "updateQueue", value: function value(e) {
11776
11838
  this.logger && this.logger.info("updateQueue");var t = this;t.queue.some(function (n, i) {
11777
11839
  return n.id === e.bullet.id && (t.queue.splice(i, 1), !0);
11778
- }), t.data.some(function (t, n) {
11779
- return t.id === e.bullet.id && (t.hasAttached = !1, !0);
11840
+ }), t.data.some(function (t) {
11841
+ return t.id === e.bullet.id && (t.attached_ = !1, !0);
11780
11842
  });
11781
- } }, { key: "init", value: function value(e, t) {
11782
- t.logger && t.logger.info("init"), t || (t = this), t.retryStatus = "normal", t.data.sort(function (e, t) {
11783
- return e.start - t.start;
11784
- });t.retryTimer || function e() {
11785
- "closed" === t.status && "stop" === t.retryStatus || ("playing" === t.status && (t.readData(), t.dataHandle()), "stop" === t.retryStatus && "paused" !== t.status || (t.dataHandleTimer = setTimeout(function () {
11786
- e();
11787
- }, t.interval - 1e3)));
11843
+ } }, { key: "init", value: function value() {
11844
+ var e = this;e.logger && e.logger.info("init"), e.retryStatus = "normal", e.sortData(), function t() {
11845
+ "closed" !== e._status || "stop" !== e.retryStatus ? ("playing" === e._status && (e.readData(), e.dataHandle()), "stop" === e.retryStatus && "paused" !== e._status || (e.handleTimer = setTimeout(function () {
11846
+ e.handleId = requestAnimationFrame(function () {
11847
+ t();
11848
+ });
11849
+ }, 250))) : e._cancelDataHandleTimer();
11788
11850
  }();
11789
11851
  } }, { key: "start", value: function value() {
11790
- this.logger && this.logger.info("start");this.status = "playing", this.queue = [], this.container.innerHTML = "", this.channel.resetWithCb(this.init, this);
11852
+ this.logger && this.logger.info("start");this._status = "playing", this.queue = [], this.container.innerHTML = "", this.channel.reset(), this.init();
11791
11853
  } }, { key: "stop", value: function value() {
11792
- this.logger && this.logger.info("stop");this.status = "closed", this.retryTimer = null, this.retryStatus = "stop", this.channel.reset(), this.queue = [], this.container.innerHTML = "";
11854
+ this.logger && this.logger.info("stop");this._status = "closed", this.retryStatus = "stop", this.queue = [], this.container.innerHTML = "", this.channel.reset();
11793
11855
  } }, { key: "clear", value: function value() {
11794
11856
  this.logger && this.logger.info("clear"), this.channel.reset(), this.data = [], this.queue = [], this.container.innerHTML = "";
11795
11857
  } }, { key: "play", value: function value() {
11796
- var e = this;this.logger && this.logger.info("play"), this.status = "playing";var t = this.channel.channels,
11797
- n = this.danmu.container.getBoundingClientRect();t && t.length > 0 && ["scroll", "top", "bottom"].forEach(function (i) {
11798
- e.queue.forEach(function (e) {
11799
- e.startMove(n), e.resized = !0;
11800
- });for (var o = 0; o < t.length; o++) {
11801
- t[o].queue[i].forEach(function (e) {
11802
- e.resized = !1;
11803
- });
11804
- }
11805
- });
11858
+ var e = this;if ("closed" !== this._status) {
11859
+ this.logger && this.logger.info("play"), this._status = "playing";var t = this.channel.channels;t && t.length > 0 && ["scroll", "top", "bottom"].forEach(function (n) {
11860
+ e.queue.forEach(function (e) {
11861
+ e.startMove(), e.resized = !0;
11862
+ });for (var i = 0; i < t.length; i++) {
11863
+ t[i].queue[n].forEach(function (e) {
11864
+ e.resized = !1;
11865
+ });
11866
+ }
11867
+ });
11868
+ } else this.logger && this.logger.info("play ignored");
11806
11869
  } }, { key: "pause", value: function value() {
11807
- this.logger && this.logger.info("pause"), this.status = "paused";var e = this.channel.channels,
11808
- t = this.danmu.container.getBoundingClientRect();e && e.length > 0 && this.queue.forEach(function (e) {
11809
- e.pauseMove(t);
11810
- });
11870
+ if ("closed" !== this._status) {
11871
+ this.logger && this.logger.info("pause"), this._status = "paused";var e = this.channel.channels;e && e.length > 0 && this.queue.forEach(function (e) {
11872
+ e.pauseMove();
11873
+ });
11874
+ } else this.logger && this.logger.info("pause ignored");
11811
11875
  } }, { key: "dataHandle", value: function value() {
11812
- var e = this;"paused" !== this.status && "closed" !== this.status && e.queue.length && e.queue.forEach(function (t) {
11813
- "waiting" === t.status && t.startMove(e.channel.containerPos);
11876
+ "paused" !== this._status && "closed" !== this._status && this.queue.length && this.queue.forEach(function (e) {
11877
+ "waiting" === e.status && e.startMove();
11814
11878
  });
11815
11879
  } }, { key: "readData", value: function value() {
11816
- var e = this,
11817
- t = this.danmu;if (t.isReady) {
11818
- var n = 0;t.player && t.player.currentTime && (n = s.default.formatTime(t.player.currentTime));var i = void 0,
11819
- o = e.interval,
11820
- r = e.channel,
11821
- l = void 0;t.player ? (l = e.data.filter(function (t) {
11822
- return !t.start && e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && (t.start = n), e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && t.start - o <= n && n <= t.start + o;
11823
- }), t.live && (e.data = [])) : 0 === (l = e.data.splice(0, 1)).length && (l = e.playedData.splice(0, 1)), l.length > 0 && l.forEach(function (n) {
11824
- if (e.forceDuration && e.forceDuration != n.duration && (n.duration = e.forceDuration), i = new a.default(t, n), n.hasAttached) {
11825
- for (var o in i.detach(), i) {
11826
- delete i[o];
11827
- }i = null, n.hasAttached = !1, n.noDiscard && (n.prior ? e.data.unshift(n) : e.data.push(n));
11828
- } else if (i.attach(), n.hasAttached = !0, r.addBullet(i).result) e.queue.push(i), e.nums++, i.topInit();else {
11829
- for (var s in i.detach(), i) {
11830
- delete i[s];
11831
- }i = null, n.hasAttached = !1, n.noDiscard && (n.prior ? e.data.unshift(n) : e.data.push(n));
11880
+ if (this.danmu.isReady) {
11881
+ var e = this,
11882
+ t = this.danmu,
11883
+ n = t.player,
11884
+ i = e.interval,
11885
+ o = e.channel,
11886
+ a = void 0,
11887
+ l = void 0;if (n) {
11888
+ var u = n.currentTime ? Math.floor(1e3 * n.currentTime) : 0;l = e.data.filter(function (t) {
11889
+ return !t.start && e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && (t.start = u), !t.attached_ && e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && t.start - i <= u && u <= t.start + i;
11890
+ }), t.live && (e.data = []);
11891
+ } else 0 === (l = e.data.splice(0, 1)).length && (l = e.playedData.splice(0, 1));if (l.length > 0) {
11892
+ o.updatePos();var c = 2;e: for (var f, h = 0; h < l.length; h++) {
11893
+ if (f = l[h], e.forceDuration && e.forceDuration !== f.duration && (f.duration = e.forceDuration), (a = new r.default(t, f)) && !a.bulletCreateFail) {
11894
+ if (a.attach(), f.attached_ = !0, o.addBullet(a).result) e.queue.push(a), a.topInit(), c = 2;else {
11895
+ for (var d in a.detach(), a) {
11896
+ s.hasOwnProperty.call(a, d) && delete a[d];
11897
+ }if (a = null, f.attached_ = !1, f.noDiscard && (f.prior ? e.data.unshift(f) : e.data.push(f)), 0 === c) break e;c--;
11898
+ }
11899
+ } else {
11900
+ if (0 === c) break e;c--;
11901
+ }
11832
11902
  }
11833
- });
11903
+ }
11834
11904
  }
11905
+ } }, { key: "sortData", value: function value() {
11906
+ this.data.sort(function (e, t) {
11907
+ return (e.start || -1) - (t.start || -1);
11908
+ });
11909
+ } }, { key: "status", get: function get() {
11910
+ return this._status;
11835
11911
  } }]), t;
11836
11912
  }(o.default);t.default = u, e.exports = t.default;
11837
11913
  }, function (e, t, n) {
11838
11914
  "use strict";
11839
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
11915
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Bullet = void 0;var i,
11916
+ o = function () {
11840
11917
  function e(e, t) {
11841
11918
  for (var n = 0; n < t.length; n++) {
11842
11919
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -11845,86 +11922,128 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11845
11922
  return n && e(t.prototype, n), i && e(t, i), t;
11846
11923
  };
11847
11924
  }(),
11848
- o = a(n(1)),
11849
- r = a(n(0));function a(e) {
11850
- return e && e.__esModule ? e : { default: e };
11851
- }var s = function (e) {
11925
+ r = n(1),
11926
+ a = (i = r) && i.__esModule ? i : { default: i },
11927
+ s = n(0);function l(e, t) {
11928
+ if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11929
+ }var u = t.Bullet = function (e) {
11930
+ function t(e, n) {
11931
+ !function (e, t) {
11932
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11933
+ }(this, t);var i = l(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this)),
11934
+ o = i,
11935
+ r = void 0;if (i.setLogger("bullet"), i.danmu = e, i.options = n, i.duration = n.duration, i.id = n.id, i.container = e.container, i.start = n.start, i.prior = n.prior, i.realTime = n.realTime, i.color = n.color, i.bookChannelId = n.bookChannelId, i.direction = e.direction, i.reuseDOM = !0, i.willChanges = [], i.domObj = e.domObj, n.el && 1 === n.el.nodeType) {
11936
+ if (n.el.parentNode) return l(i, { bulletCreateFail: !0 });if (e.config.disableCopyDOM) r = n.el, i.reuseDOM = !1;else {
11937
+ r = i.domObj.use();var a = (0, s.copyDom)(n.el);n.eventListeners && n.eventListeners.length > 0 && n.eventListeners.forEach(function (e) {
11938
+ a.addEventListener(e.event, e.listener, e.useCapture || !1);
11939
+ }), r.appendChild(a);
11940
+ }
11941
+ } else (r = i.domObj.use()).textContent = n.txt;if (i.onChangeDirection = function (e) {
11942
+ o.direction = e;
11943
+ }, i.danmu.on("changeDirection", i.onChangeDirection), n.style) {
11944
+ var u = n.style;Object.keys(u).forEach(function (e) {
11945
+ (0, s.styleUtil)(r, e, u[e]);
11946
+ });
11947
+ }"top" === n.mode || "bottom" === n.mode ? i.mode = n.mode : i.mode = "scroll", i.el = r, n.like && n.like.el && i.setLikeDom(n.like.el, n.like.style), i.status = "waiting";var c = void 0;if ((0, s.isNumber)(e.config.bulletOffset) && e.config.bulletOffset >= 0) c = e.config.bulletOffset;else {
11948
+ var f = e.containerPos;c = f.width / 10 > 100 ? 100 : f.width / 10;
11949
+ }var h = n.realTime ? 0 : Math.floor(Math.random() * c);return i.updateOffset(h), i;
11950
+ }return function (e, t) {
11951
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11952
+ }(t, e), o(t, [{ key: "updateOffset", value: function value(e) {
11953
+ this.random = e, (0, s.styleUtil)(this.el, "left", this.danmu.containerPos.width + e + "px");
11954
+ } }, { key: "attach", value: function value() {
11955
+ var e = this.el;this.container.appendChild(e), this.elPos = e.getBoundingClientRect(), "b2t" === this.direction ? (this.width = this.elPos.height, this.height = this.elPos.width) : (this.width = this.elPos.width, this.height = this.elPos.height), this.moveV && (this.duration = (this.danmu.containerPos.width + this.random + this.width) / this.moveV * 1e3), this.danmu.config && (this.danmu.config.mouseControl && (this.mouseoverFunWrapper = this.mouseoverFun.bind(this), e.addEventListener("mouseover", this.mouseoverFunWrapper, !1)), this.danmu.config.mouseEnterControl && (this.mouseEnterFunWrapper = this.mouseoverFun.bind(this), e.addEventListener("mouseenter", this.mouseEnterFunWrapper, !1))), e.addEventListener("transitionend", this._onTransitionEnd, !1);
11956
+ } }, { key: "detach", value: function value() {
11957
+ var e = this.el;if (e) {
11958
+ var t = this.danmu.config;t && (t.mouseControl && e.removeEventListener("mouseover", this.mouseoverFunWrapper, !1), t.mouseEnterControl && e.removeEventListener("mouseenter", this.mouseEnterFunWrapper, !1)), e.removeEventListener("transitionend", this._onTransitionEnd, !1), e.parentNode && e.parentNode.removeChild(e), this.reuseDOM && this.domObj.unused(e), this.el = null;
11959
+ }this.elPos = void 0, this.danmu.off("changeDirection", this.onChangeDirection);
11960
+ } }, { key: "willChange", value: function value() {
11961
+ var e = this.danmu.main.willChanges.concat(this.willChanges).join();(0, s.styleUtil)(this.el, "willChange", e);
11962
+ } }, { key: "mouseoverFun", value: function value(e) {
11963
+ this.danmu && this.danmu.mouseControl && this.danmu.config.mouseControlPause || "waiting" === this.status || "end" === this.status || this.danmu && this.danmu.emit("bullet_hover", { bullet: this, event: e });
11964
+ } }, { key: "_onTransitionEnd", value: function value() {
11965
+ this.status = "end", this.remove();
11966
+ } }, { key: "topInit", value: function value() {
11967
+ this.logger && this.logger.info("topInit #" + (this.options.txt || "[DOM Element]") + "#"), "b2t" === this.direction ? ((0, s.styleUtil)(this.el, "transformOrigin", "left top"), (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + this.danmu.containerPos.height + "px) translateZ(0px) rotate(90deg)"), (0, s.styleUtil)(this.el, "transition", "transform 0s linear 0s")) : (0, s.styleUtil)(this.el, "top", this.top + "px");
11968
+ } }, { key: "pauseMove", value: function value() {
11969
+ var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
11970
+ t = this;if ("paused" !== t.status && ("forcedPause" !== t.status && (this.status = "paused"), t._moveV = void 0, this.el)) if (this.willChange(), "scroll" === this.mode) {
11971
+ var n = t.danmu.containerPos;if (e) {
11972
+ var i = (new Date().getTime() - t.moveTime) / 1e3,
11973
+ o = i * this.moveV,
11974
+ r = 0;r = t.moveMoreS - o >= 0 ? "b2t" === this.direction ? (t.moveMoreS - o) / t.moveContainerHeight * n.height : (t.moveMoreS - o) / t.moveContainerWidth * n.width : t.moveMoreS - o, "b2t" === this.direction ? (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + r + "px) translateZ(0px) rotate(90deg)") : (0, s.styleUtil)(this.el, "left", r + "px");
11975
+ } else "b2t" === this.direction ? (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + (this.el.getBoundingClientRect().top - n.top) + "px) translateZ(0px) rotate(90deg)") : (0, s.styleUtil)(this.el, "left", this.el.getBoundingClientRect().left - n.left + "px");"b2t" === this.direction || (0, s.styleUtil)(this.el, "transform", "translateX(0px) translateY(0px) translateZ(0px)"), (0, s.styleUtil)(this.el, "transition", "transform 0s linear 0s");
11976
+ } else this.pastDuration && this.startTime ? this.pastDuration = this.pastDuration + new Date().getTime() - this.startTime : this.pastDuration = 1;
11977
+ } }, { key: "startMove", value: function value(e) {
11978
+ if (this.hasMove || (this.danmu.emit("bullet_start", this), this.hasMove = !0), ("forcedPause" !== this.status || e) && this.el && "start" !== this.status) if (this.status = "start", this.willChanges = ["transform", "transition"], this.willChange(), (0, s.styleUtil)(this.el, "backface-visibility", "hidden"), (0, s.styleUtil)(this.el, "perspective", "500em"), "scroll" === this.mode) {
11979
+ var t = this.danmu.containerPos;if ("b2t" === this.direction) {
11980
+ var n = (this.el.getBoundingClientRect().bottom - t.top) / this.moveV;(0, s.styleUtil)(this.el, "transition", "transform " + n + "s linear 0s"), (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(-" + this.height + "px) translateZ(0px) rotate(90deg)"), this.moveTime = new Date().getTime(), this.moveMoreS = this.el.getBoundingClientRect().top - t.top, this.moveContainerHeight = t.height;
11981
+ } else {
11982
+ if (!this.el) return;var i = this.el.getBoundingClientRect(),
11983
+ o = i.right - t.left,
11984
+ r = o / this.moveV;i.right > t.left ? ((0, s.styleUtil)(this.el, "transition", "transform " + r + "s linear 0s"), (0, s.styleUtil)(this.el, "transform", "translateX(-" + o + "px) translateY(0px) translateZ(0px)"), this.moveTime = new Date().getTime(), this.moveMoreS = i.left - t.left, this.moveContainerWidth = t.width) : (this.status = "end", this.remove());
11985
+ }
11986
+ } else {
11987
+ var a = new Date().getTime(),
11988
+ l = (this.startTime && a - this.startTime > this.duration ? a - this.startTime : this.duration) / 1e3;(0, s.styleUtil)(this.el, "left", "50%"), (0, s.styleUtil)(this.el, "margin", "0 0 0 -" + this.width / 2 + "px"), (0, s.styleUtil)(this.el, "visibility", "hidden"), (0, s.styleUtil)(this.el, "transition", "visibility " + l + "s 0s"), this.pastDuration || (this.pastDuration = 1), this.startTime = a;
11989
+ }
11990
+ } }, { key: "remove", value: function value() {
11991
+ this.logger && this.logger.info("remove #" + (this.options.txt || "[DOM Element]") + "#");this.pauseMove(), this.el && this.el.parentNode && (this.willChanges = [], this.willChange(), this.detach(), this.options.el && 1 === this.options.el.nodeType && this.danmu.config.disableCopyDOM && (0, s.styleUtil)(this.options.el, "transform", "none"), this.danmu.emit("bullet_remove", { bullet: this }));
11992
+ } }, { key: "setFontSize", value: function value(e) {
11993
+ this.el && (this.el.style.fontSize = e);
11994
+ } }, { key: "setLikeDom", value: function value(e, t) {
11995
+ if (e) {
11996
+ Object.keys(t).forEach(function (n) {
11997
+ e.style[n] = t[n];
11998
+ });if (e.className = "danmu-like", this.el) {
11999
+ var n = this.el.querySelector(".danmu-like");n && this.el.removeChild(n), this.el.innerHTML = "" + this.el.innerHTML + e.outerHTML;
12000
+ }
12001
+ }return e;
12002
+ } }, { key: "moveV", get: function get() {
12003
+ var e = this._moveV;if (!e) {
12004
+ if (this.options.moveV) e = this.options.moveV;else if (this.elPos) {
12005
+ var t = this.danmu.containerPos;e = ("b2t" === this.direction ? t.height + this.height : t.width + this.width) / this.duration * 1e3;
12006
+ }e && (e *= this.danmu.main.playRate, this._moveV = e);
12007
+ }return e;
12008
+ } }]), t;
12009
+ }(a.default);t.default = u;
12010
+ }, function (e, t, n) {
12011
+ "use strict";
12012
+ Object.defineProperty(t, "__esModule", { value: !0 });var i,
12013
+ o = function () {
12014
+ function e(e, t) {
12015
+ for (var n = 0; n < t.length; n++) {
12016
+ var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
12017
+ }
12018
+ }return function (t, n, i) {
12019
+ return n && e(t.prototype, n), i && e(t, i), t;
12020
+ };
12021
+ }(),
12022
+ r = n(1),
12023
+ a = (i = r) && i.__esModule ? i : { default: i },
12024
+ s = n(0),
12025
+ l = n(31);var u = function (e) {
11852
12026
  function t(e) {
11853
12027
  !function (e, t) {
11854
12028
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11855
12029
  }(this, t);var n = function (e, t) {
11856
12030
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11857
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));n.setLogger("channel"), n.danmu = e, n.reset(!0);var i = n;return r.default.on(n.danmu, "bullet_remove", function (e) {
12031
+ }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this)),
12032
+ i = n;return i.setLogger("channel"), i.danmu = e, i.reset(!0), i.direction = e.direction, i.channels = [], i.updatePos(), (0, s.attachEventListener)(n.danmu, "bullet_remove", function (e) {
11858
12033
  i.removeBullet(e.bullet);
11859
- }, "destroy"), n.direction = e.direction, r.default.on(n.danmu, "changeDirection", function (e) {
12034
+ }, "destroy"), (0, s.attachEventListener)(n.danmu, "changeDirection", function (e) {
11860
12035
  i.direction = e;
11861
- }, "destroy"), n.containerPos = n.danmu.container.getBoundingClientRect(), n.containerWidth = n.containerPos.width, n.containerHeight = n.containerPos.height, n.containerLeft = n.containerPos.left, n.containerRight = n.containerPos.right, r.default.on(n.danmu, "channel_resize", function () {
11862
- i.containerPos = i.danmu.container.getBoundingClientRect(), i.resizing || (i.containerWidth = i.containerPos.width, i.containerHeight = i.containerPos.height, i.containerLeft = i.containerPos.left, i.containerRight = i.containerPos.right, i.resize(!0));
12036
+ }, "destroy"), (0, s.attachEventListener)(n.danmu, "channel_resize", function () {
12037
+ i.resize();
11863
12038
  }, "destroy"), n;
11864
12039
  }return function (e, t) {
11865
12040
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11866
- }(t, e), i(t, [{ key: "destroy", value: function value() {
11867
- for (var e in this.logger && this.logger.info("destroy"), clearTimeout(this.resizeTimer), this.channels = [], this) {
11868
- delete this[e];
12041
+ }(t, e), o(t, [{ key: "updatePos", value: function value() {
12042
+ var e = this.container.getBoundingClientRect();this.containerPos = e, this.containerWidth = e.width, this.containerHeight = e.height, this.containerTop = e.top, this.containerBottom = e.bottom, this.containerLeft = e.left, this.containerRight = e.right;
12043
+ } }, { key: "destroy", value: function value() {
12044
+ for (var e in this.logger && this.logger.info("destroy"), this.channels.splice(0, this.channels.length), this._cancelResizeTimer(), this) {
12045
+ s.hasOwnProperty.call(this, e) && delete this[e];
11869
12046
  }
11870
- } }, { key: "resize", value: function value() {
11871
- var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("resize");var t = this.danmu.container,
11872
- n = this;n.resizing || (n.resizing = !0, this.resizeTimer = setTimeout(function () {
11873
- n.danmu.bulletBtn.main.data && n.danmu.bulletBtn.main.data.forEach(function (e) {
11874
- e.bookChannelId && (delete e.bookChannelId, n.logger && n.logger.info("resize导致" + e.id + "号优先弹幕预定取消"));
11875
- }), n.logger && n.logger.info("resize导致所有轨道恢复正常使用");var i = t.getBoundingClientRect();n.width = i.width, n.height = i.height, n.danmu.config.area && n.danmu.config.area.start >= 0 && n.danmu.config.area.end >= n.danmu.config.area.start && ("b2t" === n.direction ? n.width = n.width * (n.danmu.config.area.end - n.danmu.config.area.start) : n.height = n.height * (n.danmu.config.area.end - n.danmu.config.area.start)), n.container = t;var o = n.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
11876
- r = void 0;r = "b2t" === n.direction ? Math.floor(n.width / o) : Math.floor(n.height / o);for (var a = [], s = 0; s < r; s++) {
11877
- a[s] = { id: s, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
11878
- }if (n.channels && n.channels.length <= a.length) {
11879
- for (var l = function l(t) {
11880
- a[t] = { id: t, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top"].forEach(function (i) {
11881
- n.channels[t].queue[i].forEach(function (o) {
11882
- o.el && (a[t].queue[i].push(o), o.resized || (o.pauseMove(n.containerPos, e), "paused" !== o.danmu.bulletBtn.main.status && o.startMove(n.containerPos), o.resized = !0));
11883
- });
11884
- }), n.channels[t].queue.bottom.forEach(function (i) {
11885
- if (i.el) {
11886
- if (a[t + a.length - n.channels.length].queue.bottom.push(i), i.channel_id[0] + i.channel_id[1] - 1 === t) {
11887
- var r = [].concat(i.channel_id);i.channel_id = [r[0] - n.channels.length + a.length, r[1]], i.top = i.channel_id[0] * o, n.danmu.config.area && n.danmu.config.area.start && (i.top += n.containerHeight * n.danmu.config.area.start), i.topInit();
11888
- }i.resized || (i.pauseMove(n.containerPos, e), "paused" !== i.danmu.bulletBtn.main.status && i.startMove(n.containerPos), i.resized = !0);
11889
- }
11890
- });
11891
- }, u = 0; u < n.channels.length; u++) {
11892
- l(u);
11893
- }for (var c = function c(e) {
11894
- ["scroll", "top", "bottom"].forEach(function (t) {
11895
- a[e].queue[t].forEach(function (e) {
11896
- e.resized = !1;
11897
- });
11898
- });
11899
- }, f = 0; f < a.length; f++) {
11900
- c(f);
11901
- }n.channels = a, "b2t" === n.direction ? n.channelWidth = o : n.channelHeight = o;
11902
- } else if (n.channels && n.channels.length > a.length) {
11903
- for (var h = function h(t) {
11904
- a[t] = { id: t, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top", "bottom"].forEach(function (i) {
11905
- if ("top" === i && t > Math.floor(a.length / 2)) ;else if ("bottom" === i && t <= Math.floor(a.length / 2)) ;else {
11906
- var r = "bottom" === i ? t - a.length + n.channels.length : t;n.channels[r].queue[i].forEach(function (s, l) {
11907
- if (s.el) {
11908
- if (a[t].queue[i].push(s), "bottom" === i && s.channel_id[0] + s.channel_id[1] - 1 === r) {
11909
- var u = [].concat(s.channel_id);s.channel_id = [u[0] - n.channels.length + a.length, u[1]], s.top = s.channel_id[0] * o, n.danmu.config.area && n.danmu.config.area.start && (s.top += n.containerHeight * n.danmu.config.area.start), s.topInit();
11910
- }s.pauseMove(n.containerPos, e), "paused" !== s.danmu.bulletBtn.main.status && s.startMove(n.containerPos), s.resized || (s.resized = !0);
11911
- }n.channels[r].queue[i].splice(l, 1);
11912
- });
11913
- }
11914
- });
11915
- }, d = 0; d < a.length; d++) {
11916
- h(d);
11917
- }for (var g = function g(e) {
11918
- ["scroll", "top", "bottom"].forEach(function (t) {
11919
- a[e].queue[t].forEach(function (e) {
11920
- e.resized = !1;
11921
- });
11922
- });
11923
- }, p = 0; p < a.length; p++) {
11924
- g(p);
11925
- }n.channels = a, "b2t" === n.direction ? n.channelWidth = o : n.channelHeight = o;
11926
- }n.resizing = !1;
11927
- }, 10));
11928
12047
  } }, { key: "addBullet", value: function value(e) {
11929
12048
  var t = this,
11930
12049
  n = this.danmu,
@@ -11934,36 +12053,38 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11934
12053
  a = void 0;if ("b2t" === t.direction ? (r = this.channelWidth, a = Math.ceil(e.width / r)) : (o = this.channelHeight, a = Math.ceil(e.height / o)), a > i.length) return { result: !1, message: "exceed channels.length, occupy=" + a + ",channelsSize=" + i.length };for (var s = !0, l = void 0, u = -1, c = 0, f = i.length; c < f; c++) {
11935
12054
  if (i[c].queue[e.mode].some(function (t) {
11936
12055
  return t.id === e.id;
11937
- })) return { result: !1, message: "exsited, channelOrder=" + c + ",danmu_id=" + e.id };
12056
+ })) return { result: !1, message: "exited, channelOrder=" + c + ",danmu_id=" + e.id };
11938
12057
  }if ("scroll" === e.mode) for (var h = 0, d = i.length - a; h <= d; h++) {
11939
- s = !0;for (var g = h; g < h + a; g++) {
11940
- if ((l = i[g]).operating.scroll) {
12058
+ s = !0;for (var p = h; p < h + a; p++) {
12059
+ if ((l = i[p]).operating.scroll) {
11941
12060
  s = !1;break;
11942
12061
  }if (l.bookId.scroll && l.bookId.scroll !== e.id) {
11943
12062
  s = !1;break;
11944
- }l.operating.scroll = !0;var p = l.queue.scroll[0];if (p) {
11945
- var m = p.el.getBoundingClientRect();if ("b2t" === t.direction) {
11946
- if (m.bottom > t.containerPos.bottom) {
12063
+ }l.operating.scroll = !0;var g = l.queue.scroll[0];if (g) {
12064
+ var m = g.el.getBoundingClientRect();if ("b2t" === t.direction) {
12065
+ if (m.bottom >= t.containerPos.bottom) {
11947
12066
  s = !1, l.operating.scroll = !1;break;
11948
12067
  }
11949
- } else if (m.right > t.containerPos.right) {
12068
+ } else if (m.right >= t.containerPos.right) {
11950
12069
  s = !1, l.operating.scroll = !1;break;
11951
- }var v,
12070
+ }var v = void 0,
12071
+ y = g.moveV,
11952
12072
  b = void 0,
11953
- y = void 0,
11954
- w = void 0,
11955
- _ = void 0;if ("b2t" === t.direction ? (y = (m.top - t.containerPos.top + m.height) / (b = (t.containerPos.height + m.height) / p.duration), w = t.containerPos.height, _ = (t.containerPos.height + e.height) / e.duration) : (y = (m.left - t.containerPos.left + m.width) / (b = (t.containerPos.width + m.width) / p.duration), w = t.containerPos.width, _ = (t.containerPos.width + e.width) / e.duration), v = w / _, n.config.bOffset || (n.config.bOffset = 0), b < _ && y + n.config.bOffset > v) {
11956
- s = !1, l.operating.scroll = !1;break;
12073
+ _ = e.moveV,
12074
+ w = void 0;if ("b2t" === t.direction ? (b = (v = m.bottom - t.containerTop) / y, w = t.containerHeight + e.random - v) : (b = (v = m.right - t.containerLeft) / y, w = t.containerWidth + e.random - v), _ > y) {
12075
+ var O = w / (_ - y);if (n.config.bOffset || (n.config.bOffset = 0), b + n.config.bOffset >= O) {
12076
+ var k = b * _ - t.containerPos.width;k > 0 && e.updateOffset(k + (1 + Math.ceil(5 * Math.random())));
12077
+ }
11957
12078
  }
11958
12079
  }l.operating.scroll = !1;
11959
12080
  }if (s) {
11960
12081
  u = h;break;
11961
12082
  }
11962
- } else if ("top" === e.mode) for (var O = 0, k = i.length - a; O <= k; O++) {
11963
- s = !0;for (var x = O; x < O + a; x++) {
11964
- if (x > Math.floor(i.length / 2)) {
12083
+ } else if ("top" === e.mode) for (var x = 0, C = i.length - a; x <= C; x++) {
12084
+ s = !0;for (var j = x; j < x + a; j++) {
12085
+ if (j > Math.floor(i.length / 2)) {
11965
12086
  s = !1;break;
11966
- }if ((l = i[x]).operating[e.mode]) {
12087
+ }if ((l = i[j]).operating[e.mode]) {
11967
12088
  s = !1;break;
11968
12089
  }if ((l.bookId[e.mode] || e.prior) && l.bookId[e.mode] !== e.id) {
11969
12090
  s = !1;break;
@@ -11971,13 +12092,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11971
12092
  s = !1, l.operating[e.mode] = !1;break;
11972
12093
  }l.operating[e.mode] = !1;
11973
12094
  }if (s) {
11974
- u = O;break;
12095
+ u = x;break;
11975
12096
  }
11976
- } else if ("bottom" === e.mode) for (var M = i.length - a; M >= 0; M--) {
11977
- s = !0;for (var C = M; C < M + a; C++) {
11978
- if (C <= Math.floor(i.length / 2)) {
12097
+ } else if ("bottom" === e.mode) for (var E = i.length - a; E >= 0; E--) {
12098
+ s = !0;for (var M = E; M < E + a; M++) {
12099
+ if (M <= Math.floor(i.length / 2)) {
11979
12100
  s = !1;break;
11980
- }if ((l = i[C]).operating[e.mode]) {
12101
+ }if ((l = i[M]).operating[e.mode]) {
11981
12102
  s = !1;break;
11982
12103
  }if ((l.bookId[e.mode] || e.prior) && l.bookId[e.mode] !== e.id) {
11983
12104
  s = !1;break;
@@ -11985,40 +12106,40 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11985
12106
  s = !1, l.operating[e.mode] = !1;break;
11986
12107
  }l.operating[e.mode] = !1;
11987
12108
  }if (s) {
11988
- u = M;break;
12109
+ u = E;break;
11989
12110
  }
11990
12111
  }if (-1 !== u) {
11991
- for (var E = u, j = u + a; E < j; E++) {
11992
- (l = i[E]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && (delete l.bookId[e.mode], t.logger && t.logger.info(E + "号轨道恢复正常使用")), l.operating[e.mode] = !1;
12112
+ for (var L = u, T = u + a; L < T; L++) {
12113
+ (l = i[L]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && (delete l.bookId[e.mode], t.logger && t.logger.info(L + "号轨道恢复正常使用")), l.operating[e.mode] = !1;
11993
12114
  }if (e.prior) if (t.logger && t.logger.info(e.id + "号优先弹幕运行完毕"), delete e.bookChannelId, n.player) n.bulletBtn.main.data.some(function (t) {
11994
12115
  return t.id === e.id && (delete t.bookChannelId, !0);
11995
12116
  });return e.channel_id = [u, a], "b2t" === t.direction ? (e.top = u * r, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerWidth * t.danmu.config.area.start)) : (e.top = u * o, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerHeight * t.danmu.config.area.start)), { result: e, message: "success" };
11996
12117
  }if (e.options.realTime) {
11997
- var B = 0,
11998
- T = -1,
11999
- P = null;if (t.danmu.bulletBtn.main.queue.forEach(function (e, n) {
12000
- !e.prior && !e.options.realTime && e.el && e.el.getBoundingClientRect().left > t.containerPos.right && e.start >= B && (B = e.start, T = n, P = e);
12001
- }), P) {
12002
- P.remove(), t.removeBullet(P), t.danmu.bulletBtn.main.queue.splice(T, 1), e.channel_id = P.channel_id;for (var z = P.channel_id[0], S = P.channel_id[0] + P.channel_id[1]; z < S; z++) {
12003
- (l = i[z]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && delete l.bookId[e.mode], l.operating[e.mode] = !1;
12004
- }return e.top = P.top, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerHeight * t.danmu.config.area.start), { result: e, message: "success" };
12118
+ var P = 0,
12119
+ z = -1,
12120
+ S = null;if (t.danmu.bulletBtn.main.queue.forEach(function (e, n) {
12121
+ !e.prior && !e.options.realTime && e.el && e.el.getBoundingClientRect().left > t.containerPos.right && e.start >= P && (P = e.start, z = n, S = e);
12122
+ }), S) {
12123
+ S.remove(), t.removeBullet(S), t.danmu.bulletBtn.main.queue.splice(z, 1), e.channel_id = S.channel_id;for (var D = S.channel_id[0], I = S.channel_id[0] + S.channel_id[1]; D < I; D++) {
12124
+ (l = i[D]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && delete l.bookId[e.mode], l.operating[e.mode] = !1;
12125
+ }return e.top = S.top, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerHeight * t.danmu.config.area.start), { result: e, message: "success" };
12005
12126
  }
12006
12127
  }if (e.prior) if (e.bookChannelId || t.danmu.live) {
12007
12128
  if (n.player) n.bulletBtn.main.data.some(function (n) {
12008
12129
  return n.id === e.id && (t.logger && t.logger.info(e.id + "号优先弹幕将于2秒后再次请求注册"), n.start += 2e3, !0);
12009
12130
  });
12010
12131
  } else {
12011
- u = -1;for (var L = 0, D = i.length - a; L <= D; L++) {
12012
- s = !0;for (var q = L; q < L + a; q++) {
12013
- if (i[q].bookId[e.mode]) {
12132
+ u = -1;for (var q = 0, R = i.length - a; q <= R; q++) {
12133
+ s = !0;for (var A = q; A < q + a; A++) {
12134
+ if (i[A].bookId[e.mode]) {
12014
12135
  s = !1;break;
12015
12136
  }
12016
12137
  }if (s) {
12017
- u = L;break;
12138
+ u = q;break;
12018
12139
  }
12019
12140
  }if (-1 !== u) {
12020
- for (var R = u; R < u + a; R++) {
12021
- i[R].bookId[e.mode] = e.id, t.logger && t.logger.info(R + "号轨道被" + e.id + "号优先弹幕预定");
12141
+ for (var U = u; U < u + a; U++) {
12142
+ i[U].bookId[e.mode] = e.id, t.logger && t.logger.info(U + "号轨道被" + e.id + "号优先弹幕预定");
12022
12143
  }if (n.player) n.bulletBtn.main.data.some(function (n) {
12023
12144
  return n.id === e.id && (t.logger && t.logger.info(e.id + "号优先弹幕将于2秒后再次请求注册"), n.start += 2e3, n.bookChannelId = [u, a], t.logger && t.logger.info(e.id + "号优先弹幕预定了" + u + "~" + (u + a - 1) + "号轨道"), !0);
12024
12145
  });
@@ -12032,187 +12153,107 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12032
12153
  }), a > -1 && i.queue[e.mode].splice(a, 1), i.operating[e.mode] = !1;
12033
12154
  }
12034
12155
  }e.options.loop && this.danmu.bulletBtn.main.playedData.push(e.options);
12035
- } }, { key: "resetArea", value: function value() {
12036
- this.logger && this.logger.info("resetArea");var e = this.danmu.container,
12037
- t = this,
12038
- n = e.getBoundingClientRect();t.width = n.width, t.height = n.height, t.danmu.config.area && t.danmu.config.area.start >= 0 && t.danmu.config.area.end >= t.danmu.config.area.start && ("b2t" === t.direction ? t.width = t.width * (t.danmu.config.area.end - t.danmu.config.area.start) : t.height = t.height * (t.danmu.config.area.end - t.danmu.config.area.start)), t.container = e;var i = t.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
12039
- o = void 0;o = "b2t" === t.direction ? Math.floor(t.width / i) : Math.floor(t.height / i);for (var r = [], a = 0; a < o; a++) {
12040
- r[a] = { id: a, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12041
- }if (t.channels && t.channels.length <= r.length) {
12042
- for (var s = function s(e) {
12043
- r[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top"].forEach(function (n) {
12044
- t.channels[e].queue[n].forEach(function (i) {
12045
- i.el && (r[e].queue[n].push(i), i.resized || (i.pauseMove(t.containerPos, !1), i.startMove(t.containerPos), i.resized = !0));
12156
+ } }, { key: "resizeSync", value: function value() {
12157
+ this.resize(!0);
12158
+ } }, { key: "resize", value: function value() {
12159
+ var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("resize");var t = this;function n() {
12160
+ var e = t.danmu,
12161
+ n = e.container,
12162
+ i = e.config,
12163
+ o = e.bulletBtn,
12164
+ r = void 0;if (t.updatePos(), t._cancelResizeTimer(), o.main.data && o.main.data.forEach(function (e) {
12165
+ e.bookChannelId && (delete e.bookChannelId, t.logger && t.logger.info("resize导致" + e.id + "号优先弹幕预定取消"));
12166
+ }), t.logger && t.logger.info("resize导致所有轨道恢复正常使用"), t.width = t.containerWidth, t.height = t.containerHeight, i.area) {
12167
+ var a = i.area,
12168
+ u = a.lines,
12169
+ c = a.start,
12170
+ f = a.end;(0, l.validAreaLineRule)(u) ? r = u : c >= 0 && f >= c && ("b2t" === t.direction ? t.width = t.width * (f - c) : t.height = t.height * (f - c));
12171
+ }t.container = n;var h = i.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12);(0, s.isNumber)(r) || (r = "b2t" === t.direction ? Math.floor(t.width / h) : Math.floor(t.height / h));for (var d = [], p = 0; p < r; p++) {
12172
+ d[p] = { id: p, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12173
+ }if (t.channels && t.channels.length <= d.length) {
12174
+ for (var g = function g(e) {
12175
+ d[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top"].forEach(function (n) {
12176
+ t.channels[e].queue[n].forEach(function (t) {
12177
+ t.el && d[e].queue[n].push(t);
12178
+ });
12179
+ }), t.channels[e].queue.bottom.forEach(function (n) {
12180
+ if (n.el && (d[e + d.length - t.channels.length].queue.bottom.push(n), n.channel_id[0] + n.channel_id[1] - 1 === e)) {
12181
+ var i = [].concat(n.channel_id);n.channel_id = [i[0] - t.channels.length + d.length, i[1]], n.top = n.channel_id[0] * h, t.danmu.config.area && t.danmu.config.area.start && (n.top += t.containerHeight * t.danmu.config.area.start), n.topInit();
12182
+ }
12046
12183
  });
12047
- }), t.channels[e].queue.bottom.forEach(function (n) {
12048
- if (n.el) {
12049
- if (r[e + r.length - t.channels.length].queue.bottom.push(n), n.channel_id[0] + n.channel_id[1] - 1 === e) {
12050
- var o = [].concat(n.channel_id);n.channel_id = [o[0] - t.channels.length + r.length, o[1]], n.top = n.channel_id[0] * i, t.danmu.config.area && t.danmu.config.area.start && (n.top += t.containerHeight * t.danmu.config.area.start), n.topInit();
12051
- }n.resized || (n.pauseMove(t.containerPos, !1), n.startMove(t.containerPos), n.resized = !0);
12052
- }
12053
- });
12054
- }, l = 0; l < t.channels.length; l++) {
12055
- s(l);
12056
- }for (var u = function u(e) {
12057
- ["scroll", "top", "bottom"].forEach(function (t) {
12058
- r[e].queue[t].forEach(function (e) {
12059
- e.resized = !1;
12184
+ }, m = 0; m < t.channels.length; m++) {
12185
+ g(m);
12186
+ }for (var v = function v(e) {
12187
+ ["scroll", "top", "bottom"].forEach(function (t) {
12188
+ d[e].queue[t].forEach(function (e) {
12189
+ e.resized = !1;
12190
+ });
12060
12191
  });
12061
- });
12062
- }, c = 0; c < r.length; c++) {
12063
- u(c);
12064
- }t.channels = r, "b2t" === t.direction ? t.channelWidth = i : t.channelHeight = i;
12065
- } else if (t.channels && t.channels.length > r.length) {
12066
- for (var f = function f(e) {
12067
- r[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top", "bottom"].forEach(function (n) {
12068
- if ("top" === n && e > Math.floor(r.length / 2)) ;else if ("bottom" === n && e <= Math.floor(r.length / 2)) ;else {
12069
- var o = "bottom" === n ? e - r.length + t.channels.length : e;t.channels[o].queue[n].forEach(function (a, s) {
12070
- if (a.el) {
12071
- if (r[e].queue[n].push(a), "bottom" === n && a.channel_id[0] + a.channel_id[1] - 1 === o) {
12072
- var l = [].concat(a.channel_id);a.channel_id = [l[0] - t.channels.length + r.length, l[1]], a.top = a.channel_id[0] * i, t.danmu.config.area && t.danmu.config.area.start && (a.top += t.containerHeight * t.danmu.config.area.start), a.topInit();
12073
- }a.resized || (a.pauseMove(t.containerPos, !1), a.startMove(t.containerPos), a.resized = !0);
12074
- }t.channels[o].queue[n].splice(s, 1);
12192
+ }, y = 0; y < d.length; y++) {
12193
+ v(y);
12194
+ }t.channels = d, "b2t" === t.direction ? t.channelWidth = h : t.channelHeight = h;
12195
+ } else if (t.channels && t.channels.length > d.length) {
12196
+ for (var b = function b(e) {
12197
+ d[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top", "bottom"].forEach(function (n) {
12198
+ if ("top" === n && e > Math.floor(d.length / 2)) ;else if ("bottom" === n && e <= Math.floor(d.length / 2)) ;else {
12199
+ var i = "bottom" === n ? e - d.length + t.channels.length : e;t.channels[i].queue[n].forEach(function (o, r) {
12200
+ if (o.el && (d[e].queue[n].push(o), "bottom" === n && o.channel_id[0] + o.channel_id[1] - 1 === i)) {
12201
+ var a = [].concat(o.channel_id);o.channel_id = [a[0] - t.channels.length + d.length, a[1]], o.top = o.channel_id[0] * h, t.danmu.config.area && t.danmu.config.area.start && (o.top += t.containerHeight * t.danmu.config.area.start), o.topInit();
12202
+ }t.channels[i].queue[n].splice(r, 1);
12203
+ });
12204
+ }
12205
+ });
12206
+ }, _ = 0; _ < d.length; _++) {
12207
+ b(_);
12208
+ }for (var w = function w(e) {
12209
+ ["scroll", "top", "bottom"].forEach(function (t) {
12210
+ d[e].queue[t].forEach(function (e) {
12211
+ e.resized = !1;
12075
12212
  });
12076
- }
12077
- });
12078
- }, h = 0; h < r.length; h++) {
12079
- f(h);
12080
- }for (var d = function d(e) {
12081
- ["scroll", "top", "bottom"].forEach(function (t) {
12082
- r[e].queue[t].forEach(function (e) {
12083
- e.resized = !1;
12084
12213
  });
12085
- });
12086
- }, g = 0; g < r.length; g++) {
12087
- d(g);
12088
- }t.channels = r, "b2t" === t.direction ? t.channelWidth = i : t.channelHeight = i;
12089
- }
12214
+ }, O = 0; O < d.length; O++) {
12215
+ w(O);
12216
+ }t.channels = d, "b2t" === t.direction ? t.channelWidth = h : t.channelHeight = h;
12217
+ }t.resizing = !1;
12218
+ }t.resizing || (t.resizing = !0, e ? n() : (this._cancelResizeTimer(), this.resizeId = requestAnimationFrame(n)));
12219
+ } }, { key: "_cancelResizeTimer", value: function value() {
12220
+ this.resizeId && (cancelAnimationFrame(this.resizeId), this.resizeId = null);
12090
12221
  } }, { key: "reset", value: function value() {
12091
- var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("reset");var t = this.danmu.container,
12092
- n = this;function i() {
12093
- var e = t.getBoundingClientRect();n.width = e.width, n.height = e.height, n.danmu.config.area && n.danmu.config.area.start >= 0 && n.danmu.config.area.end >= n.danmu.config.area.start && ("b2t" === n.direction ? n.width = n.width * (n.danmu.config.area.end - n.danmu.config.area.start) : n.height = n.height * (n.danmu.config.area.end - n.danmu.config.area.start)), n.container = t;var i = n.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
12094
- o = void 0;o = "b2t" === n.direction ? Math.floor(n.width / i) : Math.floor(n.height / i);for (var r = [], a = 0; a < o; a++) {
12095
- r[a] = { id: a, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12096
- }n.channels = r, "b2t" === n.direction ? n.channelWidth = i : n.channelHeight = i;
12097
- }n.danmu.bulletBtn && n.danmu.bulletBtn.main && n.danmu.bulletBtn.main.queue.forEach(function (e) {
12098
- e.pauseMove(n.containerPos), e.remove();
12099
- }), n.channels && n.channels.length > 0 && ["scroll", "top", "bottom"].forEach(function (e) {
12100
- for (var t = 0; t < n.channels.length; t++) {
12101
- n.channels[t].queue[e].forEach(function (e) {
12102
- e.pauseMove(n.containerPos), e.remove();
12103
- });
12104
- }
12105
- }), n.danmu.bulletBtn && n.danmu.bulletBtn.main && n.danmu.bulletBtn.main.data && n.danmu.bulletBtn.main.data.forEach(function (e) {
12106
- e.hasAttached = !1;
12107
- }), e ? this.resetTimer = setTimeout(i, 200) : i();
12108
- } }, { key: "resetWithCb", value: function value(e, t) {
12109
- this.logger && this.logger.info("resetWithCb");var n = this.danmu.container,
12110
- i = this;i.channels && i.channels.length > 0 && ["scroll", "top", "bottom"].forEach(function (e) {
12111
- for (var t = 0; t < i.channels.length; t++) {
12112
- i.channels[t].queue[e].forEach(function (e) {
12113
- e.pauseMove(i.containerPos), e.remove();
12222
+ var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("reset");var t = this,
12223
+ n = t.danmu,
12224
+ i = n.container,
12225
+ o = n.bulletBtn,
12226
+ r = n.config;function a() {
12227
+ var e = void 0,
12228
+ n = i.getBoundingClientRect();if (t.width = n.width, t.height = n.height, t.resetId && (cancelAnimationFrame(t.resetId), t.resetId = null), r.area) {
12229
+ var o = r.area,
12230
+ a = o.lines,
12231
+ u = o.start,
12232
+ c = o.end;(0, l.validAreaLineRule)(a) ? e = a : u >= 0 && c >= u && ("b2t" === t.direction ? t.width = t.width * (c - u) : t.height = t.height * (c - u));
12233
+ }var f = r.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12);(0, s.isNumber)(e) || (e = "b2t" === t.direction ? Math.floor(t.width / f) : Math.floor(t.height / f));for (var h = [], d = 0; d < e; d++) {
12234
+ h[d] = { id: d, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12235
+ }t.channels = h, "b2t" === t.direction ? t.channelWidth = f : t.channelHeight = f;
12236
+ }t.container = i, o && o.main && o.main.queue.forEach(function (e) {
12237
+ e.remove();
12238
+ }), t.channels && t.channels.length > 0 && ["scroll", "top", "bottom"].forEach(function (e) {
12239
+ for (var n = 0; n < t.channels.length; n++) {
12240
+ t.channels[n].queue[e].forEach(function (e) {
12241
+ e.remove();
12114
12242
  });
12115
12243
  }
12116
- });var o = n.getBoundingClientRect();i.width = o.width, i.height = o.height, i.danmu.config.area && i.danmu.config.area.start >= 0 && i.danmu.config.area.end >= i.danmu.config.area.start && ("b2t" === i.direction ? i.width = i.width * (i.danmu.config.area.end - i.danmu.config.area.start) : i.height = i.height * (i.danmu.config.area.end - i.danmu.config.area.start)), i.container = n;var r = i.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
12117
- a = void 0;a = "b2t" === i.direction ? Math.floor(i.width / r) : Math.floor(i.height / r);for (var s = [], l = 0; l < a; l++) {
12118
- s[l] = { id: l, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12119
- }i.channels = s, i.channelHeight = r, e && e(!0, t);
12244
+ }), o && o.main && o.main.data && o.main.data.forEach(function (e) {
12245
+ e.attached_ = !1;
12246
+ }), e ? this.resetId = requestAnimationFrame(a) : a();
12120
12247
  } }]), t;
12121
- }(o.default);t.default = s, e.exports = t.default;
12248
+ }(a.default);t.default = u, e.exports = t.default;
12122
12249
  }, function (e, t, n) {
12123
12250
  "use strict";
12124
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
12125
- function e(e, t) {
12126
- for (var n = 0; n < t.length; n++) {
12127
- var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
12128
- }
12129
- }return function (t, n, i) {
12130
- return n && e(t.prototype, n), i && e(t, i), t;
12131
- };
12132
- }(),
12133
- o = a(n(1)),
12134
- r = a(n(0));function a(e) {
12135
- return e && e.__esModule ? e : { default: e };
12136
- }var s = function (e) {
12137
- function t(e, n) {
12138
- !function (e, t) {
12139
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12140
- }(this, t);var i = function (e, t) {
12141
- if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
12142
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));i.setLogger("bullet"), i.danmu = e, i.options = n, i.duration = n.duration, i.moveV = n.moveV, i.id = n.id, i.container = e.container, i.start = n.start, i.prior = n.prior, i.color = n.color, i.bookChannelId = n.bookChannelId, i.direction = e.direction;var o = i;i.onChangeDirection = function (e) {
12143
- o.direction = e;
12144
- }, i.danmu.on("changeDirection", i.onChangeDirection);var a = void 0;if (i.domObj = e.domObj, n.el && 1 === n.el.nodeType) {
12145
- a = i.domObj.use();var s = r.default.copyDom(n.el);n.eventListeners && n.eventListeners.length > 0 && n.eventListeners.forEach(function (e) {
12146
- s.addEventListener(e.event, e.listener, e.useCapture || !1);
12147
- }), a.appendChild(s);
12148
- } else (a = i.domObj.use()).textContent = n.txt;if (n.style) {
12149
- var l = n.style;Object.keys(l).forEach(function (e) {
12150
- r.default.style(a, e, l[e]);
12151
- });
12152
- }"top" === n.mode || "bottom" === n.mode ? i.mode = n.mode : i.mode = "scroll", i.el = a, n.like && n.like.el && i.setLikeDom(n.like.el, n.like.style), i.status = "waiting";var u = i.container.getBoundingClientRect(),
12153
- c = Math.floor(Math.random() * (u.width / 10 > 100 ? 200 : u.width / 10));n.realTime && (c = 0);var f = u.width + c + "px";return r.default.style(i.el, "left", f), i.containerPos = u, i;
12154
- }return function (e, t) {
12155
- if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
12156
- }(t, e), i(t, [{ key: "attach", value: function value() {
12157
- if (this.container.appendChild(this.el), this.elPos = this.el.getBoundingClientRect(), "b2t" === this.direction ? (this.width = this.elPos.height, this.height = this.elPos.width) : (this.width = this.elPos.width, this.height = this.elPos.height), this.moveV) {
12158
- var e = this.containerPos;this.duration = (e.width + this.width) / this.moveV * 1e3;
12159
- }this.danmu.config && this.danmu.config.mouseControl && (this.mouseoverFunWrapper = this.mouseoverFun.bind(this), this.el.addEventListener("mouseover", this.mouseoverFunWrapper, !1)), this.danmu.config && this.danmu.config.mouseEnterControl && (this.mouseEnterFunWrapper = this.mouseoverFun.bind(this), this.el.addEventListener("mouseenter", this.mouseEnterFunWrapper, !1));
12160
- } }, { key: "mouseoverFun", value: function value(e) {
12161
- this.danmu && this.danmu.mouseControl && this.danmu.config.mouseControlPause || "waiting" === this.status || "end" === this.status || this.danmu && this.danmu.emit("bullet_hover", { bullet: this, event: e });
12162
- } }, { key: "detach", value: function value() {
12163
- this.el && (this.danmu.config && this.danmu.config.mouseControl && this.el.removeEventListener("mouseover", this.mouseoverFunWrapper, !1), this.danmu.config && this.danmu.config.mouseEnterControl && this.el.removeEventListener("mouseenter", this.mouseEnterFunWrapper, !1), this.el.parentNode && this.el.parentNode.removeChild(this.el), this.domObj.unuse(this.el), this.el = null), this.danmu.off("changeDirection", this.onChangeDirection);
12164
- } }, { key: "topInit", value: function value() {
12165
- if (this.logger && this.logger.info("topInit #" + (this.options.txt || "[DOM Element]") + "#"), "b2t" === this.direction) {
12166
- var e = this.containerPos;r.default.style(this.el, "transformOrigin", "left top"), r.default.style(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + e.height + "px) translateZ(0px) rotate(90deg)"), r.default.style(this.el, "transition", "transform 0s linear 0s");
12167
- } else r.default.style(this.el, "top", this.top + "px");
12168
- } }, { key: "pauseMove", value: function value(e) {
12169
- var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];this.logger && this.logger.info("pauseMove #" + (this.options.txt || "[DOM Element]") + "#");var n = this;if ("paused" !== this.status && ("forcedPause" !== n.status && (this.status = "paused"), clearTimeout(n.removeTimer), this.el)) if (r.default.style(this.el, "willChange", "auto"), "scroll" === this.mode) {
12170
- if (t) {
12171
- var i = (new Date().getTime() - n.moveTime) / 1e3,
12172
- o = i * this.moveV,
12173
- a = 0;a = n.moveMoreS - o >= 0 ? "b2t" === this.direction ? (n.moveMoreS - o) / n.moveContainerHeight * e.height : (n.moveMoreS - o) / n.moveContainerWidth * e.width : n.moveMoreS - o, "b2t" === this.direction ? r.default.style(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + a + "px) translateZ(0px) rotate(90deg)") : r.default.style(this.el, "left", a + "px");
12174
- } else "b2t" === this.direction ? r.default.style(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + (this.el.getBoundingClientRect().top - e.top) + "px) translateZ(0px) rotate(90deg)") : r.default.style(this.el, "left", this.el.getBoundingClientRect().left - e.left + "px");"b2t" === this.direction || r.default.style(this.el, "transform", "translateX(0px) translateY(0px) translateZ(0px)"), r.default.style(this.el, "transition", "transform 0s linear 0s");
12175
- } else this.pastDuration && this.startTime ? this.pastDuration = this.pastDuration + new Date().getTime() - this.startTime : this.pastDuration = 1;
12176
- } }, { key: "startMove", value: function value(e, t) {
12177
- this.logger && this.logger.info("startMove #" + (this.options.txt || "[DOM Element]") + "#");var n = this;if (n.hasMove || (n.danmu.emit("bullet_start", n), n.hasMove = !0), ("forcedPause" !== n.status || t) && this.el && "start" !== this.status) if (this.status = "start", r.default.style(this.el, "willChange", "transform"), "scroll" === this.mode) {
12178
- if ("b2t" === this.direction) {
12179
- this.moveV = (e.height + this.height) / this.duration * 1e3;var i = (n.el.getBoundingClientRect().bottom - e.top) / this.moveV;r.default.style(this.el, "transition", "transform " + i + "s linear 0s"), this.startMoveTimer = setTimeout(function () {
12180
- n.el && (r.default.style(n.el, "transform", "translateX(-" + n.top + "px) translateY(-" + n.height + "px) translateZ(0px) rotate(90deg)"), n.moveTime = new Date().getTime(), n.moveMoreS = n.el.getBoundingClientRect().top - e.top, n.moveContainerHeight = e.height, n.removeTimer = setTimeout(l, 1e3 * i));
12181
- }, 20);
12182
- } else {
12183
- var o = this.el.getBoundingClientRect();this.moveV = (e.width + this.width) / this.duration * 1e3;var a = (o.right - e.left) / this.moveV;r.default.style(this.el, "transition", "transform " + a + "s linear 0s"), this.startMoveTimer = setTimeout(function () {
12184
- if (n.el) {
12185
- var t = n.el.getBoundingClientRect(),
12186
- i = (t.right - e.left) / a;t.right > e.left && i > n.moveV - 1 && i < n.moveV + 1 ? (r.default.style(n.el, "transform", "translateX(-" + (t.right - e.left) + "px) translateY(0px) translateZ(0px)"), n.moveTime = new Date().getTime(), n.moveMoreS = t.left - e.left, n.moveContainerWidth = e.width, n.removeTimer = setTimeout(l, 1e3 * a)) : (n.status = "end", n.remove());
12187
- }
12188
- }, 0);
12189
- }
12190
- } else {
12191
- r.default.style(this.el, "left", "50%"), r.default.style(this.el, "margin", "0 0 0 -" + this.width / 2 + "px"), this.pastDuration || (this.pastDuration = 1);var s = this.duration >= this.pastDuration ? this.duration - this.pastDuration : 0;this.removeTimer = setTimeout(l, s), this.startTime = new Date().getTime();
12192
- }function l() {
12193
- if (n.el) if ("scroll" === n.mode) {
12194
- var e = n.containerPos,
12195
- t = n.el.getBoundingClientRect();"b2t" === n.direction ? t && t.bottom <= e.top + 100 ? (n.status = "end", n.remove()) : (n.pauseMove(e), "paused" !== n.danmu.bulletBtn.main.status && n.startMove(e)) : t && t.right <= e.left + 100 ? (n.status = "end", n.remove()) : (n.pauseMove(e), "paused" !== n.danmu.bulletBtn.main.status && n.startMove(e));
12196
- } else n.status = "end", n.remove();
12197
- }
12198
- } }, { key: "remove", value: function value() {
12199
- this.logger && this.logger.info("remove #" + (this.options.txt || "[DOM Element]") + "#");this.removeTimer && clearTimeout(this.removeTimer), this.startMoveTimer && clearTimeout(this.startMoveTimer), this.el && this.el.parentNode && (r.default.style(this.el, "willChange", "auto"), this.detach(), this.danmu.emit("bullet_remove", { bullet: this }));
12200
- } }, { key: "setFontSize", value: function value(e) {
12201
- this.el && (this.el.style.fontSize = e);
12202
- } }, { key: "setLikeDom", value: function value(e, t) {
12203
- if (e) {
12204
- Object.keys(t).forEach(function (n) {
12205
- e.style[n] = t[n];
12206
- });if (e.className = "danmu-like", this.el) {
12207
- var n = this.el.querySelector(".danmu-like");n && this.el.removeChild(n), this.el.innerHTML = "" + this.el.innerHTML + e.outerHTML;
12208
- }
12209
- }return e;
12210
- } }]), t;
12211
- }(o.default);t.default = s, e.exports = t.default;
12251
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.validAreaLineRule = function (e) {
12252
+ return "number" == typeof e && e >= 0 && Number.isInteger(e);
12253
+ };
12212
12254
  }, function (e, t, n) {
12213
12255
  "use strict";
12214
- Object.defineProperty(t, "__esModule", { value: !0 });var i,
12215
- o = function () {
12256
+ Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
12216
12257
  function e(e, t) {
12217
12258
  for (var n = 0; n < t.length; n++) {
12218
12259
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -12221,19 +12262,18 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12221
12262
  return n && e(t.prototype, n), i && e(t, i), t;
12222
12263
  };
12223
12264
  }(),
12224
- r = n(0),
12225
- a = (i = r) && i.__esModule ? i : { default: i };var s = function () {
12265
+ o = n(0);var r = function () {
12226
12266
  function e(t) {
12227
12267
  !function (e, t) {
12228
12268
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12229
12269
  }(this, e), t = { initDOM: function initDOM() {
12230
12270
  return document.createElement("div");
12231
12271
  }, initSize: 10 }, this.init(t);
12232
- }return o(e, [{ key: "init", value: function value(e) {
12272
+ }return i(e, [{ key: "init", value: function value(e) {
12233
12273
  this.idleList = [], this.usingList = [], this._id = 0, this.options = e, this._expand(e.initSize);
12234
12274
  } }, { key: "use", value: function value() {
12235
12275
  this.idleList.length || this._expand(1);var e = this.idleList.shift();return this.usingList.push(e), e;
12236
- } }, { key: "unuse", value: function value(e) {
12276
+ } }, { key: "unused", value: function value(e) {
12237
12277
  var t = this.usingList.indexOf(e);t < 0 || (this.usingList.splice(t, 1), e.innerHTML = "", e.textcontent = "", this.clearElementStyle(e), this.idleList.push(e));
12238
12278
  } }, { key: "_expand", value: function value(e) {
12239
12279
  for (var t = 0; t < e; t++) {
@@ -12245,17 +12285,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12245
12285
  }for (var t = 0; t < this.usingList.length; t++) {
12246
12286
  this.usingList[t].innerHTML = "", this.usingList[t].textcontent = "", this.clearElementStyle(this.usingList[t]);
12247
12287
  }for (var n in this) {
12248
- delete this[n];
12288
+ o.hasOwnProperty.call(this, n) && delete this[n];
12249
12289
  }
12250
12290
  } }, { key: "clearElementStyle", value: function value(e) {
12251
- var t = "undefined" != typeof window ? window.navigator.userAgent : null;t && (t.indexOf("MSIE ") > -1 || t.indexOf("Trident/") > -1 ? a.default.style(e, "transform", "none") : e.setAttribute("style", ""));
12291
+ var t = "undefined" != typeof window ? window.navigator.userAgent : null;t && (t.indexOf("MSIE ") > -1 || t.indexOf("Trident/") > -1 ? (0, o.styleUtil)(e, "transform", "none") : e.setAttribute("style", ""));
12252
12292
  } }]), e;
12253
- }();t.default = s, e.exports = t.default;
12254
- }, function (e) {
12255
- e.exports = JSON.parse('{"version":"0.5.10"}');
12293
+ }();t.default = r, e.exports = t.default;
12256
12294
  }, function (e, t, n) {
12257
12295
  "use strict";
12258
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
12296
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.destroyObserver = t.unObserver = t.addObserver = void 0;var i = function () {
12259
12297
  function e(e, t) {
12260
12298
  for (var n = 0; n < t.length; n++) {
12261
12299
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -12263,14 +12301,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12263
12301
  }return function (t, n, i) {
12264
12302
  return n && e(t.prototype, n), i && e(t, i), t;
12265
12303
  };
12266
- }();var o = new (function () {
12304
+ }(),
12305
+ o = n(0);var r = new (function () {
12267
12306
  function e() {
12268
12307
  var t = this;if (function (e, t) {
12269
12308
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12270
12309
  }(this, e), this.__handlers = [], window.ResizeObserver) try {
12271
- this.observer = new window.ResizeObserver(function (e) {
12272
- var n = new Date().getTime();n - t.timeStampe < 200 || (t.timeStampe = n, t.__trigger(e));
12273
- }), this.timeStampe = new Date().getTime();
12310
+ this.observer = new window.ResizeObserver((0, o.throttle)(function (e) {
12311
+ t.__trigger(e);
12312
+ }, 100));
12274
12313
  } catch (e) {}
12275
12314
  }return i(e, [{ key: "addObserver", value: function value(e, t) {
12276
12315
  if (this.observer) {
@@ -12302,16 +12341,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12302
12341
  });
12303
12342
  } }]), e;
12304
12343
  }())();t.addObserver = function (e, t) {
12305
- o.addObserver(e, t);
12344
+ r.addObserver(e, t);
12306
12345
  }, t.unObserver = function (e, t) {
12307
- o.unObserver(e, t);
12346
+ r.unObserver(e, t);
12308
12347
  }, t.destroyObserver = function (e, t) {
12309
- o.destroyObserver(e, t);
12348
+ r.destroyObserver(e, t);
12310
12349
  };
12311
12350
  }, function (e, t, n) {
12312
12351
  var i = n(35);"string" == typeof i && (i = [[e.i, i, ""]]);var o = { hmr: !0, transform: void 0, insertInto: void 0 };n(37)(i, o);i.locals && (e.exports = i.locals);
12313
12352
  }, function (e, t, n) {
12314
- (e.exports = n(36)(!1)).push([e.i, ".danmu{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#ffffff;-webkit-box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}\n", ""]);
12353
+ (e.exports = n(36)(!1)).push([e.i, ".danmu{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#fff;-webkit-box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}", ""]);
12315
12354
  }, function (e, t) {
12316
12355
  e.exports = function (e) {
12317
12356
  var t = [];return t.toString = function () {
@@ -12367,39 +12406,39 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12367
12406
  o.refs++;for (var a = 0; a < o.parts.length; a++) {
12368
12407
  o.parts[a](i.parts[a]);
12369
12408
  }for (; a < i.parts.length; a++) {
12370
- o.parts.push(y(i.parts[a], t));
12409
+ o.parts.push(b(i.parts[a], t));
12371
12410
  }
12372
12411
  } else {
12373
12412
  var s = [];for (a = 0; a < i.parts.length; a++) {
12374
- s.push(y(i.parts[a], t));
12413
+ s.push(b(i.parts[a], t));
12375
12414
  }r[i.id] = { id: i.id, refs: 1, parts: s };
12376
12415
  }
12377
12416
  }
12378
- }function g(e, t) {
12417
+ }function p(e, t) {
12379
12418
  for (var n = [], i = {}, o = 0; o < e.length; o++) {
12380
12419
  var r = e[o],
12381
12420
  a = t.base ? r[0] + t.base : r[0],
12382
12421
  s = { css: r[1], media: r[2], sourceMap: r[3] };i[a] ? i[a].parts.push(s) : n.push(i[a] = { id: a, parts: [s] });
12383
12422
  }return n;
12384
- }function p(e, t) {
12423
+ }function g(e, t) {
12385
12424
  var n = l(e.insertInto);if (!n) throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i = f[f.length - 1];if ("top" === e.insertAt) i ? i.nextSibling ? n.insertBefore(t, i.nextSibling) : n.appendChild(t) : n.insertBefore(t, n.firstChild), f.push(t);else if ("bottom" === e.insertAt) n.appendChild(t);else {
12386
12425
  if ("object" != _typeof(e.insertAt) || !e.insertAt.before) throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o = l(e.insertInto + " " + e.insertAt.before);n.insertBefore(t, o);
12387
12426
  }
12388
12427
  }function m(e) {
12389
12428
  if (null === e.parentNode) return !1;e.parentNode.removeChild(e);var t = f.indexOf(e);t >= 0 && f.splice(t, 1);
12390
12429
  }function v(e) {
12391
- var t = document.createElement("style");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), b(t, e.attrs), p(e, t), t;
12392
- }function b(e, t) {
12430
+ var t = document.createElement("style");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), y(t, e.attrs), g(e, t), t;
12431
+ }function y(e, t) {
12393
12432
  Object.keys(t).forEach(function (n) {
12394
12433
  e.setAttribute(n, t[n]);
12395
12434
  });
12396
- }function y(e, t) {
12435
+ }function b(e, t) {
12397
12436
  var n, i, o, r;if (t.transform && e.css) {
12398
12437
  if (!(r = t.transform(e.css))) return function () {};e.css = r;
12399
12438
  }if (t.singleton) {
12400
12439
  var a = c++;n = u || (u = v(t)), i = O.bind(null, n, a, !1), o = O.bind(null, n, a, !0);
12401
12440
  } else e.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (n = function (e) {
12402
- var t = document.createElement("link");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), e.attrs.rel = "stylesheet", b(t, e.attrs), p(e, t), t;
12441
+ var t = document.createElement("link");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), e.attrs.rel = "stylesheet", y(t, e.attrs), g(e, t), t;
12403
12442
  }(t), i = x.bind(null, n, t), o = function o() {
12404
12443
  m(n), n.href && URL.revokeObjectURL(n.href);
12405
12444
  }) : (n = v(t), i = k.bind(null, n), o = function o() {
@@ -12410,10 +12449,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12410
12449
  } else o();
12411
12450
  };
12412
12451
  }e.exports = function (e, t) {
12413
- if ("undefined" != typeof DEBUG && DEBUG && "object" != (typeof document === "undefined" ? "undefined" : _typeof(document))) throw new Error("The style-loader cannot be used in a non-browser environment");(t = t || {}).attrs = "object" == _typeof(t.attrs) ? t.attrs : {}, t.singleton || "boolean" == typeof t.singleton || (t.singleton = a()), t.insertInto || (t.insertInto = "head"), t.insertAt || (t.insertAt = "bottom");var n = g(e, t);return d(n, t), function (e) {
12452
+ if ("undefined" != typeof DEBUG && DEBUG && "object" != (typeof document === "undefined" ? "undefined" : _typeof(document))) throw new Error("The style-loader cannot be used in a non-browser environment");(t = t || {}).attrs = "object" == _typeof(t.attrs) ? t.attrs : {}, t.singleton || "boolean" == typeof t.singleton || (t.singleton = a()), t.insertInto || (t.insertInto = "head"), t.insertAt || (t.insertAt = "bottom");var n = p(e, t);return d(n, t), function (e) {
12414
12453
  for (var i = [], o = 0; o < n.length; o++) {
12415
12454
  var a = n[o];(s = r[a.id]).refs--, i.push(s);
12416
- }e && d(g(e, t), t);for (o = 0; o < i.length; o++) {
12455
+ }e && d(p(e, t), t);for (o = 0; o < i.length; o++) {
12417
12456
  var s;if (0 === (s = i[o]).refs) {
12418
12457
  for (var l = 0; l < s.parts.length; l++) {
12419
12458
  s.parts[l]();
@@ -12421,11 +12460,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12421
12460
  }
12422
12461
  }
12423
12462
  };
12424
- };var w,
12425
- _ = (w = [], function (e, t) {
12426
- return w[e] = t, w.filter(Boolean).join("\n");
12463
+ };var _,
12464
+ w = (_ = [], function (e, t) {
12465
+ return _[e] = t, _.filter(Boolean).join("\n");
12427
12466
  });function O(e, t, n, i) {
12428
- var o = n ? "" : i.css;if (e.styleSheet) e.styleSheet.cssText = _(t, o);else {
12467
+ var o = n ? "" : i.css;if (e.styleSheet) e.styleSheet.cssText = w(t, o);else {
12429
12468
  var r = document.createTextNode(o),
12430
12469
  a = e.childNodes;a[t] && e.removeChild(a[t]), a.length ? e.insertBefore(r, a[t]) : e.appendChild(r);
12431
12470
  }