@forward-widget/danmu-universe 0.0.16 → 0.1.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.
Files changed (2) hide show
  1. package/dist/danmu-universe.js +463 -228
  2. package/package.json +1 -1
@@ -514,7 +514,7 @@ var __webpack_modules__ = {
514
514
  e = this.words = e || [], t != n ? this.sigBytes = n : this.sigBytes = 4 * e.length;
515
515
  },
516
516
  toString: function(e) {
517
- return (e || d).stringify(this);
517
+ return (e || f).stringify(this);
518
518
  },
519
519
  concat: function(e) {
520
520
  var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes;
@@ -537,7 +537,7 @@ var __webpack_modules__ = {
537
537
  for(var t = [], n = 0; n < e; n += 4)t.push(i());
538
538
  return new l.init(t, e);
539
539
  }
540
- }), c = s.enc = {}, d = c.Hex = {
540
+ }), c = s.enc = {}, f = c.Hex = {
541
541
  stringify: function(e) {
542
542
  for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
543
543
  var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
@@ -549,7 +549,7 @@ var __webpack_modules__ = {
549
549
  for(var t = e.length, n = [], r = 0; r < t; r += 2)n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4;
550
550
  return new l.init(n, t / 2);
551
551
  }
552
- }, p = c.Latin1 = {
552
+ }, d = c.Latin1 = {
553
553
  stringify: function(e) {
554
554
  for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
555
555
  var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
@@ -561,28 +561,28 @@ var __webpack_modules__ = {
561
561
  for(var t = e.length, n = [], r = 0; r < t; r++)n[r >>> 2] |= (0xff & e.charCodeAt(r)) << 24 - r % 4 * 8;
562
562
  return new l.init(n, t);
563
563
  }
564
- }, f = c.Utf8 = {
564
+ }, p = c.Utf8 = {
565
565
  stringify: function(e) {
566
566
  try {
567
- return decodeURIComponent(escape(p.stringify(e)));
567
+ return decodeURIComponent(escape(d.stringify(e)));
568
568
  } catch (e) {
569
569
  throw Error('Malformed UTF-8 data');
570
570
  }
571
571
  },
572
572
  parse: function(e) {
573
- return p.parse(unescape(encodeURIComponent(e)));
573
+ return d.parse(unescape(encodeURIComponent(e)));
574
574
  }
575
575
  }, h = a.BufferedBlockAlgorithm = u.extend({
576
576
  reset: function() {
577
577
  this._data = new l.init(), this._nDataBytes = 0;
578
578
  },
579
579
  _append: function(e) {
580
- 'string' == typeof e && (e = f.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
580
+ 'string' == typeof e && (e = p.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
581
581
  },
582
582
  _process: function(t) {
583
583
  var n, r = this._data, i = r.words, o = r.sigBytes, s = this.blockSize, a = o / (4 * s), u = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * s, c = e.min(4 * u, o);
584
584
  if (u) {
585
- for(var d = 0; d < u; d += s)this._doProcessBlock(i, d);
585
+ for(var f = 0; f < u; f += s)this._doProcessBlock(i, f);
586
586
  n = i.splice(0, u), r.sigBytes -= c;
587
587
  }
588
588
  return new l.init(n, c);
@@ -695,8 +695,8 @@ var __webpack_modules__ = {
695
695
  var r = t + n, i = e[r];
696
696
  e[r] = (i << 8 | i >>> 24) & 0x00ff00ff | (i << 24 | i >>> 8) & 0xff00ff00;
697
697
  }
698
- var o = this._hash.words, s = e[t + 0], u = e[t + 1], f = e[t + 2], h = e[t + 3], m = e[t + 4], g = e[t + 5], v = e[t + 6], y = e[t + 7], b = e[t + 8], _ = e[t + 9], w = e[t + 10], k = e[t + 11], x = e[t + 12], S = e[t + 13], E = e[t + 14], z = e[t + 15], O = o[0], I = o[1], $ = o[2], P = o[3];
699
- O = l(O, I, $, P, s, 7, a[0]), P = l(P, O, I, $, u, 12, a[1]), $ = l($, P, O, I, f, 17, a[2]), I = l(I, $, P, O, h, 22, a[3]), O = l(O, I, $, P, m, 7, a[4]), P = l(P, O, I, $, g, 12, a[5]), $ = l($, P, O, I, v, 17, a[6]), I = l(I, $, P, O, y, 22, a[7]), O = l(O, I, $, P, b, 7, a[8]), P = l(P, O, I, $, _, 12, a[9]), $ = l($, P, O, I, w, 17, a[10]), I = l(I, $, P, O, k, 22, a[11]), O = l(O, I, $, P, x, 7, a[12]), P = l(P, O, I, $, S, 12, a[13]), $ = l($, P, O, I, E, 17, a[14]), I = l(I, $, P, O, z, 22, a[15]), O = c(O, I, $, P, u, 5, a[16]), P = c(P, O, I, $, v, 9, a[17]), $ = c($, P, O, I, k, 14, a[18]), I = c(I, $, P, O, s, 20, a[19]), O = c(O, I, $, P, g, 5, a[20]), P = c(P, O, I, $, w, 9, a[21]), $ = c($, P, O, I, z, 14, a[22]), I = c(I, $, P, O, m, 20, a[23]), O = c(O, I, $, P, _, 5, a[24]), P = c(P, O, I, $, E, 9, a[25]), $ = c($, P, O, I, h, 14, a[26]), I = c(I, $, P, O, b, 20, a[27]), O = c(O, I, $, P, S, 5, a[28]), P = c(P, O, I, $, f, 9, a[29]), $ = c($, P, O, I, y, 14, a[30]), I = c(I, $, P, O, x, 20, a[31]), O = d(O, I, $, P, g, 4, a[32]), P = d(P, O, I, $, b, 11, a[33]), $ = d($, P, O, I, k, 16, a[34]), I = d(I, $, P, O, E, 23, a[35]), O = d(O, I, $, P, u, 4, a[36]), P = d(P, O, I, $, m, 11, a[37]), $ = d($, P, O, I, y, 16, a[38]), I = d(I, $, P, O, w, 23, a[39]), O = d(O, I, $, P, S, 4, a[40]), P = d(P, O, I, $, s, 11, a[41]), $ = d($, P, O, I, h, 16, a[42]), I = d(I, $, P, O, v, 23, a[43]), O = d(O, I, $, P, _, 4, a[44]), P = d(P, O, I, $, x, 11, a[45]), $ = d($, P, O, I, z, 16, a[46]), I = d(I, $, P, O, f, 23, a[47]), O = p(O, I, $, P, s, 6, a[48]), P = p(P, O, I, $, y, 10, a[49]), $ = p($, P, O, I, E, 15, a[50]), I = p(I, $, P, O, g, 21, a[51]), O = p(O, I, $, P, x, 6, a[52]), P = p(P, O, I, $, h, 10, a[53]), $ = p($, P, O, I, w, 15, a[54]), I = p(I, $, P, O, u, 21, a[55]), O = p(O, I, $, P, b, 6, a[56]), P = p(P, O, I, $, z, 10, a[57]), $ = p($, P, O, I, v, 15, a[58]), I = p(I, $, P, O, S, 21, a[59]), O = p(O, I, $, P, m, 6, a[60]), P = p(P, O, I, $, k, 10, a[61]), $ = p($, P, O, I, f, 15, a[62]), I = p(I, $, P, O, _, 21, a[63]), o[0] = o[0] + O | 0, o[1] = o[1] + I | 0, o[2] = o[2] + $ | 0, o[3] = o[3] + P | 0;
698
+ var o = this._hash.words, s = e[t + 0], u = e[t + 1], p = e[t + 2], h = e[t + 3], m = e[t + 4], g = e[t + 5], y = e[t + 6], v = e[t + 7], b = e[t + 8], _ = e[t + 9], w = e[t + 10], k = e[t + 11], x = e[t + 12], S = e[t + 13], E = e[t + 14], z = e[t + 15], O = o[0], I = o[1], $ = o[2], A = o[3];
699
+ O = l(O, I, $, A, s, 7, a[0]), A = l(A, O, I, $, u, 12, a[1]), $ = l($, A, O, I, p, 17, a[2]), I = l(I, $, A, O, h, 22, a[3]), O = l(O, I, $, A, m, 7, a[4]), A = l(A, O, I, $, g, 12, a[5]), $ = l($, A, O, I, y, 17, a[6]), I = l(I, $, A, O, v, 22, a[7]), O = l(O, I, $, A, b, 7, a[8]), A = l(A, O, I, $, _, 12, a[9]), $ = l($, A, O, I, w, 17, a[10]), I = l(I, $, A, O, k, 22, a[11]), O = l(O, I, $, A, x, 7, a[12]), A = l(A, O, I, $, S, 12, a[13]), $ = l($, A, O, I, E, 17, a[14]), I = l(I, $, A, O, z, 22, a[15]), O = c(O, I, $, A, u, 5, a[16]), A = c(A, O, I, $, y, 9, a[17]), $ = c($, A, O, I, k, 14, a[18]), I = c(I, $, A, O, s, 20, a[19]), O = c(O, I, $, A, g, 5, a[20]), A = c(A, O, I, $, w, 9, a[21]), $ = c($, A, O, I, z, 14, a[22]), I = c(I, $, A, O, m, 20, a[23]), O = c(O, I, $, A, _, 5, a[24]), A = c(A, O, I, $, E, 9, a[25]), $ = c($, A, O, I, h, 14, a[26]), I = c(I, $, A, O, b, 20, a[27]), O = c(O, I, $, A, S, 5, a[28]), A = c(A, O, I, $, p, 9, a[29]), $ = c($, A, O, I, v, 14, a[30]), I = c(I, $, A, O, x, 20, a[31]), O = f(O, I, $, A, g, 4, a[32]), A = f(A, O, I, $, b, 11, a[33]), $ = f($, A, O, I, k, 16, a[34]), I = f(I, $, A, O, E, 23, a[35]), O = f(O, I, $, A, u, 4, a[36]), A = f(A, O, I, $, m, 11, a[37]), $ = f($, A, O, I, v, 16, a[38]), I = f(I, $, A, O, w, 23, a[39]), O = f(O, I, $, A, S, 4, a[40]), A = f(A, O, I, $, s, 11, a[41]), $ = f($, A, O, I, h, 16, a[42]), I = f(I, $, A, O, y, 23, a[43]), O = f(O, I, $, A, _, 4, a[44]), A = f(A, O, I, $, x, 11, a[45]), $ = f($, A, O, I, z, 16, a[46]), I = f(I, $, A, O, p, 23, a[47]), O = d(O, I, $, A, s, 6, a[48]), A = d(A, O, I, $, v, 10, a[49]), $ = d($, A, O, I, E, 15, a[50]), I = d(I, $, A, O, g, 21, a[51]), O = d(O, I, $, A, x, 6, a[52]), A = d(A, O, I, $, h, 10, a[53]), $ = d($, A, O, I, w, 15, a[54]), I = d(I, $, A, O, u, 21, a[55]), O = d(O, I, $, A, b, 6, a[56]), A = d(A, O, I, $, z, 10, a[57]), $ = d($, A, O, I, y, 15, a[58]), I = d(I, $, A, O, S, 21, a[59]), O = d(O, I, $, A, m, 6, a[60]), A = d(A, O, I, $, k, 10, a[61]), $ = d($, A, O, I, p, 15, a[62]), I = d(I, $, A, O, _, 21, a[63]), o[0] = o[0] + O | 0, o[1] = o[1] + I | 0, o[2] = o[2] + $ | 0, o[3] = o[3] + A | 0;
700
700
  },
701
701
  _doFinalize: function() {
702
702
  var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
@@ -722,11 +722,11 @@ var __webpack_modules__ = {
722
722
  var a = e + (t & r | n & ~r) + i + s;
723
723
  return (a << o | a >>> 32 - o) + t;
724
724
  }
725
- function d(e, t, n, r, i, o, s) {
725
+ function f(e, t, n, r, i, o, s) {
726
726
  var a = e + (t ^ n ^ r) + i + s;
727
727
  return (a << o | a >>> 32 - o) + t;
728
728
  }
729
- function p(e, t, n, r, i, o, s) {
729
+ function d(e, t, n, r, i, o, s) {
730
730
  var a = e + (n ^ (t | ~r)) + i + s;
731
731
  return (a << o | a >>> 32 - o) + t;
732
732
  }
@@ -766,7 +766,7 @@ var __webpack_modules__ = {
766
766
  })(e);
767
767
  } : l;
768
768
  };
769
- function d() {
769
+ function f() {
770
770
  var e = new o(0, 0), t = 0;
771
771
  if (this.len - this.pos > 4) {
772
772
  for(; t < 4; ++t)if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e;
@@ -787,12 +787,12 @@ var __webpack_modules__ = {
787
787
  }
788
788
  throw Error("invalid varint encoding");
789
789
  }
790
- function p(e, t) {
790
+ function d(e, t) {
791
791
  return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
792
792
  }
793
- function f() {
793
+ function p() {
794
794
  if (this.pos + 8 > this.len) throw a(this, 8);
795
- return new o(p(this.buf, this.pos += 4), p(this.buf, this.pos += 4));
795
+ return new o(d(this.buf, this.pos += 4), d(this.buf, this.pos += 4));
796
796
  }
797
797
  u.create = c(), u.prototype._slice = i.Array.prototype.subarray || i.Array.prototype.slice, u.prototype.uint32 = function() {
798
798
  var e = 4294967295;
@@ -810,10 +810,10 @@ var __webpack_modules__ = {
810
810
  return 0 !== this.uint32();
811
811
  }, u.prototype.fixed32 = function() {
812
812
  if (this.pos + 4 > this.len) throw a(this, 4);
813
- return p(this.buf, this.pos += 4);
813
+ return d(this.buf, this.pos += 4);
814
814
  }, u.prototype.sfixed32 = function() {
815
815
  if (this.pos + 4 > this.len) throw a(this, 4);
816
- return 0 | p(this.buf, this.pos += 4);
816
+ return 0 | d(this.buf, this.pos += 4);
817
817
  }, u.prototype.float = function() {
818
818
  if (this.pos + 4 > this.len) throw a(this, 4);
819
819
  var e = i.float.readFloatLE(this.buf, this.pos);
@@ -867,19 +867,19 @@ var __webpack_modules__ = {
867
867
  var t = i.Long ? "toLong" : "toNumber";
868
868
  i.merge(u.prototype, {
869
869
  int64: function() {
870
- return d.call(this)[t](!1);
870
+ return f.call(this)[t](!1);
871
871
  },
872
872
  uint64: function() {
873
- return d.call(this)[t](!0);
873
+ return f.call(this)[t](!0);
874
874
  },
875
875
  sint64: function() {
876
- return d.call(this).zzDecode()[t](!1);
876
+ return f.call(this).zzDecode()[t](!1);
877
877
  },
878
878
  fixed64: function() {
879
- return f.call(this)[t](!0);
879
+ return p.call(this)[t](!0);
880
880
  },
881
881
  sfixed64: function() {
882
- return f.call(this)[t](!1);
882
+ return p.call(this)[t](!1);
883
883
  }
884
884
  });
885
885
  };
@@ -1090,7 +1090,7 @@ var __webpack_modules__ = {
1090
1090
  };
1091
1091
  },
1092
1092
  114: function(e, t, n) {
1093
- e.exports = d;
1093
+ e.exports = f;
1094
1094
  var r, i = n(837), o = i.LongBits, s = i.base64, a = i.utf8;
1095
1095
  function u(e, t, n) {
1096
1096
  this.fn = e, this.len = t, this.next = void 0, this.val = n;
@@ -1099,19 +1099,19 @@ var __webpack_modules__ = {
1099
1099
  function c(e) {
1100
1100
  this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states;
1101
1101
  }
1102
- function d() {
1102
+ function f() {
1103
1103
  this.len = 0, this.head = new u(l, 0, 0), this.tail = this.head, this.states = null;
1104
1104
  }
1105
- var p = function() {
1105
+ var d = function() {
1106
1106
  return i.Buffer ? function() {
1107
- return (d.create = function() {
1107
+ return (f.create = function() {
1108
1108
  return new r();
1109
1109
  })();
1110
1110
  } : function() {
1111
- return new d();
1111
+ return new f();
1112
1112
  };
1113
1113
  };
1114
- function f(e, t, n) {
1114
+ function p(e, t, n) {
1115
1115
  t[n] = 255 & e;
1116
1116
  }
1117
1117
  function h(e, t, n) {
@@ -1126,65 +1126,65 @@ var __webpack_modules__ = {
1126
1126
  for(; e.lo > 127;)t[n++] = 127 & e.lo | 128, e.lo = e.lo >>> 7;
1127
1127
  t[n++] = e.lo;
1128
1128
  }
1129
- function v(e, t, n) {
1129
+ function y(e, t, n) {
1130
1130
  t[n] = 255 & e, t[n + 1] = e >>> 8 & 255, t[n + 2] = e >>> 16 & 255, t[n + 3] = e >>> 24;
1131
1131
  }
1132
- d.create = p(), d.alloc = function(e) {
1132
+ f.create = d(), f.alloc = function(e) {
1133
1133
  return new i.Array(e);
1134
- }, i.Array !== Array && (d.alloc = i.pool(d.alloc, i.Array.prototype.subarray)), d.prototype._push = function(e, t, n) {
1134
+ }, i.Array !== Array && (f.alloc = i.pool(f.alloc, i.Array.prototype.subarray)), f.prototype._push = function(e, t, n) {
1135
1135
  return this.tail = this.tail.next = new u(e, t, n), this.len += t, this;
1136
- }, m.prototype = Object.create(u.prototype), m.prototype.fn = h, d.prototype.uint32 = function(e) {
1136
+ }, m.prototype = Object.create(u.prototype), m.prototype.fn = h, f.prototype.uint32 = function(e) {
1137
1137
  return this.len += (this.tail = this.tail.next = new m((e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5, e)).len, this;
1138
- }, d.prototype.int32 = function(e) {
1138
+ }, f.prototype.int32 = function(e) {
1139
1139
  return e < 0 ? this._push(g, 10, o.fromNumber(e)) : this.uint32(e);
1140
- }, d.prototype.sint32 = function(e) {
1140
+ }, f.prototype.sint32 = function(e) {
1141
1141
  return this.uint32((e << 1 ^ e >> 31) >>> 0);
1142
- }, d.prototype.uint64 = function(e) {
1142
+ }, f.prototype.uint64 = function(e) {
1143
1143
  var t = o.from(e);
1144
1144
  return this._push(g, t.length(), t);
1145
- }, d.prototype.int64 = d.prototype.uint64, d.prototype.sint64 = function(e) {
1145
+ }, f.prototype.int64 = f.prototype.uint64, f.prototype.sint64 = function(e) {
1146
1146
  var t = o.from(e).zzEncode();
1147
1147
  return this._push(g, t.length(), t);
1148
- }, d.prototype.bool = function(e) {
1149
- return this._push(f, 1, +!!e);
1150
- }, d.prototype.fixed32 = function(e) {
1151
- return this._push(v, 4, e >>> 0);
1152
- }, d.prototype.sfixed32 = d.prototype.fixed32, d.prototype.fixed64 = function(e) {
1148
+ }, f.prototype.bool = function(e) {
1149
+ return this._push(p, 1, +!!e);
1150
+ }, f.prototype.fixed32 = function(e) {
1151
+ return this._push(y, 4, e >>> 0);
1152
+ }, f.prototype.sfixed32 = f.prototype.fixed32, f.prototype.fixed64 = function(e) {
1153
1153
  var t = o.from(e);
1154
- return this._push(v, 4, t.lo)._push(v, 4, t.hi);
1155
- }, d.prototype.sfixed64 = d.prototype.fixed64, d.prototype.float = function(e) {
1154
+ return this._push(y, 4, t.lo)._push(y, 4, t.hi);
1155
+ }, f.prototype.sfixed64 = f.prototype.fixed64, f.prototype.float = function(e) {
1156
1156
  return this._push(i.float.writeFloatLE, 4, e);
1157
- }, d.prototype.double = function(e) {
1157
+ }, f.prototype.double = function(e) {
1158
1158
  return this._push(i.float.writeDoubleLE, 8, e);
1159
1159
  };
1160
- var y = i.Array.prototype.set ? function(e, t, n) {
1160
+ var v = i.Array.prototype.set ? function(e, t, n) {
1161
1161
  t.set(e, n);
1162
1162
  } : function(e, t, n) {
1163
1163
  for(var r = 0; r < e.length; ++r)t[n + r] = e[r];
1164
1164
  };
1165
- d.prototype.bytes = function(e) {
1165
+ f.prototype.bytes = function(e) {
1166
1166
  var t = e.length >>> 0;
1167
- if (!t) return this._push(f, 1, 0);
1167
+ if (!t) return this._push(p, 1, 0);
1168
1168
  if (i.isString(e)) {
1169
- var n = d.alloc(t = s.length(e));
1169
+ var n = f.alloc(t = s.length(e));
1170
1170
  s.decode(e, n, 0), e = n;
1171
1171
  }
1172
- return this.uint32(t)._push(y, t, e);
1173
- }, d.prototype.string = function(e) {
1172
+ return this.uint32(t)._push(v, t, e);
1173
+ }, f.prototype.string = function(e) {
1174
1174
  var t = a.length(e);
1175
- return t ? this.uint32(t)._push(a.write, t, e) : this._push(f, 1, 0);
1176
- }, d.prototype.fork = function() {
1175
+ return t ? this.uint32(t)._push(a.write, t, e) : this._push(p, 1, 0);
1176
+ }, f.prototype.fork = function() {
1177
1177
  return this.states = new c(this), this.head = this.tail = new u(l, 0, 0), this.len = 0, this;
1178
- }, d.prototype.reset = function() {
1178
+ }, f.prototype.reset = function() {
1179
1179
  return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new u(l, 0, 0), this.len = 0), this;
1180
- }, d.prototype.ldelim = function() {
1180
+ }, f.prototype.ldelim = function() {
1181
1181
  var e = this.head, t = this.tail, n = this.len;
1182
1182
  return this.reset().uint32(n), n && (this.tail.next = e.next, this.tail = t, this.len += n), this;
1183
- }, d.prototype.finish = function() {
1183
+ }, f.prototype.finish = function() {
1184
1184
  for(var e = this.head.next, t = this.constructor.alloc(this.len), n = 0; e;)e.fn(e.val, t, n), n += e.len, e = e.next;
1185
1185
  return t;
1186
- }, d._configure = function(e) {
1187
- r = e, d.create = p(), r._configure();
1186
+ }, f._configure = function(e) {
1187
+ r = e, f.create = d(), r._configure();
1188
1188
  };
1189
1189
  },
1190
1190
  491: function(e, t, n) {
@@ -1268,10 +1268,10 @@ var __webpack_modules__ = {
1268
1268
  },
1269
1269
  337: function(e, t, n) {
1270
1270
  var r = n(995), i = n(682), o = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, s = /[\n\r\t]/g, a = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, u = /:\d+$/, l = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, c = /^[a-zA-Z]:/;
1271
- function d(e) {
1271
+ function f(e) {
1272
1272
  return (e || '').toString().replace(o, '');
1273
1273
  }
1274
- var p = [
1274
+ var d = [
1275
1275
  [
1276
1276
  '#',
1277
1277
  'hash'
@@ -1312,16 +1312,16 @@ var __webpack_modules__ = {
1312
1312
  1,
1313
1313
  1
1314
1314
  ]
1315
- ], f = {
1315
+ ], p = {
1316
1316
  hash: 1,
1317
1317
  query: 1
1318
1318
  };
1319
1319
  function h(e) {
1320
1320
  var t, r, i = (t = 'undefined' != typeof window ? window : void 0 !== n.g ? n.g : 'undefined' != typeof self ? self : {}).location || {}, o = {}, s = typeof (e = e || i);
1321
- if ('blob:' === e.protocol) o = new y(unescape(e.pathname), {});
1322
- else if ('string' === s) for(r in o = new y(e, {}), f)delete o[r];
1321
+ if ('blob:' === e.protocol) o = new v(unescape(e.pathname), {});
1322
+ else if ('string' === s) for(r in o = new v(e, {}), p)delete o[r];
1323
1323
  else if ('object' === s) {
1324
- for(r in e)r in f || (o[r] = e[r]);
1324
+ for(r in e)r in p || (o[r] = e[r]);
1325
1325
  void 0 === o.slashes && (o.slashes = a.test(e.href));
1326
1326
  }
1327
1327
  return o;
@@ -1330,7 +1330,7 @@ var __webpack_modules__ = {
1330
1330
  return 'file:' === e || 'ftp:' === e || 'http:' === e || 'https:' === e || 'ws:' === e || 'wss:' === e;
1331
1331
  }
1332
1332
  function g(e, t) {
1333
- e = (e = d(e)).replace(s, ''), t = t || {};
1333
+ e = (e = f(e)).replace(s, ''), t = t || {};
1334
1334
  var n, r = l.exec(e), i = r[1] ? r[1].toLowerCase() : '', o = !!r[2], a = !!r[3], u = 0;
1335
1335
  return o ? a ? (n = r[2] + r[3] + r[4], u = r[2].length + r[3].length) : (n = r[2] + r[4], u = r[2].length) : a ? (n = r[3] + r[4], u = r[3].length) : n = r[4], 'file:' === i ? u >= 2 && (n = n.slice(2)) : m(i) ? n = r[4] : i ? o && (n = n.slice(2)) : u >= 2 && m(t.protocol) && (n = r[4]), {
1336
1336
  protocol: i,
@@ -1339,14 +1339,14 @@ var __webpack_modules__ = {
1339
1339
  rest: n
1340
1340
  };
1341
1341
  }
1342
- function v(e, t) {
1342
+ function y(e, t) {
1343
1343
  if ('' === e) return t;
1344
1344
  for(var n = (t || '/').split('/').slice(0, -1).concat(e.split('/')), r = n.length, i = n[r - 1], o = !1, s = 0; r--;)'.' === n[r] ? n.splice(r, 1) : '..' === n[r] ? (n.splice(r, 1), s++) : s && (0 === r && (o = !0), n.splice(r, 1), s--);
1345
1345
  return o && n.unshift(''), ('.' === i || '..' === i) && n.push(''), n.join('/');
1346
1346
  }
1347
- function y(e, t, n) {
1348
- if (e = (e = d(e)).replace(s, ''), !(this instanceof y)) return new y(e, t, n);
1349
- var o, a, u, l, f, b, _ = p.slice(), w = typeof t, k = this, x = 0;
1347
+ function v(e, t, n) {
1348
+ if (e = (e = f(e)).replace(s, ''), !(this instanceof v)) return new v(e, t, n);
1349
+ var o, a, u, l, p, b, _ = d.slice(), w = typeof t, k = this, x = 0;
1350
1350
  for('object' !== w && 'string' !== w && (n = t, t = null), n && 'function' != typeof n && (n = i.parse), o = !(a = g(e || '', t = h(t))).protocol && !a.slashes, k.slashes = a.slashes || o && t.slashes, k.protocol = a.protocol || t.protocol || '', e = a.rest, ('file:' === a.protocol && (2 !== a.slashesCount || c.test(e)) || !a.slashes && (a.protocol || a.slashesCount < 2 || !m(k.protocol))) && (_[3] = [
1351
1351
  /(.*)/,
1352
1352
  'pathname'
@@ -1355,11 +1355,11 @@ var __webpack_modules__ = {
1355
1355
  e = l(e, k);
1356
1356
  continue;
1357
1357
  }
1358
- u = l[0], b = l[1], u != u ? k[b] = e : 'string' == typeof u ? ~(f = '@' === u ? e.lastIndexOf(u) : e.indexOf(u)) && ('number' == typeof l[2] ? (k[b] = e.slice(0, f), e = e.slice(f + l[2])) : (k[b] = e.slice(f), e = e.slice(0, f))) : (f = u.exec(e)) && (k[b] = f[1], e = e.slice(0, f.index)), k[b] = k[b] || o && l[3] && t[b] || '', l[4] && (k[b] = k[b].toLowerCase());
1358
+ u = l[0], b = l[1], u != u ? k[b] = e : 'string' == typeof u ? ~(p = '@' === u ? e.lastIndexOf(u) : e.indexOf(u)) && ('number' == typeof l[2] ? (k[b] = e.slice(0, p), e = e.slice(p + l[2])) : (k[b] = e.slice(p), e = e.slice(0, p))) : (p = u.exec(e)) && (k[b] = p[1], e = e.slice(0, p.index)), k[b] = k[b] || o && l[3] && t[b] || '', l[4] && (k[b] = k[b].toLowerCase());
1359
1359
  }
1360
- n && (k.query = n(k.query)), o && t.slashes && '/' !== k.pathname.charAt(0) && ('' !== k.pathname || '' !== t.pathname) && (k.pathname = v(k.pathname, t.pathname)), '/' !== k.pathname.charAt(0) && m(k.protocol) && (k.pathname = '/' + k.pathname), r(k.port, k.protocol) || (k.host = k.hostname, k.port = ''), k.username = k.password = '', k.auth && (~(f = k.auth.indexOf(':')) ? (k.username = k.auth.slice(0, f), k.username = encodeURIComponent(decodeURIComponent(k.username)), k.password = k.auth.slice(f + 1), k.password = encodeURIComponent(decodeURIComponent(k.password))) : k.username = encodeURIComponent(decodeURIComponent(k.auth)), k.auth = k.password ? k.username + ':' + k.password : k.username), k.origin = 'file:' !== k.protocol && m(k.protocol) && k.host ? k.protocol + '//' + k.host : 'null', k.href = k.toString();
1360
+ n && (k.query = n(k.query)), o && t.slashes && '/' !== k.pathname.charAt(0) && ('' !== k.pathname || '' !== t.pathname) && (k.pathname = y(k.pathname, t.pathname)), '/' !== k.pathname.charAt(0) && m(k.protocol) && (k.pathname = '/' + k.pathname), r(k.port, k.protocol) || (k.host = k.hostname, k.port = ''), k.username = k.password = '', k.auth && (~(p = k.auth.indexOf(':')) ? (k.username = k.auth.slice(0, p), k.username = encodeURIComponent(decodeURIComponent(k.username)), k.password = k.auth.slice(p + 1), k.password = encodeURIComponent(decodeURIComponent(k.password))) : k.username = encodeURIComponent(decodeURIComponent(k.auth)), k.auth = k.password ? k.username + ':' + k.password : k.username), k.origin = 'file:' !== k.protocol && m(k.protocol) && k.host ? k.protocol + '//' + k.host : 'null', k.href = k.toString();
1361
1361
  }
1362
- y.prototype = {
1362
+ v.prototype = {
1363
1363
  set: function(e, t, n) {
1364
1364
  var o = this;
1365
1365
  switch(e){
@@ -1393,8 +1393,8 @@ var __webpack_modules__ = {
1393
1393
  var a = t.indexOf(':');
1394
1394
  ~a ? (o.username = t.slice(0, a), o.username = encodeURIComponent(decodeURIComponent(o.username)), o.password = t.slice(a + 1), o.password = encodeURIComponent(decodeURIComponent(o.password))) : o.username = encodeURIComponent(decodeURIComponent(t));
1395
1395
  }
1396
- for(var l = 0; l < p.length; l++){
1397
- var c = p[l];
1396
+ for(var l = 0; l < d.length; l++){
1397
+ var c = d[l];
1398
1398
  c[4] && (o[c[1]] = o[c[1]].toLowerCase());
1399
1399
  }
1400
1400
  return o.auth = o.password ? o.username + ':' + o.password : o.username, o.origin = 'file:' !== o.protocol && m(o.protocol) && o.host ? o.protocol + '//' + o.host : 'null', o.href = o.toString(), o;
@@ -1406,7 +1406,7 @@ var __webpack_modules__ = {
1406
1406
  var s = o + (n.protocol && n.slashes || m(n.protocol) ? '//' : '');
1407
1407
  return n.username ? (s += n.username, n.password && (s += ':' + n.password), s += '@') : n.password ? (s += ':' + n.password, s += '@') : 'file:' !== n.protocol && m(n.protocol) && !r && '/' !== n.pathname && (s += '@'), (':' === r[r.length - 1] || u.test(n.hostname) && !n.port) && (r += ':'), s += r + n.pathname, (t = 'object' == typeof n.query ? e(n.query) : n.query) && (s += '?' !== t.charAt(0) ? '?' + t : t), n.hash && (s += n.hash), s;
1408
1408
  }
1409
- }, y.extractProtocol = g, y.location = h, y.trimLeft = d, y.qs = i, e.exports = y;
1409
+ }, v.extractProtocol = g, v.location = h, v.trimLeft = f, v.qs = i, e.exports = v;
1410
1410
  },
1411
1411
  602: function() {}
1412
1412
  }, __webpack_module_cache__ = {};
@@ -2523,6 +2523,8 @@ const $ZodJWT = $constructor("$ZodJWT", (e, t)=>{
2523
2523
  inst: e
2524
2524
  }), n;
2525
2525
  };
2526
+ }), $ZodAny = $constructor("$ZodAny", (e, t)=>{
2527
+ $ZodType.init(e, t), e._zod.parse = (e)=>e;
2526
2528
  }), $ZodUnknown = $constructor("$ZodUnknown", (e, t)=>{
2527
2529
  $ZodType.init(e, t), e._zod.parse = (e)=>e;
2528
2530
  }), $ZodNever = $constructor("$ZodNever", (e, t)=>{
@@ -2618,48 +2620,48 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
2618
2620
  let a = t.compile();
2619
2621
  return (t, n)=>a(e, t, n);
2620
2622
  }, s = util_isObject, a = !globalConfig.jitless, u = util_allowsEval, l = a && u.value, c = t.catchall;
2621
- e._zod.parse = (u, d)=>{
2623
+ e._zod.parse = (u, f)=>{
2622
2624
  r ?? (r = i.value);
2623
- let p = u.value;
2624
- if (!s(p)) return u.issues.push({
2625
+ let d = u.value;
2626
+ if (!s(d)) return u.issues.push({
2625
2627
  expected: "object",
2626
2628
  code: "invalid_type",
2627
- input: p,
2629
+ input: d,
2628
2630
  inst: e
2629
2631
  }), u;
2630
- let f = [];
2631
- if (a && l && d?.async === !1 && !0 !== d.jitless) n || (n = o(t.shape)), u = n(u, d);
2632
+ let p = [];
2633
+ if (a && l && f?.async === !1 && !0 !== f.jitless) n || (n = o(t.shape)), u = n(u, f);
2632
2634
  else {
2633
2635
  u.value = {};
2634
2636
  let e = r.shape;
2635
2637
  for (let t of r.keys){
2636
2638
  let n = e[t]._zod.run({
2637
- value: p[t],
2639
+ value: d[t],
2638
2640
  issues: []
2639
- }, d);
2640
- n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t, p))) : handlePropertyResult(n, u, t, p);
2641
+ }, f);
2642
+ n instanceof Promise ? p.push(n.then((e)=>handlePropertyResult(e, u, t, d))) : handlePropertyResult(n, u, t, d);
2641
2643
  }
2642
2644
  }
2643
- if (!c) return f.length ? Promise.all(f).then(()=>u) : u;
2644
- let h = [], m = r.keySet, g = c._zod, v = g.def.type;
2645
- for (let e of Object.keys(p)){
2645
+ if (!c) return p.length ? Promise.all(p).then(()=>u) : u;
2646
+ let h = [], m = r.keySet, g = c._zod, y = g.def.type;
2647
+ for (let e of Object.keys(d)){
2646
2648
  if (m.has(e)) continue;
2647
- if ("never" === v) {
2649
+ if ("never" === y) {
2648
2650
  h.push(e);
2649
2651
  continue;
2650
2652
  }
2651
2653
  let t = g.run({
2652
- value: p[e],
2654
+ value: d[e],
2653
2655
  issues: []
2654
- }, d);
2655
- t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e, p))) : handlePropertyResult(t, u, e, p);
2656
+ }, f);
2657
+ t instanceof Promise ? p.push(t.then((t)=>handlePropertyResult(t, u, e, d))) : handlePropertyResult(t, u, e, d);
2656
2658
  }
2657
2659
  return (h.length && u.issues.push({
2658
2660
  code: "unrecognized_keys",
2659
2661
  keys: h,
2660
- input: p,
2662
+ input: d,
2661
2663
  inst: e
2662
- }), f.length) ? Promise.all(f).then(()=>u) : u;
2664
+ }), p.length) ? Promise.all(p).then(()=>u) : u;
2663
2665
  };
2664
2666
  });
2665
2667
  function handleUnionResults(e, t, n, r) {
@@ -3028,6 +3030,13 @@ function _string(e, t) {
3028
3030
  ...normalizeParams(t)
3029
3031
  });
3030
3032
  }
3033
+ function _coercedString(e, t) {
3034
+ return new e({
3035
+ type: "string",
3036
+ coerce: !0,
3037
+ ...normalizeParams(t)
3038
+ });
3039
+ }
3031
3040
  function _email(e, t) {
3032
3041
  return new e({
3033
3042
  type: "string",
@@ -3295,6 +3304,11 @@ function _boolean(e, t) {
3295
3304
  ...normalizeParams(t)
3296
3305
  });
3297
3306
  }
3307
+ function _any(e) {
3308
+ return new e({
3309
+ type: "any"
3310
+ });
3311
+ }
3298
3312
  function _unknown(e) {
3299
3313
  return new e({
3300
3314
  type: "unknown"
@@ -3617,6 +3631,12 @@ const ZodBoolean = $constructor("ZodBoolean", (e, t)=>{
3617
3631
  function schemas_boolean(e) {
3618
3632
  return _boolean(ZodBoolean, e);
3619
3633
  }
3634
+ const ZodAny = $constructor("ZodAny", (e, t)=>{
3635
+ $ZodAny.init(e, t), ZodType.init(e, t);
3636
+ });
3637
+ function any() {
3638
+ return _any(ZodAny);
3639
+ }
3620
3640
  const ZodUnknown = $constructor("ZodUnknown", (e, t)=>{
3621
3641
  $ZodUnknown.init(e, t), ZodType.init(e, t);
3622
3642
  });
@@ -3866,35 +3886,13 @@ function refine(e, t = {}) {
3866
3886
  function superRefine(e) {
3867
3887
  return _superRefine(e);
3868
3888
  }
3869
- function omit_omit(e, t) {
3870
- let n = {
3871
- ...e
3872
- };
3873
- for(let e = 0; e < t.length; e++){
3874
- let r = t[e];
3875
- delete n[r];
3876
- }
3877
- return n;
3889
+ function coerce_string(e) {
3890
+ return _coercedString(ZodString, e);
3878
3891
  }
3879
- function isUnsafeProperty(e) {
3880
- return '__proto__' === e;
3881
- }
3882
- function isPlainObject_isPlainObject(e) {
3883
- if (!e || 'object' != typeof e) return !1;
3884
- let t = Object.getPrototypeOf(e);
3885
- return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && '[object Object]' === Object.prototype.toString.call(e);
3886
- }
3887
- function merge_merge(e, t) {
3888
- let n = Object.keys(t);
3889
- for(let r = 0; r < n.length; r++){
3890
- let i = n[r];
3891
- if (isUnsafeProperty(i)) continue;
3892
- let o = t[i], s = e[i];
3893
- Array.isArray(o) ? Array.isArray(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge([], o) : isPlainObject_isPlainObject(o) ? isPlainObject_isPlainObject(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge({}, o) : (void 0 === s || void 0 !== o) && (e[i] = o);
3894
- }
3895
- return e;
3892
+ function coerce_number(e) {
3893
+ return _coercedNumber(ZodNumber, e);
3896
3894
  }
3897
- var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse), enc_base64 = __webpack_require__(716), enc_base64_default = __webpack_require__.n(enc_base64);
3895
+ var enc_base64 = __webpack_require__(716), enc_base64_default = __webpack_require__.n(enc_base64);
3898
3896
  function safeJsonParse(e) {
3899
3897
  try {
3900
3898
  if (!e) return null;
@@ -3973,7 +3971,41 @@ class Storage {
3973
3971
  _define_property(this, "defaultTTL", TTL_5_MINUTES);
3974
3972
  }
3975
3973
  }
3976
- const storage = new Storage();
3974
+ const storage = new Storage(), getExternalIdsByTmdbId = async (e, t)=>{
3975
+ let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
3976
+ return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
3977
+ ttl: TTL_7_DAYS
3978
+ })), n;
3979
+ };
3980
+ function omit_omit(e, t) {
3981
+ let n = {
3982
+ ...e
3983
+ };
3984
+ for(let e = 0; e < t.length; e++){
3985
+ let r = t[e];
3986
+ delete n[r];
3987
+ }
3988
+ return n;
3989
+ }
3990
+ function isUnsafeProperty(e) {
3991
+ return '__proto__' === e;
3992
+ }
3993
+ function isPlainObject_isPlainObject(e) {
3994
+ if (!e || 'object' != typeof e) return !1;
3995
+ let t = Object.getPrototypeOf(e);
3996
+ return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && '[object Object]' === Object.prototype.toString.call(e);
3997
+ }
3998
+ function merge_merge(e, t) {
3999
+ let n = Object.keys(t);
4000
+ for(let r = 0; r < n.length; r++){
4001
+ let i = n[r];
4002
+ if (isUnsafeProperty(i)) continue;
4003
+ let o = t[i], s = e[i];
4004
+ Array.isArray(o) ? Array.isArray(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge([], o) : isPlainObject_isPlainObject(o) ? isPlainObject_isPlainObject(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge({}, o) : (void 0 === s || void 0 !== o) && (e[i] = o);
4005
+ }
4006
+ return e;
4007
+ }
4008
+ var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse);
3977
4009
  function fetch_define_property(e, t, n) {
3978
4010
  return t in e ? Object.defineProperty(e, t, {
3979
4011
  value: n,
@@ -4062,13 +4094,13 @@ class Fetch {
4062
4094
  }, s), r = storage.getJson(n);
4063
4095
  if (r) return console.debug("fetch cache hit", n), Promise.resolve(r);
4064
4096
  }
4065
- let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...d } = s, p = t;
4066
- c && (p = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", p, null != a ? a : "", d);
4067
- let f = o ? Widget.http.get(p, d) : Widget.http.post(p, a, d);
4097
+ let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...f } = s, d = t;
4098
+ c && (d = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", d, null != a ? a : "", f);
4099
+ let p = o ? Widget.http.get(d, f) : Widget.http.post(d, a, f);
4068
4100
  return u && u > 0 ? Promise.race([
4069
- f,
4101
+ p,
4070
4102
  this.createTimeoutPromise(u)
4071
- ]) : f;
4103
+ ]) : p;
4072
4104
  }
4073
4105
  getCacheKey(e, t) {
4074
4106
  var n;
@@ -4106,11 +4138,7 @@ class Fetch {
4106
4138
  };
4107
4139
  }
4108
4140
  }
4109
- const fetch_fetch = new Fetch();
4110
- function coerce_number(e) {
4111
- return _coercedNumber(ZodNumber, e);
4112
- }
4113
- const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRequestSchema = schemas_object({
4141
+ const fetch = new Fetch(), BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRequestSchema = schemas_object({
4114
4142
  season: coerce_number().optional().default(1),
4115
4143
  pageSize: coerce_number().optional().default(20),
4116
4144
  pageToken: schemas_string().optional()
@@ -4187,7 +4215,7 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4187
4215
  u = null != (s = null == r || null == (o = r.episodes.find((e)=>1 === e.episodeNumber)) ? void 0 : o.id) ? s : "";
4188
4216
  }
4189
4217
  u || (u = e), console.log("Get douban info by imdb id", u);
4190
- let l = await fetch_fetch.post(`https://api.douban.com/v2/movie/imdb/${u}`, {
4218
+ let l = await fetch.post(`https://api.douban.com/v2/movie/imdb/${u}`, {
4191
4219
  apikey: DOUBAN_API_KEY
4192
4220
  }, {
4193
4221
  headers: {
@@ -4206,12 +4234,84 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4206
4234
  doubanId: c,
4207
4235
  originResponse: l.data
4208
4236
  } : null;
4209
- }, getExternalIdsByTmdbId = async (e, t)=>{
4210
- let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
4211
- return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
4212
- ttl: TTL_7_DAYS
4213
- })), n;
4237
+ };
4238
+ function compact(e) {
4239
+ let t = [];
4240
+ for(let n = 0; n < e.length; n++){
4241
+ let r = e[n];
4242
+ r && t.push(r);
4243
+ }
4244
+ return t;
4245
+ }
4246
+ const doubanSubjectItemSchema = schemas_object({
4247
+ type_name: schemas_string(),
4248
+ target_type: schemas_string(),
4249
+ target_id: schemas_string(),
4250
+ target: schemas_object({
4251
+ title: schemas_string(),
4252
+ has_linewatch: schemas_boolean().refine((e)=>e)
4253
+ })
4254
+ }), doubanSearchResponseSchema = schemas_object({
4255
+ subjects: schemas_object({
4256
+ items: schemas_array(unknown().transform((e)=>{
4257
+ var t;
4258
+ return null != (t = doubanSubjectItemSchema.safeParse(e).data) ? t : null;
4259
+ })).transform((e)=>compact(e))
4260
+ })
4261
+ }), searchDoubanInfoByName = async (e)=>{
4262
+ var t, n;
4263
+ return e && null != (n = null == (t = (await fetch.get("https://m.douban.com/rexxar/api/v2/search", {
4264
+ params: {
4265
+ q: e,
4266
+ start: 0,
4267
+ count: 20,
4268
+ type: "movie"
4269
+ },
4270
+ headers: {
4271
+ Referer: "https://m.douban.com/movie/",
4272
+ "Content-Type": "application/json"
4273
+ },
4274
+ schema: doubanSearchResponseSchema,
4275
+ cache: {
4276
+ cacheKey: [
4277
+ "douban",
4278
+ "search",
4279
+ e
4280
+ ].filter(Boolean).join(":")
4281
+ }
4282
+ })).data) ? void 0 : t.subjects.items) ? n : [];
4283
+ }, getDoubanInfoParamsSchema = schemas_object({
4284
+ tmdbId: coerce_string().optional(),
4285
+ type: schemas_enum([
4286
+ "movie",
4287
+ "tv"
4288
+ ]).transform((e)=>e),
4289
+ title: coerce_string().optional(),
4290
+ seriesName: coerce_string().optional(),
4291
+ season: coerce_number().optional(),
4292
+ episode: coerce_number().optional(),
4293
+ fuzzyMatch: schemas_enum([
4294
+ "always",
4295
+ "never",
4296
+ "auto"
4297
+ ]).catch("auto").optional().default("auto")
4298
+ }), getDoubanIds = async (e)=>{
4299
+ let t = new Set(), { tmdbId: n, type: r, seriesName: i, season: o, fuzzyMatch: s } = getDoubanInfoParamsSchema.parse(e);
4300
+ try {
4301
+ let e = await getDoubanInfoByTmdbId(r, n, o);
4302
+ (null == e ? void 0 : e.doubanId) && t.add(e.doubanId);
4303
+ } catch (e) {
4304
+ console.error("Error getting douban info by tmdb id", e);
4305
+ }
4306
+ if ("always" === s || "auto" === s && !t.size) try {
4307
+ let e = i;
4308
+ for (let n of (o && parseInt(o.toString()) > 1 && (e += o.toString()), await searchDoubanInfoByName(e)))t.add(n.target_id);
4309
+ } catch (e) {
4310
+ console.error("Error searching douban info by name", e);
4311
+ }
4312
+ return Array.from(t);
4214
4313
  }, getDoubanInfoByTmdbId = async (e, t, n)=>{
4314
+ if (!t) return null;
4215
4315
  let r = await getExternalIdsByTmdbId(e, t);
4216
4316
  return (console.log("Get external ids by tmdb id", r), r.imdb_id) ? getDoubanInfoByImdbId(r.imdb_id, n) : null;
4217
4317
  }, doubanInfoResponseSchema = schemas_object({
@@ -4223,7 +4323,7 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4223
4323
  }))
4224
4324
  }), getVideoPlatformInfoByDoubanId = async (e)=>{
4225
4325
  var t, n, r;
4226
- let i = await fetch_fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
4326
+ let i = await fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
4227
4327
  headers: {
4228
4328
  Referer: `https://m.douban.com/movie/subject/${e}/?dt_dapp=1`,
4229
4329
  "Content-Type": "application/json"
@@ -4280,23 +4380,6 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4280
4380
  }
4281
4381
  return o;
4282
4382
  };
4283
- function compact(e) {
4284
- let t = [];
4285
- for(let n = 0; n < e.length; n++){
4286
- let r = e[n];
4287
- r && t.push(r);
4288
- }
4289
- return t;
4290
- }
4291
- const doubanSubjectItemSchema = schemas_object({
4292
- type_name: schemas_string(),
4293
- target_type: schemas_string(),
4294
- target_id: coerce_number(),
4295
- target: schemas_object({
4296
- title: schemas_string(),
4297
- has_linewatch: schemas_boolean().refine((e)=>e)
4298
- })
4299
- });
4300
4383
  function keyBy(e, t) {
4301
4384
  let n = {};
4302
4385
  for(let r = 0; r < e.length; r++){
@@ -4323,6 +4406,134 @@ function sortBy(e, t) {
4323
4406
  'asc'
4324
4407
  ]);
4325
4408
  }
4409
+ function uniqWith(e, t) {
4410
+ let n = [];
4411
+ for(let r = 0; r < e.length; r++){
4412
+ let i = e[r];
4413
+ n.every((e)=>!t(e, i)) && n.push(i);
4414
+ }
4415
+ return n;
4416
+ }
4417
+ function getSymbols(e) {
4418
+ return Object.getOwnPropertySymbols(e).filter((t)=>Object.prototype.propertyIsEnumerable.call(e, t));
4419
+ }
4420
+ function getTag(e) {
4421
+ return null == e ? void 0 === e ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(e);
4422
+ }
4423
+ const regexpTag = '[object RegExp]', stringTag = '[object String]', numberTag = '[object Number]', booleanTag = '[object Boolean]', argumentsTag = '[object Arguments]', symbolTag = '[object Symbol]', dateTag = '[object Date]', mapTag = '[object Map]', setTag = '[object Set]', arrayTag = '[object Array]', functionTag = '[object Function]', arrayBufferTag = '[object ArrayBuffer]', objectTag = '[object Object]', errorTag = '[object Error]', dataViewTag = '[object DataView]', uint8ArrayTag = '[object Uint8Array]', uint8ClampedArrayTag = '[object Uint8ClampedArray]', uint16ArrayTag = '[object Uint16Array]', uint32ArrayTag = '[object Uint32Array]', bigUint64ArrayTag = '[object BigUint64Array]', int8ArrayTag = '[object Int8Array]', int16ArrayTag = '[object Int16Array]', int32ArrayTag = '[object Int32Array]', bigInt64ArrayTag = '[object BigInt64Array]', float32ArrayTag = '[object Float32Array]', float64ArrayTag = '[object Float64Array]';
4424
+ function eq(e, t) {
4425
+ return e === t || Number.isNaN(e) && Number.isNaN(t);
4426
+ }
4427
+ function isEqualWith(e, t, n) {
4428
+ return isEqualWithImpl(e, t, void 0, void 0, void 0, void 0, n);
4429
+ }
4430
+ function isEqualWithImpl(e, t, n, r, i, o, s) {
4431
+ let a = s(e, t, n, r, i, o);
4432
+ if (void 0 !== a) return a;
4433
+ if (typeof e == typeof t) switch(typeof e){
4434
+ case 'bigint':
4435
+ case 'string':
4436
+ case 'boolean':
4437
+ case 'symbol':
4438
+ case 'undefined':
4439
+ case 'function':
4440
+ return e === t;
4441
+ case 'number':
4442
+ return e === t || Object.is(e, t);
4443
+ }
4444
+ return areObjectsEqual(e, t, o, s);
4445
+ }
4446
+ function areObjectsEqual(e, t, n, r) {
4447
+ if (Object.is(e, t)) return !0;
4448
+ let i = getTag(e), o = getTag(t);
4449
+ if (i === argumentsTag && (i = objectTag), o === argumentsTag && (o = objectTag), i !== o) return !1;
4450
+ switch(i){
4451
+ case stringTag:
4452
+ return e.toString() === t.toString();
4453
+ case numberTag:
4454
+ return eq(e.valueOf(), t.valueOf());
4455
+ case booleanTag:
4456
+ case dateTag:
4457
+ case symbolTag:
4458
+ return Object.is(e.valueOf(), t.valueOf());
4459
+ case regexpTag:
4460
+ return e.source === t.source && e.flags === t.flags;
4461
+ case functionTag:
4462
+ return e === t;
4463
+ }
4464
+ let s = (n = n ?? new Map()).get(e), a = n.get(t);
4465
+ if (null != s && null != a) return s === t;
4466
+ n.set(e, t), n.set(t, e);
4467
+ try {
4468
+ switch(i){
4469
+ case mapTag:
4470
+ if (e.size !== t.size) return !1;
4471
+ for (let [i, o] of e.entries())if (!t.has(i) || !isEqualWithImpl(o, t.get(i), i, e, t, n, r)) return !1;
4472
+ return !0;
4473
+ case setTag:
4474
+ {
4475
+ if (e.size !== t.size) return !1;
4476
+ let i = Array.from(e.values()), o = Array.from(t.values());
4477
+ for(let s = 0; s < i.length; s++){
4478
+ let a = i[s], u = o.findIndex((i)=>isEqualWithImpl(a, i, void 0, e, t, n, r));
4479
+ if (-1 === u) return !1;
4480
+ o.splice(u, 1);
4481
+ }
4482
+ return !0;
4483
+ }
4484
+ case arrayTag:
4485
+ case uint8ArrayTag:
4486
+ case uint8ClampedArrayTag:
4487
+ case uint16ArrayTag:
4488
+ case uint32ArrayTag:
4489
+ case bigUint64ArrayTag:
4490
+ case int8ArrayTag:
4491
+ case int16ArrayTag:
4492
+ case int32ArrayTag:
4493
+ case bigInt64ArrayTag:
4494
+ case float32ArrayTag:
4495
+ case float64ArrayTag:
4496
+ if ('undefined' != typeof Buffer && Buffer.isBuffer(e) !== Buffer.isBuffer(t) || e.length !== t.length) return !1;
4497
+ for(let i = 0; i < e.length; i++)if (!isEqualWithImpl(e[i], t[i], i, e, t, n, r)) return !1;
4498
+ return !0;
4499
+ case arrayBufferTag:
4500
+ if (e.byteLength !== t.byteLength) return !1;
4501
+ return areObjectsEqual(new Uint8Array(e), new Uint8Array(t), n, r);
4502
+ case dataViewTag:
4503
+ if (e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset) return !1;
4504
+ return areObjectsEqual(new Uint8Array(e), new Uint8Array(t), n, r);
4505
+ case errorTag:
4506
+ return e.name === t.name && e.message === t.message;
4507
+ case objectTag:
4508
+ {
4509
+ if (!(areObjectsEqual(e.constructor, t.constructor, n, r) || isPlainObject_isPlainObject(e) && isPlainObject_isPlainObject(t))) return !1;
4510
+ let i = [
4511
+ ...Object.keys(e),
4512
+ ...getSymbols(e)
4513
+ ], o = [
4514
+ ...Object.keys(t),
4515
+ ...getSymbols(t)
4516
+ ];
4517
+ if (i.length !== o.length) return !1;
4518
+ for(let o = 0; o < i.length; o++){
4519
+ let s = i[o], a = e[s];
4520
+ if (!Object.hasOwn(t, s)) return !1;
4521
+ let u = t[s];
4522
+ if (!isEqualWithImpl(a, u, s, e, t, n, r)) return !1;
4523
+ }
4524
+ return !0;
4525
+ }
4526
+ default:
4527
+ return !1;
4528
+ }
4529
+ } finally{
4530
+ n.delete(e), n.delete(t);
4531
+ }
4532
+ }
4533
+ function noop() {}
4534
+ function isEqual(e, t) {
4535
+ return isEqualWith(e, t, noop);
4536
+ }
4326
4537
  function base_define_property(e, t, n) {
4327
4538
  return t in e ? Object.defineProperty(e, t, {
4328
4539
  value: n,
@@ -4331,14 +4542,6 @@ function base_define_property(e, t, n) {
4331
4542
  writable: !0
4332
4543
  }) : e[t] = n, e;
4333
4544
  }
4334
- schemas_object({
4335
- subjects: schemas_object({
4336
- items: schemas_array(unknown().transform((e)=>{
4337
- var t;
4338
- return null != (t = doubanSubjectItemSchema.safeParse(e).data) ? t : null;
4339
- })).transform((e)=>compact(e))
4340
- })
4341
- });
4342
4545
  class BaseScraper {
4343
4546
  parseIdString(e) {
4344
4547
  var t, n;
@@ -4889,32 +5092,32 @@ const parseXml = function(e) {
4889
5092
  }
4890
5093
  ]) : n.add(this.options.textNodeName, a), o = t + 2;
4891
5094
  } else {
4892
- let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, d = s.closeIndex;
5095
+ let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, f = s.closeIndex;
4893
5096
  this.options.transformTagName && (a = this.options.transformTagName(a)), n && r && '!xml' !== n.tagname && (r = this.saveTextToParentTag(r, n, i, !1));
4894
- let p = n;
4895
- p && -1 !== this.options.unpairedTags.indexOf(p.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
4896
- let f = o;
5097
+ let d = n;
5098
+ d && -1 !== this.options.unpairedTags.indexOf(d.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
5099
+ let p = o;
4897
5100
  if (this.isItStopNode(this.options.stopNodes, i, a)) {
4898
5101
  let t = "";
4899
5102
  if (l.length > 0 && l.lastIndexOf("/") === l.length - 1) "/" === a[a.length - 1] ? (a = a.substr(0, a.length - 1), i = i.substr(0, i.length - 1), l = a) : l = l.substr(0, l.length - 1), o = s.closeIndex;
4900
5103
  else if (-1 !== this.options.unpairedTags.indexOf(a)) o = s.closeIndex;
4901
5104
  else {
4902
- let n = this.readStopNodeData(e, u, d + 1);
5105
+ let n = this.readStopNodeData(e, u, f + 1);
4903
5106
  if (!n) throw Error(`Unexpected end of ${u}`);
4904
5107
  o = n.i, t = n.tagContent;
4905
5108
  }
4906
5109
  let r = new XmlNode(a);
4907
- a !== l && c && (r[":@"] = this.buildAttributesMap(l, i, a)), t && (t = this.parseTextData(t, a, i, !0, c, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), r.add(this.options.textNodeName, t), this.addChild(n, r, i, f);
5110
+ a !== l && c && (r[":@"] = this.buildAttributesMap(l, i, a)), t && (t = this.parseTextData(t, a, i, !0, c, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), r.add(this.options.textNodeName, t), this.addChild(n, r, i, p);
4908
5111
  } else {
4909
5112
  if (l.length > 0 && l.lastIndexOf("/") === l.length - 1) {
4910
5113
  "/" === a[a.length - 1] ? (a = a.substr(0, a.length - 1), i = i.substr(0, i.length - 1), l = a) : l = l.substr(0, l.length - 1), this.options.transformTagName && (a = this.options.transformTagName(a));
4911
5114
  let e = new XmlNode(a);
4912
- a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, f), i = i.substr(0, i.lastIndexOf("."));
5115
+ a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), i = i.substr(0, i.lastIndexOf("."));
4913
5116
  } else {
4914
5117
  let e = new XmlNode(a);
4915
- this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, f), n = e;
5118
+ this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), n = e;
4916
5119
  }
4917
- r = "", o = d;
5120
+ r = "", o = f;
4918
5121
  }
4919
5122
  }
4920
5123
  else r += e[o];
@@ -5296,24 +5499,32 @@ const iqiyiIdSchema = schemas_object({
5296
5499
  }
5297
5500
  })), safeParseVideo = (e)=>{
5298
5501
  let t = iqiyiEpisodeTabDataVideoSchema.safeParse(e);
5299
- return t.success ? t.data : (console.warn("\u7231\u5947\u827A: \u89E3\u6790\u5206\u96C6\u6570\u636E\u65F6\u53D1\u751F\u9519\u8BEF:", t.error.format(), e), null);
5300
- }, iqiyiTvTabDataSchema = schemas_object({
5301
- data: schemas_array(schemas_object({
5302
- videos: schemas_object({
5303
- feature_paged: record(schemas_string(), schemas_array(unknown().transform((e)=>safeParseVideo(e)))).optional().transform((e)=>compact(Object.values(null != e ? e : {}).flat()))
5304
- }).optional()
5305
- }).transform((e)=>{
5306
- var t;
5307
- return null == (t = e.videos) ? void 0 : t.feature_paged;
5308
- })).transform((e)=>compact(e.flat()))
5309
- }), iqiyiMovieTabDataSchema = schemas_object({
5502
+ return t.success ? t.data : (console.warn("\u7231\u5947\u827A: \u89E3\u6790\u5206\u96C6\u6570\u636E\u65F6\u53D1\u751F\u9519\u8BEF:", prettifyError(t.error), e), null);
5503
+ }, iqiyiTvTabSchema = schemas_object({
5504
+ bk_id: literal("selector_bk"),
5505
+ bk_type: literal("album_episodes"),
5506
+ data: schemas_object({
5507
+ data: schemas_array(unknown().transform((e)=>schemas_object({
5508
+ videos: schemas_object({
5509
+ feature_paged: record(any(), schemas_array(unknown().transform((e)=>safeParseVideo(e)))).optional().transform((e)=>compact(Object.values(null != e ? e : {}).flat()))
5510
+ }).optional()
5511
+ }).transform((e)=>{
5512
+ var t;
5513
+ return null == (t = e.videos) ? void 0 : t.feature_paged;
5514
+ }).safeParse(e).data)).transform((e)=>compact(e.flat()))
5515
+ })
5516
+ }), iqiyiMovieTabSchema = schemas_object({
5517
+ bk_id: literal("film_feature_bk"),
5518
+ bk_type: literal("video_list"),
5310
5519
  data: schemas_object({
5311
- videos: schemas_array(unknown().transform((e)=>safeParseVideo(e)))
5312
- }).transform((e)=>compact(e.videos))
5313
- }), iqiyiEpisodeTabDataSchema = union([
5314
- iqiyiTvTabDataSchema,
5315
- iqiyiMovieTabDataSchema
5316
- ]), iqiyiV3ApiResponseSchema = schemas_object({
5520
+ data: schemas_object({
5521
+ videos: schemas_array(unknown().transform((e)=>safeParseVideo(e)))
5522
+ }).transform((e)=>compact(e.videos))
5523
+ })
5524
+ }), iqiyiEpisodeTabSchema = union([
5525
+ iqiyiTvTabSchema,
5526
+ iqiyiMovieTabSchema
5527
+ ]).transform((e)=>e.data.data), iqiyiV3ApiResponseSchema = schemas_object({
5317
5528
  status_code: schemas_number(),
5318
5529
  data: schemas_object({
5319
5530
  base_data: schemas_object({
@@ -5397,7 +5608,7 @@ class IqiyiScraper extends BaseScraper {
5397
5608
  console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
5398
5609
  let a = await this.fetch.get(s, {
5399
5610
  zlibMode: !0
5400
- }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: d } = iqiyiCommentsResponseSchema.safeParse(u);
5611
+ }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: f } = iqiyiCommentsResponseSchema.safeParse(u);
5401
5612
  return l ? c.map((e)=>{
5402
5613
  let t = 16777215;
5403
5614
  try {
@@ -5410,7 +5621,7 @@ class IqiyiScraper extends BaseScraper {
5410
5621
  color: t,
5411
5622
  content: e.content
5412
5623
  };
5413
- }) : (console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5F39}\u{5E55}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(d)), []);
5624
+ }) : (console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5F39}\u{5E55}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(f)), []);
5414
5625
  }
5415
5626
  async getEpisodesV3(e) {
5416
5627
  let t = {
@@ -5445,10 +5656,10 @@ class IqiyiScraper extends BaseScraper {
5445
5656
  url: e.play_url
5446
5657
  }))) ? o : [];
5447
5658
  if (!c.length) {
5448
- let t = null == e || null == (u = e.data) || null == (a = u.template) || null == (s = a.tabs) ? void 0 : s.flatMap((e)=>e.blocks || []).find((e)=>"selector_bk" === e.bk_id && "album_episodes" === e.bk_type || "film_feature_bk" === e.bk_id && "video_list" === e.bk_type), { success: n, data: r, error: i } = iqiyiEpisodeTabDataSchema.safeParse(null == t ? void 0 : t.data);
5449
- if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5206}\u{96C6}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(i), t), [];
5450
- let o = this.getEpisodeBlacklistPattern(), d = 1;
5451
- for (let e of r.data){
5659
+ let t = null == e || null == (u = e.data) || null == (a = u.template) || null == (s = a.tabs) ? void 0 : s.flatMap((e)=>e.blocks || []).find((e)=>iqiyiEpisodeTabSchema.safeParse(e).success), { success: n, data: r, error: i } = iqiyiEpisodeTabSchema.safeParse(t);
5660
+ if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5206}\u{96C6}\u{5217}\u{8868}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(i), t), [];
5661
+ let o = this.getEpisodeBlacklistPattern(), f = 1;
5662
+ for (let e of r){
5452
5663
  if (17 === e.mark_type_show) continue;
5453
5664
  let t = this.videoIdToEntityId(e.videoId);
5454
5665
  t && (null != o && o.test(e.title) || (c.push({
@@ -5457,8 +5668,8 @@ class IqiyiScraper extends BaseScraper {
5457
5668
  entityId: t
5458
5669
  }),
5459
5670
  episodeTitle: e.title,
5460
- episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : d
5461
- }), d += 1));
5671
+ episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : f
5672
+ }), f += 1));
5462
5673
  }
5463
5674
  }
5464
5675
  return c;
@@ -5788,12 +5999,12 @@ class YoukuScraper extends BaseScraper {
5788
5999
  }),
5789
6000
  episodeTitle: e.title,
5790
6001
  episodeNumber: t
5791
- }), o = await this.getEpisodesPage(s, l, a), c = e(null != (r = null == o ? void 0 : o.videos) ? r : []), d = c.find((e)=>e.seq === u);
5792
- if (d) return [
5793
- n(d, u)
6002
+ }), o = await this.getEpisodesPage(s, l, a), c = e(null != (r = null == o ? void 0 : o.videos) ? r : []), f = c.find((e)=>e.seq === u);
6003
+ if (f) return [
6004
+ n(f, u)
5794
6005
  ];
5795
- let p = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), f = Math.max(1, Math.ceil(p / a)), h = Array.from({
5796
- length: f
6006
+ let d = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), p = Math.max(1, Math.ceil(d / a)), h = Array.from({
6007
+ length: p
5797
6008
  }, (e, t)=>t + 1).filter((e)=>e !== l), m = [];
5798
6009
  for (let e of h){
5799
6010
  await this.sleep(500);
@@ -5803,17 +6014,17 @@ class YoukuScraper extends BaseScraper {
5803
6014
  let g = e(m.flatMap((e)=>{
5804
6015
  var t;
5805
6016
  return null != (t = null == e ? void 0 : e.videos) ? t : [];
5806
- })), v = [
6017
+ })), y = [
5807
6018
  ...c,
5808
6019
  ...g
5809
6020
  ];
5810
6021
  if (void 0 !== t) {
5811
- let e = v.find((e)=>e.seq === u);
6022
+ let e = y.find((e)=>e.seq === u);
5812
6023
  return e ? [
5813
6024
  n(e, u)
5814
6025
  ] : [];
5815
6026
  }
5816
- return v.sort((e, t)=>{
6027
+ return y.sort((e, t)=>{
5817
6028
  var n, r;
5818
6029
  return (null != (n = e.seq) ? n : Number.MAX_SAFE_INTEGER) - (null != (r = t.seq) ? r : Number.MAX_SAFE_INTEGER);
5819
6030
  }).map((e, t)=>n(e, t + 1));
@@ -6100,9 +6311,9 @@ class scrapers_Scraper {
6100
6311
  episodeNumber: this.getEpisodeNumber(t, n)
6101
6312
  });
6102
6313
  }
6103
- async getDetailWithDoubanId(e, t, n) {
6104
- let r = await getVideoPlatformInfoByDoubanId(e.toString()), i = this.getEpisodeNumber(t, n), o = [];
6105
- return Object.entries(r.providers).forEach((e)=>{
6314
+ async getDetailWithDoubanIds(e, t, n) {
6315
+ let r = await Promise.all(e.map((e)=>getVideoPlatformInfoByDoubanId(e).catch(()=>null))), i = this.getEpisodeNumber(t, n), o = [];
6316
+ for (let e of r)e && Object.entries(e.providers).forEach((e)=>{
6106
6317
  var t, n;
6107
6318
  let [r, s] = e;
6108
6319
  o.push({
@@ -6110,7 +6321,8 @@ class scrapers_Scraper {
6110
6321
  idString: null != (n = null == (t = this.scraperMap[r]) ? void 0 : t.generateIdString(s)) ? n : "",
6111
6322
  episodeNumber: i
6112
6323
  });
6113
- }), this.getEpisodes(...o);
6324
+ });
6325
+ return this.getEpisodes(...uniqWith(o, isEqual));
6114
6326
  }
6115
6327
  constructor(){
6116
6328
  scrapers_define_property(this, "scrapers", []), scrapers.forEach((e)=>{
@@ -6118,7 +6330,7 @@ class scrapers_Scraper {
6118
6330
  });
6119
6331
  }
6120
6332
  }
6121
- const widgetVersion = "0.0.16";
6333
+ const widgetVersion = "0.1.1";
6122
6334
  WidgetMetadata = {
6123
6335
  id: "baranwang.danmu.universe",
6124
6336
  title: "\u901A\u7528\u5F39\u5E55",
@@ -6127,6 +6339,29 @@ WidgetMetadata = {
6127
6339
  version: widgetVersion,
6128
6340
  site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
6129
6341
  requiredVersion: "0.0.2",
6342
+ globalParams: [
6343
+ {
6344
+ title: "\u6A21\u7CCA\u5339\u914D",
6345
+ name: "fuzzyMatch",
6346
+ description: "\u662F\u5426\u5F00\u542F\u6A21\u7CCA\u5339\u914D",
6347
+ value: "auto",
6348
+ type: "enumeration",
6349
+ enumOptions: [
6350
+ {
6351
+ title: "\u81EA\u52A8",
6352
+ value: "auto"
6353
+ },
6354
+ {
6355
+ title: "\u59CB\u7EC8\u5F00\u542F",
6356
+ value: "always"
6357
+ },
6358
+ {
6359
+ title: "\u59CB\u7EC8\u5173\u95ED",
6360
+ value: "never"
6361
+ }
6362
+ ]
6363
+ }
6364
+ ],
6130
6365
  modules: [
6131
6366
  {
6132
6367
  type: "danmu",
@@ -6160,11 +6395,12 @@ WidgetMetadata = {
6160
6395
  };
6161
6396
  const src_scraper = new scrapers_Scraper();
6162
6397
  searchDanmu = async (e)=>{
6163
- let { tmdbId: t, type: n, season: r, episode: i } = e;
6398
+ storage.cleanup();
6399
+ let { tmdbId: t, type: n, episode: r } = e;
6164
6400
  if (!t) return null;
6165
- let o = await getDoubanInfoByTmdbId(n, t, r);
6166
- return (null == o ? void 0 : o.doubanId) ? {
6167
- animes: (await src_scraper.getDetailWithDoubanId(o.doubanId, n, i)).map((e)=>{
6401
+ let i = await getDoubanIds(e);
6402
+ return i.length ? {
6403
+ animes: (await src_scraper.getDetailWithDoubanIds(i, n, r)).map((e)=>{
6168
6404
  let t = `[${PROVIDER_NAMES[e.provider]}] `;
6169
6405
  return e.episodeTitle && (t += e.episodeTitle), {
6170
6406
  animeId: e.episodeId,
@@ -6173,26 +6409,25 @@ searchDanmu = async (e)=>{
6173
6409
  })
6174
6410
  } : null;
6175
6411
  }, getDetail = async (e)=>{
6176
- var t;
6177
- let { animeId: n, tmdbId: r, type: i, season: o, episode: s } = e;
6178
- if (!r && !n) return null;
6179
- if (n) return src_scraper.getDetailWithAnimeId(n.toString(), i, s);
6180
- let a = await getDoubanInfoByTmdbId(i, null != r ? r : "", o);
6181
- return src_scraper.getDetailWithDoubanId(null != (t = null == a ? void 0 : a.doubanId) ? t : "", i, s);
6412
+ let { animeId: t, tmdbId: n, type: r, episode: i } = e;
6413
+ if (!n && !t) return null;
6414
+ if (t) return src_scraper.getDetailWithAnimeId(t.toString(), r, i);
6415
+ let o = await getDoubanIds(e);
6416
+ return o.length ? src_scraper.getDetailWithDoubanIds(o, r, i) : null;
6182
6417
  }, getComments = async (e)=>{
6183
- let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, season: s, episode: a } = e, u = null != n ? n : t;
6184
- if (!u) {
6185
- var l;
6418
+ let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, episode: s } = e, a = null != n ? n : t;
6419
+ if (!a) {
6186
6420
  if (!i) return null;
6187
- let e = await getDoubanInfoByTmdbId(o, i, s);
6188
- u = (await src_scraper.getDetailWithDoubanId(null != (l = null == e ? void 0 : e.doubanId) ? l : "", o, a)).map((e)=>[
6421
+ let t = await getDoubanIds(e);
6422
+ if (!t.length) return null;
6423
+ a = (await src_scraper.getDetailWithDoubanIds(t, o, s)).map((e)=>[
6189
6424
  e.provider,
6190
6425
  e.episodeId
6191
6426
  ].join(":")).join(",");
6192
6427
  }
6193
- let c = await src_scraper.getDanmuWithSegmentTimeByVideoId(u.toString(), r);
6428
+ let u = await src_scraper.getDanmuWithSegmentTimeByVideoId(a.toString(), r);
6194
6429
  return {
6195
- comments: c,
6196
- count: c.length
6430
+ comments: u,
6431
+ count: u.length
6197
6432
  };
6198
6433
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forward-widget/danmu-universe",
3
- "version": "0.0.16",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "./dist/danmu-universe.js",
6
6
  "exports": {