@forward-widget/danmu-universe 0.0.15 → 0.1.0

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 +503 -361
  2. package/package.json +2 -2
@@ -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
- }, f = 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;
@@ -564,13 +564,13 @@ var __webpack_modules__ = {
564
564
  }, p = c.Utf8 = {
565
565
  stringify: function(e) {
566
566
  try {
567
- return decodeURIComponent(escape(f.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 f.parse(unescape(encodeURIComponent(e)));
573
+ return d.parse(unescape(encodeURIComponent(e)));
574
574
  }
575
575
  }, h = a.BufferedBlockAlgorithm = u.extend({
576
576
  reset: function() {
@@ -582,7 +582,7 @@ var __webpack_modules__ = {
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], p = 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], E = e[t + 13], S = 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, p, 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, $, E, 12, a[13]), $ = l($, P, O, I, S, 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, $, S, 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, E, 5, a[28]), P = c(P, O, I, $, p, 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, S, 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, E, 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, p, 23, a[47]), O = f(O, I, $, P, s, 6, a[48]), P = f(P, O, I, $, y, 10, a[49]), $ = f($, P, O, I, S, 15, a[50]), I = f(I, $, P, O, g, 21, a[51]), O = f(O, I, $, P, x, 6, a[52]), P = f(P, O, I, $, h, 10, a[53]), $ = f($, P, O, I, w, 15, a[54]), I = f(I, $, P, O, u, 21, a[55]), O = f(O, I, $, P, b, 6, a[56]), P = f(P, O, I, $, z, 10, a[57]), $ = f($, P, O, I, v, 15, a[58]), I = f(I, $, P, O, E, 21, a[59]), O = f(O, I, $, P, m, 6, a[60]), P = f(P, O, I, $, k, 10, a[61]), $ = f($, P, O, I, p, 15, a[62]), I = f(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 f(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 f(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
793
  function p() {
794
794
  if (this.pos + 8 > this.len) throw a(this, 8);
795
- return new o(f(this.buf, this.pos += 4), f(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 f(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 | f(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,13 +867,13 @@ 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
879
  return p.call(this)[t](!0);
@@ -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,16 +1099,16 @@ 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 f = 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
1114
  function p(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 = f(), 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) {
1148
+ }, f.prototype.bool = function(e) {
1149
1149
  return this._push(p, 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) {
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
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
1175
  return t ? this.uint32(t)._push(a.write, t, e) : this._push(p, 1, 0);
1176
- }, d.prototype.fork = function() {
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 = f(), 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 f = [
1274
+ var d = [
1275
1275
  [
1276
1276
  '#',
1277
1277
  'hash'
@@ -1318,8 +1318,8 @@ var __webpack_modules__ = {
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, {}), p)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
1324
  for(r in e)r in p || (o[r] = e[r]);
1325
1325
  void 0 === o.slashes && (o.slashes = a.test(e.href));
@@ -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, p, b, _ = f.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'
@@ -1357,9 +1357,9 @@ var __webpack_modules__ = {
1357
1357
  }
1358
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 && (~(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();
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 < f.length; l++){
1397
- var c = f[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__ = {};
@@ -1448,13 +1448,12 @@ function __webpack_require__(e) {
1448
1448
  })(), (()=>{
1449
1449
  __webpack_require__.nmd = (e)=>(e.paths = [], e.children || (e.children = []), e);
1450
1450
  })();
1451
- const DOUBAN_API_KEY = "0ac44ae016490db2204ce0a042db2916", PROVIDER_NAMES = {
1451
+ const PROVIDER_NAMES = {
1452
1452
  tencent: "\u817E\u8BAF\u89C6\u9891",
1453
1453
  iqiyi: "\u7231\u5947\u827A",
1454
1454
  youku: "\u4F18\u9177\u89C6\u9891",
1455
1455
  bilibili: "\u54D4\u54E9\u54D4\u54E9"
1456
1456
  };
1457
- var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse);
1458
1457
  function $constructor(e, t, n) {
1459
1458
  function r(n, r) {
1460
1459
  var i;
@@ -1493,20 +1492,15 @@ class $ZodAsyncError extends Error {
1493
1492
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
1494
1493
  }
1495
1494
  }
1496
- class $ZodEncodeError extends Error {
1497
- constructor(e){
1498
- super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
1499
- }
1500
- }
1501
1495
  const globalConfig = {};
1502
1496
  function core_config(e) {
1503
1497
  return e && Object.assign(globalConfig, e), globalConfig;
1504
1498
  }
1505
- const cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, regexes_duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, uuid = (e)=>e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, _emoji = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1499
+ const cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, regexes_duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, uuid = (e)=>e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, _emoji = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1506
1500
  function emoji() {
1507
1501
  return RegExp(_emoji, "u");
1508
1502
  }
1509
- const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, regexes_base64url = /^[A-Za-z0-9_-]*$/, hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
1503
+ const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
1510
1504
  function timeSource(e) {
1511
1505
  let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
1512
1506
  return "number" == typeof e.precision ? -1 === e.precision ? `${t}` : 0 === e.precision ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -1707,9 +1701,7 @@ function omit(e, t) {
1707
1701
  }
1708
1702
  function extend(e, t) {
1709
1703
  if (!isPlainObject(t)) throw Error("Invalid input to extend: expected a plain object");
1710
- let n = e._zod.def.checks;
1711
- if (n && n.length > 0) throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
1712
- let r = mergeDefs(e._zod.def, {
1704
+ let n = mergeDefs(e._zod.def, {
1713
1705
  get shape () {
1714
1706
  let n = {
1715
1707
  ...e._zod.def.shape,
@@ -1719,21 +1711,6 @@ function extend(e, t) {
1719
1711
  },
1720
1712
  checks: []
1721
1713
  });
1722
- return clone(e, r);
1723
- }
1724
- function safeExtend(e, t) {
1725
- if (!isPlainObject(t)) throw Error("Invalid input to safeExtend: expected a plain object");
1726
- let n = {
1727
- ...e._zod.def,
1728
- get shape () {
1729
- let n = {
1730
- ...e._zod.def.shape,
1731
- ...t
1732
- };
1733
- return assignProp(this, "shape", n), n;
1734
- },
1735
- checks: e._zod.def.checks
1736
- };
1737
1714
  return clone(e, n);
1738
1715
  }
1739
1716
  function merge(e, t) {
@@ -1799,7 +1776,6 @@ function required(e, t, n) {
1799
1776
  return clone(t, r);
1800
1777
  }
1801
1778
  function aborted(e, t = 0) {
1802
- if (!0 === e.aborted) return !0;
1803
1779
  for(let n = t; n < e.issues.length; n++)if (e.issues[n]?.continue !== !0) return !0;
1804
1780
  return !1;
1805
1781
  }
@@ -2256,38 +2232,10 @@ const _parse = (e)=>(t, n, r, i)=>{
2256
2232
  success: !0,
2257
2233
  data: o.value
2258
2234
  };
2259
- }, safeParseAsync = _safeParseAsync($ZodRealError), _encode = (e)=>(t, n, r)=>{
2260
- let i = r ? Object.assign(r, {
2261
- direction: "backward"
2262
- }) : {
2263
- direction: "backward"
2264
- };
2265
- return _parse(e)(t, n, i);
2266
- }, _decode = (e)=>(t, n, r)=>_parse(e)(t, n, r), _encodeAsync = (e)=>async (t, n, r)=>{
2267
- let i = r ? Object.assign(r, {
2268
- direction: "backward"
2269
- }) : {
2270
- direction: "backward"
2271
- };
2272
- return _parseAsync(e)(t, n, i);
2273
- }, _decodeAsync = (e)=>async (t, n, r)=>_parseAsync(e)(t, n, r), _safeEncode = (e)=>(t, n, r)=>{
2274
- let i = r ? Object.assign(r, {
2275
- direction: "backward"
2276
- }) : {
2277
- direction: "backward"
2278
- };
2279
- return _safeParse(e)(t, n, i);
2280
- }, _safeDecode = (e)=>(t, n, r)=>_safeParse(e)(t, n, r), _safeEncodeAsync = (e)=>async (t, n, r)=>{
2281
- let i = r ? Object.assign(r, {
2282
- direction: "backward"
2283
- }) : {
2284
- direction: "backward"
2285
- };
2286
- return _safeParseAsync(e)(t, n, i);
2287
- }, _safeDecodeAsync = (e)=>async (t, n, r)=>_safeParseAsync(e)(t, n, r), versions_version = {
2235
+ }, safeParseAsync = _safeParseAsync($ZodRealError), versions_version = {
2288
2236
  major: 4,
2289
- minor: 1,
2290
- patch: 5
2237
+ minor: 0,
2238
+ patch: 17
2291
2239
  }, $ZodType = $constructor("$ZodType", (e, t)=>{
2292
2240
  var n;
2293
2241
  e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = versions_version;
@@ -2316,33 +2264,14 @@ const _parse = (e)=>(t, n, r, i)=>{
2316
2264
  }
2317
2265
  }
2318
2266
  return r ? r.then(()=>e) : e;
2319
- }, n = (n, i, o)=>{
2320
- if (aborted(n)) return n.aborted = !0, n;
2321
- let s = t(i, r, o);
2322
- if (s instanceof Promise) {
2323
- if (!1 === o.async) throw new $ZodAsyncError();
2324
- return s.then((t)=>e._zod.parse(t, o));
2325
- }
2326
- return e._zod.parse(s, o);
2327
2267
  };
2328
- e._zod.run = (i, o)=>{
2329
- if (o.skipChecks) return e._zod.parse(i, o);
2330
- if ("backward" === o.direction) {
2331
- let t = e._zod.parse({
2332
- value: i.value,
2333
- issues: []
2334
- }, {
2335
- ...o,
2336
- skipChecks: !0
2337
- });
2338
- return t instanceof Promise ? t.then((e)=>n(e, i, o)) : n(t, i, o);
2339
- }
2340
- let s = e._zod.parse(i, o);
2341
- if (s instanceof Promise) {
2342
- if (!1 === o.async) throw new $ZodAsyncError();
2343
- return s.then((e)=>t(e, r, o));
2268
+ e._zod.run = (n, i)=>{
2269
+ let o = e._zod.parse(n, i);
2270
+ if (o instanceof Promise) {
2271
+ if (!1 === i.async) throw new $ZodAsyncError();
2272
+ return o.then((e)=>t(e, r, i));
2344
2273
  }
2345
- return t(s, r, o);
2274
+ return t(o, r, i);
2346
2275
  };
2347
2276
  }
2348
2277
  e["~standard"] = {
@@ -2519,12 +2448,12 @@ const $ZodBase64 = $constructor("$ZodBase64", (e, t)=>{
2519
2448
  };
2520
2449
  });
2521
2450
  function isValidBase64URL(e) {
2522
- if (!regexes_base64url.test(e)) return !1;
2451
+ if (!base64url.test(e)) return !1;
2523
2452
  let t = e.replace(/[-_]/g, (e)=>"-" === e ? "+" : "/");
2524
2453
  return isValidBase64(t.padEnd(4 * Math.ceil(t.length / 4), "="));
2525
2454
  }
2526
2455
  const $ZodBase64URL = $constructor("$ZodBase64URL", (e, t)=>{
2527
- t.pattern ?? (t.pattern = regexes_base64url), $ZodStringFormat.init(e, t), e._zod.onattach.push((e)=>{
2456
+ t.pattern ?? (t.pattern = base64url), $ZodStringFormat.init(e, t), e._zod.onattach.push((e)=>{
2528
2457
  e._zod.bag.contentEncoding = "base64url";
2529
2458
  }), e._zod.check = (n)=>{
2530
2459
  isValidBase64URL(n.value) || n.issues.push({
@@ -2631,43 +2560,21 @@ const $ZodArray = $constructor("$ZodArray", (e, t)=>{
2631
2560
  function handlePropertyResult(e, t, n, r) {
2632
2561
  e.issues.length && t.issues.push(...prefixIssues(n, e.issues)), void 0 === e.value ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
2633
2562
  }
2634
- function normalizeDef(e) {
2635
- let t = Object.keys(e.shape);
2636
- for (let n of t)if (!e.shape[n]._zod.traits.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
2637
- let n = optionalKeys(e.shape);
2638
- return {
2639
- ...e,
2640
- keys: t,
2641
- keySet: new Set(t),
2642
- numKeys: t.length,
2643
- optionalKeys: new Set(n)
2644
- };
2645
- }
2646
- function handleCatchall(e, t, n, r, i, o) {
2647
- let s = [], a = i.keySet, u = i.catchall._zod, l = u.def.type;
2648
- for (let i of Object.keys(t)){
2649
- if (a.has(i)) continue;
2650
- if ("never" === l) {
2651
- s.push(i);
2652
- continue;
2653
- }
2654
- let o = u.run({
2655
- value: t[i],
2656
- issues: []
2657
- }, r);
2658
- o instanceof Promise ? e.push(o.then((e)=>handlePropertyResult(e, n, i, t))) : handlePropertyResult(o, n, i, t);
2659
- }
2660
- return (s.length && n.issues.push({
2661
- code: "unrecognized_keys",
2662
- keys: s,
2663
- input: t,
2664
- inst: o
2665
- }), e.length) ? Promise.all(e).then(()=>n) : n;
2666
- }
2667
2563
  const $ZodObject = $constructor("$ZodObject", (e, t)=>{
2668
- let n;
2564
+ let n, r;
2669
2565
  $ZodType.init(e, t);
2670
- let r = util_cached(()=>normalizeDef(t));
2566
+ let i = util_cached(()=>{
2567
+ let e = Object.keys(t.shape);
2568
+ for (let n of e)if (!t.shape[n]._zod.traits.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
2569
+ let n = optionalKeys(t.shape);
2570
+ return {
2571
+ shape: t.shape,
2572
+ keys: e,
2573
+ keySet: new Set(e),
2574
+ numKeys: e.length,
2575
+ optionalKeys: new Set(n)
2576
+ };
2577
+ });
2671
2578
  defineLazy(e._zod, "propValues", ()=>{
2672
2579
  let e = t.shape, n = {};
2673
2580
  for(let t in e){
@@ -2676,74 +2583,83 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
2676
2583
  }
2677
2584
  return n;
2678
2585
  });
2679
- let i = util_isObject, o = t.catchall;
2680
- e._zod.parse = (t, s)=>{
2681
- n ?? (n = r.value);
2682
- let a = t.value;
2683
- if (!i(a)) return t.issues.push({
2684
- expected: "object",
2685
- code: "invalid_type",
2686
- input: a,
2687
- inst: e
2688
- }), t;
2689
- t.value = {};
2690
- let u = [], l = n.shape;
2691
- for (let e of n.keys){
2692
- let n = l[e]._zod.run({
2693
- value: a[e],
2694
- issues: []
2695
- }, s);
2696
- n instanceof Promise ? u.push(n.then((n)=>handlePropertyResult(n, t, e, a))) : handlePropertyResult(n, t, e, a);
2697
- }
2698
- return o ? handleCatchall(u, a, t, s, r.value, e) : u.length ? Promise.all(u).then(()=>t) : t;
2699
- };
2700
- }), $ZodObjectJIT = $constructor("$ZodObjectJIT", (e, t)=>{
2701
- let n, r;
2702
- $ZodObject.init(e, t);
2703
- let i = e._zod.parse, o = util_cached(()=>normalizeDef(t)), s = (e)=>{
2586
+ let o = (e)=>{
2704
2587
  let t = new Doc([
2705
2588
  "shape",
2706
2589
  "payload",
2707
2590
  "ctx"
2708
- ]), n = o.value, r = (e)=>{
2591
+ ]), n = i.value, r = (e)=>{
2709
2592
  let t = esc(e);
2710
2593
  return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
2711
2594
  };
2712
2595
  t.write("const input = payload.value;");
2713
- let i = Object.create(null), s = 0;
2714
- for (let e of n.keys)i[e] = `key_${s++}`;
2596
+ let o = Object.create(null), s = 0;
2597
+ for (let e of n.keys)o[e] = `key_${s++}`;
2715
2598
  for (let e of (t.write("const newResult = {}"), n.keys)){
2716
- let n = i[e], o = esc(e);
2599
+ let n = o[e], i = esc(e);
2717
2600
  t.write(`const ${n} = ${r(e)};`), t.write(`
2718
2601
  if (${n}.issues.length) {
2719
2602
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
2720
2603
  ...iss,
2721
- path: iss.path ? [${o}, ...iss.path] : [${o}]
2604
+ path: iss.path ? [${i}, ...iss.path] : [${i}]
2722
2605
  })));
2723
2606
  }
2724
2607
 
2725
2608
  if (${n}.value === undefined) {
2726
- if (${o} in input) {
2727
- newResult[${o}] = undefined;
2609
+ if (${i} in input) {
2610
+ newResult[${i}] = undefined;
2728
2611
  }
2729
2612
  } else {
2730
- newResult[${o}] = ${n}.value;
2613
+ newResult[${i}] = ${n}.value;
2731
2614
  }
2732
2615
  `);
2733
2616
  }
2734
2617
  t.write("payload.value = newResult;"), t.write("return payload;");
2735
2618
  let a = t.compile();
2736
2619
  return (t, n)=>a(e, t, n);
2737
- }, a = util_isObject, u = !globalConfig.jitless, l = util_allowsEval, c = u && l.value, d = t.catchall;
2738
- e._zod.parse = (l, f)=>{
2739
- r ?? (r = o.value);
2740
- let p = l.value;
2741
- return a(p) ? u && c && f?.async === !1 && !0 !== f.jitless ? (n || (n = s(t.shape)), l = n(l, f), d) ? handleCatchall([], p, l, f, r, e) : l : i(l, f) : (l.issues.push({
2620
+ }, s = util_isObject, a = !globalConfig.jitless, u = util_allowsEval, l = a && u.value, c = t.catchall;
2621
+ e._zod.parse = (u, f)=>{
2622
+ r ?? (r = i.value);
2623
+ let d = u.value;
2624
+ if (!s(d)) return u.issues.push({
2742
2625
  expected: "object",
2743
2626
  code: "invalid_type",
2744
- input: p,
2627
+ input: d,
2745
2628
  inst: e
2746
- }), l);
2629
+ }), u;
2630
+ let p = [];
2631
+ if (a && l && f?.async === !1 && !0 !== f.jitless) n || (n = o(t.shape)), u = n(u, f);
2632
+ else {
2633
+ u.value = {};
2634
+ let e = r.shape;
2635
+ for (let t of r.keys){
2636
+ let n = e[t]._zod.run({
2637
+ value: d[t],
2638
+ issues: []
2639
+ }, f);
2640
+ n instanceof Promise ? p.push(n.then((e)=>handlePropertyResult(e, u, t, d))) : handlePropertyResult(n, u, t, d);
2641
+ }
2642
+ }
2643
+ if (!c) return p.length ? Promise.all(p).then(()=>u) : u;
2644
+ let h = [], m = r.keySet, g = c._zod, y = g.def.type;
2645
+ for (let e of Object.keys(d)){
2646
+ if (m.has(e)) continue;
2647
+ if ("never" === y) {
2648
+ h.push(e);
2649
+ continue;
2650
+ }
2651
+ let t = g.run({
2652
+ value: d[e],
2653
+ issues: []
2654
+ }, f);
2655
+ t instanceof Promise ? p.push(t.then((t)=>handlePropertyResult(t, u, e, d))) : handlePropertyResult(t, u, e, d);
2656
+ }
2657
+ return (h.length && u.issues.push({
2658
+ code: "unrecognized_keys",
2659
+ keys: h,
2660
+ input: d,
2661
+ inst: e
2662
+ }), p.length) ? Promise.all(p).then(()=>u) : u;
2747
2663
  };
2748
2664
  });
2749
2665
  function handleUnionResults(e, t, n, r) {
@@ -2938,12 +2854,11 @@ const $ZodRecord = $constructor("$ZodRecord", (e, t)=>{
2938
2854
  }), n;
2939
2855
  };
2940
2856
  }), $ZodTransform = $constructor("$ZodTransform", (e, t)=>{
2941
- $ZodType.init(e, t), e._zod.parse = (n, r)=>{
2942
- if ("backward" === r.direction) throw new $ZodEncodeError(e.constructor.name);
2943
- let i = t.transform(n.value, n);
2944
- if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e)=>(n.value = e, n));
2945
- if (i instanceof Promise) throw new $ZodAsyncError();
2946
- return n.value = i, n;
2857
+ $ZodType.init(e, t), e._zod.parse = (e, n)=>{
2858
+ let r = t.transform(e.value, e);
2859
+ if (n.async) return (r instanceof Promise ? r : Promise.resolve(r)).then((t)=>(e.value = t, e));
2860
+ if (r instanceof Promise) throw new $ZodAsyncError();
2861
+ return e.value = r, e;
2947
2862
  };
2948
2863
  });
2949
2864
  function handleOptionalResult(e, t) {
@@ -2976,7 +2891,6 @@ const $ZodOptional = $constructor("$ZodOptional", (e, t)=>{
2976
2891
  ]) : void 0), e._zod.parse = (e, n)=>null === e.value ? e : t.innerType._zod.run(e, n);
2977
2892
  }), $ZodDefault = $constructor("$ZodDefault", (e, t)=>{
2978
2893
  $ZodType.init(e, t), e._zod.optin = "optional", defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>{
2979
- if ("backward" === n.direction) return t.innerType._zod.run(e, n);
2980
2894
  if (void 0 === e.value) return e.value = t.defaultValue, e;
2981
2895
  let r = t.innerType._zod.run(e, n);
2982
2896
  return r instanceof Promise ? r.then((e)=>handleDefaultResult(e, t)) : handleDefaultResult(r, t);
@@ -2986,7 +2900,7 @@ function handleDefaultResult(e, t) {
2986
2900
  return void 0 === e.value && (e.value = t.defaultValue), e;
2987
2901
  }
2988
2902
  const $ZodPrefault = $constructor("$ZodPrefault", (e, t)=>{
2989
- $ZodType.init(e, t), e._zod.optin = "optional", defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>("backward" === n.direction || void 0 === e.value && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
2903
+ $ZodType.init(e, t), e._zod.optin = "optional", defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>(void 0 === e.value && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
2990
2904
  }), $ZodNonOptional = $constructor("$ZodNonOptional", (e, t)=>{
2991
2905
  $ZodType.init(e, t), defineLazy(e._zod, "values", ()=>{
2992
2906
  let e = t.innerType._zod.values;
@@ -3008,7 +2922,6 @@ function handleNonOptionalResult(e, t) {
3008
2922
  }
3009
2923
  const $ZodCatch = $constructor("$ZodCatch", (e, t)=>{
3010
2924
  $ZodType.init(e, t), defineLazy(e._zod, "optin", ()=>t.innerType._zod.optin), defineLazy(e._zod, "optout", ()=>t.innerType._zod.optout), defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>{
3011
- if ("backward" === n.direction) return t.innerType._zod.run(e, n);
3012
2925
  let r = t.innerType._zod.run(e, n);
3013
2926
  return r instanceof Promise ? r.then((r)=>(e.value = r.value, r.issues.length && (e.value = t.catchValue({
3014
2927
  ...e,
@@ -3026,23 +2939,18 @@ const $ZodCatch = $constructor("$ZodCatch", (e, t)=>{
3026
2939
  };
3027
2940
  }), $ZodPipe = $constructor("$ZodPipe", (e, t)=>{
3028
2941
  $ZodType.init(e, t), defineLazy(e._zod, "values", ()=>t.in._zod.values), defineLazy(e._zod, "optin", ()=>t.in._zod.optin), defineLazy(e._zod, "optout", ()=>t.out._zod.optout), defineLazy(e._zod, "propValues", ()=>t.in._zod.propValues), e._zod.parse = (e, n)=>{
3029
- if ("backward" === n.direction) {
3030
- let r = t.out._zod.run(e, n);
3031
- return r instanceof Promise ? r.then((e)=>handlePipeResult(e, t.in, n)) : handlePipeResult(r, t.in, n);
3032
- }
3033
2942
  let r = t.in._zod.run(e, n);
3034
- return r instanceof Promise ? r.then((e)=>handlePipeResult(e, t.out, n)) : handlePipeResult(r, t.out, n);
2943
+ return r instanceof Promise ? r.then((e)=>handlePipeResult(e, t, n)) : handlePipeResult(r, t, n);
3035
2944
  };
3036
2945
  });
3037
2946
  function handlePipeResult(e, t, n) {
3038
- return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
2947
+ return e.issues.length ? e : t.out._zod.run({
3039
2948
  value: e.value,
3040
2949
  issues: e.issues
3041
2950
  }, n);
3042
2951
  }
3043
2952
  const $ZodReadonly = $constructor("$ZodReadonly", (e, t)=>{
3044
2953
  $ZodType.init(e, t), defineLazy(e._zod, "propValues", ()=>t.innerType._zod.propValues), defineLazy(e._zod, "values", ()=>t.innerType._zod.values), defineLazy(e._zod, "optin", ()=>t.innerType._zod.optin), defineLazy(e._zod, "optout", ()=>t.innerType._zod.optout), e._zod.parse = (e, n)=>{
3045
- if ("backward" === n.direction) return t.innerType._zod.run(e, n);
3046
2954
  let r = t.innerType._zod.run(e, n);
3047
2955
  return r instanceof Promise ? r.then(handleReadonlyResult) : handleReadonlyResult(r);
3048
2956
  };
@@ -3120,6 +3028,13 @@ function _string(e, t) {
3120
3028
  ...normalizeParams(t)
3121
3029
  });
3122
3030
  }
3031
+ function _coercedString(e, t) {
3032
+ return new e({
3033
+ type: "string",
3034
+ coerce: !0,
3035
+ ...normalizeParams(t)
3036
+ });
3037
+ }
3123
3038
  function _email(e, t) {
3124
3039
  return new e({
3125
3040
  type: "string",
@@ -3604,7 +3519,7 @@ const classic_errors_initializer = (e, t)=>{
3604
3519
  $constructor("ZodError", classic_errors_initializer);
3605
3520
  const ZodRealError = $constructor("ZodError", classic_errors_initializer, {
3606
3521
  Parent: Error
3607
- }), classic_parse_parse = _parse(ZodRealError), classic_parse_parseAsync = _parseAsync(ZodRealError), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), parse_encode = _encode(ZodRealError), parse_decode = _decode(ZodRealError), parse_encodeAsync = _encodeAsync(ZodRealError), parse_decodeAsync = _decodeAsync(ZodRealError), parse_safeEncode = _safeEncode(ZodRealError), parse_safeDecode = _safeDecode(ZodRealError), parse_safeEncodeAsync = _safeEncodeAsync(ZodRealError), parse_safeDecodeAsync = _safeDecodeAsync(ZodRealError), ZodType = $constructor("ZodType", (e, t)=>($ZodType.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", {
3522
+ }), parse_parse = _parse(ZodRealError), parse_parseAsync = _parseAsync(ZodRealError), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), ZodType = $constructor("ZodType", (e, t)=>($ZodType.init(e, t), e.def = t, Object.defineProperty(e, "_def", {
3608
3523
  value: t
3609
3524
  }), e.check = (...n)=>e.clone({
3610
3525
  ...t,
@@ -3620,11 +3535,11 @@ const ZodRealError = $constructor("ZodError", classic_errors_initializer, {
3620
3535
  }
3621
3536
  } : e)
3622
3537
  ]
3623
- }), e.clone = (t, n)=>clone(e, t, n), e.brand = ()=>e, e.register = (t, n)=>(t.add(e, n), e), e.parse = (t, n)=>classic_parse_parse(e, t, n, {
3538
+ }), e.clone = (t, n)=>clone(e, t, n), e.brand = ()=>e, e.register = (t, n)=>(t.add(e, n), e), e.parse = (t, n)=>parse_parse(e, t, n, {
3624
3539
  callee: e.parse
3625
- }), e.safeParse = (t, n)=>parse_safeParse(e, t, n), e.parseAsync = async (t, n)=>classic_parse_parseAsync(e, t, n, {
3540
+ }), e.safeParse = (t, n)=>parse_safeParse(e, t, n), e.parseAsync = async (t, n)=>parse_parseAsync(e, t, n, {
3626
3541
  callee: e.parseAsync
3627
- }), e.safeParseAsync = async (t, n)=>parse_safeParseAsync(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n)=>parse_encode(e, t, n), e.decode = (t, n)=>parse_decode(e, t, n), e.encodeAsync = async (t, n)=>parse_encodeAsync(e, t, n), e.decodeAsync = async (t, n)=>parse_decodeAsync(e, t, n), e.safeEncode = (t, n)=>parse_safeEncode(e, t, n), e.safeDecode = (t, n)=>parse_safeDecode(e, t, n), e.safeEncodeAsync = async (t, n)=>parse_safeEncodeAsync(e, t, n), e.safeDecodeAsync = async (t, n)=>parse_safeDecodeAsync(e, t, n), e.refine = (t, n)=>e.check(refine(t, n)), e.superRefine = (t)=>e.check(superRefine(t)), e.overwrite = (t)=>e.check(_overwrite(t)), e.optional = ()=>optional(e), e.nullable = ()=>nullable(e), e.nullish = ()=>optional(nullable(e)), e.nonoptional = (t)=>nonoptional(e, t), e.array = ()=>schemas_array(e), e.or = (t)=>union([
3542
+ }), e.safeParseAsync = async (t, n)=>parse_safeParseAsync(e, t, n), e.spa = e.safeParseAsync, e.refine = (t, n)=>e.check(refine(t, n)), e.superRefine = (t)=>e.check(superRefine(t)), e.overwrite = (t)=>e.check(_overwrite(t)), e.optional = ()=>optional(e), e.nullable = ()=>nullable(e), e.nullish = ()=>optional(nullable(e)), e.nonoptional = (t)=>nonoptional(e, t), e.array = ()=>schemas_array(e), e.or = (t)=>union([
3628
3543
  e,
3629
3544
  t
3630
3545
  ]), e.and = (t)=>intersection(e, t), e.transform = (t)=>pipe(e, transform(t)), e.default = (t)=>schemas_default(e, t), e.prefault = (t)=>prefault(e, t), e.catch = (t)=>schemas_catch(e, t), e.pipe = (t)=>pipe(e, t), e.readonly = ()=>readonly(e), e.describe = (t)=>{
@@ -3728,7 +3643,7 @@ function schemas_array(e, t) {
3728
3643
  return _array(ZodArray, e, t);
3729
3644
  }
3730
3645
  const ZodObject = $constructor("ZodObject", (e, t)=>{
3731
- $ZodObjectJIT.init(e, t), ZodType.init(e, t), defineLazy(e, "shape", ()=>t.shape), e.keyof = ()=>schemas_enum(Object.keys(e._zod.def.shape)), e.catchall = (t)=>e.clone({
3646
+ $ZodObject.init(e, t), ZodType.init(e, t), defineLazy(e, "shape", ()=>t.shape), e.keyof = ()=>schemas_enum(Object.keys(e._zod.def.shape)), e.catchall = (t)=>e.clone({
3732
3647
  ...e._zod.def,
3733
3648
  catchall: t
3734
3649
  }), e.passthrough = ()=>e.clone({
@@ -3743,7 +3658,7 @@ const ZodObject = $constructor("ZodObject", (e, t)=>{
3743
3658
  }), e.strip = ()=>e.clone({
3744
3659
  ...e._zod.def,
3745
3660
  catchall: void 0
3746
- }), e.extend = (t)=>extend(e, t), e.safeExtend = (t)=>safeExtend(e, t), e.merge = (t)=>merge(e, t), e.pick = (t)=>pick(e, t), e.omit = (t)=>omit(e, t), e.partial = (...t)=>partial(ZodOptional, e, t[0]), e.required = (...t)=>required(ZodNonOptional, e, t[0]);
3661
+ }), e.extend = (t)=>extend(e, t), e.merge = (t)=>merge(e, t), e.pick = (t)=>pick(e, t), e.omit = (t)=>omit(e, t), e.partial = (...t)=>partial(ZodOptional, e, t[0]), e.required = (...t)=>required(ZodNonOptional, e, t[0]);
3747
3662
  });
3748
3663
  function schemas_object(e, t) {
3749
3664
  return new ZodObject({
@@ -3851,7 +3766,6 @@ function literal(e, t) {
3851
3766
  }
3852
3767
  const ZodTransform = $constructor("ZodTransform", (e, t)=>{
3853
3768
  $ZodTransform.init(e, t), ZodType.init(e, t), e._zod.parse = (n, r)=>{
3854
- if ("backward" === r.direction) throw new $ZodEncodeError(e.constructor.name);
3855
3769
  n.addIssue = (r)=>{
3856
3770
  if ("string" == typeof r) n.issues.push(util_issue(r, n.value, t));
3857
3771
  else {
@@ -3959,33 +3873,11 @@ function refine(e, t = {}) {
3959
3873
  function superRefine(e) {
3960
3874
  return _superRefine(e);
3961
3875
  }
3962
- function omit_omit(e, t) {
3963
- let n = {
3964
- ...e
3965
- };
3966
- for(let e = 0; e < t.length; e++){
3967
- let r = t[e];
3968
- delete n[r];
3969
- }
3970
- return n;
3971
- }
3972
- function isUnsafeProperty(e) {
3973
- return '__proto__' === e;
3876
+ function coerce_string(e) {
3877
+ return _coercedString(ZodString, e);
3974
3878
  }
3975
- function isPlainObject_isPlainObject(e) {
3976
- if (!e || 'object' != typeof e) return !1;
3977
- let t = Object.getPrototypeOf(e);
3978
- return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && '[object Object]' === Object.prototype.toString.call(e);
3979
- }
3980
- function merge_merge(e, t) {
3981
- let n = Object.keys(t);
3982
- for(let r = 0; r < n.length; r++){
3983
- let i = n[r];
3984
- if (isUnsafeProperty(i)) continue;
3985
- let o = t[i], s = e[i];
3986
- 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);
3987
- }
3988
- return e;
3879
+ function coerce_number(e) {
3880
+ return _coercedNumber(ZodNumber, e);
3989
3881
  }
3990
3882
  var enc_base64 = __webpack_require__(716), enc_base64_default = __webpack_require__.n(enc_base64);
3991
3883
  function safeJsonParse(e) {
@@ -4002,7 +3894,7 @@ function safeJsonParseWithZod(e, t) {
4002
3894
  let { success: r, data: i, error: o } = t.safeParse(n);
4003
3895
  return r ? i : (console.warn(`Failed to parse JSON with Zod: ${e}`, o), null);
4004
3896
  }
4005
- function utils_base64ToUint8Array(e) {
3897
+ function base64ToUint8Array(e) {
4006
3898
  let t = enc_base64_default().parse(e), n = new Uint8Array(t.sigBytes);
4007
3899
  for(let e = 0; e < t.sigBytes; e++){
4008
3900
  let r = e >>> 2, i = e % 4;
@@ -4066,7 +3958,41 @@ class Storage {
4066
3958
  _define_property(this, "defaultTTL", TTL_5_MINUTES);
4067
3959
  }
4068
3960
  }
4069
- const storage = new Storage();
3961
+ const storage = new Storage(), getExternalIdsByTmdbId = async (e, t)=>{
3962
+ let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
3963
+ return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
3964
+ ttl: TTL_7_DAYS
3965
+ })), n;
3966
+ };
3967
+ function omit_omit(e, t) {
3968
+ let n = {
3969
+ ...e
3970
+ };
3971
+ for(let e = 0; e < t.length; e++){
3972
+ let r = t[e];
3973
+ delete n[r];
3974
+ }
3975
+ return n;
3976
+ }
3977
+ function isUnsafeProperty(e) {
3978
+ return '__proto__' === e;
3979
+ }
3980
+ function isPlainObject_isPlainObject(e) {
3981
+ if (!e || 'object' != typeof e) return !1;
3982
+ let t = Object.getPrototypeOf(e);
3983
+ return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && '[object Object]' === Object.prototype.toString.call(e);
3984
+ }
3985
+ function merge_merge(e, t) {
3986
+ let n = Object.keys(t);
3987
+ for(let r = 0; r < n.length; r++){
3988
+ let i = n[r];
3989
+ if (isUnsafeProperty(i)) continue;
3990
+ let o = t[i], s = e[i];
3991
+ 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);
3992
+ }
3993
+ return e;
3994
+ }
3995
+ var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse);
4070
3996
  function fetch_define_property(e, t, n) {
4071
3997
  return t in e ? Object.defineProperty(e, t, {
4072
3998
  value: n,
@@ -4155,9 +4081,9 @@ class Fetch {
4155
4081
  }, s), r = storage.getJson(n);
4156
4082
  if (r) return console.debug("fetch cache hit", n), Promise.resolve(r);
4157
4083
  }
4158
- let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...d } = s, f = t;
4159
- c && (f = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", f, null != a ? a : "", d);
4160
- let p = o ? Widget.http.get(f, d) : Widget.http.post(f, a, d);
4084
+ let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...f } = s, d = t;
4085
+ c && (d = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", d, null != a ? a : "", f);
4086
+ let p = o ? Widget.http.get(d, f) : Widget.http.post(d, a, f);
4161
4087
  return u && u > 0 ? Promise.race([
4162
4088
  p,
4163
4089
  this.createTimeoutPromise(u)
@@ -4172,14 +4098,17 @@ class Fetch {
4172
4098
  fetch_define_property(this, "cookie", void 0), fetch_define_property(this, "headers", void 0), fetch_define_property(this, "handleResponse", void 0), this.cookie = e, this.headers = t, this.handleResponse = (e, t, n)=>{
4173
4099
  var r;
4174
4100
  if ((null == n || null == (r = n.successStatus) ? void 0 : r.length) && !n.successStatus.includes(e.statusCode)) throw new HttpStatusError(e.statusCode, n.successStatus, t, e);
4101
+ let i = {
4102
+ ...e
4103
+ };
4175
4104
  if (null == n ? void 0 : n.schema) {
4176
4105
  let r = n.schema.safeParse(e.data);
4177
- if (!r.success) throw new HttpSchemaError(t, e, r.error);
4106
+ if (!r.success) throw new HttpSchemaError(t, i, r.error);
4178
4107
  e.data = r.data;
4179
4108
  }
4180
- let i = e.headers["set-cookie"] || e.headers["Set-Cookie"];
4181
- if (i) {
4182
- let e = i.split(",").reduce((e, t)=>{
4109
+ let o = e.headers["set-cookie"] || e.headers["Set-Cookie"];
4110
+ if (o) {
4111
+ let e = o.split(",").reduce((e, t)=>{
4183
4112
  if (!t) return e;
4184
4113
  let [n] = t.split(";"), [r, ...i] = n.split("=");
4185
4114
  return r && i.length > 0 && (e[r.trim()] = i.join("=").trim()), e;
@@ -4187,8 +4116,8 @@ class Fetch {
4187
4116
  this.setCookie(e);
4188
4117
  }
4189
4118
  if (null == n ? void 0 : n.cache) {
4190
- let r = this.getCacheKey(t, n);
4191
- storage.setJson(r, e, {
4119
+ let e = this.getCacheKey(t, n);
4120
+ storage.setJson(e, i, {
4192
4121
  ttl: n.cache.ttl
4193
4122
  });
4194
4123
  }
@@ -4196,16 +4125,13 @@ class Fetch {
4196
4125
  };
4197
4126
  }
4198
4127
  }
4199
- function coerce_number(e) {
4200
- return _coercedNumber(ZodNumber, e);
4201
- }
4202
- const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequestSchema = schemas_object({
4128
+ const fetch = new Fetch(), BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRequestSchema = schemas_object({
4203
4129
  season: coerce_number().optional().default(1),
4204
4130
  pageSize: coerce_number().optional().default(20),
4205
4131
  pageToken: schemas_string().optional()
4206
4132
  }), getImdbEpisodes = async (e, t)=>{
4207
4133
  let { season: n, pageSize: r, pageToken: i } = episodesRequestSchema.parse(null != t ? t : {});
4208
- return (await fetch.get(`${BASE_URL}/titles/${e}/episodes`, {
4134
+ return (await imdb_fetch.get(`${BASE_URL}/titles/${e}/episodes`, {
4209
4135
  params: {
4210
4136
  season: n,
4211
4137
  pageSize: r,
@@ -4234,7 +4160,7 @@ const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequest
4234
4160
  nextPageToken: schemas_string().optional()
4235
4161
  })
4236
4162
  })).data;
4237
- }, getImdbSeasons = async (e)=>(await fetch.get(`${BASE_URL}/titles/${e}/seasons`, {
4163
+ }, getImdbSeasons = async (e)=>(await imdb_fetch.get(`${BASE_URL}/titles/${e}/seasons`, {
4238
4164
  cache: {
4239
4165
  cacheKey: [
4240
4166
  "imdb:seasons",
@@ -4247,12 +4173,7 @@ const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequest
4247
4173
  episodeCount: schemas_number().optional()
4248
4174
  }))
4249
4175
  })
4250
- })).data, getExternalIdsByTmdbId = async (e, t)=>{
4251
- let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
4252
- return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
4253
- ttl: TTL_7_DAYS
4254
- })), n;
4255
- }, douban_fetch = new Fetch(), doubanImdbResponseSchema = schemas_object({
4176
+ })).data, DOUBAN_API_KEY = "0ac44ae016490db2204ce0a042db2916", doubanImdbResponseSchema = schemas_object({
4256
4177
  id: schemas_string(),
4257
4178
  rating: schemas_object({
4258
4179
  min: schemas_number(),
@@ -4281,7 +4202,7 @@ const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequest
4281
4202
  u = null != (s = null == r || null == (o = r.episodes.find((e)=>1 === e.episodeNumber)) ? void 0 : o.id) ? s : "";
4282
4203
  }
4283
4204
  u || (u = e), console.log("Get douban info by imdb id", u);
4284
- let l = await douban_fetch.post(`https://api.douban.com/v2/movie/imdb/${u}`, {
4205
+ let l = await fetch.post(`https://api.douban.com/v2/movie/imdb/${u}`, {
4285
4206
  apikey: DOUBAN_API_KEY
4286
4207
  }, {
4287
4208
  headers: {
@@ -4300,7 +4221,84 @@ const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequest
4300
4221
  doubanId: c,
4301
4222
  originResponse: l.data
4302
4223
  } : null;
4224
+ };
4225
+ function compact(e) {
4226
+ let t = [];
4227
+ for(let n = 0; n < e.length; n++){
4228
+ let r = e[n];
4229
+ r && t.push(r);
4230
+ }
4231
+ return t;
4232
+ }
4233
+ const doubanSubjectItemSchema = schemas_object({
4234
+ type_name: schemas_string(),
4235
+ target_type: schemas_string(),
4236
+ target_id: schemas_string(),
4237
+ target: schemas_object({
4238
+ title: schemas_string(),
4239
+ has_linewatch: schemas_boolean().refine((e)=>e)
4240
+ })
4241
+ }), doubanSearchResponseSchema = schemas_object({
4242
+ subjects: schemas_object({
4243
+ items: schemas_array(unknown().transform((e)=>{
4244
+ var t;
4245
+ return null != (t = doubanSubjectItemSchema.safeParse(e).data) ? t : null;
4246
+ })).transform((e)=>compact(e))
4247
+ })
4248
+ }), searchDoubanInfoByName = async (e)=>{
4249
+ var t, n;
4250
+ return e && null != (n = null == (t = (await fetch.get("https://m.douban.com/rexxar/api/v2/search", {
4251
+ params: {
4252
+ q: e,
4253
+ start: 0,
4254
+ count: 20,
4255
+ type: "movie"
4256
+ },
4257
+ headers: {
4258
+ Referer: "https://m.douban.com/movie/",
4259
+ "Content-Type": "application/json"
4260
+ },
4261
+ schema: doubanSearchResponseSchema,
4262
+ cache: {
4263
+ cacheKey: [
4264
+ "douban",
4265
+ "search",
4266
+ e
4267
+ ].filter(Boolean).join(":")
4268
+ }
4269
+ })).data) ? void 0 : t.subjects.items) ? n : [];
4270
+ }, getDoubanInfoParamsSchema = schemas_object({
4271
+ tmdbId: coerce_string().optional(),
4272
+ type: schemas_enum([
4273
+ "movie",
4274
+ "tv"
4275
+ ]).transform((e)=>e),
4276
+ title: coerce_string().optional(),
4277
+ seriesName: coerce_string().optional(),
4278
+ season: coerce_number().optional(),
4279
+ episode: coerce_number().optional(),
4280
+ fuzzyMatch: schemas_enum([
4281
+ "always",
4282
+ "never",
4283
+ "auto"
4284
+ ]).catch("auto").optional().default("auto")
4285
+ }), getDoubanIds = async (e)=>{
4286
+ let t = new Set(), { tmdbId: n, type: r, seriesName: i, season: o, fuzzyMatch: s } = getDoubanInfoParamsSchema.parse(e);
4287
+ try {
4288
+ let e = await getDoubanInfoByTmdbId(r, n, o);
4289
+ (null == e ? void 0 : e.doubanId) && t.add(e.doubanId);
4290
+ } catch (e) {
4291
+ console.error("Error getting douban info by tmdb id", e);
4292
+ }
4293
+ if ("always" === s || "auto" === s && !t.size) try {
4294
+ let e = i;
4295
+ for (let n of (o && parseInt(o.toString()) > 1 && (e += o.toString()), await searchDoubanInfoByName(e)))t.add(n.target_id);
4296
+ } catch (e) {
4297
+ console.error("Error searching douban info by name", e);
4298
+ }
4299
+ return Array.from(t);
4303
4300
  }, getDoubanInfoByTmdbId = async (e, t, n)=>{
4301
+ if (!t) return null;
4304
4302
  let r = await getExternalIdsByTmdbId(e, t);
4305
4303
  return (console.log("Get external ids by tmdb id", r), r.imdb_id) ? getDoubanInfoByImdbId(r.imdb_id, n) : null;
4306
4304
  }, doubanInfoResponseSchema = schemas_object({
@@ -4312,7 +4310,7 @@ const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequest
4312
4310
  }))
4313
4311
  }), getVideoPlatformInfoByDoubanId = async (e)=>{
4314
4312
  var t, n, r;
4315
- let i = await douban_fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
4313
+ let i = await fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
4316
4314
  headers: {
4317
4315
  Referer: `https://m.douban.com/movie/subject/${e}/?dt_dapp=1`,
4318
4316
  "Content-Type": "application/json"
@@ -4395,13 +4393,133 @@ function sortBy(e, t) {
4395
4393
  'asc'
4396
4394
  ]);
4397
4395
  }
4398
- function compact(e) {
4399
- let t = [];
4400
- for(let n = 0; n < e.length; n++){
4401
- let r = e[n];
4402
- r && t.push(r);
4396
+ function uniqWith(e, t) {
4397
+ let n = [];
4398
+ for(let r = 0; r < e.length; r++){
4399
+ let i = e[r];
4400
+ n.every((e)=>!t(e, i)) && n.push(i);
4403
4401
  }
4404
- return t;
4402
+ return n;
4403
+ }
4404
+ function getSymbols(e) {
4405
+ return Object.getOwnPropertySymbols(e).filter((t)=>Object.prototype.propertyIsEnumerable.call(e, t));
4406
+ }
4407
+ function getTag(e) {
4408
+ return null == e ? void 0 === e ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(e);
4409
+ }
4410
+ 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]';
4411
+ function eq(e, t) {
4412
+ return e === t || Number.isNaN(e) && Number.isNaN(t);
4413
+ }
4414
+ function isEqualWith(e, t, n) {
4415
+ return isEqualWithImpl(e, t, void 0, void 0, void 0, void 0, n);
4416
+ }
4417
+ function isEqualWithImpl(e, t, n, r, i, o, s) {
4418
+ let a = s(e, t, n, r, i, o);
4419
+ if (void 0 !== a) return a;
4420
+ if (typeof e == typeof t) switch(typeof e){
4421
+ case 'bigint':
4422
+ case 'string':
4423
+ case 'boolean':
4424
+ case 'symbol':
4425
+ case 'undefined':
4426
+ case 'function':
4427
+ return e === t;
4428
+ case 'number':
4429
+ return e === t || Object.is(e, t);
4430
+ }
4431
+ return areObjectsEqual(e, t, o, s);
4432
+ }
4433
+ function areObjectsEqual(e, t, n, r) {
4434
+ if (Object.is(e, t)) return !0;
4435
+ let i = getTag(e), o = getTag(t);
4436
+ if (i === argumentsTag && (i = objectTag), o === argumentsTag && (o = objectTag), i !== o) return !1;
4437
+ switch(i){
4438
+ case stringTag:
4439
+ return e.toString() === t.toString();
4440
+ case numberTag:
4441
+ return eq(e.valueOf(), t.valueOf());
4442
+ case booleanTag:
4443
+ case dateTag:
4444
+ case symbolTag:
4445
+ return Object.is(e.valueOf(), t.valueOf());
4446
+ case regexpTag:
4447
+ return e.source === t.source && e.flags === t.flags;
4448
+ case functionTag:
4449
+ return e === t;
4450
+ }
4451
+ let s = (n = n ?? new Map()).get(e), a = n.get(t);
4452
+ if (null != s && null != a) return s === t;
4453
+ n.set(e, t), n.set(t, e);
4454
+ try {
4455
+ switch(i){
4456
+ case mapTag:
4457
+ if (e.size !== t.size) return !1;
4458
+ for (let [i, o] of e.entries())if (!t.has(i) || !isEqualWithImpl(o, t.get(i), i, e, t, n, r)) return !1;
4459
+ return !0;
4460
+ case setTag:
4461
+ {
4462
+ if (e.size !== t.size) return !1;
4463
+ let i = Array.from(e.values()), o = Array.from(t.values());
4464
+ for(let s = 0; s < i.length; s++){
4465
+ let a = i[s], u = o.findIndex((i)=>isEqualWithImpl(a, i, void 0, e, t, n, r));
4466
+ if (-1 === u) return !1;
4467
+ o.splice(u, 1);
4468
+ }
4469
+ return !0;
4470
+ }
4471
+ case arrayTag:
4472
+ case uint8ArrayTag:
4473
+ case uint8ClampedArrayTag:
4474
+ case uint16ArrayTag:
4475
+ case uint32ArrayTag:
4476
+ case bigUint64ArrayTag:
4477
+ case int8ArrayTag:
4478
+ case int16ArrayTag:
4479
+ case int32ArrayTag:
4480
+ case bigInt64ArrayTag:
4481
+ case float32ArrayTag:
4482
+ case float64ArrayTag:
4483
+ if ('undefined' != typeof Buffer && Buffer.isBuffer(e) !== Buffer.isBuffer(t) || e.length !== t.length) return !1;
4484
+ for(let i = 0; i < e.length; i++)if (!isEqualWithImpl(e[i], t[i], i, e, t, n, r)) return !1;
4485
+ return !0;
4486
+ case arrayBufferTag:
4487
+ if (e.byteLength !== t.byteLength) return !1;
4488
+ return areObjectsEqual(new Uint8Array(e), new Uint8Array(t), n, r);
4489
+ case dataViewTag:
4490
+ if (e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset) return !1;
4491
+ return areObjectsEqual(new Uint8Array(e), new Uint8Array(t), n, r);
4492
+ case errorTag:
4493
+ return e.name === t.name && e.message === t.message;
4494
+ case objectTag:
4495
+ {
4496
+ if (!(areObjectsEqual(e.constructor, t.constructor, n, r) || isPlainObject_isPlainObject(e) && isPlainObject_isPlainObject(t))) return !1;
4497
+ let i = [
4498
+ ...Object.keys(e),
4499
+ ...getSymbols(e)
4500
+ ], o = [
4501
+ ...Object.keys(t),
4502
+ ...getSymbols(t)
4503
+ ];
4504
+ if (i.length !== o.length) return !1;
4505
+ for(let o = 0; o < i.length; o++){
4506
+ let s = i[o], a = e[s];
4507
+ if (!Object.hasOwn(t, s)) return !1;
4508
+ let u = t[s];
4509
+ if (!isEqualWithImpl(a, u, s, e, t, n, r)) return !1;
4510
+ }
4511
+ return !0;
4512
+ }
4513
+ default:
4514
+ return !1;
4515
+ }
4516
+ } finally{
4517
+ n.delete(e), n.delete(t);
4518
+ }
4519
+ }
4520
+ function noop() {}
4521
+ function isEqual(e, t) {
4522
+ return isEqualWith(e, t, noop);
4405
4523
  }
4406
4524
  function base_define_property(e, t, n) {
4407
4525
  return t in e ? Object.defineProperty(e, t, {
@@ -4541,7 +4659,7 @@ class BilibiliScraper extends BaseScraper {
4541
4659
  base64Data: !0
4542
4660
  });
4543
4661
  if (404 === r.statusCode || 304 === r.statusCode) return null;
4544
- let i = this.DmSegMobileReply.decode(utils_base64ToUint8Array(r.data));
4662
+ let i = this.DmSegMobileReply.decode(base64ToUint8Array(r.data));
4545
4663
  return console.log(i), i.elems;
4546
4664
  } catch (r) {
4547
4665
  console.error(`\u{83B7}\u{53D6}\u{5206}\u{6BB5} ${n} \u{5931}\u{8D25} (aid=${e}, cid=${t}): ${r}`);
@@ -4961,17 +5079,17 @@ const parseXml = function(e) {
4961
5079
  }
4962
5080
  ]) : n.add(this.options.textNodeName, a), o = t + 2;
4963
5081
  } else {
4964
- let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, d = s.closeIndex;
5082
+ let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, f = s.closeIndex;
4965
5083
  this.options.transformTagName && (a = this.options.transformTagName(a)), n && r && '!xml' !== n.tagname && (r = this.saveTextToParentTag(r, n, i, !1));
4966
- let f = n;
4967
- f && -1 !== this.options.unpairedTags.indexOf(f.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
5084
+ let d = n;
5085
+ 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);
4968
5086
  let p = o;
4969
5087
  if (this.isItStopNode(this.options.stopNodes, i, a)) {
4970
5088
  let t = "";
4971
5089
  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;
4972
5090
  else if (-1 !== this.options.unpairedTags.indexOf(a)) o = s.closeIndex;
4973
5091
  else {
4974
- let n = this.readStopNodeData(e, u, d + 1);
5092
+ let n = this.readStopNodeData(e, u, f + 1);
4975
5093
  if (!n) throw Error(`Unexpected end of ${u}`);
4976
5094
  o = n.i, t = n.tagContent;
4977
5095
  }
@@ -4986,7 +5104,7 @@ const parseXml = function(e) {
4986
5104
  let e = new XmlNode(a);
4987
5105
  this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), n = e;
4988
5106
  }
4989
- r = "", o = d;
5107
+ r = "", o = f;
4990
5108
  }
4991
5109
  }
4992
5110
  else r += e[o];
@@ -5469,7 +5587,7 @@ class IqiyiScraper extends BaseScraper {
5469
5587
  console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
5470
5588
  let a = await this.fetch.get(s, {
5471
5589
  zlibMode: !0
5472
- }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: d } = iqiyiCommentsResponseSchema.safeParse(u);
5590
+ }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: f } = iqiyiCommentsResponseSchema.safeParse(u);
5473
5591
  return l ? c.map((e)=>{
5474
5592
  let t = 16777215;
5475
5593
  try {
@@ -5482,7 +5600,7 @@ class IqiyiScraper extends BaseScraper {
5482
5600
  color: t,
5483
5601
  content: e.content
5484
5602
  };
5485
- }) : (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)), []);
5603
+ }) : (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)), []);
5486
5604
  }
5487
5605
  async getEpisodesV3(e) {
5488
5606
  let t = {
@@ -5519,7 +5637,7 @@ class IqiyiScraper extends BaseScraper {
5519
5637
  if (!c.length) {
5520
5638
  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);
5521
5639
  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), [];
5522
- let o = this.getEpisodeBlacklistPattern(), d = 1;
5640
+ let o = this.getEpisodeBlacklistPattern(), f = 1;
5523
5641
  for (let e of r.data){
5524
5642
  if (17 === e.mark_type_show) continue;
5525
5643
  let t = this.videoIdToEntityId(e.videoId);
@@ -5529,8 +5647,8 @@ class IqiyiScraper extends BaseScraper {
5529
5647
  entityId: t
5530
5648
  }),
5531
5649
  episodeTitle: e.title,
5532
- episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : d
5533
- }), d += 1));
5650
+ episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : f
5651
+ }), f += 1));
5534
5652
  }
5535
5653
  }
5536
5654
  return c;
@@ -5606,7 +5724,9 @@ const tencentIdSchema = schemas_object({
5606
5724
  "\u8D70\u5FC3",
5607
5725
  "\u89E3\u5FE7",
5608
5726
  "\u7EAF\u4EAB",
5609
- "\u8282\u70B9"
5727
+ "\u8282\u70B9",
5728
+ "\u91C7\u8BBF",
5729
+ "\u82B1\u7D6E"
5610
5730
  ])if (e.includes(t)) return !1;
5611
5731
  return !0;
5612
5732
  }),
@@ -5617,8 +5737,14 @@ const tencentIdSchema = schemas_object({
5617
5737
  module_datas: schemas_array(schemas_object({
5618
5738
  item_data_lists: schemas_object({
5619
5739
  item_datas: schemas_array(schemas_object({
5620
- item_params: unknown()
5621
- }))
5740
+ item_params: unknown().transform((e)=>{
5741
+ var t;
5742
+ return null != (t = tencentEpisodeSchema.safeParse(e).data) ? t : null;
5743
+ })
5744
+ }).transform((e)=>{
5745
+ var t;
5746
+ return null != (t = e.item_params) ? t : null;
5747
+ })).transform((e)=>compact(e))
5622
5748
  })
5623
5749
  }))
5624
5750
  }))
@@ -5701,7 +5827,7 @@ class TencentScraper extends BaseScraper {
5701
5827
  let n = this.parseIdString(e);
5702
5828
  if (!(null == n ? void 0 : n.vid)) return [];
5703
5829
  let r = await this.internalGetComments(n.vid, t);
5704
- return r && 0 !== r.length ? r.map((e)=>{
5830
+ return (console.log("\u627E\u5230", r.length, "\u6761\u5F39\u5E55"), r && 0 !== r.length) ? r.map((e)=>{
5705
5831
  let t = 1, n = 16777215;
5706
5832
  if (e.content_style && (2 === e.content_style.position ? t = 5 : 3 === e.content_style.position && (t = 4), e.content_style.color)) try {
5707
5833
  n = parseInt(e.content_style.color, 10);
@@ -5742,15 +5868,11 @@ class TencentScraper extends BaseScraper {
5742
5868
  cacheKey: `tencent:episodes:${e}:${n}`
5743
5869
  }
5744
5870
  })).data) ? i : [];
5745
- for (let e of (o.length >= tencent_pageSize ? (n += 1, r = url_parse.qs.stringify({
5871
+ if (o.length >= tencent_pageSize ? (n += 1, r = url_parse.qs.stringify({
5746
5872
  episode_begin: n * tencent_pageSize,
5747
5873
  episode_end: (n + 1) * tencent_pageSize,
5748
5874
  episode_step: tencent_pageSize
5749
- })) : r = "", o)){
5750
- let { success: n, data: r } = tencentEpisodeSchema.safeParse(e.item_params);
5751
- n && t.push(r);
5752
- }
5753
- if (!r) break;
5875
+ })) : r = "", t.push(...o), !r) break;
5754
5876
  } catch (t) {
5755
5877
  console.error(`\u{83B7}\u{53D6}\u{5206}\u{96C6}\u{5217}\u{8868}\u{5931}\u{8D25} (cid=${e})`, t);
5756
5878
  break;
@@ -5795,7 +5917,7 @@ const youkuIdSchema = schemas_object({
5795
5917
  id: schemas_string(),
5796
5918
  show_id: schemas_string().optional(),
5797
5919
  title: schemas_string(),
5798
- seq: schemas_string().transform((e)=>parseInt(e)).optional(),
5920
+ seq: coerce_number().optional(),
5799
5921
  duration: schemas_string(),
5800
5922
  category: schemas_string(),
5801
5923
  link: schemas_string()
@@ -5856,11 +5978,11 @@ class YoukuScraper extends BaseScraper {
5856
5978
  }),
5857
5979
  episodeTitle: e.title,
5858
5980
  episodeNumber: t
5859
- }), 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);
5860
- if (d) return [
5861
- n(d, u)
5981
+ }), 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);
5982
+ if (f) return [
5983
+ n(f, u)
5862
5984
  ];
5863
- let f = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), p = Math.max(1, Math.ceil(f / a)), h = Array.from({
5985
+ let d = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), p = Math.max(1, Math.ceil(d / a)), h = Array.from({
5864
5986
  length: p
5865
5987
  }, (e, t)=>t + 1).filter((e)=>e !== l), m = [];
5866
5988
  for (let e of h){
@@ -5871,17 +5993,17 @@ class YoukuScraper extends BaseScraper {
5871
5993
  let g = e(m.flatMap((e)=>{
5872
5994
  var t;
5873
5995
  return null != (t = null == e ? void 0 : e.videos) ? t : [];
5874
- })), v = [
5996
+ })), y = [
5875
5997
  ...c,
5876
5998
  ...g
5877
5999
  ];
5878
6000
  if (void 0 !== t) {
5879
- let e = v.find((e)=>e.seq === u);
6001
+ let e = y.find((e)=>e.seq === u);
5880
6002
  return e ? [
5881
6003
  n(e, u)
5882
6004
  ] : [];
5883
6005
  }
5884
- return v.sort((e, t)=>{
6006
+ return y.sort((e, t)=>{
5885
6007
  var n, r;
5886
6008
  return (null != (n = e.seq) ? n : Number.MAX_SAFE_INTEGER) - (null != (r = t.seq) ? r : Number.MAX_SAFE_INTEGER);
5887
6009
  }).map((e, t)=>n(e, t + 1));
@@ -6168,9 +6290,9 @@ class scrapers_Scraper {
6168
6290
  episodeNumber: this.getEpisodeNumber(t, n)
6169
6291
  });
6170
6292
  }
6171
- async getDetailWithDoubanId(e, t, n) {
6172
- let r = await getVideoPlatformInfoByDoubanId(e.toString()), i = this.getEpisodeNumber(t, n), o = [];
6173
- return Object.entries(r.providers).forEach((e)=>{
6293
+ async getDetailWithDoubanIds(e, t, n) {
6294
+ let r = await Promise.all(e.map((e)=>getVideoPlatformInfoByDoubanId(e).catch(()=>null))), i = this.getEpisodeNumber(t, n), o = [];
6295
+ for (let e of r)e && Object.entries(e.providers).forEach((e)=>{
6174
6296
  var t, n;
6175
6297
  let [r, s] = e;
6176
6298
  o.push({
@@ -6178,7 +6300,8 @@ class scrapers_Scraper {
6178
6300
  idString: null != (n = null == (t = this.scraperMap[r]) ? void 0 : t.generateIdString(s)) ? n : "",
6179
6301
  episodeNumber: i
6180
6302
  });
6181
- }), this.getEpisodes(...o);
6303
+ });
6304
+ return this.getEpisodes(...uniqWith(o, isEqual));
6182
6305
  }
6183
6306
  constructor(){
6184
6307
  scrapers_define_property(this, "scrapers", []), scrapers.forEach((e)=>{
@@ -6186,7 +6309,7 @@ class scrapers_Scraper {
6186
6309
  });
6187
6310
  }
6188
6311
  }
6189
- const widgetVersion = "0.0.15";
6312
+ const widgetVersion = "0.1.0";
6190
6313
  WidgetMetadata = {
6191
6314
  id: "baranwang.danmu.universe",
6192
6315
  title: "\u901A\u7528\u5F39\u5E55",
@@ -6195,6 +6318,29 @@ WidgetMetadata = {
6195
6318
  version: widgetVersion,
6196
6319
  site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
6197
6320
  requiredVersion: "0.0.2",
6321
+ globalParams: [
6322
+ {
6323
+ title: "\u6A21\u7CCA\u5339\u914D",
6324
+ name: "fuzzyMatch",
6325
+ description: "\u662F\u5426\u5F00\u542F\u6A21\u7CCA\u5339\u914D",
6326
+ value: "auto",
6327
+ type: "enumeration",
6328
+ enumOptions: [
6329
+ {
6330
+ title: "\u81EA\u52A8",
6331
+ value: "auto"
6332
+ },
6333
+ {
6334
+ title: "\u59CB\u7EC8\u5F00\u542F",
6335
+ value: "always"
6336
+ },
6337
+ {
6338
+ title: "\u59CB\u7EC8\u5173\u95ED",
6339
+ value: "never"
6340
+ }
6341
+ ]
6342
+ }
6343
+ ],
6198
6344
  modules: [
6199
6345
  {
6200
6346
  type: "danmu",
@@ -6228,43 +6374,39 @@ WidgetMetadata = {
6228
6374
  };
6229
6375
  const src_scraper = new scrapers_Scraper();
6230
6376
  searchDanmu = async (e)=>{
6231
- var t;
6232
6377
  storage.cleanup();
6233
- let { tmdbId: n, type: r, season: i, episode: o } = e;
6234
- if (!n) return {
6235
- animes: []
6236
- };
6237
- let s = await getDoubanInfoByTmdbId(r, n, i);
6238
- return {
6239
- animes: (await src_scraper.getDetailWithDoubanId(null != (t = null == s ? void 0 : s.doubanId) ? t : "", r, o)).map((e)=>{
6378
+ let { tmdbId: t, type: n, episode: r } = e;
6379
+ if (!t) return null;
6380
+ let i = await getDoubanIds(e);
6381
+ return i.length ? {
6382
+ animes: (await src_scraper.getDetailWithDoubanIds(i, n, r)).map((e)=>{
6240
6383
  let t = `[${PROVIDER_NAMES[e.provider]}] `;
6241
6384
  return e.episodeTitle && (t += e.episodeTitle), {
6242
6385
  animeId: e.episodeId,
6243
6386
  animeTitle: t
6244
6387
  };
6245
6388
  })
6246
- };
6389
+ } : null;
6247
6390
  }, getDetail = async (e)=>{
6248
- var t;
6249
- let { animeId: n, tmdbId: r, type: i, season: o, episode: s } = e;
6250
- if (!r && !n) return null;
6251
- if (n) return src_scraper.getDetailWithAnimeId(n.toString(), i, s);
6252
- let a = await getDoubanInfoByTmdbId(i, null != r ? r : "", o);
6253
- return src_scraper.getDetailWithDoubanId(null != (t = null == a ? void 0 : a.doubanId) ? t : "", i, s);
6391
+ let { animeId: t, tmdbId: n, type: r, episode: i } = e;
6392
+ if (!n && !t) return null;
6393
+ if (t) return src_scraper.getDetailWithAnimeId(t.toString(), r, i);
6394
+ let o = await getDoubanIds(e);
6395
+ return o.length ? src_scraper.getDetailWithDoubanIds(o, r, i) : null;
6254
6396
  }, getComments = async (e)=>{
6255
- let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, season: s, episode: a } = e, u = null != n ? n : t;
6256
- if (!u) {
6257
- var l;
6397
+ let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, episode: s } = e, a = null != n ? n : t;
6398
+ if (!a) {
6258
6399
  if (!i) return null;
6259
- let e = await getDoubanInfoByTmdbId(o, i, s);
6260
- u = (await src_scraper.getDetailWithDoubanId(null != (l = null == e ? void 0 : e.doubanId) ? l : "", o, a)).map((e)=>[
6400
+ let t = await getDoubanIds(e);
6401
+ if (!t.length) return null;
6402
+ a = (await src_scraper.getDetailWithDoubanIds(t, o, s)).map((e)=>[
6261
6403
  e.provider,
6262
6404
  e.episodeId
6263
6405
  ].join(":")).join(",");
6264
6406
  }
6265
- let c = await src_scraper.getDanmuWithSegmentTimeByVideoId(u.toString(), r);
6407
+ let u = await src_scraper.getDanmuWithSegmentTimeByVideoId(a.toString(), r);
6266
6408
  return {
6267
- comments: c,
6268
- count: c.length
6409
+ comments: u,
6410
+ count: u.length
6269
6411
  };
6270
6412
  };