UNPKG

@kwai-video-team/kwai-player-web

Version:

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

13,520 lines 611 kB
var gu = Object.defineProperty;
var To = Object.getOwnPropertySymbols;
var yu = Object.prototype.hasOwnProperty, bu = Object.prototype.propertyIsEnumerable;
var Ro = (t, e, r) => e in t ? gu(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, So = (t, e) => {
  for (var r in e || (e = {}))
    yu.call(e, r) && Ro(t, r, e[r]);
  if (To)
    for (var r of To(e))
      bu.call(e, r) && Ro(t, r, e[r]);
  return t;
};
import { defineComponent as Eu, ref as wu, watch as De, onMounted as Tu, onBeforeUnmount as Ru, openBlock as Su, createElementBlock as Lu, renderSlot as ku } from "vue";
Number.isFinite || (Number.isFinite = (t) => typeof t == "number" && isFinite(t));
Array.prototype.find || (Array.prototype.find = function(t, e) {
  if (this === null || this === void 0)
    throw new TypeError("Array.prototype.find called on null or undefined");
  if (typeof t != "function")
    throw new TypeError("callback must be a function");
  const r = Object(this), s = r.length >>> 0;
  for (let l = 0; l < s; l++)
    if (t.call(e, r[l], l, r))
      return r[l];
});
Array.prototype.findIndex || (Array.prototype.findIndex = function(t, e) {
  if (this === null || this === void 0)
    throw new TypeError("Array.prototype.findIndex called on null or undefined");
  if (typeof t != "function")
    throw new TypeError("callback must be a function");
  const r = Object(this), s = r.length >>> 0;
  for (let l = 0; l < s; l++)
    if (l in r && t.call(e, r[l], l, r))
      return l;
  return -1;
});
Array.prototype.fill || (Array.prototype.fill = function(t, e = 0, r = this.length) {
  if (this === null || this === void 0)
    throw new TypeError("Array.prototype.fill called on null or undefined");
  const s = Object(this), l = s.length >>> 0, d = e >> 0, f = r >> 0, c = d < 0 ? Math.max(l + d, 0) : Math.min(d, l), R = f < 0 ? Math.max(l + f, 0) : Math.min(f, l);
  for (let A = c; A < R; A++)
    s[A] = t;
  return s;
});
var Iu = Object.defineProperty, xu = (t, e, r) => e in t ? Iu(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ha = (t, e, r) => (xu(t, typeof e != "symbol" ? e + "" : e, r), r), Qt = function(t) {
  var e = {};
  function r(s) {
    if (e[s])
      return e[s].exports;
    var l = e[s] = { i: s, l: !1, exports: {} };
    return t[s].call(l.exports, l, l.exports, r), l.l = !0, l.exports;
  }
  return r.m = t, r.c = e, r.d = function(s, l, d) {
    r.o(s, l) || Object.defineProperty(s, l, { enumerable: !0, get: d });
  }, r.r = function(s) {
    typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
  }, r.t = function(s, l) {
    if (1 & l && (s = r(s)), 8 & l || 4 & l && typeof s == "object" && s && s.__esModule)
      return s;
    var d = /* @__PURE__ */ Object.create(null);
    if (r.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & l && typeof s != "string")
      for (var f in s)
        r.d(d, f, function(c) {
          return s[c];
        }.bind(null, f));
    return d;
  }, r.n = function(s) {
    var l = s && s.__esModule ? function() {
      return s.default;
    } : function() {
      return s;
    };
    return r.d(l, "a", l), l;
  }, r.o = function(s, l) {
    return Object.prototype.hasOwnProperty.call(s, l);
  }, r.p = "", r(r.s = 8);
}([function(t, e, r) {
  var s = r(5);
  function l(d, f) {
    for (var c = 0; c < f.length; c++) {
      var R = f[c];
      R.enumerable = R.enumerable || !1, R.configurable = !0, "value" in R && (R.writable = !0), Object.defineProperty(d, s(R.key), R);
    }
  }
  t.exports = function(d, f, c) {
    return f && l(d.prototype, f), c && l(d, c), Object.defineProperty(d, "prototype", { writable: !1 }), d;
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  function r(s) {
    return t.exports = r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
      return typeof l;
    } : function(l) {
      return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r(s);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(7)();
  t.exports = s;
  try {
    regeneratorRuntime = s;
  } catch (l) {
    typeof globalThis == "object" ? globalThis.regeneratorRuntime = s : Function("r", "regeneratorRuntime = r")(s);
  }
}, function(t, e) {
  function r() {
    return t.exports = r = Object.assign ? Object.assign.bind() : function(s) {
      for (var l = 1; l < arguments.length; l++) {
        var d = arguments[l];
        for (var f in d)
          Object.prototype.hasOwnProperty.call(d, f) && (s[f] = d[f]);
      }
      return s;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r.apply(this, arguments);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  function r(s, l, d, f, c, R, A) {
    try {
      var v = s[R](A), O = v.value;
    } catch (m) {
      return void d(m);
    }
    v.done ? l(O) : Promise.resolve(O).then(f, c);
  }
  t.exports = function(s) {
    return function() {
      var l = this, d = arguments;
      return new Promise(function(f, c) {
        var R = s.apply(l, d);
        function A(O) {
          r(R, f, c, A, v, "next", O);
        }
        function v(O) {
          r(R, f, c, A, v, "throw", O);
        }
        A(void 0);
      });
    };
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(1).default, l = r(6);
  t.exports = function(d) {
    var f = l(d, "string");
    return s(f) == "symbol" ? f : f + "";
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(1).default;
  t.exports = function(l, d) {
    if (s(l) != "object" || !l)
      return l;
    var f = l[Symbol.toPrimitive];
    if (f !== void 0) {
      var c = f.call(l, d || "default");
      if (s(c) != "object")
        return c;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (d === "string" ? String : Number)(l);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(1).default;
  function l() {
    /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
    t.exports = l = function() {
      return f;
    }, t.exports.__esModule = !0, t.exports.default = t.exports;
    var d, f = {}, c = Object.prototype, R = c.hasOwnProperty, A = Object.defineProperty || function(C, M, B) {
      C[M] = B.value;
    }, v = typeof Symbol == "function" ? Symbol : {}, O = v.iterator || "@@iterator", m = v.asyncIterator || "@@asyncIterator", x = v.toStringTag || "@@toStringTag";
    function g(C, M, B) {
      return Object.defineProperty(C, M, { value: B, enumerable: !0, configurable: !0, writable: !0 }), C[M];
    }
    try {
      g({}, "");
    } catch (C) {
      g = function(M, B, Z) {
        return M[B] = Z;
      };
    }
    function E(C, M, B, Z) {
      var K = M && M.prototype instanceof I ? M : I, se = Object.create(K.prototype), pe = new z(Z || []);
      return A(se, "_invoke", { value: S(C, B, pe) }), se;
    }
    function k(C, M, B) {
      try {
        return { type: "normal", arg: C.call(M, B) };
      } catch (Z) {
        return { type: "throw", arg: Z };
      }
    }
    f.wrap = E;
    var y = "suspendedStart", w = "executing", _ = "completed", b = {};
    function I() {
    }
    function P() {
    }
    function G() {
    }
    var H = {};
    g(H, O, function() {
      return this;
    });
    var Q = Object.getPrototypeOf, ue = Q && Q(Q(Y([])));
    ue && ue !== c && R.call(ue, O) && (H = ue);
    var de = G.prototype = I.prototype = Object.create(H);
    function j(C) {
      ["next", "throw", "return"].forEach(function(M) {
        g(C, M, function(B) {
          return this._invoke(M, B);
        });
      });
    }
    function F(C, M) {
      function B(K, se, pe, he) {
        var we = k(C[K], C, se);
        if (we.type !== "throw") {
          var ee = we.arg, je = ee.value;
          return je && s(je) == "object" && R.call(je, "__await") ? M.resolve(je.__await).then(function(Le) {
            B("next", Le, pe, he);
          }, function(Le) {
            B("throw", Le, pe, he);
          }) : M.resolve(je).then(function(Le) {
            ee.value = Le, pe(ee);
          }, function(Le) {
            return B("throw", Le, pe, he);
          });
        }
        he(we.arg);
      }
      var Z;
      A(this, "_invoke", { value: function(K, se) {
        function pe() {
          return new M(function(he, we) {
            B(K, se, he, we);
          });
        }
        return Z = Z ? Z.then(pe, pe) : pe();
      } });
    }
    function S(C, M, B) {
      var Z = y;
      return function(K, se) {
        if (Z === w)
          throw Error("Generator is already running");
        if (Z === _) {
          if (K === "throw")
            throw se;
          return { value: d, done: !0 };
        }
        for (B.method = K, B.arg = se; ; ) {
          var pe = B.delegate;
          if (pe) {
            var he = D(pe, B);
            if (he) {
              if (he === b)
                continue;
              return he;
            }
          }
          if (B.method === "next")
            B.sent = B._sent = B.arg;
          else if (B.method === "throw") {
            if (Z === y)
              throw Z = _, B.arg;
            B.dispatchException(B.arg);
          } else
            B.method === "return" && B.abrupt("return", B.arg);
          Z = w;
          var we = k(C, M, B);
          if (we.type === "normal") {
            if (Z = B.done ? _ : "suspendedYield", we.arg === b)
              continue;
            return { value: we.arg, done: B.done };
          }
          we.type === "throw" && (Z = _, B.method = "throw", B.arg = we.arg);
        }
      };
    }
    function D(C, M) {
      var B = M.method, Z = C.iterator[B];
      if (Z === d)
        return M.delegate = null, B === "throw" && C.iterator.return && (M.method = "return", M.arg = d, D(C, M), M.method === "throw") || B !== "return" && (M.method = "throw", M.arg = new TypeError("The iterator does not provide a '" + B + "' method")), b;
      var K = k(Z, C.iterator, M.arg);
      if (K.type === "throw")
        return M.method = "throw", M.arg = K.arg, M.delegate = null, b;
      var se = K.arg;
      return se ? se.done ? (M[C.resultName] = se.value, M.next = C.nextLoc, M.method !== "return" && (M.method = "next", M.arg = d), M.delegate = null, b) : se : (M.method = "throw", M.arg = new TypeError("iterator result is not an object"), M.delegate = null, b);
    }
    function U(C) {
      var M = { tryLoc: C[0] };
      1 in C && (M.catchLoc = C[1]), 2 in C && (M.finallyLoc = C[2], M.afterLoc = C[3]), this.tryEntries.push(M);
    }
    function N(C) {
      var M = C.completion || {};
      M.type = "normal", delete M.arg, C.completion = M;
    }
    function z(C) {
      this.tryEntries = [{ tryLoc: "root" }], C.forEach(U, this), this.reset(!0);
    }
    function Y(C) {
      if (C || C === "") {
        var M = C[O];
        if (M)
          return M.call(C);
        if (typeof C.next == "function")
          return C;
        if (!isNaN(C.length)) {
          var B = -1, Z = function K() {
            for (; ++B < C.length; )
              if (R.call(C, B))
                return K.value = C[B], K.done = !1, K;
            return K.value = d, K.done = !0, K;
          };
          return Z.next = Z;
        }
      }
      throw new TypeError(s(C) + " is not iterable");
    }
    return P.prototype = G, A(de, "constructor", { value: G, configurable: !0 }), A(G, "constructor", { value: P, configurable: !0 }), P.displayName = g(G, x, "GeneratorFunction"), f.isGeneratorFunction = function(C) {
      var M = typeof C == "function" && C.constructor;
      return !!M && (M === P || (M.displayName || M.name) === "GeneratorFunction");
    }, f.mark = function(C) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(C, G) : (C.__proto__ = G, g(C, x, "GeneratorFunction")), C.prototype = Object.create(de), C;
    }, f.awrap = function(C) {
      return { __await: C };
    }, j(F.prototype), g(F.prototype, m, function() {
      return this;
    }), f.AsyncIterator = F, f.async = function(C, M, B, Z, K) {
      K === void 0 && (K = Promise);
      var se = new F(E(C, M, B, Z), K);
      return f.isGeneratorFunction(M) ? se : se.next().then(function(pe) {
        return pe.done ? pe.value : se.next();
      });
    }, j(de), g(de, x, "Generator"), g(de, O, function() {
      return this;
    }), g(de, "toString", function() {
      return "[object Generator]";
    }), f.keys = function(C) {
      var M = Object(C), B = [];
      for (var Z in M)
        B.push(Z);
      return B.reverse(), function K() {
        for (; B.length; ) {
          var se = B.pop();
          if (se in M)
            return K.value = se, K.done = !1, K;
        }
        return K.done = !0, K;
      };
    }, f.values = Y, z.prototype = { constructor: z, reset: function(C) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = d, this.done = !1, this.delegate = null, this.method = "next", this.arg = d, this.tryEntries.forEach(N), !C)
        for (var M in this)
          M.charAt(0) === "t" && R.call(this, M) && !isNaN(+M.slice(1)) && (this[M] = d);
    }, stop: function() {
      this.done = !0;
      var C = this.tryEntries[0].completion;
      if (C.type === "throw")
        throw C.arg;
      return this.rval;
    }, dispatchException: function(C) {
      if (this.done)
        throw C;
      var M = this;
      function B(we, ee) {
        return se.type = "throw", se.arg = C, M.next = we, ee && (M.method = "next", M.arg = d), !!ee;
      }
      for (var Z = this.tryEntries.length - 1; Z >= 0; --Z) {
        var K = this.tryEntries[Z], se = K.completion;
        if (K.tryLoc === "root")
          return B("end");
        if (K.tryLoc <= this.prev) {
          var pe = R.call(K, "catchLoc"), he = R.call(K, "finallyLoc");
          if (pe && he) {
            if (this.prev < K.catchLoc)
              return B(K.catchLoc, !0);
            if (this.prev < K.finallyLoc)
              return B(K.finallyLoc);
          } else if (pe) {
            if (this.prev < K.catchLoc)
              return B(K.catchLoc, !0);
          } else {
            if (!he)
              throw Error("try statement without catch or finally");
            if (this.prev < K.finallyLoc)
              return B(K.finallyLoc);
          }
        }
      }
    }, abrupt: function(C, M) {
      for (var B = this.tryEntries.length - 1; B >= 0; --B) {
        var Z = this.tryEntries[B];
        if (Z.tryLoc <= this.prev && R.call(Z, "finallyLoc") && this.prev < Z.finallyLoc) {
          var K = Z;
          break;
        }
      }
      K && (C === "break" || C === "continue") && K.tryLoc <= M && M <= K.finallyLoc && (K = null);
      var se = K ? K.completion : {};
      return se.type = C, se.arg = M, K ? (this.method = "next", this.next = K.finallyLoc, b) : this.complete(se);
    }, complete: function(C, M) {
      if (C.type === "throw")
        throw C.arg;
      return C.type === "break" || C.type === "continue" ? this.next = C.arg : C.type === "return" ? (this.rval = this.arg = C.arg, this.method = "return", this.next = "end") : C.type === "normal" && M && (this.next = M), b;
    }, finish: function(C) {
      for (var M = this.tryEntries.length - 1; M >= 0; --M) {
        var B = this.tryEntries[M];
        if (B.finallyLoc === C)
          return this.complete(B.completion, B.afterLoc), N(B), b;
      }
    }, catch: function(C) {
      for (var M = this.tryEntries.length - 1; M >= 0; --M) {
        var B = this.tryEntries[M];
        if (B.tryLoc === C) {
          var Z = B.completion;
          if (Z.type === "throw") {
            var K = Z.arg;
            N(B);
          }
          return K;
        }
      }
      throw Error("illegal catch attempt");
    }, delegateYield: function(C, M, B) {
      return this.delegate = { iterator: Y(C), resultName: M, nextLoc: B }, this.method === "next" && (this.arg = d), b;
    } }, f;
  }
  t.exports = l, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  r.r(e), r.d(e, "KwaiVideoLocalLog", function() {
    return de;
  }), r.d(e, "LogLevel", function() {
    return m;
  }), r.d(e, "DefaultLogger", function() {
    return k;
  }), r.d(e, "Logger", function() {
    return E;
  }), r.d(e, "printVersion", function() {
    return R;
  }), r.d(e, "DEFAULT_LOG_LEVEL", function() {
    return x;
  });
  var s = r(0), l = r.n(s), d = r(3), f = r.n(d), c = { idbName: "kwai-video-local-log", idbMaxDataCount: 25e3, idbMaxFoldLog: 20, maxLogLen: 4096 };
  function R(j, F) {
    console.log("%c " + j + " %c " + F + " %c", "background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px;  color: #fff", "background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0;  color: #fff", "background:transparent");
  }
  var A = function() {
    function j() {
      this.timeout = 6048e5;
    }
    var F = j.prototype;
    return F.write = function(S, D) {
      if (j.available)
        try {
          localStorage.setItem(S, JSON.stringify({ value: D, time: Date.now() }));
        } catch (U) {
        }
    }, F.read = function(S, D) {
      if (D === void 0 && (D = !0), j.available)
        try {
          var U = localStorage.getItem(S);
          if (U) {
            var N = JSON.parse(U), z = N.value, Y = N.time, C = Y === void 0 ? 0 : Y;
            if (!D || Date.now() - C < (typeof D == "number" ? D : this.timeout))
              return z;
          }
        } catch (M) {
        }
    }, l()(j, null, [{ key: "available", get: function() {
      if (j._available === void 0)
        try {
          localStorage.setItem("alg", "test"), j._available = !0;
        } catch (S) {
          j._available = !1;
        }
      return j._available;
    } }]);
  }();
  A._available = void 0;
  var v, O = A, m = function(j) {
    return j.NONE = "none", j.ERROR = "e", j.WARN = "w", j.INFO = "i", j.DEBUG = "d", j.VERBOSE = "v", j;
  }({}), x = m.ERROR, g = ((v = {})[m.NONE] = { value: 1, str: "N" }, v[m.ERROR] = { value: 100, str: "E" }, v[m.WARN] = { value: 200, str: "W" }, v[m.INFO] = { value: 300, str: "I" }, v[m.DEBUG] = { value: 400, str: "D" }, v[m.VERBOSE] = { value: 500, str: "V" }, v), E = function() {
    function j(S) {
      if (this._name = "kwai-v", this._level = x, this._id = -1, this._output = void 0, this._workerTag = "main", typeof location < "u" && location.protocol === "blob:") {
        var D, U = location.href.split("/"), N = (D = U[U.length - 1]) == null ? void 0 : D.match(/(\w+)-/);
        N && (this._workerTag = S ? S + "-" + N[1] : N[1]);
      } else
        S && (this._workerTag = S);
    }
    j.loadLogLevel = function(S, D) {
      if (D === void 0 && (D = !0), location.href) {
        var U = new RegExp(S + "=([a-z]{1})"), N = location.href.match(U);
        if (N && N.length > 1) {
          var z = N[1];
          if (this._isValueInLevel(z))
            return z;
        }
      }
      var Y = new O().read(S, D);
      if (this._isValueInLevel(Y))
        return Y;
    }, j.saveLogLevel = function(S, D) {
      this._isValueInLevel(D) && new O().write(S, D);
    }, j._isValueInLevel = function(S) {
      return Object.values(m).indexOf(S) !== -1;
    };
    var F = j.prototype;
    return F.setOutput = function(S) {
      return this._output = S, this;
    }, F.setLevel = function(S) {
      return this._level = S, this;
    }, F.setId = function(S) {
      return this._id = S, this;
    }, F.setName = function(S) {
      return this._name = S, this;
    }, F.getLevel = function() {
      return this._level;
    }, F.getOutput = function() {
      return this._output;
    }, F.hasOutput = function() {
      return !!this._output;
    }, F.e = function(S) {
      if (this._isLevelEnabled(this._level, m.ERROR)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.ERROR, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.e.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.w = function(S) {
      if (this._isLevelEnabled(this._level, m.WARN)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.WARN, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.w.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.i = function(S) {
      if (this._isLevelEnabled(this._level, m.INFO)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.INFO, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.i.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.d = function(S) {
      if (this._isLevelEnabled(this._level, m.DEBUG)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.DEBUG, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.d.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.v = function(S) {
      if (this._isLevelEnabled(this._level, m.VERBOSE)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.VERBOSE, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.v.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F._isLevelEnabled = function(S, D) {
      return g[S].value >= g[D].value;
    }, F._printLog = function(S, D, U) {
      var N, z, Y = typeof D;
      if (Y === "object")
        D = ((z = D) == null ? void 0 : z.constructor.name) || "unknown";
      else if (Y === "function") {
        var C;
        D = ((C = Object.getOwnPropertyDescriptor(D, "name")) == null ? void 0 : C.value) || "unknown";
      }
      var M, B, Z = (((N = g[S]) == null ? void 0 : N.str) || "") + "|" + this._name + "[" + (typeof this._id == "function" ? this._id() : this._id) + "][" + this._workerTag + "]::" + D;
      return S === m.ERROR ? (M = console).error.apply(M, [Z].concat(U.slice(0))) : (B = console).log.apply(B, [Z].concat(U.slice(0))), Z;
    }, j;
  }(), k = new E(), y = function() {
    return l()(function j(F) {
      this._logger = void 0, this._id = 0, this._config = c, this._id = j._id, j._id++, this._logger = new E().setId(this._id).setLevel(m.INFO), this._config = f()({}, c, F);
    }, [{ key: "config", get: function() {
      return this._config;
    } }, { key: "logger", get: function() {
      return this._logger;
    } }, { key: "id", get: function() {
      return this._id;
    } }], [{ key: "packName", get: function() {
      return "ll_es";
    } }, { key: "version", get: function() {
      return "1.0.13";
    } }, { key: "buildTime", get: function() {
      return "Tue Oct 08 2024 17:18:49 GMT+0800 (中国标准时间)";
    } }]);
  }();
  y._id = 0;
  var w = r(4), _ = r.n(w), b = r(2), I = r.n(b), P = function() {
    function j(S, D, U, N, z) {
      var Y = this;
      z === void 0 && (z = 1), this._logger = void 0, this._name = void 0, this._storeName = void 0, this._dbIndex = void 0, this._version = void 0, this._taskQueue = [], this._openReq = void 0, this._isTransactionActive = !1, this._runTaskQueue = function() {
        for (; Y._taskQueue.length; ) {
          var C = Y._taskQueue.shift();
          C && Y.run(C.task, C.mode);
        }
      }, this._logger = S, this._name = D, this._storeName = U, this._dbIndex = N, this._version = z;
    }
    var F = j.prototype;
    return F.init = function() {
      var S = this;
      if (!this._openReq && indexedDB) {
        var D = this._openReq = indexedDB.open(this._name, this._version);
        this._logger.i("idb-wrapper", "open", D), D.onerror = function() {
          S._logger.i("idb-wrapper", "open error.");
        }, D.onsuccess = function() {
          S._logger.i("idb-wrapper", "open success."), S._runTaskQueue();
        }, D.onupgradeneeded = function() {
          S._logger.i("idb-wrapper", "open upgradeneeded."), D.result.objectStoreNames.contains(S._storeName) && D.result.deleteObjectStore(S._storeName);
          var U = D.result.createObjectStore(S._storeName, { keyPath: "id", autoIncrement: !0 });
          S._dbIndex && S._dbIndex.forEach(function(N) {
            U.createIndex(N.name, N.keyPath, N.option);
          });
        };
      }
    }, F.run = function(S, D) {
      if (D === void 0 && (D = "readwrite"), this.init(), this._openReq && this._openReq.readyState === "done" && !this._openReq.error)
        return this._doTask(S, D);
      this.state !== "error" && (this._taskQueue.push({ task: S, mode: D }), this._taskQueue.length > 1e3 && this._taskQueue.shift());
    }, F.close = function() {
      var S = this;
      this._logger.i("idb-wrapper", "close"), this._openReq && (this._openReq.readyState === "done" ? (this._openReq.result.close(), this._openReq = void 0) : this._openReq.onsuccess = function() {
        S.close();
      });
    }, F.destroy = function() {
      this._logger.i("idb-wrapper", "destroy"), this.close(), this._taskQueue = [];
    }, F._doTask = function(S, D) {
      var U = this;
      if (D === void 0 && (D = "readwrite"), this._openReq && !this._openReq.error)
        try {
          this._isTransactionActive = !0;
          var N = this._openReq.result.transaction(this._storeName, D), z = void 0;
          N.oncomplete = function() {
            U._isTransactionActive = !1, S.callback && S.callback(z), U._runTaskQueue();
          }, N.onabort = N.onerror = function() {
            U._isTransactionActive = !1, S.callback && S.callback(z), U._runTaskQueue();
          }, z = S.exec(N.objectStore(this._storeName));
        } catch (Y) {
        }
      else
        S.callback && S.callback();
    }, l()(j, [{ key: "isTransactionActive", get: function() {
      return this._isTransactionActive;
    } }, { key: "state", get: function() {
      return this._openReq && this._openReq.readyState === "done" ? this._openReq.error ? "error" : "ready" : "idle";
    } }]);
  }(), G = [{ name: "id", keyPath: "id", option: { unique: !0 } }], H = [function() {
    function j(S) {
      this._ctx = void 0, this._idb = void 0, this._logCount = 0, this._saveCount = 0, this._reCountOnSaveCount = 100, this._reduceData = !1, this._ctx = S, this._idb = new P(S.logger, S.config.idbName, S.config.idbName, G), this._reCountOnSaveCount = Math.min(200, Math.max(50, Math.round(this._ctx.config.idbMaxDataCount / 10))), this._count();
    }
    j.isSupported = function() {
      return typeof indexedDB < "u";
    };
    var F = j.prototype;
    return F.saveLog = function(S) {
      var D = this, U = { exec: function(N) {
        return N.add({ value: S });
      }, callback: function(N) {
        D._saveCount++, D._saveCount % D._reCountOnSaveCount == 0 && D._count(), N != null && N.error && D._ctx.logger.i("idb-backend", "save log err", N.error);
      } };
      this._idb.run(U);
    }, F.exportLog = function() {
      var S = _()(I.a.mark(function D() {
        var U = this;
        return I.a.wrap(function(N) {
          for (; ; )
            switch (N.prev = N.next) {
              case 0:
                return N.abrupt("return", new Promise(function(z, Y) {
                  U._ctx.logger.i("idb-backend", "export start");
                  var C = { exec: function(M) {
                    return M.getAll();
                  }, callback: function(M) {
                    z(M === void 0 ? "" : U._mergeGetAll(M.result));
                  } };
                  U._idb.run(C, "readonly");
                }));
              case 1:
              case "end":
                return N.stop();
            }
        }, D);
      }));
      return function() {
        return S.apply(this, arguments);
      };
    }(), F.destroy = function() {
      this._idb.destroy();
    }, F.clean = function() {
      this._idb.run({ exec: function(S) {
        return S.clear();
      } });
    }, F._count = function() {
      var S = this, D = { exec: function(U) {
        return U.count();
      }, callback: function(U) {
        U != null && U.error || U == null || !U.result || (S._ctx.logger.i("idb-backend", "count: " + U.result + " max: " + S._ctx.config.idbMaxDataCount), S._logCount = U.result, S._logCount >= S._ctx.config.idbMaxDataCount && !S._reduceData && S._deleteFromHead(S._logCount - Math.round(S._ctx.config.idbMaxDataCount / 2)));
      } };
      this._idb.run(D);
    }, F._deleteFromHead = function(S) {
      var D = this;
      this._ctx.logger.i("idb-backend", "delete from head"), this._reduceData = !0;
      var U = { exec: function(N) {
        return N.openCursor();
      }, callback: function(N) {
        if (D._reduceData = !1, N != null && N.result) {
          var z = IDBKeyRange.bound(N.result.key, N.result.key + S, !1, !1), Y = { exec: function(C) {
            return D._ctx.logger.i("idb-backend", "del: " + z.lower + "~" + z.upper), C.delete(z);
          }, callback: function(C) {
            D._ctx.logger.i("idb-backend", "del result: " + !(C == null || !C.error));
          } };
          D._idb.run(Y);
        }
      } };
      this._idb.run(U);
    }, F._mergeGetAll = function(S) {
      return S.length ? S.reduce(function(D, U) {
        return "" + D + U.value + `
`;
      }, "") : "";
    }, l()(j, [{ key: "isActive", get: function() {
      return this._idb.state !== "error";
    } }]);
  }()];
  function Q(j, F, S) {
    var D = /* @__PURE__ */ new Date();
    typeof j != "string" && (j = j.toString());
    var U = D.toLocaleString() + "." + D.getMilliseconds().toString().padStart(3, "0") + "|" + j + "|";
    return F.forEach(function(N) {
      U += typeof N == "object" ? JSON.stringify(N) + " " : N + " ";
    }), U.length > S ? U.substring(0, S) : U;
  }
  function ue(j) {
    return j.join(`
`);
  }
  var de = function() {
    function j(S) {
      var D = this;
      this._ctx = void 0, this._backend = void 0, this._delayTimer = void 0, this._logCache = [], this._loggerForAdd = void 0, this._downloadHref = void 0, this._startDelay = function() {
        D._delayTimer = setInterval(function() {
          D._saveLog(!0);
        }, 1e3);
      }, this._stopDelay = function() {
        D._delayTimer && (clearTimeout(D._delayTimer), D._delayTimer = void 0);
      }, R("kwai-video-local-log", "1.0.13"), this._ctx = new y(S);
      var U = function(N) {
        for (var z = arguments.length, Y = new Array(z > 1 ? z - 1 : 0), C = 1; C < z; C++)
          Y[C - 1] = arguments[C];
        D.addLog.apply(D, [N].concat(Y));
      };
      this._loggerForAdd = { e: U, w: U, i: U, d: U, v: U }, this._ctx.logger.setOutput(this._loggerForAdd), this._ctx.logger.i("kwai-video-local-log", "constructor", S, this._ctx.config), this._backend = function(N) {
        for (var z = 0; z < H.length; z++) {
          var Y = H[z];
          if (Y != null && Y.isSupported())
            return new Y(N);
        }
      }(this._ctx), this._backend && this._startDelay();
    }
    j.isSupported = function() {
      return function() {
        for (var S = 0; S < H.length; S++) {
          var D = H[S];
          if (D != null && D.isSupported())
            return !0;
        }
        return !1;
      }();
    };
    var F = j.prototype;
    return F.addLog = function(S) {
      for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
        U[N - 1] = arguments[N];
      this._logCache.push(Q(S, U, this._ctx.config.maxLogLen)), this._saveLog();
    }, F.cleanLog = function() {
      var S;
      this._ctx.logger.i("kwai-video-local-log", "clean"), (S = this._backend) == null || S.clean();
    }, F.exportLog = function() {
      var S = this;
      return this._ctx.logger.i("kwai-video-local-log", "export log"), new Promise(function(D, U) {
        S._backend ? S._backend.exportLog().then(function(N) {
          D(ue([N].concat(S._logCache)));
        }) : D("");
      });
    }, F.downloadLog = function(S) {
      var D = this;
      this._ctx.logger.i("kwai-video-local-log", "download log: " + S), this._destroyDownloadHref(), this.exportLog().then(function(U) {
        var N = new Blob([U], { type: "text/plain" });
        if (document) {
          var z = document.createElement("a");
          D._downloadHref = z.href = URL.createObjectURL(N), z.download = S || "Log_web_" + (/* @__PURE__ */ new Date()).toLocaleString() + ".log", document.body.appendChild(z), z.click(), z.remove();
        } else
          console.log("无document,当前是否在worker中");
      });
    }, F.destroy = function() {
      var S;
      this._destroyDownloadHref(), (S = this._backend) == null || S.destroy(), this._stopDelay();
    }, F.getLoggerForAdd = function() {
      return this._loggerForAdd;
    }, F._destroyDownloadHref = function() {
      try {
        this._downloadHref && (URL.revokeObjectURL(this._downloadHref), this._downloadHref = void 0);
      } catch (S) {
      }
    }, F._saveLog = function(S) {
      if (S === void 0 && (S = !1), this._backend && this._backend.isActive && (this._logCache.length >= this._ctx.config.idbMaxFoldLog || this._logCache.length > 0 && S)) {
        var D = ue(this._logCache);
        this._logCache.splice(0, this._logCache.length), D && this._backend.saveLog(D);
      }
    }, l()(j, null, [{ key: "version", get: function() {
      return "1.0.13";
    } }]);
  }();
  e.default = de;
}]);
Qt === void 0 && console.error("esm-webpack-plugin: nothing exported!");
Qt.KwaiVideoLocalLog;
const fa = Qt.LogLevel, Ze = Qt.DefaultLogger, Aa = Qt.Logger, Cu = Qt.printVersion;
Qt.DEFAULT_LOG_LEVEL;
Qt.default;
var Du = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ou(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var pn = { exports: {} }, di = typeof Reflect == "object" ? Reflect : null, Lo = di && typeof di.apply == "function" ? di.apply : function(t, e, r) {
  return Function.prototype.apply.call(t, e, r);
}, zi;
di && typeof di.ownKeys == "function" ? zi = di.ownKeys : Object.getOwnPropertySymbols ? zi = function(t) {
  return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));
} : zi = function(t) {
  return Object.getOwnPropertyNames(t);
};
function Mu(t) {
  console && console.warn && console.warn(t);
}
var pa = Number.isNaN || function(t) {
  return t !== t;
};
function Fe() {
  Fe.init.call(this);
}
pn.exports = Fe;
pn.exports.once = Fu;
Fe.EventEmitter = Fe;
Fe.prototype._events = void 0;
Fe.prototype._eventsCount = 0;
Fe.prototype._maxListeners = void 0;
var ko = 10;
function cr(t) {
  if (typeof t != "function")
    throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
}
Object.defineProperty(Fe, "defaultMaxListeners", {
  enumerable: !0,
  get: function() {
    return ko;
  },
  set: function(t) {
    if (typeof t != "number" || t < 0 || pa(t))
      throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
    ko = t;
  }
});
Fe.init = function() {
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
};
Fe.prototype.setMaxListeners = function(t) {
  if (typeof t != "number" || t < 0 || pa(t))
    throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
  return this._maxListeners = t, this;
};
function va(t) {
  return t._maxListeners === void 0 ? Fe.defaultMaxListeners : t._maxListeners;
}
Fe.prototype.getMaxListeners = function() {
  return va(this);
};
Fe.prototype.emit = function(t) {
  for (var e = [], r = 1; r < arguments.length; r++)
    e.push(arguments[r]);
  var s = t === "error", l = this._events;
  if (l !== void 0)
    s = s && l.error === void 0;
  else if (!s)
    return !1;
  if (s) {
    var d;
    if (e.length > 0 && (d = e[0]), d instanceof Error)
      throw d;
    var f = new Error("Unhandled error." + (d ? " (" + d.message + ")" : ""));
    throw f.context = d, f;
  }
  var c = l[t];
  if (c === void 0)
    return !1;
  if (typeof c == "function")
    Lo(c, this, e);
  else
    for (var R = c.length, A = ba(c, R), r = 0; r < R; ++r)
      Lo(A[r], this, e);
  return !0;
};
function _a(t, e, r, s) {
  var l, d, f;
  if (cr(r), d = t._events, d === void 0 ? (d = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (d.newListener !== void 0 && (t.emit(
    "newListener",
    e,
    r.listener ? r.listener : r
  ), d = t._events), f = d[e]), f === void 0)
    f = d[e] = r, ++t._eventsCount;
  else if (typeof f == "function" ? f = d[e] = s ? [r, f] : [f, r] : s ? f.unshift(r) : f.push(r), l = va(t), l > 0 && f.length > l && !f.warned) {
    f.warned = !0;
    var c = new Error("Possible EventEmitter memory leak detected. " + f.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
    c.name = "MaxListenersExceededWarning", c.emitter = t, c.type = e, c.count = f.length, Mu(c);
  }
  return t;
}
Fe.prototype.addListener = function(t, e) {
  return _a(this, t, e, !1);
};
Fe.prototype.on = Fe.prototype.addListener;
Fe.prototype.prependListener = function(t, e) {
  return _a(this, t, e, !0);
};
function Nu() {
  if (!this.fired)
    return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
}
function ma(t, e, r) {
  var s = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, l = Nu.bind(s);
  return l.listener = r, s.wrapFn = l, l;
}
Fe.prototype.once = function(t, e) {
  return cr(e), this.on(t, ma(this, t, e)), this;
};
Fe.prototype.prependOnceListener = function(t, e) {
  return cr(e), this.prependListener(t, ma(this, t, e)), this;
};
Fe.prototype.removeListener = function(t, e) {
  var r, s, l, d, f;
  if (cr(e), s = this._events, s === void 0)
    return this;
  if (r = s[t], r === void 0)
    return this;
  if (r === e || r.listener === e)
    --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete s[t], s.removeListener && this.emit("removeListener", t, r.listener || e));
  else if (typeof r != "function") {
    for (l = -1, d = r.length - 1; d >= 0; d--)
      if (r[d] === e || r[d].listener === e) {
        f = r[d].listener, l = d;
        break;
      }
    if (l < 0)
      return this;
    l === 0 ? r.shift() : Pu(r, l), r.length === 1 && (s[t] = r[0]), s.removeListener !== void 0 && this.emit("removeListener", t, f || e);
  }
  return this;
};
Fe.prototype.off = Fe.prototype.removeListener;
Fe.prototype.removeAllListeners = function(t) {
  var e, r, s;
  if (r = this._events, r === void 0)
    return this;
  if (r.removeListener === void 0)
    return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : r[t] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete r[t]), this;
  if (arguments.length === 0) {
    var l = Object.keys(r), d;
    for (s = 0; s < l.length; ++s)
      d = l[s], d !== "removeListener" && this.removeAllListeners(d);
    return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
  }
  if (e = r[t], typeof e == "function")
    this.removeListener(t, e);
  else if (e !== void 0)
    for (s = e.length - 1; s >= 0; s--)
      this.removeListener(t, e[s]);
  return this;
};
function ga(t, e, r) {
  var s = t._events;
  if (s === void 0)
    return [];
  var l = s[e];
  return l === void 0 ? [] : typeof l == "function" ? r ? [l.listener || l] : [l] : r ? Uu(l) : ba(l, l.length);
}
Fe.prototype.listeners = function(t) {
  return ga(this, t, !0);
};
Fe.prototype.rawListeners = function(t) {
  return ga(this, t, !1);
};
Fe.listenerCount = function(t, e) {
  return typeof t.listenerCount == "function" ? t.listenerCount(e) : ya.call(t, e);
};
Fe.prototype.listenerCount = ya;
function ya(t) {
  var e = this._events;
  if (e !== void 0) {
    var r = e[t];
    if (typeof r == "function")
      return 1;
    if (r !== void 0)
      return r.length;
  }
  return 0;
}
Fe.prototype.eventNames = function() {
  return this._eventsCount > 0 ? zi(this._events) : [];
};
function ba(t, e) {
  for (var r = new Array(e), s = 0; s < e; ++s)
    r[s] = t[s];
  return r;
}
function Pu(t, e) {
  for (; e + 1 < t.length; e++)
    t[e] = t[e + 1];
  t.pop();
}
function Uu(t) {
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
    e[r] = t[r].listener || t[r];
  return e;
}
function Fu(t, e) {
  return new Promise(function(r, s) {
    function l(f) {
      t.removeListener(e, d), s(f);
    }
    function d() {
      typeof t.removeListener == "function" && t.removeListener("error", l), r([].slice.call(arguments));
    }
    Ea(t, e, d, { once: !0 }), e !== "error" && Bu(t, l, { once: !0 });
  });
}
function Bu(t, e, r) {
  typeof t.on == "function" && Ea(t, "error", e, r);
}
function Ea(t, e, r, s) {
  if (typeof t.on == "function")
    s.once ? t.once(e, r) : t.on(e, r);
  else if (typeof t.addEventListener == "function")
    t.addEventListener(e, function l(d) {
      s.once && t.removeEventListener(e, l), r(d);
    });
  else
    throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
}
var Hu = pn.exports, wa = function() {
  if (typeof Map < "u")
    return Map;
  function t(e, r) {
    var s = -1;
    return e.some(function(l, d) {
      return l[0] === r ? (s = d, !0) : !1;
    }), s;
  }
  return (
    /** @class */
    function() {
      function e() {
        this.__entries__ = [];
      }
      return Object.defineProperty(e.prototype, "size", {
        /**
         * @returns {boolean}
         */
        get: function() {
          return this.__entries__.length;
        },
        enumerable: !0,
        configurable: !0
      }), e.prototype.get = function(r) {
        var s = t(this.__entries__, r), l = this.__entries__[s];
        return l && l[1];
      }, e.prototype.set = function(r, s) {
        var l = t(this.__entries__, r);
        ~l ? this.__entries__[l][1] = s : this.__entries__.push([r, s]);
      }, e.prototype.delete = function(r) {
        var s = this.__entries__, l = t(s, r);
        ~l && s.splice(l, 1);
      }, e.prototype.has = function(r) {
        return !!~t(this.__entries__, r);
      }, e.prototype.clear = function() {
        this.__entries__.splice(0);
      }, e.prototype.forEach = function(r, s) {
        s === void 0 && (s = null);
        for (var l = 0, d = this.__entries__; l < d.length; l++) {
          var f = d[l];
          r.call(s, f[1], f[0]);
        }
      }, e;
    }()
  );
}(), $r = typeof window < "u" && typeof document < "u" && window.document === document, er = function() {
  return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
}(), Vu = function() {
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(er) : function(t) {
    return setTimeout(function() {
      return t(Date.now());
    }, 1e3 / 60);
  };
}(), Gu = 2;
function Wu(t, e) {
  var r = !1, s = !1, l = 0;
  function d() {
    r && (r = !1, t()), s && c();
  }
  function f() {
    Vu(d);
  }
  function c() {
    var R = Date.now();
    if (r) {
      if (R - l < Gu)
        return;
      s = !0;
    } else
      r = !0, s = !1, setTimeout(f, e);
    l = R;
  }
  return c;
}
var ju = 20, Ku = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], zu = typeof MutationObserver < "u", Ju = (
  /** @class */
  function() {
    function t() {
      this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = Wu(this.refresh.bind(this), ju);
    }
    return t.prototype.addObserver = function(e) {
      ~this.observers_.indexOf(e) || this.observers_.push(e), this.connected_ || this.connect_();
    }, t.prototype.removeObserver = function(e) {
      var r = this.observers_, s = r.indexOf(e);
      ~s && r.splice(s, 1), !r.length && this.connected_ && this.disconnect_();
    }, t.prototype.refresh = function() {
      var e = this.updateObservers_();
      e && this.refresh();
    }, t.prototype.updateObservers_ = function() {
      var e = this.observers_.filter(function(r) {
        return r.gatherActive(), r.hasActive();
      });
      return e.forEach(function(r) {
        return r.broadcastActive();
      }), e.length > 0;
    }, t.prototype.connect_ = function() {
      !$r || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), zu ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
        attributes: !0,
        childList: !0,
        characterData: !0,
        subtree: !0
      })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
    }, t.prototype.disconnect_ = function() {
      !$r || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
    }, t.prototype.onTransitionEnd_ = function(e) {
      var r = e.propertyName, s = r === void 0 ? "" : r, l = Ku.some(function(d) {
        return !!~s.indexOf(d);
      });
      l && this.refresh();
    }, t.getInstance = function() {
      return this.instance_ || (this.instance_ = new t()), this.instance_;
    }, t.instance_ = null, t;
  }()
), Ta = function(t, e) {
  for (var r = 0, s = Object.keys(e); r < s.length; r++) {
    var l = s[r];
    Object.defineProperty(t, l, {
      value: e[l],
      enumerable: !1,
      writable: !1,
      configurable: !0
    });
  }
  return t;
}, pi = function(t) {
  var e = t && t.ownerDocument && t.ownerDocument.defaultView;
  return e || er;
}, Ra = dr(0, 0, 0, 0);
function tr(t) {
  return parseFloat(t) || 0;
}
function Io(t) {
  for (var e = [], r = 1; r < arguments.length; r++)
    e[r - 1] = arguments[r];
  return e.reduce(function(s, l) {
    var d = t["border-" + l + "-width"];
    return s + tr(d);
  }, 0);
}
function $u(t) {
  for (var e = ["top", "right", "bottom", "left"], r = {}, s = 0, l = e; s < l.length; s++) {
    var d = l[s], f = t["padding-" + d];
    r[d] = tr(f);
  }
  return r;
}
function qu(t) {
  var e = t.getBBox();
  return dr(0, 0, e.width, e.height);
}
function Yu(t) {
  var e = t.clientWidth, r = t.clientHeight;
  if (!e && !r)
    return Ra;
  var s = pi(t).getComputedStyle(t), l = $u(s), d = l.left + l.right, f = l.top + l.bottom, c = tr(s.width), R = tr(s.height);
  if (s.boxSizing === "border-box" && (Math.round(c + d) !== e && (c -= Io(s, "left", "right") + d), Math.round(R + f) !== r && (R -= Io(s, "top", "bottom") + f)), !Zu(t)) {
    var A = Math.round(c + d) - e, v = Math.round(R + f) - r;
    Math.abs(A) !== 1 && (c -= A), Math.abs(v) !== 1 && (R -= v);
  }
  return dr(l.left, l.top, c, R);
}
var Qu = function() {
  return typeof SVGGraphicsElement < "u" ? function(t) {
    return t instanceof pi(t).SVGGraphicsElement;
  } : function(t) {
    return t instanceof pi(t).SVGElement && typeof t.getBBox == "function";
  };
}();
function Zu(t) {
  return t === pi(t).document.documentElement;
}
function Xu(t) {
  return $r ? Qu(t) ? qu(t) : Yu(t) : Ra;
}
function ec(t) {
  var e = t.x, r = t.y, s = t.width, l = t.height, d = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, f = Object.create(d.prototype);
  return Ta(f, {
    x: e,
    y: r,
    width: s,
    height: l,
    top: r,
    right: e + s,
    bottom: l + r,
    left: e
  }), f;
}
function dr(t, e, r, s) {
  return { x: t, y: e, width: r, height: s };
}
var tc = (
  /** @class */
  function() {
    function t(e) {
      this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = dr(0, 0, 0, 0), this.target = e;
    }
    return t.prototype.isActive = function() {
      var e = Xu(this.target);
      return this.contentRect_ = e, e.width !== this.broadcastWidth || e.height !== this.broadcastHeight;
    }, t.prototype.broadcastRect = function() {
      var e = this.contentRect_;
      return this.broadcastWidth = e.width, this.broadcastHeight = e.height, e;
    }, t;
  }()
), ic = (
  /** @class */
  function() {
    function t(e, r) {
      var s = ec(r);
      Ta(this, { target: e, contentRect: s });
    }
    return t;
  }()
), rc = (
  /** @class */
  function() {
    function t(e, r, s) {
      if (this.activeObservations_ = [], this.observations_ = new wa(), typeof e != "function")
        throw new TypeError("The callback provided as parameter 1 is not a function.");
      this.callback_ = e, this.controller_ = r, this.callbackCtx_ = s;
    }
    return t.prototype.observe = function(e) {
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      if (!(typeof Element > "u" || !(Element instanceof Object))) {
        if (!(e instanceof pi(e).Element))
          throw new TypeError('parameter 1 is not of type "Element".');
        var r = this.observations_;
        r.has(e) || (r.set(e, new tc(e)), this.controller_.addObserver(this), this.controller_.refresh());
      }
    }, t.prototype.unobserve = function(e) {
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      if (!(typeof Element > "u" || !(Element instanceof Object))) {
        if (!(e instanceof pi(e).Element))
          throw new TypeError('parameter 1 is not of type "Element".');
        var r = this.observations_;
        r.has(e) && (r.delete(e), r.size || this.controller_.removeObserver(this));
      }
    }, t.prototype.disconnect = function() {
      this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
    }, t.prototype.gatherActive = function() {
      var e = this;
      this.clearActive(), this.observations_.forEach(function(r) {
        r.isActive() && e.activeObservations_.push(r);
      });
    }, t.prototype.broadcastActive = function() {
      if (this.hasActive()) {
        var e = this.callbackCtx_, r = this.activeObservations_.map(function(s) {
          return new ic(s.target, s.broadcastRect());
        });
        this.callback_.call(e, r, e), this.clearActive();
      }
    }, t.prototype.clearActive = function() {
      this.activeObservations_.splice(0);
    }, t.prototype.hasActive = function() {
      return this.activeObservations_.length > 0;
    }, t;
  }()
), Sa = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new wa(), La = (
  /** @class */
  function() {
    function t(e) {
      if (!(this instanceof t))
        throw new TypeError("Cannot call a class as a function.");
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      var r = Ju.getInstance(), s = new rc(e, r, this);
      Sa.set(this, s);
    }
    return t;
  }()
);
[
  "observe",
  "unobserve",
  "disconnect"
].forEach(function(t) {
  La.prototype[t] = function() {
    var e;
    return (e = Sa.get(this))[t].apply(e, arguments);
  };
});
(function() {
  return typeof er.ResizeObserver < "u" ? er.ResizeObserver : La;
})();
var ka = {}, nc = Object.prototype.hasOwnProperty, oc;
function xo(t) {
  try {
    return decodeURIComponent(t.replace(/\+/g, " "));
  } catch (e) {
    return null;
  }
}
function Co(t) {
  try {
    return encodeURIComponent(t);
  } catch (e) {
    return null;
  }
}
function ac(t) {
  for (var e = /([^=?#&]+)=?([^&]*)/g, r = {}, s; s = e.exec(t); ) {
    var l = xo(s[1]), d = xo(s[2]);
    l === null || d === null || l in r || (r[l] = d);
  }
  return r;
}
function sc(t, e) {
  e = e || "";
  var r = [], s, l;
  typeof e != "string" && (e = "?");
  for (l in t)
    if (nc.call(t, l)) {
      if (s = t[l], !s && (s === null || s === oc || isNaN(s)) && (s = ""), l = Co(l), s = Co(s), l === null || s === null)
        continue;
      r.push(l + "=" + s);
    }
  return r.length ? e + r.join("&") : "";
}
ka.stringify = sc;
ka.parse = ac;
var _i = function(t) {
  var e = {};
  function r(s) {
    if (e[s])
      return e[s].exports;
    var l = e[s] = { i: s, l: !1, exports: {} };
    return t[s].call(l.exports, l, l.exports, r), l.l = !0, l.exports;
  }
  return r.m = t, r.c = e, r.d = function(s, l, d) {
    r.o(s, l) || Object.defineProperty(s, l, { enumerable: !0, get: d });
  }, r.r = function(s) {
    typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
  }, r.t = function(s, l) {
    if (1 & l && (s = r(s)), 8 & l || 4 & l && typeof s == "object" && s && s.__esModule)
      return s;
    var d = /* @__PURE__ */ Object.create(null);
    if (r.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & l && typeof s != "string")
      for (var f in s)
        r.d(d, f, function(c) {
          return s[c];
        }.bind(null, f));
    return d;
  }, r.n = function(s) {
    var l = s && s.__esModule ? function() {
      return s.default;
    } : function() {
      return s;
    };
    return r.d(l, "a", l), l;
  }, r.o = function(s, l) {
    return Object.prototype.hasOwnProperty.call(s, l);
  }, r.p = "", r(r.s = 4);
}([function(t, e) {
  function r(s) {
    return t.exports = r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
      return typeof l;
    } : function(l) {
      return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r(s);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(2);
  function l(d, f) {
    for (var c = 0; c < f.length; c++) {
      var R = f[c];
      R.enumerable = R.enumerable || !1, R.configurable = !0, "value" in R && (R.writable = !0), Object.defineProperty(d, s(R.key), R);
    }
  }
  t.exports = function(d, f, c) {
    return f && l(d.prototype, f), c && l(d, c), Object.defineProperty(d, "prototype", { writable: !1 }), d;
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(0).default, l = r(3);
  t.exports = function(d) {
    var f = l(d, "string");
    return s(f) == "symbol" ? f : f + "";
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(0).default;
  t.exports = function(l, d) {
    if (s(l) != "object" || !l)
      return l;
    var f = l[Symbol.toPrimitive];
    if (f !== void 0) {
      var c = f.call(l, d || "default");
      if (s(c) != "object")
        return c;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (d === "string" ? String : Number)(l);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  function s(g, E) {
    console.log("%c " + g + " %c " + E + " %c", "background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px;  color: #fff", "background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0;  color: #fff", "background:transparent");
  }
  r.r(e), r.d(e, "LogLevel", function() {
    return A;
  }), r.d(e, "DefaultLogger", function() {
    return x;
  }), r.d(e, "Logger", function() {
    return m;
  }), r.d(e, "printVersion", function() {
    return s;
  }), r.d(e, "DEFAULT_LOG_LEVEL", function() {
    return v;
  });
  var l = r(1), d = r.n(l), f = function() {
    function g() {
      this.timeout = 6048e5;
    }
    var E = g.prototype;
    return E.write = function(k, y) {
      if (g.available)
        try {
          localStorage.setItem(k, JSON.stringify({ value: y, time: Date.now() }));
        } catch (w) {
        }
    }, E.read = function(k, y) {
      if (y === void 0 && (y = !0), g.available)
        try {
          var w = localStorage.getItem(k);
          if (w) {
            var _ = JSON.parse(w), b = _.value, I = _.time, P = I === void 0 ? 0 : I;
            if (!y || Date.now() - P < (typeof y == "number" ? y : this.timeout))
              return b;
          }
        } catch (G) {
        }
    }, d()(g, null, [{ key: "available", get: function() {
      if (g._available === void 0)
        try {
          localStorage.setItem("alg", "test"), g._available = !0;
        } catch (k) {
          g._available = !1;
        }
      return g._available;
    } }]);
  }();
  f._available = void 0;
  var c, R = f, A = function(g) {
    return g.NONE = "none", g.ERROR = "e", g.WARN = "w", g.INFO = "i", g.DEBUG = "d", g.VERBOSE = "v", g;
  }({}), v = A.ERROR, O = ((c = {})[A.NONE] = { value: 1, str: "N" }, c[A.ERROR] = { value: 100, str: "E" }, c[A.WARN] = { value: 200, str: "W" }, c[A.INFO] = { value: 300, str: "I" }, c[A.DEBUG] = { value: 400, str: "D" }, c[A.VERBOSE] = { value: 500, str: "V" }, c), m = function() {
    function g(k) {
      if (this._name = "kwai-v", this._level = v, this._id = -1, this._output = void 0, this._workerTag = "main", typeof location < "u" && location.protocol === "blob:") {
        var y, w = location.href.split("/"), _ = (y = w[w.length - 1]) == null ? void 0 : y.match(/(\w+)-/);
        _ && (this._workerTag = k ? k + "-" + _[1] : _[1]);
      } else
        k && (this._workerTag = k);
    }
    g.loadLogLevel = function(k, y) {
      if (y === void 0 && (y = !0), location.href) {
        var w = new RegExp(k + "=([a-z]{1})"), _ = location.href.match(w);
        if (_ && _.length > 1) {
          var b = _[1];
          if (this._isValueInLevel(b))
            return b;
        }
      }
      var I = new R().read(k, y);
      if (this._isValueInLevel(I))
        return I;
    }, g.saveLogLevel = function(k, y) {
      this._isValueInLevel(y) && new R().write(k, y);
    }, g._isValueInLevel = function(k) {
      return Object.values(A).indexOf(k) !== -1;
    };
    var E = g.prototype;
    return E.setOutput = function(k) {
      return this._output = k, this;
    }, E.setLevel = function(k) {
      return this._level = k, this;
    }, E.setId = function(k) {
      return this._id = k, this;
    }, E.setName = function(k) {
      return this._name = k, this;
    }, E.getLevel = function() {
      return this._level;
    }, E.getOutput = function() {
      return this._output;
    }, E.hasOutput = function() {
      return !!this._output;
    }, E.e = function(k) {
      if (this._isLevelEnabled(this._level, A.ERROR)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.ERROR, k, w);
        try {
          var I;
          (I = this._output) == null || I.e.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.w = function(k) {
      if (this._isLevelEnabled(this._level, A.WARN)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.WARN, k, w);
        try {
          var I;
          (I = this._output) == null || I.w.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.i = function(k) {
      if (this._isLevelEnabled(this._level, A.INFO)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.INFO, k, w);
        try {
          var I;
          (I = this._output) == null || I.i.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.d = function(k) {
      if (this._isLevelEnabled(this._level, A.DEBUG)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.DEBUG, k, w);
        try {
          var I;
          (I = this._output) == null || I.d.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.v = function(k) {
      if (this._isLevelEnabled(this._level, A.VERBOSE)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.VERBOSE, k, w);
        try {
          var I;
          (I = this._output) == null || I.v.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E._isLevelEnabled = function(k, y) {
      return O[k].value >= O[y].value;
    }, E._printLog = function(k, y, w) {
      var _, b, I = typeof y;
      if (I === "object")
        y = ((b = y) == null ? void 0 : b.constructor.name) || "unknown";
      else if (I === "function") {
        var P;
        y = ((P = Object.getOwnPropertyDescriptor(y, "name")) == null ? void 0 : P.value) || "unknown";
      }
      var G, H, Q = (((_ = O[k]) == null ? void 0 : _.str) || "") + "|" + this._name + "[" + (typeof this._id == "function" ? this._id() : this._id) + "][" + this._workerTag + "]::" + y;
      return k === A.ERROR ? (G = console).error.apply(G, [Q].concat(w.slice(0))) : (H = console).log.apply(H, [Q].concat(w.slice(0))), Q;
    }, g;
  }(), x = new m();
}]);
_i === void 0 && console.error("esm-webpack-plugin: nothing exported!");
_i.LogLevel;
const Ri = _i.DefaultLogger;
_i.Logger;
_i.printVersion;
_i.DEFAULT_LOG_LEVEL;
/*! js-cookie v3.0.5 | MIT */
function Vi(t) {
  for (var e = 1; e < arguments.length; e++) {
    var r = arguments[e];
    for (var s in r)
      t[s] = r[s];
  }
  return t;
}
var lc = {
  read: function(t) {
    return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
  },
  write: function(t) {
    return encodeURIComponent(t).replace(
      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
      decodeURIComponent
    );
  }
};
function qr(t, e) {
  function r(l, d, f) {
    if (!(typeof document > "u")) {
      f = Vi({}, e, f), typeof f.expires == "number" && (f.expires = new Date(Date.now() + f.expires * 864e5)), f.expires && (f.expires = f.expires.toUTCString()), l = encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
      var c = "";
      for (var R in f)
        f[R] && (c += "; " + R, f[R] !== !0 && (c += "=" + f[R].split(";")[0]));
      return document.cookie = l + "=" + t.write(d, l) + c;
    }
  }
  function s(l) {
    if (!(typeof document > "u" || arguments.length && !l)) {
      for (var d = document.cookie ? document.cookie.split("; ") : [], f = {}, c = 0; c < d.length; c++) {
        var R = d[c].split("="), A = R.slice(1).join("=");
        try {
          var v = decodeURIComponent(R[0]);
          if (f[v] = t.read(A, v), l === v)
            break;
        } catch (O) {
        }
      }
      return l ? f[l] : f;
    }
  }
  return Object.create(
    {
      set: r,
      get: s,
      remove: function(l, d) {
        r(
          l,
          "",
          Vi({}, d, {
            expires: -1
          })
        );
      },
      withAttributes: function(l) {
        return qr(this.converter, Vi({}, this.attributes, l));
      },
      withConverter: function(l) {
        return qr(Vi({}, this.converter, l), this.attributes);
      }
    },
    {
      attributes: { value: Object.freeze(e) },
      converter: { value: Object.freeze(t) }
    }
  );
}
var Pr = qr(lc, { path: "/" });
const Si = "did", Ur = "kwai_player_device_id";
function Do() {
  try {
    const t = Math.random() * 1e9 >>> 0, e = [], r = "0123456789ABCDEF";
    for (let l = 0; l < 7; l++)
      e.push(r.charAt(Math.random() * 16));
    const s = `web_${t}${e.join("")}`;
    return Ri.i(Si, "generate nanoId", s), s;
  } catch (t) {
  }
  return "web_did_generation_failed";
}
function uc() {
  let t = "";
  try {
    t = (Pr.get("did") || Pr.get("_did") || Pr.get("weblogger_did") || "").trim(), Ri.i(Si, "generate deviceId from cookie", t);
  } catch (e) {
    Ri.i(Si, "generate deviceId from cookie err", e);
  }
  try {
    t ? localStorage == null || localStorage.setItem(Ur, t) : (t = ((localStorage == null ? void 0 : localStorage.getItem(Ur)) || "").trim(), Ri.i(Si, "generate deviceId from ls", t)), t || (t = Do(), localStorage == null || localStorage.setItem(Ur, t));
  } catch (e) {
    Ri.i(Si, "generate deviceId from ls err", e);
  }
  return t || Do();
}
uc();
const Ia = class ii {
  constructor() {
    ha(this, "timeout", 7 * 24 * 3600 * 1e3);
  }
  write(e, r) {
    if (ii.available)
      try {
        localStorage.setItem(
          e,
          JSON.stringify({ value: r, time: Date.now() })
        );
      } catch (s) {
      }
  }
  read(e, r = !0) {
    if (ii.available)
      try {
        const s = localStorage.getItem(e);
        if (s) {
          const { value: l, time: d = 0 } = JSON.parse(s);
          if (!r || Date.now() - d < (typeof r == "number" ? r : this.timeout))
            return l;
        }
      } catch (s) {
      }
  }
  static get available() {
    if (typeof ii._available > "u")
      try {
        localStorage.setItem("alg", "test"), ii._available = !0;
      } catch (e) {
        ii._available = !1;
      }
    return ii._available;
  }
};
ha(Ia, "_available");
let xa = Ia;
var Yr = { exports: {} };
(function(t, e) {
  (function(r, s) {
    var l = "1.0.2", d = "", f = "?", c = "function", R = "undefined", A = "object", v = "string", O = "major", m = "model", x = "name", g = "type", E = "vendor", k = "version", y = "architecture", w = "console", _ = "mobile", b = "tablet", I = "smarttv", P = "wearable", G = "embedded", H = 255, Q = "Amazon", ue = "Apple", de = "ASUS", j = "BlackBerry", F = "Browser", S = "Chrome", D = "Edge", U = "Firefox", N = "Google", z = "Huawei", Y = "LG", C = "Microsoft", M = "Motorola", B = "Opera", Z = "Samsung", K = "Sony", se = "Xiaomi", pe = "Zebra", he = "Facebook", we = function(oe, le) {
      var ne = {};
      for (var me in oe)
        le[me] && le[me].length % 2 === 0 ? ne[me] = le[me].concat(oe[me]) : ne[me] = oe[me];
      return ne;
    }, ee = function(oe) {
      for (var le = {}, ne = 0; ne < oe.length; ne++)
        le[oe[ne].toUpperCase()] = oe[ne];
      return le;
    }, je = function(oe, le) {
      return typeof oe === v ? Le(le).indexOf(Le(oe)) !== -1 : !1;
    }, Le = function(oe) {
      return oe.toLowerCase();
    }, Ht = function(oe) {
      return typeof oe === v ? oe.replace(/[^\d\.]/g, d).split(".")[0] : s;
    }, it = function(oe, le) {
      if (typeof oe === v)
        return oe = oe.replace(/^\s\s*/, d).replace(/\s\s*$/, d), typeof le === R ? oe : oe.substring(0, H);
    }, fe = function(oe, le) {
      for (var ne = 0, me, ae, wt, Ae, et, $e; ne < le.length && !et; ) {
        var Tt = le[ne], Xt = le[ne + 1];
        for (me = ae = 0; me < Tt.length && !et; )
          if (et = Tt[me++].exec(oe), et)
            for (wt = 0; wt < Xt.length; wt++)
              $e = et[++ae], Ae = Xt[wt], typeof Ae === A && Ae.length > 0 ? Ae.length === 2 ? typeof Ae[1] == c ? this[Ae[0]] = Ae[1].call(this, $e) : this[Ae[0]] = Ae[1] : Ae.length === 3 ? typeof Ae[1] === c && !(Ae[1].exec && Ae[1].test) ? this[Ae[0]] = $e ? Ae[1].call(this, $e, Ae[2]) : s : this[Ae[0]] = $e ? $e.replace(Ae[1], Ae[2]) : s : Ae.length === 4 && (this[Ae[0]] = $e ? Ae[3].call(this, $e.replace(Ae[1], Ae[2])) : s) : this[Ae] = $e || s;
        ne += 2;
      }
    }, He = function(oe, le) {
      for (var ne in le)
        if (typeof le[ne] === A && le[ne].length > 0) {
          for (var me = 0; me < le[ne].length; me++)
            if (je(le[ne][me], oe))
              return ne === f ? s : ne;
        } else if (je(le[ne], oe))
          return ne === f ? s : ne;
      return oe;
    }, Lt = {
      "1.0": "/8",
      "1.2": "/1",
      "1.3": "/3",
      "2.0": "/412",
      "2.0.2": "/416",
      "2.0.3": "/417",
      "2.0.4": "/419",
      "?": "/"
    }, ce = {
      ME: "4.90",
      "NT 3.11": "NT3.51",
      "NT 4.0": "NT4.0",
      2e3: "NT 5.0",
      XP: ["NT 5.1", "NT 5.2"],
      Vista: "NT 6.0",
      7: "NT 6.1",
      8: "NT 6.2",
      "8.1": "NT 6.3",
      10: ["NT 6.4", "NT 10.0"],
      RT: "ARM"
    }, Ve = {
      browser: [
        [
          /\b(?:crmo|crios)\/([\w\.]+)/i
          // Chrome for Android/iOS
        ],
        [k, [x, "Chrome"]],
        [
          /edg(?:e|ios|a)?\/([\w\.]+)/i
          // Microsoft Edge
        ],
        [k, [x, "Edge"]],
        [
          // Presto based
          /(opera mini)\/([-\w\.]+)/i,
          // Opera Mini
          /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
          // Opera Mobi/Tablet
          /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
          // Opera
        ],
        [x, k],
        [
          /opios[\/ ]+([\w\.]+)/i
          // Opera mini on iphone >= 8.0
        ],
        [k, [x, B + " Mini"]],
        [
          /\bopr\/([\w\.]+)/i
          // Opera Webkit
        ],
        [k, [x, B]],
        [
          // Mixed
          /(kindle)\/([\w\.]+)/i,
          // Kindle
          /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
          // Lunascape/Maxthon/Netfront/Jasmine/Blazer
          // Trident based
          /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,
          // Avant/IEMobile/SlimBrowser
          /(ba?idubrowser)[\/ ]?([\w\.]+)/i,
          // Baidu Browser
          /(?:ms|\()(ie) ([\w\.]+)/i,
          // Internet Explorer
          // Webkit/KHTML based                                               // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
          /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,
          // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
          /(weibo)__([\d\.]+)/i
          // Weibo
        ],
        [x, k],
        [
          /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
          // UCBrowser
        ],
        [k, [x, "UC" + F]],
        [
          /\bqbcore\/([\w\.]+)/i
          // WeChat Desktop for Windows Built-in Browser
        ],
        [k, [x, "WeChat(Win) Desktop"]],
        [
          /micromessenger\/([\w\.]+)/i
          // WeChat
        ],
        [k, [x, "WeChat"]],
        [
          /konqueror\/([\w\.]+)/i
          // Konqueror
        ],
        [k, [x, "Konqueror"]],
        [
          /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
          // IE11
        ],
        [k, [x, "IE"]],
        [
          /yabrowser\/([\w\.]+)/i
          // Yandex
        ],
        [k, [x, "Yandex"]],
        [
          /(avast|avg)\/([\w\.]+)/i
          // Avast/AVG Secure Browser
        ],
        [[x, /(.+)/, "$1 Secure " + F], k],
        [
          /\bfocus\/([\w\.]+)/i
          // Firefox Focus
        ],
        [k, [x, U + " Focus"]],
        [
          /\bopt\/([\w\.]+)/i
          // Opera Touch
        ],
        [k, [x, B + " Touch"]],
        [
          /coc_coc\w+\/([\w\.]+)/i
          // Coc Coc Browser
        ],
        [k, [x, "Coc Coc"]],
        [
          /dolfin\/([\w\.]+)/i
          // Dolphin
        ],
        [k, [x, "Dolphin"]],
        [
          /coast\/([\w\.]+)/i
          // Opera Coast
        ],
        [k, [x, B + " Coast"]],
        [
          /miuibrowser\/([\w\.]+)/i
          // MIUI Browser
        ],
        [k, [x, "MIUI " + F]],
        [
          /fxios\/([-\w\.]+)/i
          // Firefox for iOS
        ],
        [k, [x, U]],
        [
          /\bqihu|(qi?ho?o?|360)browser/i
          // 360
        ],
        [[x, "360 " + F]],
        [
          /(oculus|samsung|sailfish)browser\/([\w\.]+)/i
        ],
        [[x, /(.+)/, "$1 " + F], k],
        [
          // Oculus/Samsung/Sailfish Browser
          /(comodo_dragon)\/([\w\.]+)/i
          // Comodo Dragon
        ],
        [[x, /_/g, " "], k],
        [
          /(electron)\/([\w\.]+) safari/i,
          // Electron-based App
          /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
          // Tesla
          /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i
          // QQBrowser/Baidu App/2345 Browser
        ],
        [x, k],
        [
          /(metasr)[\/ ]?([\w\.]+)/i,
          // SouGouBrowser
          /(lbbrowser)/i
          // LieBao Browser
        ],
        [x],
        [
          // WebView
          /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
          // Facebook App for iOS & Android
        ],
        [[x, he], k],
        [
          /safari (line)\/([\w\.]+)/i,
          // Line App for iOS
          /\b(line)\/([\w\.]+)\/iab/i,
          // Line App for Android
          /(chromium|instagram)[\/ ]([-\w\.]+)/i
          // Chromium/Instagram
        ],
        [x, k],
        [
          /\bgsa\/([\w\.]+) .*safari\//i
          // Google Search Appliance on iOS
        ],
        [k, [x, "GSA"]],
        [
          /headlesschrome(?:\/([\w\.]+)| )/i
          // Chrome Headless
        ],
        [k, [x, S + " Headless"]],
        [
          / wv\).+(chrome)\/([\w\.]+)/i
          // Chrome WebView
        ],
        [[x, S + " WebView"], k],
        [
          /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
          // Android Browser
        ],
        [k, [x, "Android " + F]],
        [
          /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
          // Chrome/OmniWeb/Arora/Tizen/Nokia
        ],
        [x, k],
        [
          /version\/([\w\.]+) .*mobile\/\w+ (safari)/i
          // Mobile Safari
        ],
        [k, [x, "Mobile Safari"]],
        [
          /version\/([\w\.]+) .*(mobile ?safari|safari)/i
          // Safari & Safari Mobile
        ],
        [k, x],
        [
          /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
          // Safari < 3.0
        ],
        [x, [k, He, Lt]],
        [
          /(webkit|khtml)\/([\w\.]+)/i
        ],
        [x, k],
        [
          // Gecko based
          /(navigator|netscape\d?)\/([-\w\.]+)/i
          // Netscape
        ],
        [[x, "Netscape"], k],
        [
          /mobile vr; rv:([\w\.]+)\).+firefox/i
          // Firefox Reality
        ],
        [k, [x, U + " Reality"]],
        [
          /ekiohf.+(flow)\/([\w\.]+)/i,
          // Flow
          /(swiftfox)/i,
          // Swiftfox
          /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
          // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
          /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
          // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
          /(firefox)\/([\w\.]+)/i,
          // Other Firefox-based
          /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
          // Mozilla
          // Other
          /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
          // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
          /(links) \(([\w\.]+)/i
          // Links
        ],
        [x, k]
      ],
      cpu: [
        [
          /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
          // AMD64 (x64)
        ],
        [[y, "amd64"]],
        [
          /(ia32(?=;))/i
          // IA32 (quicktime)
        ],
        [[y, Le]],
        [
          /((?:i[346]|x)86)[;\)]/i
          // IA32 (x86)
        ],
        [[y, "ia32"]],
        [
          /\b(aarch64|arm(v?8e?l?|_?64))\b/i
          // ARM64
        ],
        [[y, "arm64"]],
        [
          /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
          // ARMHF
        ],
        [[y, "armhf"]],
        [
          // PocketPC mistakenly identified as PowerPC
          /windows (ce|mobile); ppc;/i
        ],
        [[y, "arm"]],
        [
          /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
          // PowerPC
        ],
        [[y, /ower/, d, Le]],
        [
          /(sun4\w)[;\)]/i
          // SPARC
        ],
        [[y, "sparc"]],
        [
          /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
          // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
        ],
        [[y, Le]]
      ],
      device: [
        [
          //////////////////////////
          // MOBILES & TABLETS
          // Ordered by popularity
          /////////////////////////
          // Samsung
          /\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
        ],
        [m, [E, Z], [g, b]],
        [
          /\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,
          /samsung[- ]([-\w]+)/i,
          /sec-(sgh\w+)/i
        ],
        [m, [E, Z], [g, _]],
        [
          // Apple
          /\((ip(?:hone|od)[\w ]*);/i
          // iPod/iPhone
        ],
        [m, [E, ue], [g, _]],
        [
          /\((ipad);[-\w\),; ]+apple/i,
          // iPad
          /applecoremedia\/[\w\.]+ \((ipad)/i,
          /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
        ],
        [m, [E, ue], [g, b]],
        [
          // Huawei
          /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
        ],
        [m, [E, z], [g, b]],
        [
          /(?:huawei|honor)([-\w ]+)[;\)]/i,
          /\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i
        ],
        [m, [E, z], [g, _]],
        [
          // Xiaomi
          /\b(poco[\w ]+)(?: bui|\))/i,
          // Xiaomi POCO
          /\b; (\w+) build\/hm\1/i,
          // Xiaomi Hongmi 'numeric' models
          /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
          // Xiaomi Hongmi
          /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
          // Xiaomi Redmi
          /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
          // Xiaomi Mi
        ],
        [[m, /_/g, " "], [E, se], [g, _]],
        [
          /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
          // Mi Pad tablets
        ],
        [[m, /_/g, " "], [E, se], [g, b]],
        [
          // OPPO
          /; (\w+) bui.+ oppo/i,
          /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
        ],
        [m, [E, "OPPO"], [g, _]],
        [
          // Vivo
          /vivo (\w+)(?: bui|\))/i,
          /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
        ],
        [m, [E, "Vivo"], [g, _]],
        [
          // Realme
          /\b(rmx[12]\d{3})(?: bui|;|\))/i
        ],
        [m, [E, "Realme"], [g, _]],
        [
          // Motorola
          /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
          /\bmot(?:orola)?[- ](\w*)/i,
          /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
        ],
        [m, [E, M], [g, _]],
        [
          /\b(mz60\d|xoom[2 ]{0,2}) build\//i
        ],
        [m, [E, M], [g, b]],
        [
          // LG
          /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
        ],
        [m, [E, Y], [g, b]],
        [
          /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
          /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
          /\blg-?([\d\w]+) bui/i
        ],
        [m, [E, Y], [g, _]],
        [
          // Lenovo
          /(ideatab[-\w ]+)/i,
          /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
        ],
        [m, [E, "Lenovo"], [g, b]],
        [
          // Nokia
          /(?:maemo|nokia).*(n900|lumia \d+)/i,
          /nokia[-_ ]?([-\w\.]*)/i
        ],
        [[m, /_/g, " "], [E, "Nokia"], [g, _]],
        [
          // Google
          /(pixel c)\b/i
          // Google Pixel C
        ],
        [m, [E, N], [g, b]],
        [
          /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
          // Google Pixel
        ],
        [m, [E, N], [g, _]],
        [
          // Sony
          /droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
        ],
        [m, [E, K], [g, _]],
        [
          /sony tablet [ps]/i,
          /\b(?:sony)?sgp\w+(?: bui|\))/i
        ],
        [[m, "Xperia Tablet"], [E, K], [g, b]],
        [
          // OnePlus
          / (kb2005|in20[12]5|be20[12][59])\b/i,
          /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
        ],
        [m, [E, "OnePlus"], [g, _]],
        [
          // Amazon
          /(alexa)webm/i,
          /(kf[a-z]{2}wi)( bui|\))/i,
          // Kindle Fire without Silk
          /(kf[a-z]+)( bui|\)).+silk\//i
          // Kindle Fire HD
        ],
        [m, [E, Q], [g, b]],
        [
          /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
          // Fire Phone
        ],
        [[m, /(.+)/g, "Fire Phone $1"], [E, Q], [g, _]],
        [
          // BlackBerry
          /(playbook);[-\w\),; ]+(rim)/i
          // BlackBerry PlayBook
        ],
        [m, E, [g, b]],
        [
          /\b((?:bb[a-f]|st[hv])100-\d)/i,
          /\(bb10; (\w+)/i
          // BlackBerry 10
        ],
        [m, [E, j], [g, _]],
        [
          // Asus
          /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
        ],
        [m, [E, de], [g, b]],
        [
          / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
        ],
        [m, [E, de], [g, _]],
        [
          // HTC
          /(nexus 9)/i
          // HTC Nexus 9
        ],
        [m, [E, "HTC"], [g, b]],
        [
          /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
          // HTC
          // ZTE
          /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
          /(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i
          // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
        ],
        [E, [m, /_/g, " "], [g, _]],
        [
          // Acer
          /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
        ],
        [m, [E, "Acer"], [g, b]],
        [
          // Meizu
          /droid.+; (m[1-5] note) bui/i,
          /\bmz-([-\w]{2,})/i
        ],
        [m, [E, "Meizu"], [g, _]],
        [
          // Sharp
          /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
        ],
        [m, [E, "Sharp"], [g, _]],
        [
          // MIXED
          /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,
          // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
          /(hp) ([\w ]+\w)/i,
          // HP iPAQ
          /(asus)-?(\w+)/i,
          // Asus
          /(microsoft); (lumia[\w ]+)/i,
          // Microsoft Lumia
          /(lenovo)[-_ ]?([-\w]+)/i,
          // Lenovo
          /(jolla)/i,
          // Jolla
          /(oppo) ?([\w ]+) bui/i
          // OPPO
        ],
        [E, m, [g, _]],
        [
          /(archos) (gamepad2?)/i,
          // Archos
          /(hp).+(touchpad(?!.+tablet)|tablet)/i,
          // HP TouchPad
          /(kindle)\/([\w\.]+)/i,
          // Kindle
          /(nook)[\w ]+build\/(\w+)/i,
          // Nook
          /(dell) (strea[kpr\d ]*[\dko])/i,
          // Dell Streak
          /(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
          // Le Pan Tablets
          /(trinity)[- ]*(t\d{3}) bui/i,
          // Trinity Tablets
          /(gigaset)[- ]+(q\w{1,9}) bui/i,
          // Gigaset Tablets
          /(vodafone) ([\w ]+)(?:\)| bui)/i
          // Vodafone
        ],
        [E, m, [g, b]],
        [
          /(surface duo)/i
          // Surface Duo
        ],
        [m, [E, C], [g, b]],
        [
          /droid [\d\.]+; (fp\du?)(?: b|\))/i
          // Fairphone
        ],
        [m, [E, "Fairphone"], [g, _]],
        [
          /(u304aa)/i
          // AT&T
        ],
        [m, [E, "AT&T"], [g, _]],
        [
          /\bsie-(\w*)/i
          // Siemens
        ],
        [m, [E, "Siemens"], [g, _]],
        [
          /\b(rct\w+) b/i
          // RCA Tablets
        ],
        [m, [E, "RCA"], [g, b]],
        [
          /\b(venue[\d ]{2,7}) b/i
          // Dell Venue Tablets
        ],
        [m, [E, "Dell"], [g, b]],
        [
          /\b(q(?:mv|ta)\w+) b/i
          // Verizon Tablet
        ],
        [m, [E, "Verizon"], [g, b]],
        [
          /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
          // Barnes & Noble Tablet
        ],
        [m, [E, "Barnes & Noble"], [g, b]],
        [
          /\b(tm\d{3}\w+) b/i
        ],
        [m, [E, "NuVision"], [g, b]],
        [
          /\b(k88) b/i
          // ZTE K Series Tablet
        ],
        [m, [E, "ZTE"], [g, b]],
        [
          /\b(nx\d{3}j) b/i
          // ZTE Nubia
        ],
        [m, [E, "ZTE"], [g, _]],
        [
          /\b(gen\d{3}) b.+49h/i
          // Swiss GEN Mobile
        ],
        [m, [E, "Swiss"], [g, _]],
        [
          /\b(zur\d{3}) b/i
          // Swiss ZUR Tablet
        ],
        [m, [E, "Swiss"], [g, b]],
        [
          /\b((zeki)?tb.*\b) b/i
          // Zeki Tablets
        ],
        [m, [E, "Zeki"], [g, b]],
        [
          /\b([yr]\d{2}) b/i,
          /\b(dragon[- ]+touch |dt)(\w{5}) b/i
          // Dragon Touch Tablet
        ],
        [[E, "Dragon Touch"], m, [g, b]],
        [
          /\b(ns-?\w{0,9}) b/i
          // Insignia Tablets
        ],
        [m, [E, "Insignia"], [g, b]],
        [
          /\b((nxa|next)-?\w{0,9}) b/i
          // NextBook Tablets
        ],
        [m, [E, "NextBook"], [g, b]],
        [
          /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
          // Voice Xtreme Phones
        ],
        [[E, "Voice"], m, [g, _]],
        [
          /\b(lvtel\-)?(v1[12]) b/i
          // LvTel Phones
        ],
        [[E, "LvTel"], m, [g, _]],
        [
          /\b(ph-1) /i
          // Essential PH-1
        ],
        [m, [E, "Essential"], [g, _]],
        [
          /\b(v(100md|700na|7011|917g).*\b) b/i
          // Envizen Tablets
        ],
        [m, [E, "Envizen"], [g, b]],
        [
          /\b(trio[-\w\. ]+) b/i
          // MachSpeed Tablets
        ],
        [m, [E, "MachSpeed"], [g, b]],
        [
          /\btu_(1491) b/i
          // Rotor Tablets
        ],
        [m, [E, "Rotor"], [g, b]],
        [
          /(shield[\w ]+) b/i
          // Nvidia Shield Tablets
        ],
        [m, [E, "Nvidia"], [g, b]],
        [
          /(sprint) (\w+)/i
          // Sprint Phones
        ],
        [E, m, [g, _]],
        [
          /(kin\.[onetw]{3})/i
          // Microsoft Kin
        ],
        [[m, /\./g, " "], [E, C], [g, _]],
        [
          /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
          // Zebra
        ],
        [m, [E, pe], [g, b]],
        [
          /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
        ],
        [m, [E, pe], [g, _]],
        [
          ///////////////////
          // CONSOLES
          ///////////////////
          /(ouya)/i,
          // Ouya
          /(nintendo) ([wids3utch]+)/i
          // Nintendo
        ],
        [E, m, [g, w]],
        [
          /droid.+; (shield) bui/i
          // Nvidia
        ],
        [m, [E, "Nvidia"], [g, w]],
        [
          /(playstation [345portablevi]+)/i
          // Playstation
        ],
        [m, [E, K], [g, w]],
        [
          /\b(xbox(?: one)?(?!; xbox))[\); ]/i
          // Microsoft Xbox
        ],
        [m, [E, C], [g, w]],
        [
          ///////////////////
          // SMARTTVS
          ///////////////////
          /smart-tv.+(samsung)/i
          // Samsung
        ],
        [E, [g, I]],
        [
          /hbbtv.+maple;(\d+)/i
        ],
        [[m, /^/, "SmartTV"], [E, Z], [g, I]],
        [
          /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
          // LG SmartTV
        ],
        [[E, Y], [g, I]],
        [
          /(apple) ?tv/i
          // Apple TV
        ],
        [E, [m, ue + " TV"], [g, I]],
        [
          /crkey/i
          // Google Chromecast
        ],
        [[m, S + "cast"], [E, N], [g, I]],
        [
          /droid.+aft(\w)( bui|\))/i
          // Fire TV
        ],
        [m, [E, Q], [g, I]],
        [
          /\(dtv[\);].+(aquos)/i
          // Sharp
        ],
        [m, [E, "Sharp"], [g, I]],
        [
          /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
          // Roku
          /hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i
          // HbbTV devices
        ],
        [[E, it], [m, it], [g, I]],
        [
          /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
          // SmartTV from Unidentified Vendors
        ],
        [[g, I]],
        [
          ///////////////////
          // WEARABLES
          ///////////////////
          /((pebble))app/i
          // Pebble
        ],
        [E, m, [g, P]],
        [
          /droid.+; (glass) \d/i
          // Google Glass
        ],
        [m, [E, N], [g, P]],
        [
          /droid.+; (wt63?0{2,3})\)/i
        ],
        [m, [E, pe], [g, P]],
        [
          /(quest( 2)?)/i
          // Oculus Quest
        ],
        [m, [E, he], [g, P]],
        [
          ///////////////////
          // EMBEDDED
          ///////////////////
          /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
          // Tesla
        ],
        [E, [g, G]],
        [
          ////////////////////
          // MIXED (GENERIC)
          ///////////////////
          /droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i
          // Android Phones from Unidentified Vendors
        ],
        [m, [g, _]],
        [
          /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
          // Android Tablets from Unidentified Vendors
        ],
        [m, [g, b]],
        [
          /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
          // Unidentifiable Tablet
        ],
        [[g, b]],
        [
          /(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i
          // Unidentifiable Mobile
        ],
        [[g, _]],
        [
          /(android[-\w\. ]{0,9});.+buil/i
          // Generic Android Device
        ],
        [m, [E, "Generic"]]
      ],
      engine: [
        [
          /windows.+ edge\/([\w\.]+)/i
          // EdgeHTML
        ],
        [k, [x, D + "HTML"]],
        [
          /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
          // Blink
        ],
        [k, [x, "Blink"]],
        [
          /(presto)\/([\w\.]+)/i,
          // Presto
          /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
          // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
          /ekioh(flow)\/([\w\.]+)/i,
          // Flow
          /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
          // KHTML/Tasman/Links
          /(icab)[\/ ]([23]\.[\d\.]+)/i
          // iCab
        ],
        [x, k],
        [
          /rv\:([\w\.]{1,9})\b.+(gecko)/i
          // Gecko
        ],
        [k, x]
      ],
      os: [
        [
          // Windows
          /microsoft (windows) (vista|xp)/i
          // Windows (iTunes)
        ],
        [x, k],
        [
          /(windows) nt 6\.2; (arm)/i,
          // Windows RT
          /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,
          // Windows Phone
          /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i
        ],
        [x, [k, He, ce]],
        [
          /(win(?=3|9|n)|win 9x )([nt\d\.]+)/i
        ],
        [[x, "Windows"], [k, He, ce]],
        [
          // iOS/macOS
          /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
          // iOS
          /cfnetwork\/.+darwin/i
        ],
        [[k, /_/g, "."], [x, "iOS"]],
        [
          /(mac os x) ?([\w\. ]*)/i,
          /(macintosh|mac_powerpc\b)(?!.+haiku)/i
          // Mac OS
        ],
        [[x, "Mac OS"], [k, /_/g, "."]],
        [
          // Mobile OSes
          /droid ([\w\.]+)\b.+(android[- ]x86)/i
          // Android-x86
        ],
        [k, x],
        [
          // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
          /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
          /(blackberry)\w*\/([\w\.]*)/i,
          // Blackberry
          /(tizen|kaios)[\/ ]([\w\.]+)/i,
          // Tizen/KaiOS
          /\((series40);/i
          // Series 40
        ],
        [x, k],
        [
          /\(bb(10);/i
          // BlackBerry 10
        ],
        [k, [x, j]],
        [
          /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
          // Symbian
        ],
        [k, [x, "Symbian"]],
        [
          /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
          // Firefox OS
        ],
        [k, [x, U + " OS"]],
        [
          /web0s;.+rt(tv)/i,
          /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
          // WebOS
        ],
        [k, [x, "webOS"]],
        [
          // Google Chromecast
          /crkey\/([\d\.]+)/i
          // Google Chromecast
        ],
        [k, [x, S + "cast"]],
        [
          /(cros) [\w]+ ([\w\.]+\w)/i
          // Chromium OS
        ],
        [[x, "Chromium OS"], k],
        [
          // Console
          /(nintendo|playstation) ([wids345portablevuch]+)/i,
          // Nintendo/Playstation
          /(xbox); +xbox ([^\);]+)/i,
          // Microsoft Xbox (360, One, X, S, Series X, Series S)
          // Other
          /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
          // Joli/Palm
          /(mint)[\/\(\) ]?(\w*)/i,
          // Mint
          /(mageia|vectorlinux)[; ]/i,
          // Mageia/VectorLinux
          /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
          // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
          /(hurd|linux) ?([\w\.]*)/i,
          // Hurd/Linux
          /(gnu) ?([\w\.]*)/i,
          // GNU
          /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
          // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
          /(haiku) (\w+)/i
          // Haiku
        ],
        [x, k],
        [
          /(sunos) ?([\w\.\d]*)/i
          // Solaris
        ],
        [[x, "Solaris"], k],
        [
          /((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
          // Solaris
          /(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
          // AIX
          /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,
          // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
          /(unix) ?([\w\.]*)/i
          // UNIX
        ],
        [x, k]
      ]
    }, Ne = function(oe, le) {
      if (typeof oe === A && (le = oe, oe = s), !(this instanceof Ne))
        return new Ne(oe, le).getResult();
      var ne = oe || (typeof r !== R && r.navigator && r.navigator.userAgent ? r.navigator.userAgent : d), me = le ? we(Ve, le) : Ve;
      return this.getBrowser = function() {
        var ae = {};
        return ae[x] = s, ae[k] = s, fe.call(ae, ne, me.browser), ae.major = Ht(ae.version), ae;
      }, this.getCPU = function() {
        var ae = {};
        return ae[y] = s, fe.call(ae, ne, me.cpu), ae;
      }, this.getDevice = function() {
        var ae = {};
        return ae[E] = s, ae[m] = s, ae[g] = s, fe.call(ae, ne, me.device), ae;
      }, this.getEngine = function() {
        var ae = {};
        return ae[x] = s, ae[k] = s, fe.call(ae, ne, me.engine), ae;
      }, this.getOS = function() {
        var ae = {};
        return ae[x] = s, ae[k] = s, fe.call(ae, ne, me.os), ae;
      }, this.getResult = function() {
        return {
          ua: this.getUA(),
          browser: this.getBrowser(),
          engine: this.getEngine(),
          os: this.getOS(),
          device: this.getDevice(),
          cpu: this.getCPU()
        };
      }, this.getUA = function() {
        return ne;
      }, this.setUA = function(ae) {
        return ne = typeof ae === v && ae.length > H ? it(ae, H) : ae, this;
      }, this.setUA(ne), this;
    };
    Ne.VERSION = l, Ne.BROWSER = ee([x, k, O]), Ne.CPU = ee([y]), Ne.DEVICE = ee([m, E, g, w, _, I, b, P, G]), Ne.ENGINE = Ne.OS = ee([x, k]), t.exports && (e = t.exports = Ne), e.UAParser = Ne;
    var Ue = typeof r !== R && (r.jQuery || r.Zepto);
    if (Ue && !Ue.ua) {
      var ge = new Ne();
      Ue.ua = ge.getResult(), Ue.ua.get = function() {
        return ge.getUA();
      }, Ue.ua.set = function(oe) {
        ge.setUA(oe);
        var le = ge.getResult();
        for (var ne in le)
          Ue.ua[ne] = le[ne];
      };
    }
  })(typeof window == "object" ? window : Du);
})(Yr, Yr.exports);
var cc = Yr.exports;
const dc = /* @__PURE__ */ Ou(cc);
let Gi = 0;
function hc() {
  return Gi = Gi ? Gi + 1 : Date.now(), `c-${Gi}`;
}
const Pt = dc(), ir = Pt.os.name, fc = ir && ir.toLowerCase().indexOf("android") >= 0, Ac = ir && ir.toLowerCase().indexOf("ios") >= 0, ci = Pt.device.type === "mobile" || fc || Ac, Ca = "kwai-p";
let Qr = fa.ERROR;
typeof location < "u" && (Qr = Aa.loadLogLevel("kwai-player-log") || fa.ERROR, Ze.setLevel(Qr).setName(Ca));
const Da = Hu.EventEmitter;
(function() {
  try {
    if (typeof document < "u") {
      var t = document.createElement("style");
      t.appendChild(document.createTextNode("._kwai-player_1ufc0_2{position:relative;margin:0;padding:0}._kwai-player_1ufc0_2 *{margin:0;padding:0}._kwai-player-video-interactive_1ufc0_11{display:block;width:100%;height:100%;position:absolute;top:0;left:0}._kwai-player-poster_1ufc0_19{width:100%;height:100%;position:absolute;left:0;top:0;background-color:#333;background-size:contain;background-position:center;background-repeat:no-repeat}._kwai-player-video_1ufc0_11{display:block;width:100%;height:100%;position:absolute;top:0;left:0}._kwai-player-video_1ufc0_11 video{display:block;width:100%;height:100%}._kwai-player-video_1ufc0_11 canvas{display:block;margin:0 auto;width:100%;height:100%;max-width:100%;max-height:100%;position:relative}._kwai-player-disable-scroll_1ufc0_52{overflow:hidden;height:100%}._kwai-player-yoda_1ufc0_56{display:block;width:100%;height:100%;position:absolute;top:0;left:0}")), document.head.appendChild(t);
    }
  } catch (e) {
    console.error("vite-plugin-css-injected-by-js", e);
  }
})();
var pc = Object.defineProperty, vc = (t, e, r) => e in t ? pc(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, X = (t, e, r) => (vc(t, typeof e != "symbol" ? e + "" : e, r), r), hi = /* @__PURE__ */ ((t) => (t.NONE = "none", t.KWAI = "kwai", t.KWAI2 = "kwai2", t))(hi || {}), Mt = /* @__PURE__ */ ((t) => (t.SYSTEM = "system", t.WINDOW = "window", t))(Mt || {}), Ji = /* @__PURE__ */ ((t) => (t.VIDEO = "video", t.VIDEO_INTERACTIVE = "videoInteractive", t.DEFAULT = "default", t))(Ji || {}), J = /* @__PURE__ */ ((t) => (t.ERROR = "error", t.MANIFEST_PARSED = "manifestparsed", t.LEVEL_SWITCHING = "levelswitching", t.LEVEL_SWITCHED = "levelswitched", t.LEVEL_SWITCH_PLAYING = "levelswitchplaying", t.LEVEL_SWITCH_FAILED = "levelswitchfailed", t.LEVEL_UPDATED = "levelupdated", t.AUDIO_TRACKS_SWITCHING = "audiotrackswitching", t.AUDIO_TRACKS_SWITCHED = "audiotrackswitched", t.LOADSTART = "loadstart", t.PROGRESS = "progress", t.SUSPEND = "suspend", t.ABORT = "abort", t.EMPTIED = "emptied", t.STALLED = "stalled", t.LOADEDMETADATA = "loadedmetadata", t.LOADEDDATA = "loadeddata", t.CANPLAY = "canplay", t.CANPLAYTHROUGH = "canplaythrough", t.PLAYING = "playing", t.WAITING = "waiting", t.SEEKING = "seeking", t.SEEKED = "seeked", t.ENDED = "ended", t.DURATIONCHANGE = "durationchange", t.TIMEUPDATE = "timeupdate", t.PLAY = "play", t.PAUSE = "pause", t.RATECHANGE = "ratechange", t.RESIZE = "resize", t.VOLUMECHANGE = "volumechange", t.ENTER_PICTURE_IN_PICTURE = "enterpictureinpicture", t.LEAVE_PICTURE_IN_PICTURE = "leavepictureinpicture", t.REPORT = "report", t.VIDEO_RENDERER_CHANGE = "videorendererchange", t.FULLSCREEN_CHANGE = "fullscreenchange", t.ATTRIBUTE_CHANGE = "attribute:change", t.INTERACTION = "interaction", t.LIVE_SHIFT_CHANGE = "liveshiftchange", t.LIVE_SHIFT_TYPE_CHANGE = "liveshifttypechange", t.OBJECT_FIT_CHANGE = "objectfitchange", t.ATTRIBUTE_CHANGE_CONFIG = "attribute:change:config", t.ATTRIBUTE_CHANGE_SRC = "attribute:change:src", t.ATTRIBUTE_CHANGE_VIDEO_ID = "attribute:change:videoid", t.ATTRIBUTE_CHANGE_PREVIEW_URL = "attribute:change:previewurl", t.ATTRIBUTE_CHANGE_MASK_URL = "attribute:change:maskurl", t.ATTRIBUTE_CHANGE_CROSS_ORIGIN = "attribute:change:crossorigin", t.ATTRIBUTE_CHANGE_PRELOAD = "attribute:change:preload", t.ATTRIBUTE_CHANGE_CURRENT_TIME = "attribute:change:currenttime", t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE = "attribute:change:defaultplaybackrate", t.ATTRIBUTE_CHANGE_PLAYBACK_RATE = "attribute:change:playbackrate", t.ATTRIBUTE_CHANGE_AUTOPLAY = "attribute:change:autoplay", t.ATTRIBUTE_CHANGE_LOOP = "attribute:change:loop", t.ATTRIBUTE_CHANGE_CONTROLS = "attribute:change:controls", t.ATTRIBUTE_CHANGE_VOLUME = "attribute:change:volume", t.ATTRIBUTE_CHANGE_MUTED = "attribute:change:muted", t.ATTRIBUTE_CHANGE_DEFAULT_MUTED = "attribute:change:defaultmuted", t.ATTRIBUTE_CHANGE_POSTER = "attribute:change:poster", t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE = "attribute:change:disablepictureinpicture", t.ATTRIBUTE_CHANGE_PLAYSINLINE = "attribute:change:playsinline", t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE = "attribute:change:disableadaptive", t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD = "attribute:change:disabledownload", t.ATTRIBUTE_CHANGE_DISABLE_MASK = "attribute:change:disablemask", t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY = "attribute:change:disablehotkey", t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU = "attribute:change:disabledanmaku", t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING = "attribute:change:danmakurendering", t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS = "attribute:change:danmakucontrolspos", t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN = "attribute:change:danmakucontrolsposfullscreen", t.ATTRIBUTE_CHANGE_CURRENT_LEVEL = "attribute:change:currentlevel", t.ATTRIBUTE_CHANGE_NEXT_LEVEL = "attribute:change:nextlevel", t.ATTRIBUTE_CHANGE_CURRENT_FRAME = "attribute:change:currentframe", t.ATTRIBUTE_CHANGE_AUDIO_TRACK = "attribute:change:audiotrack", t.ATTRIBUTE_CHANGE_PREFETCH = "attribute:change:prefetch", t.ATTRIBUTE_CHANGE_SHOW_PROGRESS = "attribute:change:showprogress", t.ATTRIBUTE_CHANGE_SHOW_TIME = "attribute:change:showtime", t.ATTRIBUTE_CHANGE_SHOW_NEXT = "attribute:change:shownext", t.ATTRIBUTE_CHANGE_SHOW_PREV = "attribute:change:showprev", t.ATTRIBUTE_CHANGE_BIZ_DATA = "attribute:change:bizdata", t.ATTRIBUTE_CHANGE_LIVE_TIME = "attribute:change:livetime", t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL = "attribute:change:showinfopanel", t.CLICK_NEXT = "clicknext", t.CLICK_LOGIN = "clicklogin", t.CLICK_REGISTER = "clickregister", t.CLICK_VIP = "clickvip", t))(J || {}), Je = function(t) {
  var e = {};
  function r(s) {
    if (e[s])
      return e[s].exports;
    var l = e[s] = { i: s, l: !1, exports: {} };
    return t[s].call(l.exports, l, l.exports, r), l.l = !0, l.exports;
  }
  return r.m = t, r.c = e, r.d = function(s, l, d) {
    r.o(s, l) || Object.defineProperty(s, l, { enumerable: !0, get: d });
  }, r.r = function(s) {
    typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
  }, r.t = function(s, l) {
    if (1 & l && (s = r(s)), 8 & l || 4 & l && typeof s == "object" && s && s.__esModule)
      return s;
    var d = /* @__PURE__ */ Object.create(null);
    if (r.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & l && typeof s != "string")
      for (var f in s)
        r.d(d, f, function(c) {
          return s[c];
        }.bind(null, f));
    return d;
  }, r.n = function(s) {
    var l = s && s.__esModule ? function() {
      return s.default;
    } : function() {
      return s;
    };
    return r.d(l, "a", l), l;
  }, r.o = function(s, l) {
    return Object.prototype.hasOwnProperty.call(s, l);
  }, r.p = "", r(r.s = 16);
}([function(t, e, r) {
  var s = r(10);
  function l(d, f) {
    for (var c = 0; c < f.length; c++) {
      var R = f[c];
      R.enumerable = R.enumerable || !1, R.configurable = !0, "value" in R && (R.writable = !0), Object.defineProperty(d, s(R.key), R);
    }
  }
  t.exports = function(d, f, c) {
    return f && l(d.prototype, f), c && l(d, c), Object.defineProperty(d, "prototype", { writable: !1 }), d;
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  function r() {
    return t.exports = r = Object.assign ? Object.assign.bind() : function(s) {
      for (var l = 1; l < arguments.length; l++) {
        var d = arguments[l];
        for (var f in d)
          Object.prototype.hasOwnProperty.call(d, f) && (s[f] = d[f]);
      }
      return s;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r.apply(this, arguments);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(12);
  t.exports = function(l, d) {
    l.prototype = Object.create(d.prototype), l.prototype.constructor = l, s(l, d);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  t.exports = void 0;
}, function(t, e, r) {
  var s = r(14), l = r(15), d = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, f = /[\n\r\t]/g, c = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, R = /:\d+$/, A = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, v = /^[a-zA-Z]:/;
  function O(w) {
    return (w || "").toString().replace(d, "");
  }
  var m = [["#", "hash"], ["?", "query"], function(w, _) {
    return E(_.protocol) ? w.replace(/\\/g, "/") : w;
  }, ["/", "pathname"], ["@", "auth", 1], [NaN, "host", void 0, 1, 1], [/:(\d*)$/, "port", void 0, 1], [NaN, "hostname", void 0, 1, 1]], x = { hash: 1, query: 1 };
  function g(w) {
    var _, b = (typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}).location || {}, I = {}, P = typeof (w = w || b);
    if (w.protocol === "blob:")
      I = new y(unescape(w.pathname), {});
    else if (P === "string")
      for (_ in I = new y(w, {}), x)
        delete I[_];
    else if (P === "object") {
      for (_ in w)
        _ in x || (I[_] = w[_]);
      I.slashes === void 0 && (I.slashes = c.test(w.href));
    }
    return I;
  }
  function E(w) {
    return w === "file:" || w === "ftp:" || w === "http:" || w === "https:" || w === "ws:" || w === "wss:";
  }
  function k(w, _) {
    w = (w = O(w)).replace(f, ""), _ = _ || {};
    var b, I = A.exec(w), P = I[1] ? I[1].toLowerCase() : "", G = !!I[2], H = !!I[3], Q = 0;
    return G ? H ? (b = I[2] + I[3] + I[4], Q = I[2].length + I[3].length) : (b = I[2] + I[4], Q = I[2].length) : H ? (b = I[3] + I[4], Q = I[3].length) : b = I[4], P === "file:" ? Q >= 2 && (b = b.slice(2)) : E(P) ? b = I[4] : P ? G && (b = b.slice(2)) : Q >= 2 && E(_.protocol) && (b = I[4]), { protocol: P, slashes: G || E(P), slashesCount: Q, rest: b };
  }
  function y(w, _, b) {
    if (w = (w = O(w)).replace(f, ""), !(this instanceof y))
      return new y(w, _, b);
    var I, P, G, H, Q, ue, de = m.slice(), j = typeof _, F = this, S = 0;
    for (j !== "object" && j !== "string" && (b = _, _ = null), b && typeof b != "function" && (b = l.parse), I = !(P = k(w || "", _ = g(_))).protocol && !P.slashes, F.slashes = P.slashes || I && _.slashes, F.protocol = P.protocol || _.protocol || "", w = P.rest, (P.protocol === "file:" && (P.slashesCount !== 2 || v.test(w)) || !P.slashes && (P.protocol || P.slashesCount < 2 || !E(F.protocol))) && (de[3] = [/(.*)/, "pathname"]); S < de.length; S++)
      typeof (H = de[S]) != "function" ? (G = H[0], ue = H[1], G != G ? F[ue] = w : typeof G == "string" ? ~(Q = G === "@" ? w.lastIndexOf(G) : w.indexOf(G)) && (typeof H[2] == "number" ? (F[ue] = w.slice(0, Q), w = w.slice(Q + H[2])) : (F[ue] = w.slice(Q), w = w.slice(0, Q))) : (Q = G.exec(w)) && (F[ue] = Q[1], w = w.slice(0, Q.index)), F[ue] = F[ue] || I && H[3] && _[ue] || "", H[4] && (F[ue] = F[ue].toLowerCase())) : w = H(w, F);
    b && (F.query = b(F.query)), I && _.slashes && F.pathname.charAt(0) !== "/" && (F.pathname !== "" || _.pathname !== "") && (F.pathname = function(D, U) {
      if (D === "")
        return U;
      for (var N = (U || "/").split("/").slice(0, -1).concat(D.split("/")), z = N.length, Y = N[z - 1], C = !1, M = 0; z--; )
        N[z] === "." ? N.splice(z, 1) : N[z] === ".." ? (N.splice(z, 1), M++) : M && (z === 0 && (C = !0), N.splice(z, 1), M--);
      return C && N.unshift(""), Y !== "." && Y !== ".." || N.push(""), N.join("/");
    }(F.pathname, _.pathname)), F.pathname.charAt(0) !== "/" && E(F.protocol) && (F.pathname = "/" + F.pathname), s(F.port, F.protocol) || (F.host = F.hostname, F.port = ""), F.username = F.password = "", F.auth && (~(Q = F.auth.indexOf(":")) ? (F.username = F.auth.slice(0, Q), F.username = encodeURIComponent(decodeURIComponent(F.username)), F.password = F.auth.slice(Q + 1), F.password = encodeURIComponent(decodeURIComponent(F.password))) : F.username = encodeURIComponent(decodeURIComponent(F.auth)), F.auth = F.password ? F.username + ":" + F.password : F.username), F.origin = F.protocol !== "file:" && E(F.protocol) && F.host ? F.protocol + "//" + F.host : "null", F.href = F.toString();
  }
  y.prototype = { set: function(w, _, b) {
    var I = this;
    switch (w) {
      case "query":
        typeof _ == "string" && _.length && (_ = (b || l.parse)(_)), I[w] = _;
        break;
      case "port":
        I[w] = _, s(_, I.protocol) ? _ && (I.host = I.hostname + ":" + _) : (I.host = I.hostname, I[w] = "");
        break;
      case "hostname":
        I[w] = _, I.port && (_ += ":" + I.port), I.host = _;
        break;
      case "host":
        I[w] = _, R.test(_) ? (_ = _.split(":"), I.port = _.pop(), I.hostname = _.join(":")) : (I.hostname = _, I.port = "");
        break;
      case "protocol":
        I.protocol = _.toLowerCase(), I.slashes = !b;
        break;
      case "pathname":
      case "hash":
        if (_) {
          var P = w === "pathname" ? "/" : "#";
          I[w] = _.charAt(0) !== P ? P + _ : _;
        } else
          I[w] = _;
        break;
      case "username":
      case "password":
        I[w] = encodeURIComponent(_);
        break;
      case "auth":
        var G = _.indexOf(":");
        ~G ? (I.username = _.slice(0, G), I.username = encodeURIComponent(decodeURIComponent(I.username)), I.password = _.slice(G + 1), I.password = encodeURIComponent(decodeURIComponent(I.password))) : I.username = encodeURIComponent(decodeURIComponent(_));
    }
    for (var H = 0; H < m.length; H++) {
      var Q = m[H];
      Q[4] && (I[Q[1]] = I[Q[1]].toLowerCase());
    }
    return I.auth = I.password ? I.username + ":" + I.password : I.username, I.origin = I.protocol !== "file:" && E(I.protocol) && I.host ? I.protocol + "//" + I.host : "null", I.href = I.toString(), I;
  }, toString: function(w) {
    w && typeof w == "function" || (w = l.stringify);
    var _, b = this, I = b.host, P = b.protocol;
    P && P.charAt(P.length - 1) !== ":" && (P += ":");
    var G = P + (b.protocol && b.slashes || E(b.protocol) ? "//" : "");
    return b.username ? (G += b.username, b.password && (G += ":" + b.password), G += "@") : b.password ? (G += ":" + b.password, G += "@") : b.protocol !== "file:" && E(b.protocol) && !I && b.pathname !== "/" && (G += "@"), (I[I.length - 1] === ":" || R.test(b.hostname) && !b.port) && (I += ":"), G += I + b.pathname, (_ = typeof b.query == "object" ? w(b.query) : b.query) && (G += _.charAt(0) !== "?" ? "?" + _ : _), b.hash && (G += b.hash), G;
  } }, y.extractProtocol = k, y.location = g, y.trimLeft = O, y.qs = l, t.exports = y;
}, function(t, e, r) {
  var s, l, d, f, c;
  s = /^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/, l = /^(?=([^\/?#]*))\1([^]*)$/, d = /(?:\/|^)\.(?=\/)/g, f = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g, c = { buildAbsoluteURL: function(R, A, v) {
    if (v = v || {}, R = R.trim(), !(A = A.trim())) {
      if (!v.alwaysNormalize)
        return R;
      var O = c.parseURL(R);
      if (!O)
        throw new Error("Error trying to parse base URL.");
      return O.path = c.normalizePath(O.path), c.buildURLFromParts(O);
    }
    var m = c.parseURL(A);
    if (!m)
      throw new Error("Error trying to parse relative URL.");
    if (m.scheme)
      return v.alwaysNormalize ? (m.path = c.normalizePath(m.path), c.buildURLFromParts(m)) : A;
    var x = c.parseURL(R);
    if (!x)
      throw new Error("Error trying to parse base URL.");
    if (!x.netLoc && x.path && x.path[0] !== "/") {
      var g = l.exec(x.path);
      x.netLoc = g[1], x.path = g[2];
    }
    x.netLoc && !x.path && (x.path = "/");
    var E = { scheme: x.scheme, netLoc: m.netLoc, path: null, params: m.params, query: m.query, fragment: m.fragment };
    if (!m.netLoc && (E.netLoc = x.netLoc, m.path[0] !== "/"))
      if (m.path) {
        var k = x.path, y = k.substring(0, k.lastIndexOf("/") + 1) + m.path;
        E.path = c.normalizePath(y);
      } else
        E.path = x.path, m.params || (E.params = x.params, m.query || (E.query = x.query));
    return E.path === null && (E.path = v.alwaysNormalize ? c.normalizePath(m.path) : m.path), c.buildURLFromParts(E);
  }, parseURL: function(R) {
    var A = s.exec(R);
    return A ? { scheme: A[1] || "", netLoc: A[2] || "", path: A[3] || "", params: A[4] || "", query: A[5] || "", fragment: A[6] || "" } : null;
  }, normalizePath: function(R) {
    for (R = R.split("").reverse().join("").replace(d, ""); R.length !== (R = R.replace(f, "")).length; )
      ;
    return R.split("").reverse().join("");
  }, buildURLFromParts: function(R) {
    return R.scheme + R.netLoc + R.path + R.params + R.query + R.fragment;
  } }, t.exports = c;
}, function(t, e, r) {
  t.exports = function(s) {
    var l = {};
    function d(f) {
      if (l[f])
        return l[f].exports;
      var c = l[f] = { i: f, l: !1, exports: {} };
      return s[f].call(c.exports, c, c.exports, d), c.l = !0, c.exports;
    }
    return d.m = s, d.c = l, d.d = function(f, c, R) {
      d.o(f, c) || Object.defineProperty(f, c, { enumerable: !0, get: R });
    }, d.r = function(f) {
      typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(f, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(f, "__esModule", { value: !0 });
    }, d.t = function(f, c) {
      if (1 & c && (f = d(f)), 8 & c || 4 & c && typeof f == "object" && f && f.__esModule)
        return f;
      var R = /* @__PURE__ */ Object.create(null);
      if (d.r(R), Object.defineProperty(R, "default", { enumerable: !0, value: f }), 2 & c && typeof f != "string")
        for (var A in f)
          d.d(R, A, function(v) {
            return f[v];
          }.bind(null, A));
      return R;
    }, d.n = function(f) {
      var c = f && f.__esModule ? function() {
        return f.default;
      } : function() {
        return f;
      };
      return d.d(c, "a", c), c;
    }, d.o = function(f, c) {
      return Object.prototype.hasOwnProperty.call(f, c);
    }, d.p = "", d(d.s = 4);
  }([function(s, l) {
    function d(f) {
      return s.exports = d = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
        return typeof c;
      } : function(c) {
        return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
      }, s.exports.__esModule = !0, s.exports.default = s.exports, d(f);
    }
    s.exports = d, s.exports.__esModule = !0, s.exports.default = s.exports;
  }, function(s, l, d) {
    var f = d(2);
    function c(R, A) {
      for (var v = 0; v < A.length; v++) {
        var O = A[v];
        O.enumerable = O.enumerable || !1, O.configurable = !0, "value" in O && (O.writable = !0), Object.defineProperty(R, f(O.key), O);
      }
    }
    s.exports = function(R, A, v) {
      return A && c(R.prototype, A), v && c(R, v), Object.defineProperty(R, "prototype", { writable: !1 }), R;
    }, s.exports.__esModule = !0, s.exports.default = s.exports;
  }, function(s, l, d) {
    var f = d(0).default, c = d(3);
    s.exports = function(R) {
      var A = c(R, "string");
      return f(A) == "symbol" ? A : A + "";
    }, s.exports.__esModule = !0, s.exports.default = s.exports;
  }, function(s, l, d) {
    var f = d(0).default;
    s.exports = function(c, R) {
      if (f(c) != "object" || !c)
        return c;
      var A = c[Symbol.toPrimitive];
      if (A !== void 0) {
        var v = A.call(c, R || "default");
        if (f(v) != "object")
          return v;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (R === "string" ? String : Number)(c);
    }, s.exports.__esModule = !0, s.exports.default = s.exports;
  }, function(s, l, d) {
    function f(y, w) {
      console.log("%c " + y + " %c " + w + " %c", "background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px;  color: #fff", "background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0;  color: #fff", "background:transparent");
    }
    d.r(l), d.d(l, "LogLevel", function() {
      return m;
    }), d.d(l, "DefaultLogger", function() {
      return k;
    }), d.d(l, "Logger", function() {
      return E;
    }), d.d(l, "printVersion", function() {
      return f;
    }), d.d(l, "DEFAULT_LOG_LEVEL", function() {
      return x;
    });
    var c = d(1), R = d.n(c), A = function() {
      function y() {
        this.timeout = 6048e5;
      }
      var w = y.prototype;
      return w.write = function(_, b) {
        if (y.available)
          try {
            localStorage.setItem(_, JSON.stringify({ value: b, time: Date.now() }));
          } catch (I) {
          }
      }, w.read = function(_, b) {
        if (b === void 0 && (b = !0), y.available)
          try {
            var I = localStorage.getItem(_);
            if (I) {
              var P = JSON.parse(I), G = P.value, H = P.time, Q = H === void 0 ? 0 : H;
              if (!b || Date.now() - Q < (typeof b == "number" ? b : this.timeout))
                return G;
            }
          } catch (ue) {
          }
      }, R()(y, null, [{ key: "available", get: function() {
        if (y.A === void 0)
          try {
            localStorage.setItem("alg", "test"), y.A = !0;
          } catch (_) {
            y.A = !1;
          }
        return y.A;
      } }]);
    }();
    A.A = void 0;
    var v, O = A, m = function(y) {
      return y.NONE = "none", y.ERROR = "e", y.WARN = "w", y.INFO = "i", y.DEBUG = "d", y.VERBOSE = "v", y;
    }({}), x = m.ERROR, g = ((v = {})[m.NONE] = { value: 1, str: "N" }, v[m.ERROR] = { value: 100, str: "E" }, v[m.WARN] = { value: 200, str: "W" }, v[m.INFO] = { value: 300, str: "I" }, v[m.DEBUG] = { value: 400, str: "D" }, v[m.VERBOSE] = { value: 500, str: "V" }, v), E = function() {
      function y(_) {
        if (this.h = "kwai-v", this.M = x, this._ = -1, this.R = void 0, this.D = "main", typeof location < "u" && location.protocol === "blob:") {
          var b, I = location.href.split("/"), P = (b = I[I.length - 1]) == null ? void 0 : b.match(/(\w+)-/);
          P && (this.D = _ ? _ + "-" + P[1] : P[1]);
        } else
          _ && (this.D = _);
      }
      y.loadLogLevel = function(_, b) {
        if (b === void 0 && (b = !0), location.href) {
          var I = new RegExp(_ + "=([a-z]{1})"), P = location.href.match(I);
          if (P && P.length > 1) {
            var G = P[1];
            if (this.T(G))
              return G;
          }
        }
        var H = new O().read(_, b);
        if (this.T(H))
          return H;
      }, y.saveLogLevel = function(_, b) {
        this.T(b) && new O().write(_, b);
      }, y.T = function(_) {
        return Object.values(m).indexOf(_) !== -1;
      };
      var w = y.prototype;
      return w.setOutput = function(_) {
        return this.R = _, this;
      }, w.setLevel = function(_) {
        return this.M = _, this;
      }, w.setId = function(_) {
        return this._ = _, this;
      }, w.setName = function(_) {
        return this.h = _, this;
      }, w.getLevel = function() {
        return this.M;
      }, w.getOutput = function() {
        return this.R;
      }, w.hasOutput = function() {
        return !!this.R;
      }, w.e = function(_) {
        if (this.S(this.M, m.ERROR)) {
          for (var b = arguments.length, I = new Array(b > 1 ? b - 1 : 0), P = 1; P < b; P++)
            I[P - 1] = arguments[P];
          var G = this.O(m.ERROR, _, I);
          try {
            var H;
            (H = this.R) == null || H.e.apply(H, [G].concat(I));
          } catch (Q) {
          }
        }
      }, w.w = function(_) {
        if (this.S(this.M, m.WARN)) {
          for (var b = arguments.length, I = new Array(b > 1 ? b - 1 : 0), P = 1; P < b; P++)
            I[P - 1] = arguments[P];
          var G = this.O(m.WARN, _, I);
          try {
            var H;
            (H = this.R) == null || H.w.apply(H, [G].concat(I));
          } catch (Q) {
          }
        }
      }, w.i = function(_) {
        if (this.S(this.M, m.INFO)) {
          for (var b = arguments.length, I = new Array(b > 1 ? b - 1 : 0), P = 1; P < b; P++)
            I[P - 1] = arguments[P];
          var G = this.O(m.INFO, _, I);
          try {
            var H;
            (H = this.R) == null || H.i.apply(H, [G].concat(I));
          } catch (Q) {
          }
        }
      }, w.d = function(_) {
        if (this.S(this.M, m.DEBUG)) {
          for (var b = arguments.length, I = new Array(b > 1 ? b - 1 : 0), P = 1; P < b; P++)
            I[P - 1] = arguments[P];
          var G = this.O(m.DEBUG, _, I);
          try {
            var H;
            (H = this.R) == null || H.d.apply(H, [G].concat(I));
          } catch (Q) {
          }
        }
      }, w.v = function(_) {
        if (this.S(this.M, m.VERBOSE)) {
          for (var b = arguments.length, I = new Array(b > 1 ? b - 1 : 0), P = 1; P < b; P++)
            I[P - 1] = arguments[P];
          var G = this.O(m.VERBOSE, _, I);
          try {
            var H;
            (H = this.R) == null || H.v.apply(H, [G].concat(I));
          } catch (Q) {
          }
        }
      }, w.S = function(_, b) {
        return g[_].value >= g[b].value;
      }, w.O = function(_, b, I) {
        var P, G, H = typeof b;
        if (H === "object")
          b = ((G = b) == null ? void 0 : G.constructor.name) || "unknown";
        else if (H === "function") {
          var Q;
          b = ((Q = Object.getOwnPropertyDescriptor(b, "name")) == null ? void 0 : Q.value) || "unknown";
        }
        var ue, de, j = (((P = g[_]) == null ? void 0 : P.str) || "") + "|" + this.h + "[" + (typeof this._ == "function" ? this._() : this._) + "][" + this.D + "]::" + b;
        return _ === m.ERROR ? (ue = console).error.apply(ue, [j].concat(I.slice(0))) : (de = console).log.apply(de, [j].concat(I.slice(0))), j;
      }, y;
    }(), k = new E();
  }]);
}, function(t, e, r) {
  var s, l = typeof Reflect == "object" ? Reflect : null, d = l && typeof l.apply == "function" ? l.apply : function(w, _, b) {
    return Function.prototype.apply.call(w, _, b);
  };
  s = l && typeof l.ownKeys == "function" ? l.ownKeys : Object.getOwnPropertySymbols ? function(w) {
    return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w));
  } : function(w) {
    return Object.getOwnPropertyNames(w);
  };
  var f = Number.isNaN || function(w) {
    return w != w;
  };
  function c() {
    c.init.call(this);
  }
  t.exports = c, t.exports.once = function(w, _) {
    return new Promise(function(b, I) {
      function P(H) {
        w.removeListener(_, G), I(H);
      }
      function G() {
        typeof w.removeListener == "function" && w.removeListener("error", P), b([].slice.call(arguments));
      }
      y(w, _, G, { once: !0 }), _ !== "error" && function(H, Q, ue) {
        typeof H.on == "function" && y(H, "error", Q, ue);
      }(w, P, { once: !0 });
    });
  }, c.EventEmitter = c, c.prototype.C = void 0, c.prototype.L = 0, c.prototype.N = void 0;
  var R = 10;
  function A(w) {
    if (typeof w != "function")
      throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof w);
  }
  function v(w) {
    return w.N === void 0 ? c.defaultMaxListeners : w.N;
  }
  function O(w, _, b, I) {
    var P, G, H, Q;
    if (A(b), (G = w.C) === void 0 ? (G = w.C = /* @__PURE__ */ Object.create(null), w.L = 0) : (G.newListener !== void 0 && (w.emit("newListener", _, b.listener ? b.listener : b), G = w.C), H = G[_]), H === void 0)
      H = G[_] = b, ++w.L;
    else if (typeof H == "function" ? H = G[_] = I ? [b, H] : [H, b] : I ? H.unshift(b) : H.push(b), (P = v(w)) > 0 && H.length > P && !H.warned) {
      H.warned = !0;
      var ue = new Error("Possible EventEmitter memory leak detected. " + H.length + " " + String(_) + " listeners added. Use emitter.setMaxListeners() to increase limit");
      ue.name = "MaxListenersExceededWarning", ue.emitter = w, ue.type = _, ue.count = H.length, Q = ue, console && console.warn && console.warn(Q);
    }
    return w;
  }
  function m() {
    if (!this.fired)
      return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
  }
  function x(w, _, b) {
    var I = { fired: !1, wrapFn: void 0, target: w, type: _, listener: b }, P = m.bind(I);
    return P.listener = b, I.wrapFn = P, P;
  }
  function g(w, _, b) {
    var I = w.C;
    if (I === void 0)
      return [];
    var P = I[_];
    return P === void 0 ? [] : typeof P == "function" ? b ? [P.listener || P] : [P] : b ? function(G) {
      for (var H = new Array(G.length), Q = 0; Q < H.length; ++Q)
        H[Q] = G[Q].listener || G[Q];
      return H;
    }(P) : k(P, P.length);
  }
  function E(w) {
    var _ = this.C;
    if (_ !== void 0) {
      var b = _[w];
      if (typeof b == "function")
        return 1;
      if (b !== void 0)
        return b.length;
    }
    return 0;
  }
  function k(w, _) {
    for (var b = new Array(_), I = 0; I < _; ++I)
      b[I] = w[I];
    return b;
  }
  function y(w, _, b, I) {
    if (typeof w.on == "function")
      I.once ? w.once(_, b) : w.on(_, b);
    else {
      if (typeof w.addEventListener != "function")
        throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof w);
      w.addEventListener(_, function P(G) {
        I.once && w.removeEventListener(_, P), b(G);
      });
    }
  }
  Object.defineProperty(c, "defaultMaxListeners", { enumerable: !0, get: function() {
    return R;
  }, set: function(w) {
    if (typeof w != "number" || w < 0 || f(w))
      throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + w + ".");
    R = w;
  } }), c.init = function() {
    this.C !== void 0 && this.C !== Object.getPrototypeOf(this).C || (this.C = /* @__PURE__ */ Object.create(null), this.L = 0), this.N = this.N || void 0;
  }, c.prototype.setMaxListeners = function(w) {
    if (typeof w != "number" || w < 0 || f(w))
      throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + w + ".");
    return this.N = w, this;
  }, c.prototype.getMaxListeners = function() {
    return v(this);
  }, c.prototype.emit = function(w) {
    for (var _ = [], b = 1; b < arguments.length; b++)
      _.push(arguments[b]);
    var I = w === "error", P = this.C;
    if (P !== void 0)
      I = I && P.error === void 0;
    else if (!I)
      return !1;
    if (I) {
      var G;
      if (_.length > 0 && (G = _[0]), G instanceof Error)
        throw G;
      var H = new Error("Unhandled error." + (G ? " (" + G.message + ")" : ""));
      throw H.context = G, H;
    }
    var Q = P[w];
    if (Q === void 0)
      return !1;
    if (typeof Q == "function")
      d(Q, this, _);
    else {
      var ue = Q.length, de = k(Q, ue);
      for (b = 0; b < ue; ++b)
        d(de[b], this, _);
    }
    return !0;
  }, c.prototype.addListener = function(w, _) {
    return O(this, w, _, !1);
  }, c.prototype.on = c.prototype.addListener, c.prototype.prependListener = function(w, _) {
    return O(this, w, _, !0);
  }, c.prototype.once = function(w, _) {
    return A(_), this.on(w, x(this, w, _)), this;
  }, c.prototype.prependOnceListener = function(w, _) {
    return A(_), this.prependListener(w, x(this, w, _)), this;
  }, c.prototype.removeListener = function(w, _) {
    var b, I, P, G, H;
    if (A(_), (I = this.C) === void 0)
      return this;
    if ((b = I[w]) === void 0)
      return this;
    if (b === _ || b.listener === _)
      --this.L == 0 ? this.C = /* @__PURE__ */ Object.create(null) : (delete I[w], I.removeListener && this.emit("removeListener", w, b.listener || _));
    else if (typeof b != "function") {
      for (P = -1, G = b.length - 1; G >= 0; G--)
        if (b[G] === _ || b[G].listener === _) {
          H = b[G].listener, P = G;
          break;
        }
      if (P < 0)
        return this;
      P === 0 ? b.shift() : function(Q, ue) {
        for (; ue + 1 < Q.length; ue++)
          Q[ue] = Q[ue + 1];
        Q.pop();
      }(b, P), b.length === 1 && (I[w] = b[0]), I.removeListener !== void 0 && this.emit("removeListener", w, H || _);
    }
    return this;
  }, c.prototype.off = c.prototype.removeListener, c.prototype.removeAllListeners = function(w) {
    var _, b, I;
    if ((b = this.C) === void 0)
      return this;
    if (b.removeListener === void 0)
      return arguments.length === 0 ? (this.C = /* @__PURE__ */ Object.create(null), this.L = 0) : b[w] !== void 0 && (--this.L == 0 ? this.C = /* @__PURE__ */ Object.create(null) : delete b[w]), this;
    if (arguments.length === 0) {
      var P, G = Object.keys(b);
      for (I = 0; I < G.length; ++I)
        (P = G[I]) !== "removeListener" && this.removeAllListeners(P);
      return this.removeAllListeners("removeListener"), this.C = /* @__PURE__ */ Object.create(null), this.L = 0, this;
    }
    if (typeof (_ = b[w]) == "function")
      this.removeListener(w, _);
    else if (_ !== void 0)
      for (I = _.length - 1; I >= 0; I--)
        this.removeListener(w, _[I]);
    return this;
  }, c.prototype.listeners = function(w) {
    return g(this, w, !0);
  }, c.prototype.rawListeners = function(w) {
    return g(this, w, !1);
  }, c.listenerCount = function(w, _) {
    return typeof w.listenerCount == "function" ? w.listenerCount(_) : E.call(w, _);
  }, c.prototype.listenerCount = E, c.prototype.eventNames = function() {
    return this.L > 0 ? s(this.C) : [];
  };
}, function(t, e) {
  function r(s) {
    return t.exports = r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
      return typeof l;
    } : function(l) {
      return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r(s);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  function s(A) {
    var v = {};
    function O(x) {
      if (v[x])
        return v[x].exports;
      var g = v[x] = { i: x, l: !1, exports: {} };
      return A[x].call(g.exports, g, g.exports, O), g.l = !0, g.exports;
    }
    O.m = A, O.c = v, O.i = function(x) {
      return x;
    }, O.d = function(x, g, E) {
      O.o(x, g) || Object.defineProperty(x, g, { configurable: !1, enumerable: !0, get: E });
    }, O.r = function(x) {
      Object.defineProperty(x, "__esModule", { value: !0 });
    }, O.n = function(x) {
      var g = x && x.__esModule ? function() {
        return x.default;
      } : function() {
        return x;
      };
      return O.d(g, "a", g), g;
    }, O.o = function(x, g) {
      return Object.prototype.hasOwnProperty.call(x, g);
    }, O.p = "/", O.oe = function(x) {
      throw console.error(x), x;
    };
    var m = O(O.s = ENTRY_MODULE);
    return m.default || m;
  }
  var l = "[\\.|\\-|\\+|\\w|/|@]+", d = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + l + ").*?\\)";
  function f(A) {
    return (A + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
  }
  function c(A, v, O) {
    var m = {};
    m[O] = [];
    var x = v.toString(), g = x.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
    if (!g)
      return m;
    for (var E, k = g[1], y = new RegExp("(\\\\n|\\W)" + f(k) + d, "g"); E = y.exec(x); )
      E[3] !== "dll-reference" && m[O].push(E[3]);
    for (y = new RegExp("\\(" + f(k) + '\\("(dll-reference\\s(' + l + '))"\\)\\)' + d, "g"); E = y.exec(x); )
      A[E[2]] || (m[O].push(E[1]), A[E[2]] = r(E[1]).m), m[E[2]] = m[E[2]] || [], m[E[2]].push(E[4]);
    for (var w, _ = Object.keys(m), b = 0; b < _.length; b++)
      for (var I = 0; I < m[_[b]].length; I++)
        w = m[_[b]][I], isNaN(1 * w) || (m[_[b]][I] = 1 * m[_[b]][I]);
    return m;
  }
  function R(A) {
    return Object.keys(A).reduce(function(v, O) {
      return v || A[O].length > 0;
    }, !1);
  }
  t.exports = function(A, v) {
    v = v || {};
    var O = { main: r.m }, m = v.all ? { main: Object.keys(O.main) } : function(y, w) {
      for (var _ = { main: [w] }, b = { main: [] }, I = { main: {} }; R(_); )
        for (var P = Object.keys(_), G = 0; G < P.length; G++) {
          var H = P[G], Q = _[H].pop();
          if (I[H] = I[H] || {}, !I[H][Q] && y[H][Q]) {
            I[H][Q] = !0, b[H] = b[H] || [], b[H].push(Q);
            for (var ue = c(y, y[H][Q], H), de = Object.keys(ue), j = 0; j < de.length; j++)
              _[de[j]] = _[de[j]] || [], _[de[j]] = _[de[j]].concat(ue[de[j]]);
          }
        }
      return b;
    }(O, A), x = "";
    Object.keys(m).filter(function(y) {
      return y !== "main";
    }).forEach(function(y) {
      for (var w = 0; m[y][w]; )
        w++;
      m[y].push(w), O[y][w] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", x = x + "var " + y + " = (" + s.toString().replace("ENTRY_MODULE", JSON.stringify(w)) + ")({" + m[y].map(function(_) {
        return JSON.stringify(_) + ": " + O[y][_].toString();
      }).join(",") + `});
`;
    }), x = x + "new ((" + s.toString().replace("ENTRY_MODULE", JSON.stringify(A)) + ")({" + m.main.map(function(y) {
      return JSON.stringify(y) + ": " + O.main[y].toString();
    }).join(",") + "}))(self);";
    var g = new window.Blob([x], { type: "text/javascript" });
    if (v.bare)
      return g;
    var E = (window.URL || window.webkitURL || window.mozURL || window.msURL).createObjectURL(g), k = new window.Worker(E);
    return k.objectURL = E, k;
  };
}, function(t, e, r) {
  var s = r(8).default, l = r(11);
  t.exports = function(d) {
    var f = l(d, "string");
    return s(f) === "symbol" ? f : String(f);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(8).default;
  t.exports = function(l, d) {
    if (s(l) !== "object" || l === null)
      return l;
    var f = l[Symbol.toPrimitive];
    if (f !== void 0) {
      var c = f.call(l, d || "default");
      if (s(c) !== "object")
        return c;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (d === "string" ? String : Number)(l);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  function r(s, l) {
    return t.exports = r = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(d, f) {
      return d.__proto__ = f, d;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r(s, l);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  Number.isFinite || (Number.isFinite = function(r) {
    return typeof r == "number" && isFinite(r);
  }), Number.MAX_SAFE_INTEGER || (Number.MAX_SAFE_INTEGER = Math.pow(2, 53) - 1), Object.values || (Object.values = function(r) {
    if (r == null)
      throw new TypeError("Cannot convert undefined or null to object");
    var s = [];
    for (var l in r)
      Object.prototype.hasOwnProperty.call(r, l) && s.push(r[l]);
    return s;
  });
}, function(t, e, r) {
  t.exports = function(s, l) {
    if (l = l.split(":")[0], !(s = +s))
      return !1;
    switch (l) {
      case "http":
      case "ws":
        return s !== 80;
      case "https":
      case "wss":
        return s !== 443;
      case "ftp":
        return s !== 21;
      case "gopher":
        return s !== 70;
      case "file":
        return !1;
    }
    return s !== 0;
  };
}, function(t, e, r) {
  var s = Object.prototype.hasOwnProperty;
  function l(f) {
    try {
      return decodeURIComponent(f.replace(/\+/g, " "));
    } catch (c) {
      return null;
    }
  }
  function d(f) {
    try {
      return encodeURIComponent(f);
    } catch (c) {
      return null;
    }
  }
  e.stringify = function(f, c) {
    c = c || "";
    var R, A, v = [];
    for (A in typeof c != "string" && (c = "?"), f)
      if (s.call(f, A)) {
        if ((R = f[A]) || R != null && !isNaN(R) || (R = ""), A = d(A), R = d(R), A === null || R === null)
          continue;
        v.push(A + "=" + R);
      }
    return v.length ? c + v.join("&") : "";
  }, e.parse = function(f) {
    for (var c, R = /([^=?#&]+)=?([^&]*)/g, A = {}; c = R.exec(f); ) {
      var v = l(c[1]), O = l(c[2]);
      v === null || O === null || v in A || (A[v] = O);
    }
    return A;
  };
}, function(t, e, r) {
  r.r(e), r.d(e, "default", function() {
    return Eo;
  }), r.d(e, "createKernel", function() {
    return pu;
  }), r.d(e, "AbstractDestroyable", function() {
    return S;
  }), r.d(e, "CanvasContextType", function() {
    return g;
  }), r.d(e, "CodecType", function() {
    return v;
  }), r.d(e, "DestroyableList", function() {
    return F;
  }), r.d(e, "Decoder", function() {
    return E;
  }), r.d(e, "DemuxerType", function() {
    return Ve;
  }), r.d(e, "DownloadStatus", function() {
    return gl;
  }), r.d(e, "ErrorDetails", function() {
    return ge;
  }), r.d(e, "ErrorTypes", function() {
    return Ue;
  }), r.d(e, "HttpRangeType", function() {
    return I;
  }), r.d(e, "KEvents", function() {
    return q;
  }), r.d(e, "LiveShiftType", function() {
    return de;
  }), r.d(e, "LogLevel", function() {
    return yi.LogLevel;
  }), r.d(e, "MediaBox", function() {
    return y;
  }), r.d(e, "ReportTypes", function() {
    return ht;
  }), r.d(e, "StereoType", function() {
    return Q;
  }), r.d(e, "VideoDecBlockPolicy", function() {
    return b;
  }), r.d(e, "VideoDropFramePolicy", function() {
    return _;
  }), r.d(e, "VideoRendererType", function() {
    return x;
  }), r.d(e, "WasmDecoder", function() {
    return m;
  });
  var s = r(1), l = r.n(s), d = r(0), f = r.n(d), c = r(2), R = r.n(c), A = (r(13), r(7)), v = function(n) {
    return n.unknown = "unknown", n.h264 = "h264", n.hevc = "hevc", n.av1 = "av1", n.kvc3 = "kvc3", n.kvc4 = "kvc4", n.kvc5 = "kvc5", n.kvc6 = "kvc6", n.aac = "aac", n.mp3 = "mp3", n.opus = "opus", n.yuv = "yuv", n.rawvideo = "rawvideo", n.vvc = "vvc", n.bvc2 = "bvc2", n.kvc30 = "kvc30", n;
  }({}), O = function(n) {
    return n.UNKNOWN = "unknown", n.FHD = "fhd", n.UHD_4K = "4k", n;
  }({}), m = function(n) {
    return n.kvc3 = "kvc3", n.kvc4 = "kvc4", n.kvc5 = "kvc5", n.kvc6 = "kvc6", n.h265 = "h265", n.kw265 = "kw265", n.kvc30 = "kvc30", n;
  }({}), x = function(n) {
    return n.video = "video", n.canvas = "canvas", n;
  }({}), g = function(n) {
    return n.canvas2d = "canvas2d", n.webgl = "webgl", n;
  }({}), E = function(n) {
    return n.buildin = "buildin", n.wasm = "wasm", n.none = "none", n.unsupported = "unsupported", n;
  }({}), k = function(n) {
    return n.KWAI_FLV_ABR = "kwaiFlvAbr", n.KWAI_FLV_MP = "kwaiFlvMultipart", n.KWAI = "kwai", n.FILE = "file", n.OTHERS = "others", n;
  }({}), y = function(n) {
    return n.flv = "flv", n.hls = "hls", n.hls_ts = "hls_ts", n.hls_fmp4 = "hls_fmp4", n.webrtc = "webrtc", n.mp4 = "mp4", n.raw = "raw", n.mp3 = "mp3", n.wav = "wav", n.aac = "aac", n.matroska = "matroska", n.ts = "ts", n.ivf = "ivf", n.yuv = "yuv", n.unknown = "unknown", n;
  }({}), w = function(n) {
    return n.RTC = "rtc_retry", n.BACKUP = "backup", n.FALLBACK = "fallback", n.LOADER = "loader", n;
  }({}), _ = function(n) {
    return n.AUTO = "auto", n.MIN = "min", n;
  }({}), b = function(n) {
    return n.NONE = "none", n.WAITING = "waiting", n;
  }({}), I = function(n) {
    return n.STANDARD = "standard", n.QUERY_START_END = "queryStartEnd", n;
  }({}), P = function(n) {
    return n.MAIN = "main", n.AUDIO = "audio", n.SUBTITLE = "subtitle", n;
  }({}), G = function(n) {
    return n.VIDEO = "video", n.AUDIO = "audio", n;
  }({}), H = function(n) {
    return n.unknown = "unknown", n.native = "native", n.mse = "mse", n.rtc = "rtc", n;
  }({}), Q = function(n) {
    return n[n.Normal = 0] = "Normal", n[n.V360 = 1] = "V360", n[n.V180 = 2] = "V180", n;
  }({}), ue = function(n) {
    return n[n.normal = 0] = "normal", n[n.internal = 1] = "internal", n[n.retry = 2] = "retry", n;
  }({}), de = function(n) {
    return n.NONE = "none", n.KWAI = "kwai", n.KWAI2 = "kwai2", n;
  }({}), j = function(n) {
    return n.UNKNOWN = "", n.PROBABLY = "probably", n;
  }({}), F = function() {
    function n() {
      var a;
      this.I = [], (a = this.I).push.apply(a, arguments);
    }
    var h = n.prototype;
    return h.push = function() {
      var a;
      (a = this.I).push.apply(a, arguments);
    }, h.destroyItem = function(a) {
      for (var i = 0; i < this.I.length; i++)
        if (this.I[i] === a)
          return this.I.splice(i, 1), void a.destroy();
    }, h.destroy = function() {
      for (; this.I.length; ) {
        var a = this.I.shift();
        a && a.destroy();
      }
    }, f()(n, [{ key: "destroyed", get: function() {
      return !!this.I.length;
    } }]);
  }(), S = function() {
    function n() {
      this.F = new F();
    }
    return n.prototype.destroy = function() {
      this.F.destroy();
    }, n;
  }(), D = function(n) {
    return n.LOADER_CONNECT_TIMEOUT = "connectTimeout", n.LOADER_TRANS_TIMEOUT = "transTimeout", n.HANDLING_DATA_ERROR = "handlingDataError", n;
  }({}), U = function(n) {
    return n.XHR_ERROR_NAME = "XHRError", n.FETCH_ERROR_NAME = "FetchError", n.FETCH_READ_ERROR_NAME = "ReadError", n.SLICE_UNPACK_ERROR_NAME = "SliceUnpackError", n;
  }({}), N = function(n) {
    return n.UNKNOWN = "unknown", n.FETCH = "fetch", n.XHR = "xhr", n;
  }({}), z = 255, Y = 20;
  function C(n, h, a) {
    if (n[h] === void 0)
      n[h] = a;
    else {
      var i = n[h];
      Array.isArray(i) ? i.push(a) : typeof i == "string" && (n[h] = [i, a]);
    }
  }
  function M(n) {
    var h = {};
    return typeof n == "string" ? n.trim().split(/[\r\n]+/).forEach(function(a) {
      var i = a.split(": "), o = i.shift(), u = i.join(":");
      o && C(h, o, u);
    }) : n && n.forEach(function(a, i) {
      a.split(",").forEach(function(o) {
        C(h, i, o);
      });
    }), h;
  }
  function B(n) {
    var h = [];
    if (n)
      for (var a in n) {
        var i = n[a];
        i && h.push(a + ": " + (Array.isArray(i) ? i.join(",") : i).slice(0, z));
      }
    if (h.length)
      return h.length > Y ? (h.sort(function(o, u) {
        return Z(u) - Z(o);
      }), h.slice(0, Y)) : h;
  }
  var Z = function(n) {
    return n.toLowerCase().indexOf("kwaisign") === 0 || n.toLowerCase().indexOf("x-ks-") === 0 ? 1 : 0;
  }, K = function(n) {
    return n.MOZ_CHUNK = "moz-chunked-arraybuffer", n.UNKNOW = "unknow", n.UNSUPPORT = "", n;
  }({}), se = function() {
    function n() {
      var a = this;
      this.tag = "xhr", this.B = null, this.j = void 0, this.U = null, this.P = K.UNKNOW, this.V = function() {
        if (a.B) {
          var i = a.B;
          i.readyState === 2 && (a.j.responseUrl = i.responseURL, a.j.responseHeader = M(i.getAllResponseHeaders()), a.U && a.U.onConnect && a.U.onConnect(a.j, i.status), (i.status < 200 || i.status > 299) && a.H());
        }
      }, this.W = function() {
        if (a.B) {
          var i = a.B.response;
          a.U && a.U.onProgress && i && a.U.onProgress(a.j, i);
        }
      }, this.G = function() {
        var i = null, o = a.B;
        !a.P && o && (i = o.response), a.U && a.U.onEnd(a.j, i);
      }, this.H = function() {
        var i;
        if (a.U && a.U.onError) {
          var o = new Error("xhr load error.");
          o.name = U.XHR_ERROR_NAME, a.U.onError(o);
        }
        (i = a.B) == null || i.abort();
      }, this.B = null;
    }
    n.isSupportChunk = function() {
      if (n.Y !== K.UNKNOW)
        return n.Y;
      try {
        var a = new XMLHttpRequest();
        if (a.open("GET", "https://example.com", !0), a.responseType = K.MOZ_CHUNK, a.responseType === K.MOZ_CHUNK)
          return n.Y = K.MOZ_CHUNK, n.Y;
      } catch (i) {
        n.Y = K.UNSUPPORT;
      }
      return K.UNSUPPORT;
    };
    var h = n.prototype;
    return h.load = function(a, i) {
      this.U = i, this.j = a, this.P = K.UNSUPPORT, a.progress && a.responseType === "arraybuffer" && (this.P = n.isSupportChunk());
      var o = this.B = new XMLHttpRequest();
      o.open(a.requestMethod ? a.requestMethod : "GET", this.j.url, !0), this.P === K.MOZ_CHUNK ? (o.responseType = K.MOZ_CHUNK, o.onprogress = this.W, o.onload = this.G) : (o.responseType = a.responseType || "arraybuffer", o.onload = this.G), o.onreadystatechange = this.V, o.onerror = this.H, o.withCredentials = !!a.credentials, a.range && o.setRequestHeader("Range", a.range), a.headers && a.headers.forEach(function(u) {
        o.setRequestHeader(u.header, u.value);
      }), o.send(a.requestBody);
    }, h.abort = function() {
      this.B && (this.B.onreadystatechange = null, this.B.onprogress = null, this.B.onload = null, this.B.onerror = null, this.B.abort(), this.B = null);
    }, h.destroy = function() {
      this.U = null, this.abort();
    }, n;
  }();
  se.Y = K.UNKNOW;
  var pe = [y.hls, y.hls_ts, y.hls_fmp4];
  function he(n) {
    return !!n && pe.indexOf(n) !== -1;
  }
  var we = { version: { major: 0, string: "" } };
  (function(n) {
    if (typeof navigator < "u") {
      n = n ? n.toLowerCase() : navigator.userAgent.toLowerCase();
      var h = /(edge)\/([\w.]+)/.exec(n) || /(edg)\/([\w.]+)/.exec(n) || /(opr)[/]([\w.]+)/.exec(n) || /(chrome)[ /]([\w.]+)/.exec(n) || /(iemobile)[/]([\w.]+)/.exec(n) || /(version)(applewebkit)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(n) || /(webkit)[ /]([\w.]+).*(version)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(n) || /(webkit)[ /]([\w.]+)/.exec(n) || /(opera)(?:.*version|)[ /]([\w.]+)/.exec(n) || /(msie) ([\w.]+)/.exec(n) || n.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(n) || n.indexOf("compatible") < 0 && /(firefox)[ /]([\w.]+)/.exec(n) || [], a = /(ipad)/.exec(n) || /(ipod)/.exec(n) || /(windows phone)/.exec(n) || /(iphone)/.exec(n) || /(kindle)/.exec(n) || /(android)/.exec(n) || /(windows)/.exec(n) || /(mac)/.exec(n) || /(linux)/.exec(n) || /(cros)/.exec(n) || [], i = /(?:iphone|ipad|cpu) os (\d+)[._]\d+/.exec(n) || /android ([\d.]+)/.exec(n) || [], o = { browser: h[5] || h[3] || h[1] || "", version: h[2] || h[4] || "0", majorVersion: h[4] || h[2] || "0", platform: a[0] || "", platformVersion: i[1] || "" }, u = { x5: / tbs\//.test(n), xweb: / xweb\//.test(n), version: { major: 0, string: "" } };
      if (o.browser) {
        u[o.browser] = !0;
        var p = o.majorVersion.split(".");
        u.version = { major: parseInt(o.majorVersion, 10), string: o.version }, p.length > 1 && (u.version.minor = parseInt(p[1], 10)), p.length > 2 && (u.version.build = parseInt(p[2], 10));
      }
      if (o.platform && (u[o.platform] = !0), (u.chrome || u.opr || u.safari) && (u.webkit = !0), u.rv || u.iemobile) {
        u.rv && delete u.rv;
        var T = "msie";
        o.browser = T, u[T] = !0;
      }
      if (u.edg || u.edge) {
        delete u.edg, delete u.edge;
        var L = "msedge";
        o.browser = L, u[L] = !0;
      }
      if (u.opr) {
        var V = "opera";
        o.browser = V, u[V] = !0;
      }
      if (u.safari && u.android) {
        var W = "android";
        o.browser = W, u[W] = !0;
      }
      if (u.android) {
        var $ = n.match(/android[\s0-9.]+;([\w\s-]+)(build)?/);
        if ($)
          try {
            var te;
            u.model = (te = $[1].split("build")[0]) == null ? void 0 : te.trim();
          } catch (ie) {
          }
      } else
        u.ipad ? u.model = "ipad" : u.iphone && (u.model = "iphone");
      for (var be in (u.android || u.iphone || u.ipad) && (u.mobile = !0), u.ios = u.iphone || u.ipad, u.name = o.browser, u.platform = o.platform, u.platformVersion = o.platformVersion, we)
        Object.prototype.hasOwnProperty.call(we, be) && delete we[be];
      l()(we, u);
    }
  })();
  var ee = we;
  function je(n, h) {
    var a = n.toString();
    return a.toLowerCase().indexOf("[native code]") !== -1 && a.indexOf(h) !== -1 ? j.UNKNOWN : j.PROBABLY;
  }
  var Le = function() {
    function n(a) {
      this.tag = "fetch", this.J = void 0, this.j = void 0, this.U = null, this.Z = null, this.K = null, this.q = !1, this.J = a;
    }
    n.isSupported = function() {
      return typeof fetch < "u" && typeof ReadableStream < "u";
    };
    var h = n.prototype;
    return h.load = function(a, i) {
      var o = this;
      this.j = a, this.U = i;
      var u = new Headers();
      a.headers && a.headers.forEach(function(V) {
        u.append(V.header, V.value);
      }), a.range && u.append("Range", a.range);
      var p = { method: a.requestMethod ? a.requestMethod : "GET", headers: u, mode: "cors", cache: "default", referrerPolicy: "no-referrer-when-downgrade", signal: this.X() };
      a.requestBody && (p.body = a.requestBody), a.credentials && (p.credentials = "include");
      var T = fetch;
      if (a.preferNative === !0) {
        var L = this.$();
        T = L.func, a.monkeyPatched = L.patched, a.useResetNativeFetch = L == null ? void 0 : L.resetNativeFetch;
      } else
        a.monkeyPatched = je(T, "fetch");
      T(a.url, p).then(function(V) {
        if (a.responseUrl = V.url, a.redirected = V.redirected, a.responseHeader = M(V.headers), o.U && o.U.onConnect && o.U.onConnect(a, V.status), V.ok)
          return o.q ? void (V.body && V.body.getReader().cancel().catch(function($) {
            return o.J.i(o.tag, $);
          })) : a.responseType === "arraybuffer" ? a.progress ? void (V.body && (o.K = V.body.getReader(), o.tt(o.K))) : void V.arrayBuffer().then(function($) {
            o.it(a, $);
          }).catch(function($) {
            if (!o.q) {
              var te = new Error("arraybuffer error. " + V.status + " " + $);
              te.name = U.FETCH_ERROR_NAME, o.H(te);
            }
          }) : void V.text().then(function($) {
            o.it(a, $);
          }).catch(function($) {
            if (!o.q) {
              var te = new Error("text error. " + V.status + " " + $);
              te.name = U.FETCH_ERROR_NAME, o.H(te);
            }
          });
        var W = new Error("res not ok. " + V.status + " " + V.statusText);
        W.name = U.FETCH_ERROR_NAME, o.H(W);
      }).catch(function(V) {
        V.name !== "AbortError" && o.H(V);
      });
    }, h.abort = function() {
      this.Z && (this.Z.abort(), this.Z = null), this.K && (this.K.cancel().catch(function() {
      }), this.K = null), this.q = !0;
    }, h.destroy = function() {
      this.U = null, this.abort();
    }, h.W = function(a, i) {
      this.U && this.U.onProgress && this.U.onProgress(a, i);
    }, h.it = function(a, i) {
      this.U && this.U.onEnd && (this.K = null, this.Z = null, this.U.onEnd(a, i));
    }, h.H = function(a) {
      this.U && this.U.onError && this.U.onError(a);
    }, h.tt = function(a) {
      var i = this;
      a.read().then(function(o) {
        if (i.q)
          return a.cancel(), null;
        if (o.done)
          return i.it(i.j, null), null;
        var u = o.value.buffer;
        return i.j.useResetNativeFetch && ee.safari && (u = new Uint8Array(new Uint8Array(u).subarray()).buffer), i.W(i.j, u), i.tt(a);
      }).catch(function(o) {
        o.name !== "AbortError" && (o.name = U.FETCH_READ_ERROR_NAME, i.H(o));
      });
    }, h.X = function() {
      try {
        if (AbortController)
          return this.Z = new AbortController(), this.Z.signal;
      } catch (a) {
        return null;
      }
      return null;
    }, h.$ = function() {
      if (n.et !== void 0)
        return n.et;
      if (je(fetch, "fetch") === j.PROBABLY) {
        var a = function(i) {
          var o, u, p = document.createElement("iframe");
          document.body.appendChild(p);
          var T = (o = ((u = p.contentWindow) == null ? void 0 : u.fetch) || null) == null ? void 0 : o.bind(i);
          return document.body.removeChild(p), T;
        }(window);
        this.J.i(this.tag, "detected io monkey patched. get native io, fetch: " + !!a), n.et = a ? { func: a, patched: j.PROBABLY, resetNativeFetch: !0 } : { func: fetch, patched: j.PROBABLY, resetNativeFetch: !1 };
      } else
        n.et = { func: fetch, patched: j.UNKNOWN, resetNativeFetch: !1 };
      return n.et;
    }, n;
  }();
  Le.et = void 0;
  var Ht = r(3), it = r.n(Ht), fe = 536870912, He = { alwaysSeekKeyframe: !1, lazyLoadMaxDuration: -1, lazyLoadRecoverDuration: 20, webWorker: !0, appendErrorMaxRetry: 3, credentials: !1, streamingMux: !0, autoPlaybackRate: !0, autoPlaybackRateConf: void 0, enableSoftwareAES: !0, startPlayBufferSec: 0, startFromSec: -1, startFromKeyframe: !0, defaultSpts: -5e3, resourceBuffer: !0, resourceBufferSize: 500, ntp: !0, ensureVideo: !1, adaptive: !0, abrSpeedTest: !0, httpRangeType: I.STANDARD, enableAacPriv: !1, mseDecErrSkip: 2, maxAudioFramesDrift: 5, forceKeyFrameOnDiscontinuity: !1, videoDropFramePolicy: _.AUTO, videoDecBlockPolicy: b.WAITING, videoFrameBufferSize: fe, maxVideoDecThreads: 8, mainThreadRendering: !1, mainThreadDecoding: !1, wasmDecoderEnabled: !ee.mobile, maxRetry: 3, connectionTimeout: 1e4, transmissionTimeout: 3e4, retryDelay: 100, maxFragFailSec: 11, flvLoadEndError: !0, catchUpPausedLive: !0, breakpointContinuation: !0, manifestLoadingMaxRetry: 3, manifestConnectionTimeout: 1e4, manifestTransmissionTimeout: 1e4, manifestLoadingRetryDelay: 1, levelLoadingMaxRetry: 3, levelConnectionTimeout: 1e4, levelTransmissionTimeout: 1e4, levelLoadingRetryDelay: 100, levelNoUpdateRetry: 10, emeEnabled: !0, widevineLicenseUrl: "", playreadyLicenseUrl: "", fairplayLicenseUrl: "", keyLoadingMaxRetry: 3, keyConnectionTimeout: 1e4, keyTransmissionTimeout: 5e3, keyLoadingRetryDelay: 300, sdpConnectionTimeout: 1e4, peerConnectionTimeout: 1e4, peerConnectionMaxRetry: 5, peerConnectionRetryDelay: 3e3, decLibLoadingMaxRetry: 2, decLibConnectionTimeout: 5e3, decLibLoadingRetryDelay: 300, liveDelayFragNum: 3, liveShiftDelaySec: 60, liveShiftType: de.NONE, preferNativeLoader: void 0, playbackAbilityCacheTimeout: 864e5, adjustFragTime: !0 }, Lt = { maxRetry: 1, retryDelay: 100, connectionTimeout: 1e4, levelConnectionTimeout: 1e4, manifestConnectionTimeout: 1e4 }, ce = function() {
    function n() {
    }
    return n.isStreamingSupported = function() {
      return n.nt === void 0 && (n.nt = Le.isSupported() || !!se.isSupportChunk()), n.nt;
    }, n.processConfig = function(h) {
      if (h) {
        var a = h.src, i = h.preprocessUrl, o = h.logger;
        h = l()(JSON.parse(JSON.stringify(h)), { src: a, preprocessUrl: i, logger: o });
      }
      h.isLive ? He.videoFrameBufferSize = 104857600 : He.videoFrameBufferSize = fe;
      var u = he(h.box) ? l()({}, He, Lt) : l()({}, He);
      return l()(u, h), u.wasmDecoderEnabled = u.wasmDecoderEnabled && !!it.a, u.startPlayBufferSec = Math.min(5, Math.max(0, u.startPlayBufferSec)), this.rt(u), Worker || (u.webWorker = !1), u;
    }, n.rt = function(h) {
      var a = h.autoPlaybackRateConf;
      if (a) {
        var i = a.rule;
        if (i && Array.isArray(i) && ((i = i.filter(function(o) {
          return o.upper > o.lower && o.rate > 0;
        })).sort(function(o, u) {
          return u.rate - o.rate;
        }), i.length > 1))
          return a.rule = i, void (h.autoPlaybackRateConf = a);
      }
    }, n;
  }();
  ce.nt = void 0;
  var Ve = function(n) {
    return n.UNKNOWN = "unknown", n.FLV = "flv", n.FMP4 = "fmp4", n.TS = "ts", n.MP4 = "mp4", n.RAW = "raw", n.IVF = "ivf", n.YUV = "yuv", n;
  }({}), Ne = function(n) {
    return n.MANIFEST = "manifest", n.LEVEL = "level", n.AUDIO_TRACK = "audioTrack", n.SUBTITLE_TRACK = "subtitleTrack", n;
  }({}), Ue = function(n) {
    return n.NETWORK_ERROR = "networkError", n.MEDIA_ERROR = "mediaError", n.KEY_SYSTEM_ERROR = "keySystemError", n.MUX_ERROR = "muxError", n.OTHER_ERROR = "otherError", n.MSE_ERROR = "mseError", n.DECODER_ERROR = "decoderError", n.RENDERER_ERROR = "rendererError", n;
  }({}), ge = function(n) {
    return n[n.LOAD_ERROR = 10] = "LOAD_ERROR", n[n.MANIFEST_LOAD_ERROR = 11] = "MANIFEST_LOAD_ERROR", n[n.LEVEL_LOAD_ERROR = 12] = "LEVEL_LOAD_ERROR", n[n.AUDIO_TRACK_LOAD_ERROR = 13] = "AUDIO_TRACK_LOAD_ERROR", n[n.KEY_LOAD_ERROR = 14] = "KEY_LOAD_ERROR", n[n.KEY_SYSTEM_LICENSE_REQUEST_FAILED = 15] = "KEY_SYSTEM_LICENSE_REQUEST_FAILED", n[n.DEC_LIB_LOAD_ERROR = 16] = "DEC_LIB_LOAD_ERROR", n[n.RTC_SDP_LOAD_ERROR = 17] = "RTC_SDP_LOAD_ERROR", n[n.SUBTITLE_TRACK_LOAD_ERROR = 18] = "SUBTITLE_TRACK_LOAD_ERROR", n[n.CANNOT_SEEK = 100] = "CANNOT_SEEK", n[n.VIDEO_ERROR = 101] = "VIDEO_ERROR", n[n.UNSUPPORTED = 102] = "UNSUPPORTED", n[n.CONFIG_ERROR = 103] = "CONFIG_ERROR", n[n.OTHER = 104] = "OTHER", n[n.UNKNOWN = 105] = "UNKNOWN", n[n.CANNOT_SEEK_BY_FRAME_INDEX = 106] = "CANNOT_SEEK_BY_FRAME_INDEX", n[n.SRC_EMPTY = 107] = "SRC_EMPTY", n[n.VIDEO_NO_SIZE = 108] = "VIDEO_NO_SIZE", n[n.NO_TRACKS_AVAILABLE = 109] = "NO_TRACKS_AVAILABLE", n[n.VIDEO_ERROR_1 = 111] = "VIDEO_ERROR_1", n[n.VIDEO_ERROR_2 = 112] = "VIDEO_ERROR_2", n[n.VIDEO_ERROR_3 = 113] = "VIDEO_ERROR_3", n[n.VIDEO_ERROR_4 = 114] = "VIDEO_ERROR_4", n[n.MEDIASOURCE_ERROR = 200] = "MEDIASOURCE_ERROR", n[n.ADDSOURCEBUFFER_ERROR = 201] = "ADDSOURCEBUFFER_ERROR", n[n.SOURCEBUFFER_ERROR = 202] = "SOURCEBUFFER_ERROR", n[n.ENDOFSTREAM_ERROR = 203] = "ENDOFSTREAM_ERROR", n[n.APPENDBUFFER_ERROR = 204] = "APPENDBUFFER_ERROR", n[n.CHANGETYPE_ERROR = 205] = "CHANGETYPE_ERROR", n[n.MSE_CAPABILITY_ERROR = 206] = "MSE_CAPABILITY_ERROR", n[n.MSE_SOURCE_BUFFER_CLOSE_ERROR = 207] = "MSE_SOURCE_BUFFER_CLOSE_ERROR", n[n.PARSING_ERROR = 301] = "PARSING_ERROR", n[n.REMUX_ERROR = 302] = "REMUX_ERROR", n[n.REMUX_ALLOC_ERROR = 303] = "REMUX_ALLOC_ERROR", n[n.REMUX_WORKER_ERROR = 304] = "REMUX_WORKER_ERROR", n[n.DEMUX_NOT_FOUND = 305] = "DEMUX_NOT_FOUND", n[n.MANIFEST_PARSING_ERROR = 400] = "MANIFEST_PARSING_ERROR", n[n.LEVEL_NO_UPDATE_ERROR = 402] = "LEVEL_NO_UPDATE_ERROR", n[n.KEY_SYSTEM_NO_ACCESS = 500] = "KEY_SYSTEM_NO_ACCESS", n[n.KEY_SYSTEM_NO_SESSION = 501] = "KEY_SYSTEM_NO_SESSION", n[n.KEY_SYSTEM_URL_ERROR = 502] = "KEY_SYSTEM_URL_ERROR", n[n.KEY_SYSTEM_NO_KEYS = 505] = "KEY_SYSTEM_NO_KEYS", n[n.FRAG_DECRYPT_ERROR = 506] = "FRAG_DECRYPT_ERROR", n[n.KEY_SYSTEM_NO_INIT_DATA = 507] = "KEY_SYSTEM_NO_INIT_DATA", n[n.KEY_SYSTEM_UNSUPPORTED = 508] = "KEY_SYSTEM_UNSUPPORTED", n[n.DECODER_LOAD_ERROR = 600] = "DECODER_LOAD_ERROR", n[n.DECODER_INIT_ERROR = 601] = "DECODER_INIT_ERROR", n[n.DECODER_DRAW_ERROR = 602] = "DECODER_DRAW_ERROR", n[n.DECODER_WEBGL_ERROR = 603] = "DECODER_WEBGL_ERROR", n[n.DECODER_UNSUPPORTED = 604] = "DECODER_UNSUPPORTED", n[n.DECODER_COPY_YUV_ERROR = 605] = "DECODER_COPY_YUV_ERROR", n[n.DECODER_DEC_ERROR = 606] = "DECODER_DEC_ERROR", n[n.DECODER_2D_ERROR = 607] = "DECODER_2D_ERROR", n[n.SCREENSHOT_INIT_ERROR = 700] = "SCREENSHOT_INIT_ERROR", n[n.SCREENSHOT_EMPTY_DATA_ERROR = 701] = "SCREENSHOT_EMPTY_DATA_ERROR", n[n.SCREENSHOT_CREATE_IMG_ERROR = 702] = "SCREENSHOT_CREATE_IMG_ERROR", n[n.LIVE_DISCONNECTED_ERROR = 1009] = "LIVE_DISCONNECTED_ERROR", n[n.WEBRTC_DISCONNECTED_ERROR = 1010] = "WEBRTC_DISCONNECTED_ERROR", n[n.WEBRTC_FAILED_ERROR = 1011] = "WEBRTC_FAILED_ERROR", n[n.WEBRTC_CLOSED_ERROR = 1012] = "WEBRTC_CLOSED_ERROR", n[n.WEBRTC_ICE_CANDIDATE_ERROR = 1013] = "WEBRTC_ICE_CANDIDATE_ERROR", n[n.WEBRTC_ICE_CONNECTION_ERROR = 1014] = "WEBRTC_ICE_CONNECTION_ERROR", n[n.WEBRTC_OFFER_ERROR = 1015] = "WEBRTC_OFFER_ERROR", n[n.WEBRTC_ANSWER_ERROR = 1016] = "WEBRTC_ANSWER_ERROR", n[n.WEBRTC_TRANSMISSION_DATA_NULL = 1017] = "WEBRTC_TRANSMISSION_DATA_NULL", n[n.WEBRTC_CONNECT_TIMEOUT = 1018] = "WEBRTC_CONNECT_TIMEOUT", n[n.WEBRTC_CONNECT_FAILED = 1019] = "WEBRTC_CONNECT_FAILED", n;
  }({}), oe = [ge.VIDEO_ERROR, ge.VIDEO_ERROR_1, ge.VIDEO_ERROR_2, ge.VIDEO_ERROR_3, ge.VIDEO_ERROR_4];
  function le(n, h, a, i) {
    var o = { type: n, details: h, code: 0, fatal: !0, reason: a };
    if (i)
      for (var u in i) {
        var p = i[u];
        p !== void 0 && (o[u] = p);
      }
    return o;
  }
  var ne = { other4xx: "05", serverError: "06", timeoutOpen: "07", timeoutIO: "08", handlingDataError: "10", other: "99" }, me = { 400: "01", 401: "02", 403: "03", 404: "04", 200: "09", 206: "09" };
  function ae(n, h, a) {
    if (a === void 0 && (a = 0), n >= 100)
      return n;
    var i = "00";
    return function(o) {
      return o.indexOf(D.LOADER_CONNECT_TIMEOUT) >= 0;
    }(h) ? i = ne.timeoutOpen : function(o) {
      return o.indexOf(D.LOADER_TRANS_TIMEOUT) >= 0;
    }(h) ? i = ne.timeoutIO : function(o) {
      return o.indexOf(D.HANDLING_DATA_ERROR) >= 0;
    }(h) ? i = ne.handlingDataError : Object.prototype.hasOwnProperty.call(me, a) ? i = a !== 200 && a !== 206 || !h ? me[a] || "00" : ne.other : /^4\d{2}$/.test(a.toString()) ? i = ne.other4xx : /^5\d{2}$/.test(a.toString()) && (i = ne.serverError), parseInt(n + i, 10);
  }
  var wt = /\.[^./\\?#]+(?=$|[?#])/i, Ae = { ".mp4": y.mp4, ".m4s": y.mp4, ".mov": y.mp4, ".m4a": y.mp4, ".flv": y.flv, ".m3u8": y.hls, ".sdp": y.webrtc, ".webm": y.matroska, ".mkv": y.matroska, ".mka": y.matroska, ".mp3": y.mp3, ".wav": y.wav, ".aac": y.aac, ".ts": y.ts, ".yuv": y.yuv, ".slice": y.flv };
  function et(n) {
    var h = function(a) {
      var i = a.toLocaleLowerCase().match(wt);
      return i ? i[0] : "";
    }(n);
    return h && Ae[h] || y.unknown;
  }
  var $e = r(4), Tt = r.n($e), Xt = /^[^_][A-Za-z0-9_-]*$/, vl = /_([A-Za-z0-9]+)_/;
  function _l(n) {
    var h = new Tt.a(n).pathname, a = et(n), i = a === y.flv || he(a) || a === y.ts, o = "", u = "", p = h.split("/"), T = p[p.length - 1] || "";
    if (i) {
      try {
        var L = h.lastIndexOf("/");
        L >= 0 && (h = h.slice(L + 1));
        var V = h.split(".")[0].split("_");
        V.length === 1 ? (o = si(V[0]), u = En(n)) : V.length === 2 ? (o = si(V[0]), u = si(V[1])) : V.length > 2 && (o = si(V.slice(0, V.length - 1).join("_")), u = si(V[V.length - 1]));
      } catch (W) {
      }
      return { streamID: o, transcodingTpl: u, filename: T };
    }
    return { streamID: "", transcodingTpl: En(n), filename: T };
  }
  var En = function(n) {
    var h = n.match(vl), a = "";
    return h != null && h.length && h.length > 1 && (a = h[1]), si(a);
  }, si = function(n) {
    return Xt.test(n) ? n : "";
  };
  function ml(n) {
    var h;
    performance.addEventListener && (h = n, performance && (typeof performance.setResourceTimingBufferSize == "function" ? performance.setResourceTimingBufferSize(h) : typeof performance.webkitSetResourceTimingBufferSize == "function" && performance.webkitSetResourceTimingBufferSize(h)), performance.addEventListener("resourcetimingbufferfull", wn));
  }
  var Mi, wn = function() {
    performance && (typeof performance.clearResourceTimings == "function" ? performance.clearResourceTimings() : typeof performance.webkitClearResourceTimings == "function" && performance.webkitClearResourceTimings());
  }, gl = function(n) {
    return n.FAIL = "FAIL", n.ABORT = "ABORT", n.SUCCESS = "SUCCESS", n.CONNECTED = "CONNECTED", n;
  }({});
  (Mi = {})[Ne.MANIFEST] = ge.MANIFEST_LOAD_ERROR, Mi[Ne.LEVEL] = ge.LEVEL_LOAD_ERROR, Mi[Ne.AUDIO_TRACK] = ge.AUDIO_TRACK_LOAD_ERROR, Mi[Ne.SUBTITLE_TRACK] = ge.SUBTITLE_TRACK_LOAD_ERROR;
  var Ni, rt, vr, Tn = function(n) {
    return n.METADATA = "metadata", n.MEDIA_INFO = "mediaInfo", n.PARSING_INIT_SEGMENT = "parsingInitSegment", n.PARSING_DATA = "parsingData", n.PARSED_DATA = "parsedData", n.SCRIPT_PARSED = "scriptParsed", n.KEY_FRAME_INDEXS = "keyFrameIndexs", n.VIDEO_FRAME_INFO = "videoFrameInfo", n.DISCONTINUITY = "discontinuity", n.REPORT = "report", n.LOAD_END = "loadEnd", n.ERROR = "error", n.MANIFEST_LOADED = "manifestLoaded", n.MANIFEST_PARSED = "manifestParsed", n.LEVEL_SWITCHING = "levelSwitching", n.LEVEL_SWITCHED = "levelSwitched", n.LEVEL_SWITCH_PLAYING = "levelSwitchPlaying", n.LEVEL_SWITCH_FAILED = "levelSwitchFailed", n.LEVEL_LOADED = "levelLoaded", n.LEVEL_UPDATED = "levelUpdated", n.AUDIO_TRACK_SWITCHING = "audioTrackSwitching", n.AUDIO_TRACK_SWITCHED = "audioTrackSwitched", n.AUDIO_TRACK_UPDATED = "audioTrackUpdated", n.AUDIO_TRACK_SWITCH_FAILED = "audioTrackSwitchFailed", n.HLS_MANIFEST_PARSED = "hlsManifestParsed", n.HLS_KEY_LOADED = "hlsKeyLoaded", n.AUDIO_TRACK_LOADED = "audioLoaded", n.SUBTITLE_TRACK_LOADED = "subtitleTrackLoaded", n.SUBTITLE_LOADED = "subtitleLoaded", n.SUBTITLE_TRACK_SWITCHED = "subtitleTrackSwitched", n.SUBTITLE_TRACK_UPDATED = "subtitleTrackUpdated", n.BUFFER_CLEANING = "bufferCleaning", n.VIDEO_SEEK = "vdeoSeek", n.ABR_NEXT = "abrNext", n.PRIV_NAL = "privNal", n.SEI = "sei", n.AAC_PRIV = "aacPriv", n.RAW_DATA = "rawData", n.MP4_NOT_FASTSTART = "mp4NotFaststart", n.VIDEO_CODEC_DETECTED = "videoCodecChange", n.H265_DETECTED = "h265Detected", n.VIDEO_RENDERER_CHANGE = "videoRendererChange", n.DEC_LIB_LOADED = "decLibLoaded", n.DEC_INIT_COMPLETE = "decoderInitComplete", n.DEC_VIDEO_READY = "decVideoReady", n.STEP = "step", n.RENDERER_INIT_COMPLETE = "rendererInitComplete", n.RENDERER_BUF_EXPIRED = "rendererBufExpired", n.RENDERER_SEEK = "rendererSeek", n.RENDERER_BUF_UPDATE = "rendererBufUpdate", n.RENDERER_DRAW = "rendererDraw", n.RENDERER_WAITING = "rendererWaiting", n.RENDERER_WAITING_END = "rendererWaitingEnd", n.DECODER_FRAME = "decoderFrame", n.DECODER_IMG = "decoderImg", n.DECODER_SEEK = "decoderSeek", n.DECODER_SEEK_ABORT = "decoderSeekAbort", n.DECODER_WAITING = "decoderWaiting", n.DECODER_DATA_END = "decoderDataEnd", n.DECODER_BUF_LOW = "decoderDataEmpty", n.DECODER_DROP_FRAME = "decocerDropFrame", n.DECODER_MEDIA_INFO = "decoderMediaInfo", n.MEDIA_CONNECTED = "mediaConnected", n.LOADER_CHUNK_ARRIVAL = "loaderChunkArrival", n.DEMUXER_DETECTED = "demuxerDetected", n.MEDIA_DEMUX = "mediaDemux", n.KEY_FRAME = "keyFrame", n.USE_BACKUP = "useBackup", n.NEW_SOURCE = "newSource", n.DOWNLOAD = "download", n.STOP_LOAD = "stopLoad", n.LOAD = "load", n.WAITING = "waiting", n.LOADEDMETADATA = "loadedmetadata", n.LOADEDDATA = "loadeddata", n.CANPLAY = "canplay", n.SEEKING = "seeking", n.SEEK_WITH_LOAD = "seekWithLoad", n.SEEKED = "seeked", n.PLAYING = "playing", n.PAUSE = "pause", n.PLAY = "play", n.ENDED = "ended", n.TIMEUPDATE = "timeupdate", n.PROGRESS = "progress", n.RATE_CHANGE = "ratechange", n.DURATION_CHANGE = "durationchange", n.HEARTBEAT = "heartbeat", n.MSE_UPDATE = "mseUpdate", n.MSE_BUFFER_FULL = "mseBufferFull", n.MSE_SOURCE_CLOSE = "mseSourceClose", n.RETRY = "retry", n.WORKER_LOG = "workerLog", n.VISIBILITY_CHANGE = "visibilityChange", n.SCREENSHOT = "screenshot", n;
  }(Tn || {}), q = Tn, _r = "event-bus-consumer-manager", yl = function() {
    function n(a, i) {
      this.J = void 0, this.At = [], this.ot = void 0, a.i(_r, "constructor"), this.J = a, this.ot = i, this.st();
    }
    var h = n.prototype;
    return h.destroy = function() {
      this.J.i(_r, "destroy"), this.ot.removeAllListeners(), this.At.splice(0, this.At.length);
    }, h.register = function(a, i) {
      i === void 0 && (i = !1), this.J.i(_r, "register", a.getName()), i ? this.At.unshift(a) : this.At.push(a), a.setEvtEmitter(this.ot);
    }, h.unregister = function(a) {
      for (var i = this.At.length - 1; i >= 0; i--)
        a === this.At[i] && this.At.splice(i, 1);
    }, h.st = function() {
      var a = this;
      Object.values(q).forEach(function(i) {
        var o = "on" + i.charAt(0).toUpperCase() + i.slice(1);
        a.ot.on(i, function() {
          for (var u = arguments.length, p = new Array(u), T = 0; T < u; T++)
            p[T] = arguments[T];
          for (var L = 0; L < a.At.length; L++) {
            var V = a.At[L];
            if (V && o in V) {
              var W, $ = (W = V[o]).call.apply(W, [V].concat(p));
              if ($ != null && $.stop)
                break;
            }
          }
        });
      });
    }, f()(n, [{ key: "evt", get: function() {
      return this.ot;
    } }]);
  }(), mr = function(n) {
    function h() {
      for (var i, o = arguments.length, u = new Array(o), p = 0; p < o; p++)
        u[p] = arguments[p];
      return (i = n.call.apply(n, [this].concat(u)) || this).ot = void 0, i;
    }
    R()(h, n);
    var a = h.prototype;
    return a.getName = function() {
      throw new Error("getName method must be override.");
    }, a.setEvtEmitter = function(i) {
      this.ot = i;
    }, a.emit = function(i, o) {
      var u;
      return ((u = this.ot) == null ? void 0 : u.emit(i, o)) || !1;
    }, a.onWorkerLog = function(i) {
    }, h;
  }(S), Rn = "exposed-event", bl = function(n) {
    function h(i, o) {
      var u;
      return (u = n.call(this) || this).ut = void 0, u.J = void 0, u.ht = void 0, u.ut = i, u.J = i.logger, u.ht = o, u;
    }
    R()(h, n);
    var a = h.prototype;
    return a.onReport = function(i) {
      this.ht.emit(q.REPORT, i);
    }, a.onError = function(i) {
      if ((i == null || !i.preventFollowUp) && i.fatal) {
        var o = l()({}, i);
        if (this.ut.stat.coreType === H.native) {
          var u = this.ut.stat.retryInfo.getLastMseError();
          u && (this.J.i(Rn, "replace error info by mse error."), l()(o, { type: u.type, details: u.details, reason: u.reason, code: u.code }), u.url !== void 0 && (o.url = u.url), u.statusCode !== void 0 && (o.statusCode = u.statusCode));
        }
        this.ht.emit(q.ERROR, o);
      }
    }, a.onManifestParsed = function(i) {
      i != null && i.preventFollowUp || this.ht.emit(q.MANIFEST_PARSED, i);
    }, a.onLevelSwitching = function(i) {
      this.ht.emit(q.LEVEL_SWITCHING, i);
    }, a.onLevelSwitched = function(i) {
      this.ht.emit(q.LEVEL_SWITCHED, i);
    }, a.onLevelSwitchFailed = function() {
      this.ht.emit(q.LEVEL_SWITCH_FAILED);
    }, a.onLevelUpdated = function(i) {
      this.ht.emit(q.LEVEL_UPDATED, i);
    }, a.onLevelSwitchPlaying = function(i) {
      this.ht.emit(q.LEVEL_SWITCH_PLAYING, i);
    }, a.onAudioTrackSwitching = function(i) {
      this.ht.emit(q.AUDIO_TRACK_SWITCHING, i);
    }, a.onAudioTrackSwitched = function(i) {
      this.ht.emit(q.AUDIO_TRACK_SWITCHED, i);
    }, a.onAudioTrackUpdated = function(i) {
      this.ht.emit(q.AUDIO_TRACK_UPDATED, i);
    }, a.onAudioTrackSwitchFailed = function() {
      this.ht.emit(q.AUDIO_TRACK_SWITCH_FAILED);
    }, a.onSubtitleTrackSwitched = function(i) {
      this.ht.emit(q.SUBTITLE_TRACK_SWITCHED, i);
    }, a.onLoadEnd = function(i) {
      i != null && i.preventFollowUp || this.ht.emit(q.LOAD_END);
    }, a.onVideoRendererChange = function(i) {
      this.ht.emit(q.VIDEO_RENDERER_CHANGE, i);
    }, a.onH265Detected = function(i) {
      this.ht.emit(q.H265_DETECTED, i);
    }, a.onScreenshot = function(i) {
      i.pts === -1 && (i.pts = this.ut.video ? 1e3 * this.ut.video.currentTime : 0), this.ht.emit(q.SCREENSHOT, i);
    }, a.getName = function() {
      return Rn;
    }, h;
  }(mr), Sn = "fallback", gr = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this) || this).ut = void 0, o.J = void 0, o.ct = !1, o.ft = void 0, o.ut = i, o.J = i.logger, o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.reset = function() {
      return this.J.i(Sn, "reset"), this.ct = !1, this;
    }, a.stop = function() {
      return this;
    }, a.setRetryFunc = function(i) {
      return this.ft = i, this;
    }, a.destroy = function() {
      this.J.i(Sn, "fallback: " + this.constructor.name + " destroy."), this.ft = void 0, n.prototype.destroy.call(this);
    }, a.getAvailable = function() {
      return !(!this.ft || this.ct);
    }, a.vt = function(i) {
      if (this.ft && this.ft() !== !1)
        return this.ct = !0, i;
    }, a.emit = function(i, o) {
      return this.ut.evt.emit(i, o);
    }, h;
  }(S), Ie = function(n) {
    return n.FLV_LIVE_RELOAD = "flvLiveReload", n.USE_BACKUP = "useBackup", n.USE_BACKUP_MULTIPART = "useBackupMultipart", n.NO_WORKER = "noWorker", n.SWAP_REMUX_TYPE = "swapRemuxType", n.SWAP_AUDIO_CODECSTR = "swapAudioCodecStr", n.NEXT_DESC = "nextDesc", n.SWAP_WASM_DECODER = "swapWasmDecoder", n.SWAP_CORE = "swapCore", n.SWAP_264 = "swap264", n.RELOAD_WASM = "reloadWasm", n.DROP_V_FRAME = "dropVFrame", n;
  }({}), Vt = "fallback", El = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this) || this).ut = void 0, o.J = void 0, o.dt = {}, o.lt = void 0, o.H = function(u) {
        if (o.J.i(Vt, "on error", u, Object.keys(o.dt)), o.lt || (o.lt = o.yt()), u.fatal) {
          o.J.i(Vt, "error. type: " + u.type + " details: " + u.details + " reason: " + u.reason);
          for (var p = 0; p < o.lt.actions.length; p++) {
            var T = o.lt.actions[p];
            if (T) {
              var L = o.dt[T.type];
              if (L != null && L.getAvailable()) {
                var V = o.ut.stat.coreType, W = L.run(u);
                if (W)
                  return o.J.i(Vt, "fallback run. type: " + T.type + " " + p + "/" + o.lt.actions.length + ". reason: " + u.reason), u.preventFollowUp = !0, W.code = ae(u.details, u.reason, u.statusCode), W.errorData = l()({}, u), W.core = V, o.ut.evt.emit(q.RETRY, W), void o.Mt(p);
              }
            }
          }
          o.J.i(Vt, "no fallback matched. reason: " + u.reason);
        }
      }, o.ut = i, o.J = i.logger, o.F.push(o.ut.evt.prependListener(q.ERROR, o.H)), o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.register = function(i, o) {
      var u = this;
      return this.J.i(Vt, "register " + i + " " + o.constructor.name), this.dt[i] && (this.J.i(Vt, i + " existed."), this.F.destroyItem(o)), this.dt[i] = o, this.F.push(o), { destroy: function() {
        return u.unregisterAndDestroy(i);
      } };
    }, a.unregisterAndDestroy = function(i) {
      var o = this.dt[i];
      return o && (this.F.destroyItem(o), o.destroy(), delete this.dt[i], this.J.i(Vt, "unregisterAndDestroy " + i)), this;
    }, a.hasFallback = function(i) {
      return !!this.dt[i];
    }, a.reset = function() {
      for (var i in this.J.i(Vt, "reset"), this.dt)
        this.unregisterAndDestroy(i);
      this.dt = {}, this.lt = void 0;
    }, a.stop = function() {
      for (var i in this.dt)
        this.dt[i].stop();
    }, a.Mt = function(i) {
      if (this.lt) {
        var o = this.lt.actions[i];
        !o || o.type !== Ie.SWAP_CORE && o.type !== Ie.NO_WORKER || (this.wt(Ie.USE_BACKUP), this.wt(Ie.USE_BACKUP_MULTIPART), this.wt(Ie.FLV_LIVE_RELOAD));
      }
    }, a.yt = function() {
      this.J.i(Vt, "generate fallback policy.");
      var i = this.ut, o = (ee.mobile, { core: i.stat.coreType, actions: [] });
      return i.stat.coreType === H.mse ? o.actions.push({ type: Ie.RELOAD_WASM }, { type: Ie.FLV_LIVE_RELOAD }, { type: Ie.USE_BACKUP_MULTIPART }, { type: Ie.USE_BACKUP }, { type: Ie.NO_WORKER }, { type: Ie.DROP_V_FRAME }, { type: Ie.SWAP_REMUX_TYPE }, { type: Ie.SWAP_AUDIO_CODECSTR }, { type: Ie.SWAP_264 }, { type: Ie.NEXT_DESC }, { type: Ie.SWAP_WASM_DECODER }, { type: Ie.SWAP_CORE }) : i.stat.coreType === H.native && o.actions.push({ type: Ie.USE_BACKUP }, { type: Ie.SWAP_264 }, { type: Ie.NEXT_DESC }, { type: Ie.SWAP_CORE }, { type: Ie.RELOAD_WASM }, { type: Ie.FLV_LIVE_RELOAD }, { type: Ie.USE_BACKUP_MULTIPART }, { type: Ie.NO_WORKER }, { type: Ie.SWAP_REMUX_TYPE }, { type: Ie.SWAP_AUDIO_CODECSTR }, { type: Ie.SWAP_WASM_DECODER }), o;
    }, a.wt = function(i) {
      var o;
      (o = this.dt[i]) == null || o.reset();
    }, h;
  }(S), wl = function(n) {
    function h() {
      return n.apply(this, arguments) || this;
    }
    return R()(h, n), h.prototype.run = function(a) {
      if (this.getAvailable() && this.ut.hasNextMediaDesc() && (this.ut.stat.coreType === H.mse || this.ut.stat.coreType === H.native) && (this.J.i("fallback-next-desc", "run"), this.ut.nextMediaDesc()))
        return this.vt({ type: w.FALLBACK, message: "use next media description.", fallback: Ie.NEXT_DESC });
    }, h;
  }(gr), Tl = { preferLowPowerToHighPerformance: !0, preserveDrawingBuffer: !0 };
  function Ln() {
    return typeof HTMLCanvasElement > "u" ? new OffscreenCanvas(1, 1) : document.createElement("canvas");
  }
  function yr() {
    if (!Ni) {
      var n = Ln();
      kn(n, Ni = { webGL: !1, performance: !1 }, !0) || kn(n, Ni, !1);
    }
    return Ni;
  }
  function kn(n, h, a) {
    a === void 0 && (a = !1);
    var i = !1, o = l()({ failIfMajorPerformanceCaveat: a }, Tl);
    try {
      var u = n.getContext("webgl", o);
      if (u) {
        var p = u.getExtension("WEBGL_debug_renderer_info");
        h.webGL = !0, h.performance = a, p != null && p.UNMASKED_VENDOR_WEBGL && (h.vendor = u.getParameter(p == null ? void 0 : p.UNMASKED_VENDOR_WEBGL)), p != null && p.UNMASKED_RENDERER_WEBGL && (h.renderer = u.getParameter(p == null ? void 0 : p.UNMASKED_RENDERER_WEBGL)), i = !0;
        var T = u.getExtension("WEBGL_lose_context");
        T && T.loseContext();
      }
    } catch (L) {
    }
    return i;
  }
  function Pi() {
    return typeof navigator > "u" ? 0 : navigator.hardwareConcurrency || 0;
  }
  function dt() {
    return typeof window != "object" || typeof document != "object" || typeof document.createElement != "function";
  }
  function br() {
    var n, h, a;
    if (!dt())
      return ((n = window) == null ? void 0 : n.ManagedMediaSource) || ((h = window) == null ? void 0 : h.MediaSource) || ((a = window) == null ? void 0 : a.WebKitMediaSource);
  }
  function In() {
    var n, h, a;
    if (!dt())
      return ((n = window) == null ? void 0 : n.ManagedSourceBuffer) || ((h = window) == null ? void 0 : h.SourceBuffer) || ((a = window) == null ? void 0 : a.WebKitSourceBuffer);
  }
  var Rl = { av1: ['video/mp4; codecs="av01.0.08M.08,mp4a.40.2"'], hevc: ['video/mp4; codecs="hev1.1.6.L120.90,mp4a.40.2"', 'video/mp4; codecs="hvc1.1.6.L120.90,mp4a.40.2"'], h264: ['video/mp4; codecs="avc1.4D4028,mp4a.40.2"'], opus: ['video/mp4; codecs="opus"'], mp3: ['video/mp4; codecs="mp3"'], aac: ['video/mp4; codecs="mp4a.40.2"'] }, Sl = { av1: ['video/mp4; codecs="av01.0.08M.10"'], hevc: ['video/mp4; codecs="hev1.2.2.L120.90"', 'video/mp4; codecs="hvc1.2.2.L120.90"'], h264: ['video/mp4; codecs="avc1.6e0028"'] }, Ll = { av1: ['video/mp4; codecs="av01.0.12M.08"'], hevc: ['video/mp4; codecs="hev1.1.6.L150.90"', 'video/mp4; codecs="hvc1.1.6.L150.90"'], h264: ['video/mp4; codecs="avc1.4D4033"'] }, kl = { av1: ['video/mp4; codecs="av01.0.12M.10"'], hevc: ['video/mp4; codecs="hev1.2.2.L150.90"', 'video/mp4; codecs="hvc1.2.2.L150.90"'], h264: ['video/mp4; codecs="avc1.6e0028"'] }, Il = { mp4: ["video/mp4", "video/quicktime"], flv: ["video/x-flv"], ts: ["video/mp2t"], matroska: ["video/x-matroska", "video/webm"], hls: ["application/vnd.apple.mpegURL", "application/x-mpegURL"], hls_ts: ["application/vnd.apple.mpegURL", "application/x-mpegURL"], hls_fmp4: ["application/vnd.apple.mpegURL", "application/x-mpegURL"], aac: ["audio/aac"], mp3: ["audio/mpeg", "audio/mp3"] }, kt = function() {
    function n() {
    }
    return n.isMSEAvailable = function() {
      if (n.bt !== void 0)
        return n.bt;
      if (!it.a)
        return n.bt = !1, !1;
      var h = br(), a = In();
      if (n.gt = !!(h && a && a.prototype && typeof a.prototype.appendBuffer == "function" && typeof a.prototype.remove == "function"), h && ee.mobile && n.gt)
        try {
          var i = new h(), o = document.createElement("video");
          o.src = URL.createObjectURL(i), URL.revokeObjectURL(o.src), n.bt = !0;
        } catch (u) {
          n.bt = !1;
        }
      else
        n.bt = n.gt;
      return n.bt;
    }, n.isMSECodecCapabilityNormal = function() {
      return n.isMSEAvailable() && n.TYPE_SUPPORTED.h264;
    }, n.isSupported = function(h) {
      return h === void 0 && (h = v.h264), n.isMSECodecSupported(h) && n.isMSEAvailable();
    }, n.isMSECodecSupported = function(h, a, i) {
      if (h === void 0 && (h = v.h264), a === void 0 && (a = O.FHD), i === void 0 && (i = !1), ee.msedge && ee.platform === "windows" || ee.msie)
        return n.isMSEAvailable() && h === v.h264;
      if (n.kt(h, a) === !1)
        return !1;
      var o = n._t(h, a, i);
      return !!o && o.reduce(function(u, p) {
        return u || n.isMSECodecStrSupported(p);
      }, !1);
    }, n.isVideoCodecSupported = function(h, a, i) {
      if (h === void 0 && (h = v.h264), a === void 0 && (a = O.FHD), i === void 0 && (i = !1), ee.msedge && ee.platform === "windows" || ee.msie)
        return h === v.h264;
      if (n.kt(h, a) === !1)
        return !1;
      var o = n._t(h, a, i);
      if (!o)
        return !1;
      var u = n.Et();
      return o.reduce(function(p, T) {
        return p || !(!u || !u.canPlayType(T));
      }, !0);
    }, n.isVideoBoxSupported = function(h) {
      if (h === void 0 && (h = y.mp4), h === y.unknown)
        return !0;
      var a = Il[h];
      if (!a)
        return !1;
      var i = n.Et();
      return a.reduce(function(o, u) {
        return o || !(!i || !i.canPlayType(u));
      }, !1);
    }, n.isVideoCodecStrSupportedInMp4 = function(h, a) {
      a === void 0 && (a = "");
      try {
        var i = n.Et();
        return !(!i || !i.canPlayType((a || "video") + '/mp4;codecs="' + h + '"'));
      } catch (o) {
      }
      return !1;
    }, n.isWebRTCSupported = function() {
      return "RTCPeerConnection" in window && "RTCRtpTransceiver" in window;
    }, n.isMSECodecStrSupportedInMp4 = function(h, a) {
      var i;
      return a === void 0 && (a = ""), !((i = br()) == null || !i.isTypeSupported((a || "video") + '/mp4;codecs="' + h + '"'));
    }, n.isMSECodecStrSupported = function(h) {
      var a = br();
      return !(!a || typeof a.isTypeSupported != "function" || !a.isTypeSupported(h));
    }, n.isChangeTypeSupported = function() {
      if (n.Rt === void 0) {
        var h = In();
        n.Rt = !(!h || h.prototype.changeType === void 0);
      }
      return n.Rt;
    }, n.getVideoCodecCompatibilityByCodec = function(h, a, i) {
      a === void 0 && (a = O.FHD), i === void 0 && (i = !1);
      var o = E.unsupported, u = !0;
      h === v.h264 ? o = a === O.UHD_4K ? (i ? n.TYPE_SUPPORTED.h264Hdr4k : n.TYPE_SUPPORTED.h2644k) ? E.buildin : E.unsupported : (i ? n.TYPE_SUPPORTED.h264Hdr : n.TYPE_SUPPORTED.h264) ? E.buildin : E.unsupported : h === v.av1 ? (o = a === O.UHD_4K ? (i ? n.TYPE_SUPPORTED.av1Hdr4k : n.TYPE_SUPPORTED.av14k) ? E.buildin : E.unsupported : (i ? n.TYPE_SUPPORTED.av1Hdr : n.TYPE_SUPPORTED.av1) ? E.buildin : E.unsupported, u = Pi() >= 2) : h === v.hevc ? (o = a === O.UHD_4K ? (i ? n.TYPE_SUPPORTED.hevcHdr4k : n.TYPE_SUPPORTED.hevc4k) ? E.buildin : E.unsupported : (i ? n.TYPE_SUPPORTED.hevcHdr : n.TYPE_SUPPORTED.hevc) ? E.buildin : E.unsupported) === E.buildin ? (ee.msedge && ee.platform === "windows" && (o = E.unsupported), u = !!(Pi() >= 2 || ee.safari)) : u = n.wasmSmooth : h !== v.kvc3 && h !== v.kvc4 && h !== v.kvc5 && h !== v.kvc6 && h !== v.vvc && h !== v.kvc30 && h !== v.bvc2 || (o = typeof WebAssembly < "u" ? E.wasm : E.unsupported, u = n.wasmSmooth);
      var p = !1;
      return o === E.buildin && (p = n.isChangeTypeSupported(), h === v.hevc && n.kt(h, a) === !1 && (o = E.wasm)), { decoder: o, smooth: o !== E.unsupported && u, mix: p };
    }, n.getPlayTestDefinition = function(h) {
      if (typeof h.width == "number" && typeof h.height == "number") {
        if ((h == null ? void 0 : h.width) > 1920 || (h == null ? void 0 : h.height) > 1920)
          return O.UHD_4K;
      } else if (h.qualityType.toLowerCase().indexOf("4k") !== -1)
        return O.UHD_4K;
      return O.FHD;
    }, n._t = function(h, a, i) {
      a === void 0 && (a = O.FHD), i === void 0 && (i = !1), h === v.unknown && (h = v.h264);
      var o = i ? Sl : Rl, u = i ? kl : Ll;
      return a === O.UHD_4K && u[h] || o[h];
    }, n.kt = function(h, a) {
      if (a === void 0 && (a = O.FHD), h === v.hevc && n.playHEVCTest && (a === O.UHD_4K && n.playHEVCTest[a] === !1 || a !== O.UHD_4K && n.playHEVCTest[O.FHD] === !1))
        return !1;
    }, n.Et = function() {
      return vr || dt() || (vr = document.createElement("video")), vr;
    }, n.Dt = function() {
      try {
        return typeof WebAssembly < "u" && typeof MessageChannel < "u" && new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)), WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]));
      } catch (h) {
        return !1;
      }
    }, n.Tt = function() {
      return typeof WebAssembly < "u" && WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]));
    }, f()(n, null, [{ key: "isSupportSimd", get: function() {
      return n.St === void 0 && (n.St = n.Tt()), n.St;
    } }, { key: "isSupportThreads", get: function() {
      return n.Ot === void 0 && (n.Ot = n.Dt()), n.Ot;
    } }, { key: "wasmSmooth", get: function() {
      if (n.Ct === void 0) {
        var h = Pi();
        n.Ct = !!(n.isSupportHW && n.isSupportThreads && h && h >= 6);
      }
      return n.Ct;
    } }, { key: "isSupportHW", get: function() {
      return !!yr().performance;
    } }, { key: "playHEVCTest", get: function() {
      return this.Lt;
    }, set: function(h) {
      this.Lt = h;
    } }]);
  }();
  rt = kt, kt.Rt = void 0, kt.bt = void 0, kt.gt = void 0, kt.St = void 0, kt.Ot = void 0, kt.Ct = void 0, kt.Lt = void 0, kt.TYPE_SUPPORTED = { mpeg: rt.isMSECodecStrSupported("audio/mpeg"), mp3: rt.isMSECodecSupported(v.mp3), opus: rt.isMSECodecSupported(v.opus), aac: rt.isMSECodecSupported(v.aac), hevc: rt.isMSECodecSupported(v.hevc), hevc4k: rt.isMSECodecSupported(v.hevc, O.UHD_4K), hevcHdr: rt.isMSECodecSupported(v.hevc, O.FHD, !0), hevcHdr4k: rt.isMSECodecSupported(v.hevc, O.UHD_4K, !0), av1: rt.isMSECodecSupported(v.av1), av14k: rt.isMSECodecSupported(v.av1, O.UHD_4K), av1Hdr: rt.isMSECodecSupported(v.av1, O.FHD, !0), av1Hdr4k: rt.isMSECodecSupported(v.av1, O.UHD_4K, !0), h264: rt.isMSECodecSupported(v.h264), h2644k: rt.isMSECodecSupported(v.h264, O.UHD_4K), h264Hdr: rt.isMSECodecSupported(v.h264, O.FHD, !0), h264Hdr4k: rt.isMSECodecSupported(v.h264, O.UHD_4K, !0) };
  var _e = kt, xn = "fallback-swap-to-264", xl = function(n) {
    function h() {
      return n.apply(this, arguments) || this;
    }
    return R()(h, n), h.prototype.run = function(a) {
      var i;
      if (this.getAvailable() && a.type === Ue.MEDIA_ERROR && (a.details === ge.VIDEO_ERROR || a.details === ge.VIDEO_ERROR_3 || a.details === ge.VIDEO_ERROR_4 || a.details === ge.VIDEO_NO_SIZE) && this.ut.canCodecFallback && this.ut.video instanceof HTMLVideoElement && (this.ut.stat.coreType === H.mse || this.ut.stat.coreType === H.native && ((i = this.ut.video) == null || !i.videoWidth)) && this.ut.stat.codecType !== v.h264 && this.ut.stat.decoder === E.buildin) {
        var o = "metadata video size: " + this.ut.video.videoWidth + ". fallback 264";
        this.J.i(xn, "run"), this.ut.reProcessSrc(v.h264, this.ut.stat.native);
        var u = this.vt({ type: w.FALLBACK, message: o, fallback: Ie.SWAP_264 });
        return _e.playHEVCTest === void 0 && (this.J.i(xn, "play hevc test start"), this.ut.hevcTest.start()), u;
      }
    }, h;
  }(gr), yi = r(6), zt = "ios-compatible", Cl = function(n) {
    function h(i, o) {
      var u;
      return (u = n.call(this) || this).ut = void 0, u.J = void 0, u.xt = void 0, u.Nt = !1, u.It = void 0, u.Ft = function() {
        var p = u.ut.video;
        u.It = setTimeout(function() {
          u.J.i(zt, "fix play stuck", p == null ? void 0 : p.currentTime), p && u.xt((p == null ? void 0 : p.currentTime) + 1e-3);
        }, 1e3);
      }, u.Bt = function() {
        u.It && (clearTimeout(u.It), u.It = void 0);
      }, u.ut = i, u.J = i.logger, u.xt = o, u.J.i(zt, "constructor"), u;
    }
    R()(h, n);
    var a = h.prototype;
    return a.onLoad = function() {
      this.jt();
    }, a.destroy = function() {
      this.J.i(zt, "destroy"), this.jt();
    }, a.onVisibilityChange = function(i) {
      this.J.i(zt, "onVisibilityChange", i.hidden), !i.hidden && ee.ios && (this.J.i(zt, "ios hidden false. play stuck detector on."), this.Nt = !0);
    }, a.onPlay = function() {
      this.Nt && (this.J.i(zt, "on play. start detector timer."), this.Nt = !1, this.Ft());
    }, a.onTimeupdate = function() {
      this.It && this.jt();
    }, a.getName = function() {
      return zt;
    }, a.jt = function() {
      this.J.i(zt, "reset"), this.Nt = !1, this.Bt();
    }, h;
  }(mr), ht = function(n) {
    return n.METADATA = "metadata", n.MEDIA_INFO = "mediaInfo", n.HEARTBEAT = "heartbeat", n.DOWNLOAD = "download", n.REALTIME_BEACON = "realtimeBeacon", n.DISCONTINUITY = "discontinuity", n.KEY_FRAME = "keyFrame", n.PRIV_NAL = "privNal", n.SEI = "sei", n.AAC_PRIV = "aacPriv", n;
  }({}), Dl = function(n) {
    function h() {
      return n.apply(this, arguments) || this;
    }
    return R()(h, n), h.prototype.run = function(a) {
      if (this.getAvailable() && (this.ut.stat.coreType === H.mse && a.type === Ue.NETWORK_ERROR && a.details !== ge.DEC_LIB_LOAD_ERROR && a.details !== ge.KEY_SYSTEM_LICENSE_REQUEST_FAILED && !this.ut.stat.multipart || this.ut.stat.coreType === H.native && a.details !== ge.KEY_SYSTEM_UNSUPPORTED)) {
        var i = this.ut.lctx.current;
        if (i && i.urlId < i.url.length - 1)
          return this.J.i("fallback-backup", "run"), i.urlId++, this.vt({ type: w.BACKUP, message: "trans error. use backup url.", fallback: Ie.USE_BACKUP });
      }
    }, h;
  }(gr), Ol = function() {
    function n() {
      var a = this;
      this.Ut = void 0, this.B = void 0, this.Pt = void 0, this.it = function() {
        a.Vt();
      }, this.Ht = function() {
        a.B && a.B.readyState >= 2 && a.Vt();
      }, this.Vt = function() {
        a.B && a.Pt && a.Pt(a.B.status), a.stop();
      };
    }
    var h = n.prototype;
    return h.start = function(a, i) {
      this.Pt = i, this.B && this.stop();
      var o = this.B = new XMLHttpRequest();
      o.open("GET", a, !0), o.onreadystatechange = this.Ht, o.onerror = this.it, o.onload = this.it, o.send(), this.Ut = setTimeout(this.Vt, 1e3);
    }, h.stop = function() {
      this.Ut && (clearTimeout(this.Ut), this.Ut = void 0), this.B && (this.B.onreadystatechange = null, this.B.onload = null, this.B.onerror = null, this.B.abort(), this.B = void 0), this.Pt = void 0;
    }, n;
  }(), Ml = { audio: { a3ds: !0, "ac-3": !0, "ac-4": !0, alac: !0, alaw: !0, dra1: !0, "dts+": !0, "dts-": !0, dtsc: !0, dtse: !0, dtsh: !0, "ec-3": !0, enca: !0, g719: !0, g726: !0, m4ae: !0, mha1: !0, mha2: !0, mhm1: !0, mhm2: !0, mlpa: !0, mp4a: !0, "raw ": !0, Opus: !0, samr: !0, sawb: !0, sawp: !0, sevc: !0, sqcp: !0, ssmv: !0, twos: !0, ulaw: !0 }, video: { avc1: !0, avc2: !0, avc3: !0, avc4: !0, avcp: !0, drac: !0, dvav: !0, dvhe: !0, encv: !0, hev1: !0, hvc1: !0, mjp2: !0, mp4v: !0, mvc1: !0, mvc2: !0, mvc3: !0, mvc4: !0, resv: !0, rv60: !0, s263: !0, svc1: !0, svc2: !0, "vc-1": !0, vp08: !0, vp09: !0 } };
  function Cn(n) {
    var h = {};
    return (n || "").split(/[ ,]+/).forEach(function(a) {
      a.indexOf("avc1") !== 0 && a.indexOf("hev1") !== 0 && a.indexOf("av01") !== 0 && a.indexOf("kvc") !== 0 || (h.video = a), a.indexOf("mp4a") === 0 && (h.audio = a);
    }), h;
  }
  function Nl(n, h) {
    var a = [].concat(n.split(/[ ,]+/));
    ["video", "audio"].forEach(function(i) {
      var o = a.filter(function(p) {
        return function(T, L) {
          var V = Ml[L];
          return !!V && V[T.slice(0, 4)] === !0;
        }(p, i);
      });
      if (o.length) {
        var u = o.filter(function(p) {
          return p.lastIndexOf("avc1", 0) === 0 || p.lastIndexOf("av01", 0) === 0 || p.lastIndexOf("hev1", 0) === 0 || p.lastIndexOf("hvc1", 0) === 0 || p.lastIndexOf("mp4a", 0) === 0;
        });
        h[i + "Codec"] = u.length > 0 ? u[0] : o[0], a = a.filter(function(p) {
          return o.indexOf(p) === -1;
        });
      }
    }), h.codec = a.join(",");
  }
  function Dn(n) {
    return n.indexOf("avc1") === 0 ? v.h264 : n.indexOf("hev1") === 0 || n.indexOf("hvc1") === 0 ? v.hevc : n.indexOf("av01") === 0 ? v.av1 : v.unknown;
  }
  var Gt = 1e3;
  function On(n, h, a) {
    return a === void 0 ? { width: n, height: h } : a.width > a.height ? { width: Math.round(a.width / a.height * n), height: h } : a.width < a.height ? { width: n, height: Math.round(h * a.height / a.width) } : { width: n, height: h };
  }
  var Pl = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this) || this).J = void 0, o.Wt = void 0, o.Gt = void 0, o.J = i, o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.copyImageData = function(i, o, u, p) {
      var T;
      this.Wt || (this.Wt = Ln());
      var L = { willReadFrequently: !0 };
      p && (L.colorSpace = p), this.Gt || (this.Gt = this.Wt.getContext("2d", L));
      var V, W, $ = 0, te = 0, be = typeof window < "u" && i instanceof HTMLVideoElement;
      if (be)
        $ = i.videoWidth, te = i.videoHeight;
      else if (u === 90 || u === 270) {
        var ie = On(i.height, i.width, o);
        $ = ie.height, te = ie.width;
      } else {
        var Te = On(i.width, i.height, o);
        $ = Te.width, te = Te.height;
      }
      return this.Wt.width = $, this.Wt.height = te, be ? (V = this.Gt) == null || V.drawImage(i, 0, 0) : (W = this.Gt) == null || W.drawImage(i, 0, 0, i.width, i.height, 0, 0, this.Wt.width, this.Wt.height), (T = this.Gt) == null ? void 0 : T.getImageData(0, 0, $, te, L);
    }, a.destroy = function() {
      this.J.i("image-data-copier", "destrpy"), this.Wt = void 0, this.Gt = void 0;
    }, h;
  }(S), Wt = function(n) {
    return n[n.NONE = 0] = "NONE", n[n.WAITING = 1] = "WAITING", n[n.SEEK = 2] = "SEEK", n[n.SELECT_BITRATE = 3] = "SELECT_BITRATE", n[n.INIT = 4] = "INIT", n[n.LOADING = 5] = "LOADING", n;
  }({}), qe = "kernel-base", Ke = "kernel-native", Ul = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this, i) || this).Qt = void 0, o.Yt = !1, o.F.push(o.ut.fallback.register(Ie.USE_BACKUP, new Dl(i).setRetryFunc(o.Jt.bind(o)))), o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.Jt = function(i) {
      this.Zt(ue.retry);
    }, a.load = function(i) {
      var o;
      this.J.i(Ke, "load", this.ut.stat.startFromSec);
      var u = this.ut.lctx.levels;
      if (u.length || this.emit(q.ERROR, le(Ue.OTHER_ERROR, ge.MANIFEST_PARSING_ERROR, "manifest parse error. core: native")), this.ut.stat.drm)
        this.emit(q.ERROR, le(Ue.KEY_SYSTEM_ERROR, ge.KEY_SYSTEM_UNSUPPORTED, "DRM unsupported."));
      else {
        var p = this.ut.lctx.default, T = this.ut.lctx.startIdx;
        typeof T == "number" && T >= 0 && T < u.length && (p = T, this.J.i(Ke, "set level from level startIdx.")), this.J.i(Ke, "level: " + p + " " + ((o = u[p]) == null ? void 0 : o.qualityType)), this.ut.lctx.currentIdx = this.ut.lctx.nextIdx = p, this.ut.lctx.abr = !1, this.emit(q.MANIFEST_PARSED, { levels: [], currentLevel: 0 }), this.Zt(i);
      }
    }, a.onAbrLevelsUpdated = function() {
    }, a.refresh = function() {
      var i, o = this;
      this.ut.stat.startFromSec = this.zt.currentTime, this.Zt(ue.retry), (i = this.zt.play()) == null || i.catch(function(u) {
        return o.J.i(Ke, "refresh. call play() fail.", u);
      });
    }, a.stopLoad = function() {
      this.emit(q.STOP_LOAD), this.Kt();
    }, a.setCurrentLevel = function(i) {
      var o = this;
      this.J.i(Ke, "set current level: " + i + " @ " + this.zt.currentTime);
      var u = this.ut;
      if (u.lctx.levels.length) {
        if (i >= 0 && i < u.lctx.levels.length && u.lctx.currentIdx !== i) {
          u.lctx.currentIdx = u.lctx.nextIdx = i;
          var p = u.lctx.current;
          if (p) {
            var T;
            return this.qt = Wt.SELECT_BITRATE, u.stat.startFromSec = this.zt.currentTime, this.Xt++, this.emit(q.LEVEL_SWITCHING, { time: u.currentTime, bitrate: p.bitrate, level: i, smooth: !1, auto: !1, id: this.Xt }), this.$t(u.lctx.currentIdx), !this.zt.paused && ((T = this.zt.play()) == null || T.catch(function(L) {
              return o.J.i(Ke, "set current level, call play() fail.", L);
            })), void this.emit(q.LEVEL_SWITCHED, { time: u.currentTime, bitrate: p.bitrate, level: i, smooth: !1, auto: !1, id: this.Xt });
          }
        }
        this.emit(q.LEVEL_SWITCH_FAILED);
      } else
        u.lctx.currentIdx = u.lctx.nextIdx = i;
    }, a.setNextLevel = function(i) {
      this.setCurrentLevel(i);
    }, a.liveEnd = function() {
    }, a.destroy = function() {
      this.J.i(Ke, "destroy"), this.Qt && (this.Qt.stop(), this.Qt = void 0), n.prototype.destroy.call(this), this.zt.src = "";
    }, a.ti = function() {
      this.ii || this.zt.src || this.load(), n.prototype.ti.call(this);
    }, a.ei = function() {
      var i = this.ut, o = i.lctx.current;
      o && this.qt === Wt.SELECT_BITRATE && this.emit(q.LEVEL_SWITCH_PLAYING, { time: i.currentTime, bitrate: o.bitrate, level: i.lctx.currentIdx, smooth: !1, auto: !1, id: this.Xt }), this.qt !== Wt.NONE && (this.qt = Wt.NONE), n.prototype.ei.call(this);
    }, a.ni = function() {
      var i = this.ut;
      n.prototype.ni.call(this), this.Yt && (this.J.i(Ke, "timeupdate start from: " + i.stat.startFromSec), this.ri(), this.Yt = !1);
    }, a.Ai = function() {
      this.J.i(Ke, "video waiting"), this.qt = this.qt || Wt.WAITING;
      var i = this.ut.bufferedSec, o = !this.zt.ended && !this.zt.seeking && this.qt === Wt.WAITING;
      this.emit(q.WAITING, { block: o, bufferedSec: i });
    }, a.oi = function() {
      var i;
      (ee.android || this.ut.stat.isLive === void 0 || ((i = this.si) == null ? void 0 : i.width) === 0) && this.si && this.zt.duration > 0 && (this.si.isLive = this.ut.stat.isLive = !isFinite(this.zt.duration), this.zt instanceof HTMLVideoElement && (this.si.width = this.zt.videoWidth, this.si.height = this.zt.videoHeight), this.emit(q.MEDIA_INFO, this.si)), this.ui() && this.zt.duration > 0 && (this.J.i(Ke, "check video dec failed. on android wechat hls duration change."), this.ai()), n.prototype.oi.call(this);
    }, a.hi = function() {
      if (this.J.i(Ke, "video loadeddata. duration: " + this.zt.duration + " box: " + this.ut.stat.box), !(!this.ui() && this.zt instanceof HTMLVideoElement && (this.J.i(Ke, "check video dec failed. on video loaded data."), this.ai()))) {
        this.ut.stat.isLive === void 0 && this.zt.duration > 0 && (this.ut.stat.isLive = !isFinite(this.zt.duration)), this.si = { videoDecoder: E.buildin }, this.zt instanceof HTMLVideoElement && (this.J.i(Ke, "video loadeddata. width: " + this.zt.videoWidth + " height: " + this.zt.videoHeight), this.si.width = this.zt.videoWidth, this.si.height = this.zt.videoHeight);
        var i = this.ut, o = i.lctx.current;
        if (o && o.codec) {
          var u = Cn(o.codec);
          this.si.audioCodec = u.audio, this.si.videoCodec = u.video, u.video && (i.stat.codecType = Dn(u.video));
        }
        this.si.videoCodecType = i.stat.codecType, ee.android ? i.stat.startFromSec && (this.Yt = !0) : this.ri(), this.emit(q.MEDIA_INFO, this.si);
      }
    }, a.ci = function() {
      this.J.i(Ke, "seeking " + this.zt.currentTime);
      var i = this.zt.currentTime;
      this.fi ? this.fi = !1 : (this.emit(q.SEEKING), this.ut.isTimeinBuffered(i) || this.emit(q.SEEK_WITH_LOAD));
    }, a.di = function(i) {
      var o, u = this;
      this.J.i(Ke, "video error", i);
      var p = ((o = this.zt.error) == null ? void 0 : o.code) || 0, T = ae(oe[p] || ge.VIDEO_ERROR, "video error");
      if (p === 4 && this.ut.canCodecFallback)
        this.emit(q.ERROR, le(Ue.MEDIA_ERROR, T, "buildin " + this.ut.stat.codecType + " dec error. video error: " + p));
      else {
        var L = "video error";
        this.zt && this.zt.error && (L += " code:" + p + " message:" + this.zt.error.message);
        var V = le(Ue.MEDIA_ERROR, (p ? oe[p] : ge.VIDEO_ERROR) || ge.VIDEO_ERROR, L, { url: this.zt.src });
        p === 2 || p === 4 ? (this.Qt || (this.Qt = new Ol()), this.J.i(Ke, "video error start detect status code."), this.Qt.start(this.zt.src, function(W) {
          u.J.i(Ke, "video error check http status code:", W), (p === 2 || p === 4 && W > 0) && (W < 200 || W > 299) ? u.emit(q.ERROR, le(Ue.NETWORK_ERROR, ge.LOAD_ERROR, L, { statusCode: W, url: u.zt.src })) : (W === 0 && (V.statusCode = 0), u.emit(q.ERROR, V));
        })) : this.emit(q.ERROR, V);
      }
    }, a.Zt = function(i) {
      this.J.i(Ke, "_load type: " + i), this.si = void 0, this.ii = void 0, this.ut.isLiveShift ? this.emit(q.ERROR, le(Ue.OTHER_ERROR, ge.UNSUPPORTED, "unsupported. core: " + this.type + " liveShift: " + this.ut.stat.liveShiftType)) : (this.qt = Wt.LOADING, n.prototype.Zt.call(this, i), this.emit(q.LOAD, { type: i }), this.$t(this.ut.lctx.currentIdx), this.li());
    }, a.$t = function(i) {
      var o = this.ut, u = o.lctx.current;
      if (u) {
        var p;
        this.J.i(Ke, "level", i);
        var T, L = u.currentUrl;
        this.emit(q.NEW_SOURCE, { sync: o.stat.startFromSec || 0 }), (p = this.ut.config.preprocessUrl) != null && p.stream && (this.J.d(Ke, "preprocessUrl stream"), L = (T = this.ut.config.preprocessUrl) == null ? void 0 : T.stream(L)), this.J.i(Ke, "play: " + L), this.zt.src = L;
      }
    }, a.ri = function() {
      var i = this.ut;
      i.stat.startFromSec > 0 && (this.J.i(Ke, "start from: " + i.stat.startFromSec), this.zt.currentTime = i.stat.startFromSec, i.stat.startFromSec = 0);
    }, a.ai = function() {
      return this.J.i(Ke, "check video dec failed."), !!(this.zt instanceof HTMLVideoElement && !this.zt.videoWidth && this.ut.canCodecFallback) && (this.emit(q.ERROR, le(Ue.MEDIA_ERROR, ge.VIDEO_NO_SIZE, "buildin " + this.ut.stat.codecType + " dec no width.")), !0);
    }, a.ui = function() {
      return ee.android && (ee.xweb || ee.x5) && he(this.ut.stat.box);
    }, f()(h, [{ key: "type", get: function() {
      return H.native;
    } }]);
  }(function(n) {
    function h(i) {
      var o;
      if ((o = n.call(this) || this).ut = void 0, o.J = void 0, o.zt = void 0, o.ii = void 0, o.pi = void 0, o.qt = Wt.INIT, o.si = void 0, o.Xt = 0, o.mi = [], o.yi = void 0, o.Mi = void 0, o.fi = !1, o.wi = void 0, !i.video)
        throw new Error("video is null");
      return o.ut = i, o.J = i.logger, o.zt = i.video, o.Mi = { loadedmetadata: o.bi.bind(o), loadeddata: o.hi.bind(o), canplay: o.ei.bind(o), seeking: o.ci.bind(o), seeked: o.gi.bind(o), waiting: o.Ai.bind(o), playing: o.ki.bind(o), pause: o._i.bind(o), play: o.ti.bind(o), error: o.di.bind(o), ended: o.Ei.bind(o), ratechange: o.Ri.bind(o), durationchange: o.oi.bind(o), timeupdate: o.ni.bind(o), progress: o.Di.bind(o), emptied: o.Ti.bind(o), resize: o.Si.bind(o) }, o.Oi(), o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.destroy = function() {
      this.J.i(qe, "destroy"), this.fi = !1, this.Kt(), this.Ci(), n.prototype.destroy.call(this);
    }, a.getTrackBufInfo = function() {
    }, a.load = function() {
      this.zt.load();
    }, a.resume = function() {
      var i, o = this;
      this.zt.paused && ((i = this.zt.play()) == null || i.catch(function(u) {
        return o.J.i(qe, "resume, call play() fail.", u);
      }));
    }, a.refresh = function() {
    }, a.stopLoad = function() {
    }, a.Li = function() {
      var i = this.si && this.si.fps ? this.si.fps : 30;
      return this.zt.duration && !this.zt.ended ? this.zt.currentTime + 1 / i : -1;
    }, a.xi = function() {
      var i = this.si && this.si.fps ? this.si.fps : 30;
      return this.zt.duration && this.zt.currentTime - 1 / i >= 0 ? this.zt.currentTime - 1 / i : -1;
    }, a.Oi = function() {
      if (this.zt)
        for (var i in this.Mi)
          this.zt.addEventListener(i, this.Mi[i]);
    }, a.Ci = function() {
      if (this.zt)
        for (var i in this.Mi)
          this.zt.removeEventListener(i, this.Mi[i]);
    }, a.bi = function() {
      this.J.i(qe, "loadedmetadata"), this.emit(q.LOADEDMETADATA);
    }, a.hi = function() {
      this.J.i(qe, "loadeddata"), this.emit(q.LOADEDDATA);
    }, a.ei = function() {
      this.J.i(qe, "canplay " + !!this.qt), this.emit(q.CANPLAY);
    }, a.ci = function() {
      this.J.i(qe, "seeking " + this.zt.currentTime), this.emit(q.SEEKING);
    }, a.gi = function() {
      this.J.i(qe, "seeked"), this.emit(q.SEEKED);
    }, a.Ai = function() {
      this.J.i(qe, "video waiting");
    }, a.ki = function() {
      this.J.i(qe, "playing"), this.ii || (this.qt = Wt.NONE, this.li(), this.emit(q.PLAYING));
    }, a._i = function() {
      this.J.i(qe, "pause. seeking: " + this.zt.seeking), this.zt.ended || this.emit(q.PAUSE);
    }, a.ti = function() {
      this.J.i(qe, "play", this.ii), this.emit(q.PLAY), ee.safari && this.zt.currentTime >= this.zt.duration && this.zt.loop && (this.J.i(qe, "safari loop fix. seek 0. loop: " + this.zt.loop + " " + this.zt.currentTime + "/" + this.zt.duration + "."), this.zt.currentTime = 0);
    }, a.di = function(i) {
      this.J.i(qe, "error", i);
    }, a.Ei = function() {
      this.J.i(qe, "ended"), this.fi = !1, this.emit(q.ENDED), this.Kt();
    }, a.Ri = function() {
      this.J.i(qe, "ratechange " + this.zt.playbackRate), this.emit(q.RATE_CHANGE);
    }, a.oi = function() {
      this.J.i(qe, "durationchange " + this.zt.duration), this.emit(q.DURATION_CHANGE);
    }, a.ni = function() {
      this.emit(q.TIMEUPDATE);
    }, a.Di = function() {
      this.emit(q.PROGRESS);
    }, a.Ti = function() {
      this.J.i(qe, "video emptied");
    }, a.Si = function() {
      this.J.i(qe, "video resize");
    }, a.Ni = function() {
      this.emit(q.HEARTBEAT);
    }, a.li = function() {
      this.pi || (this.pi = setInterval(this.Ni.bind(this), 1e3));
    }, a.Kt = function() {
      this.pi && (clearInterval(this.pi), this.pi = void 0);
    }, a.Zt = function(i) {
      this.fi = !1;
    }, a.emit = function(i, o) {
      if (i === q.ERROR) {
        var u = o;
        u.fatal && (this.ii = u), this.J.i(qe, "error", u);
      }
      return this.ut.evt.emit(i, o);
    }, a.internalSeek = function(i) {
      this.fi = !0;
      try {
        this.zt.currentTime = i;
      } catch (o) {
        this.J.i(qe, "internal seek err.", o);
      }
    }, a.screenshot = function(i) {
      var o = 1e3 * this.zt.currentTime;
      if (this.zt instanceof HTMLVideoElement && this.zt.videoWidth) {
        this.wi || (this.wi = new Pl(this.J), this.F.push(this.wi));
        var u = this.wi.copyImageData(this.zt, void 0, 0, i == null ? void 0 : i.colorSpace);
        u && this.emit(q.SCREENSHOT, { pts: o, id: i == null ? void 0 : i.id, image: u });
      } else
        this.emit(q.SCREENSHOT, { pts: o, id: i == null ? void 0 : i.id, errorCode: ge.SCREENSHOT_CREATE_IMG_ERROR, errorMessage: "no video" });
    }, f()(h, [{ key: "type", get: function() {
      return H.unknown;
    } }]);
  }(S)), Mn = function() {
    function n() {
      this.timeout = 6048e5;
    }
    var h = n.prototype;
    return h.write = function(a, i) {
      if (n.available)
        try {
          return localStorage.setItem(a, JSON.stringify({ value: i, time: Date.now() })), !0;
        } catch (o) {
        }
      return !1;
    }, h.read = function(a, i) {
      if (i === void 0 && (i = !0), n.available)
        try {
          var o = localStorage.getItem(a);
          if (o) {
            var u = JSON.parse(o), p = u.value, T = u.time, L = T === void 0 ? 0 : T;
            if (!i || Date.now() - L < (typeof i == "number" ? i : this.timeout))
              return p;
          }
        } catch (V) {
        }
    }, f()(n, null, [{ key: "available", get: function() {
      if (n.A === void 0)
        try {
          localStorage.setItem("alg", "test"), n.A = !0;
        } catch (a) {
          n.A = !1;
        }
      return n.A;
    } }]);
  }();
  Mn.A = void 0;
  var Er = Mn, wr = "kwai-kernel-id", Tr = function() {
    function n() {
    }
    return n.next = function() {
      if (Er.available) {
        var h = n.Ii.read(wr, !1), a = n._;
        return typeof h == "number" ? (a = this.getNextId(h), this.Ii.write(wr, a)) : (a = this.getNextId(a), this.Ii.write(wr, a)), n._ = a, a;
      }
      return n._ = n.getNextId(n._), n._;
    }, n.getNextId = function(h) {
      return ++h > n.MAX_ID ? 0 : h;
    }, f()(n, null, [{ key: "MAX_ID", get: function() {
      return 999;
    } }]);
  }();
  Tr._ = 0, Tr.Ii = new Er();
  var Nn = "sei-time", Fl = function(n) {
    function h(a) {
      var i;
      return (i = n.call(this) || this).ut = void 0, i.Fi = 0, i.J = void 0, i.Bi = { idx: 0, data: [], name: "sei" }, i.ji = { idx: 0, data: [], name: "aacPriv" }, i.Ui = { idx: 0, data: [], name: "privNal" }, i.Pi = function(o) {
        o.segments.forEach(function(u) {
          u.type === G.VIDEO ? (u.sei && i.Vi(u.sei, i.Bi), u.privNal && i.Vi(u.privNal, i.Ui)) : u.type === G.AUDIO && u.aacPriv && i.Vi(u.aacPriv, i.ji);
        }), i.Hi();
      }, i.Wi = function(o) {
        o.sei && i.Vi(o.sei, i.Bi), i.Hi();
      }, i.Gi = function() {
        var o;
        if ((o = i.ut.video) == null || !o.seeking) {
          var u = 1e3 * i.ut.currentTime, p = i.Qi(u, i.Bi);
          p == null || p.forEach(function(V) {
            i.ut.evt.emit(q.SEI, V);
          });
          var T = i.Qi(u, i.ji);
          T == null || T.forEach(function(V) {
            i.ut.evt.emit(q.AAC_PRIV, V);
          });
          var L = i.Qi(u, i.Ui);
          L == null || L.forEach(function(V) {
            i.ut.evt.emit(q.PRIV_NAL, V);
          });
        }
      }, i.Qi = function(o, u) {
        if (u.data.length && u.idx < u.data.length) {
          for (var p = [], T = 0, L = u.idx; L < u.data.length; L++) {
            var V;
            if (!(o >= (((V = u.data[L]) == null ? void 0 : V.time) || 0)))
              break;
            p.push(u.data[L]), T = L;
          }
          if (p.length)
            return u.idx = T + 1, p;
        }
      }, i.Yi = function() {
        i.J.i(Nn, "seek with load. remove all sei"), i.Bi.data.splice(0), i.Bi.idx = 0, i.ji.data.splice(0), i.ji.idx = 0, i.Ui.data.splice(0), i.Ui.idx = 0, i.Fi = 0;
      }, i.Ji = function() {
        var o = 1e3 * i.ut.currentTime;
        i.Zi(o, i.Bi), i.Zi(o, i.ji), i.Zi(o, i.Ui);
      }, i.Zi = function(o, u) {
        for (var p = 0; p < u.data.length; p++)
          if (u.data[p].time >= o) {
            u.idx = p;
            break;
          }
      }, i.Vi = function(o, u) {
        o.forEach(function(p) {
          p && typeof p.streamTimestamp == "number" && (p.time = i.ut.streamTime.getLocalTime(p.streamTimestamp / 1e3), typeof p.time == "number" && (p.time = Math.round(1e3 * p.time), u.data.push(p)));
        }), u.data.sort(function(p, T) {
          return p.time - T.time;
        });
      }, i.Hi = function() {
        var o = i.ut.video;
        if (i.Fi > 20 && o && o.buffered.length) {
          var u = 1e3 * o.buffered.start(0);
          i.zi(u, i.Bi), i.zi(u, i.ji), i.zi(u, i.Ui), i.Fi = 0;
        }
        i.Fi++;
      }, i.zi = function(o, u) {
        if (u.data.length && o > u.data[0].time) {
          for (var p = 0; p < Math.min(u.idx, u.data.length); p++)
            if (u.data[p].time >= o) {
              u.data.splice(0, p), u.idx = Math.max(0, u.idx - p), i.J.i(Nn, "remove " + p + " " + u.name + " info @" + o + ". remain " + u.data.length);
              break;
            }
        }
      }, i.ut = a, i.J = a.logger, i.F.push(i.ut.evt.on(q.PARSING_DATA, i.Pi), i.ut.evt.on(q.RAW_DATA, i.Wi), i.ut.evt.on(q.TIMEUPDATE, i.Gi), i.ut.evt.on(q.SEEK_WITH_LOAD, i.Yi), i.ut.evt.on(q.SEEKING, i.Ji)), i;
    }
    return R()(h, n), f()(h, [{ key: "seiLength", get: function() {
      return this.Bi.data.length;
    } }, { key: "seiIdx", get: function() {
      return this.Bi.idx;
    } }, { key: "aacPrivLength", get: function() {
      return this.ji.data.length;
    } }, { key: "aacPrivIdx", get: function() {
      return this.ji.idx;
    } }, { key: "privNalLength", get: function() {
      return this.Ui.data.length;
    } }, { key: "privNalIdx", get: function() {
      return this.Ui.idx;
    } }]);
  }(S), Bl = { search: function(n, h) {
    for (var a = 0, i = n.length - 1, o = null, u = null; a <= i; ) {
      var p = h(u = n[o = (a + i) / 2 | 0]);
      if (p > 0)
        a = o + 1;
      else {
        if (!(p < 0))
          return u;
        i = o - 1;
      }
    }
    return null;
  }, searchIndex: function(n, h) {
    for (var a = 0, i = n.length - 1, o = null; a <= i; ) {
      var u = h(n[o = (a + i) / 2 | 0]);
      if (u > 0)
        a = o + 1;
      else {
        if (!(u < 0))
          return o;
        i = o - 1;
      }
    }
    return -1;
  } }, ei = "stream-time", Hl = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this) || this).J = void 0, o.ut = void 0, o.Ki = [], o.qi = void 0, o.Xi = function(u) {
        u.expired || u.segments.forEach(function(p) {
          var T;
          p.type === G.VIDEO && p.keyTime && (p.keyTime.forEach(function(L) {
            L.key && o.ut.evt.emit(q.KEY_FRAME, { pts: L.pts, cts: L.cts });
          }), (T = o.Ki).push.apply(T, p.keyTime.map(function(L) {
            return l()({ frag: u.frag }, L);
          })), o.Ki.sort(function(L, V) {
            return L.pts - V.pts;
          })), p.type === G.AUDIO && p.originFirstDTS && (o.qi = p.originFirstDTS - p.startDTS);
        });
      }, o.Wi = function(u) {
        var p;
        u.keyTime && !u.expired && (p = o.Ki).push.apply(p, u.keyTime.map(function(T) {
          return l()({ frag: u.frag }, T);
        }));
      }, o.Yi = function() {
        var u, p = ((u = o.ut.video) == null ? void 0 : u.currentTime) || 0, T = o.ut.lctx.current, L = 0;
        if (o.J.i(ei, "on seek with load. current time: " + o.ut.currentTime), o.ut.stat.multipart && Object.prototype.hasOwnProperty.call(T, "fragments")) {
          var V = function(te, be) {
            return be ? Bl.search(be, function(ie) {
              return te < ie.start ? -1 : te > ie.start + ie.duration ? 1 : 0;
            }) : null;
          }(p, T.fragments);
          if (!V)
            return o.J.i(ei, "no frag. clear video key time."), void o.Ki.splice(0, o.Ki.length);
          for (var W = o.Ki.length - 1; W >= 0; W--) {
            var $;
            if ((($ = o.Ki[W].frag) == null ? void 0 : $.sn) === V.sn || o.Ki[W].originPTS < p) {
              L = W;
              break;
            }
          }
        }
        o.J.i(ei, "clear video key time. st: " + L), o.Ki.splice(L, o.Ki.length - L);
      }, i.logger.i(ei, "constructor"), o.ut = i, o.J = i.logger, o.F.push(o.ut.evt.on(q.PARSING_DATA, o.Xi), o.ut.evt.on(q.RAW_DATA, o.Wi), o.ut.evt.on(q.SEEK_WITH_LOAD, o.Yi)), o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.reset = function() {
      this.J.i(ei, "reset"), this.qi = void 0, this.Ki = [];
    }, a.getLocalTime = function(i) {
      if (!(i < 0)) {
        if (this.Ki.length) {
          var o = this.$i(i, this.Ki);
          if (o)
            return i - o.originPTS + o.pts;
        }
        return typeof this.qi == "number" ? i - this.qi : void 0;
      }
    }, a.getStreamTime = function(i) {
      if (!(i < 0)) {
        if (this.Ki.length) {
          var o, u = this.te(i, this.Ki);
          if (u)
            return this.J.i(ei, "get stream time by video. local: " + i + " pts: " + u.info.pts + " originPTS: " + u.info.originPTS + " sn: " + ((o = u.info.frag) == null ? void 0 : o.sn) + " key: " + this.Ki.length), i - u.info.pts + u.info.originPTS;
        }
        return this.J.i(ei, "get local time by audio. local: " + i + " offset: " + this.qi), typeof this.qi == "number" ? i + this.qi : void 0;
      }
    }, a.getKeyFrameTime = function(i, o) {
      if (o === void 0 && (o = 0), this.Ki.length) {
        var u = this.te(i, this.Ki);
        return u ? this.Ki[u.idx + o] : void 0;
      }
    }, a.te = function(i, o) {
      if (o) {
        for (var u = o.length - 1; u >= 0; u--)
          if (o[u].pts <= i)
            return { info: o[u], idx: u };
      }
    }, a.$i = function(i, o) {
      if (o) {
        for (var u = o.length - 1; u >= 0; u--)
          if (o[u].originPTS <= i)
            return o[u];
      }
    }, f()(h, [{ key: "localTimeOffset", get: function() {
      return this.qi;
    }, set: function(i) {
      this.qi = i;
    } }]);
  }(S), Vl = "playback-rate";
  function Pn(n, h, a, i, o) {
    a === void 0 && (a = 3), h = Math.round(h), !i || i.startDelay === h || h <= 0 || (i.startDelay = typeof o == "number" ? o : h, i.rule = [{ rate: 1.5, lower: h + 2 * a + 1, upper: Number.MAX_SAFE_INTEGER }, { rate: 1.25, lower: h + a + 1, upper: h + 2 * a }, { rate: 1.1, lower: h + 1, upper: h + a }, { rate: 1, lower: 0, upper: h }], n.i(Vl, "update auto playbackRate delay: " + h + ", step: " + a + " startDelay: " + o, JSON.stringify(i)));
  }
  var nt = function(n) {
    return n.SERIES_12 = "15_pro_max/15_plus/14_pro_max", n.SERIES_11 = "15_pro/15/14_pro", n.SERIES_10 = "14_plus/13_pro_max/12_pro_max", n.SERIES_9 = "14/13/13_pro/12/12_pro", n.SERIES_8 = "se_3/se_2/8/7/6s/6", n.SERIES_7 = "13_mini/12/11_pro/xs/x", n.SERIES_6 = "11_pro_max/xs_max", n.SERIES_5 = "11/xr", n.SERIES_4 = "8_plus/7_plus/6s_plus/6_plus", n.SERIES_3 = "se/5c/5s/5", n.SERIES_2 = "4s/4", n.SERIES_1 = "3gs/3g/1", n;
  }({}), Gl = { "430_932_3": nt.SERIES_12, "393_852_3": nt.SERIES_11, "428_926_3": nt.SERIES_10, "390_844_3": nt.SERIES_9, "375_667_2": nt.SERIES_8, "375_812_3": nt.SERIES_7, "414_896_3": nt.SERIES_6, "414_896_2": nt.SERIES_5, "414_736_3": nt.SERIES_4, "320_568_2": nt.SERIES_3, "320_480_2": nt.SERIES_2, "320_480_1": nt.SERIES_1 };
  function Un() {
    if (ee.iphone && typeof window < "u" && window.screen) {
      var n = window.screen.width + "_" + window.screen.height + "_" + window.devicePixelRatio;
      return Gl[n] || "unknown";
    }
    return "unknown";
  }
  var Ui, Fn = function() {
    function n() {
      this.I = [];
    }
    var h = n.prototype;
    return h.append = function(a) {
      this.I.push(a);
    }, h.clear = function() {
      this.I = [];
    }, h.getLastMseError = function() {
      for (var a = this.I.length - 1; a >= 0; a--) {
        var i = this.I[a];
        if (i && i.core === H.mse) {
          var o = i.errorData;
          return o && (o.code = ae(o.details, o.reason, o.statusCode)), o;
        }
      }
    }, h.ie = function(a) {
      return a.map(function(i) {
        var o = { message: i.message, pos: i.pos, ts: i.ts };
        return i.code !== void 0 && (o.code = i.code), i.core !== void 0 && (o.core = i.core), i.count !== void 0 && (o.count = i.count), i.fallback !== void 0 && (o.fallback = i.fallback), o;
      });
    }, f()(n, [{ key: "hasData", get: function() {
      return !!this.I.length;
    } }, { key: "retryCount", get: function() {
      return this.I.reduce(function(a, i) {
        return (typeof i.count == "number" && i.count > 0 ? i.count : 1) + a;
      }, 0);
    } }, { key: "mergedBeacon", get: function() {
      var a = [];
      return this.I.forEach(function(i) {
        var o;
        if (a.length && i.type === w.LOADER && ((o = a[a.length - 1]) == null ? void 0 : o.type) === w.LOADER) {
          var u = a[a.length - 1].count;
          a[a.length - 1].count = u ? u + 1 : 2;
        } else
          a.push(l()({}, i));
      }), this.ie(a.slice(-10));
    } }, { key: "beacon", get: function() {
      return this.ie(this.I.slice(-10));
    } }]);
  }(), Wl = function() {
    function n() {
      this.coreType = H.unknown, this.native = !1, this.codecType = v.unknown, this.gopRemux = !1, this.audioCodec = "", this.recoverSwapRemux = !1, this.recoverSwapAudioCodec = !1, this.box = void 0, this.isLive = void 0, this.autoLazyLoad = !0, this.lazyLoadRecoverDuration = 12.8, this.lazyLoadMaxDuration = 16, this.firstFrameLoaded = !1, this.startFromSec = -1, this.webWorker = !0, this.muxWorker = void 0, this.isNetworkInUse = !1, this.srcType = k.OTHERS, this.videoPlaybackQuality = void 0, this.drm = void 0, this.mixContainerInput = void 0, this.mixCodecInput = void 0, this.mixCodecAvailable = void 0, this.srcMeta = void 0, this.multipart = void 0, this.demuxerType = void 0, this.retryInfo = new Fn(), this.mainThreadRendering = void 0, this.stereoType = void 0, this.decoder = E.buildin, this.wasmDecoder = void 0, this.wasmSimd = void 0, this.wasmThreads = void 0, this.wasmThreadsEnabled = void 0, this.wasmLibHitCache = void 0, this.isKwaiSlice = void 0, this.autoPlaybackRateConf = void 0, this.preferNativeLoader = void 0, this.avSeparated = !1, this.mms = !1, this.hevcFallbackWasm = !1, this.frameBufLen = 0, this.flvAbrNotAligned = !1, this.seekingId = 1, this.liveShiftKwai2Params = { paramName: "offset", time: 0 }, this.liveStartTime = 0, this.liveShiftOffset = void 0, this.liveShiftOffsetAligned = void 0, this.ee = !1, this.ne = de.NONE;
    }
    return n.prototype.reset = function() {
      this.coreType = H.unknown, this.codecType = v.unknown, this.audioCodec = "", this.recoverSwapRemux = !1, this.recoverSwapAudioCodec = !1, this.box = y.unknown, this.autoLazyLoad = !0, this.firstFrameLoaded = !1, this.isNetworkInUse = !1, this.srcType = k.OTHERS, this.retryInfo.clear(), this.decoder = E.buildin, this.lazyLoadMaxDuration = 16, this.lazyLoadRecoverDuration = 0.8 * this.lazyLoadMaxDuration, this.isKwaiSlice = !1, this.avSeparated = !1, this.mms = !1, this.hevcFallbackWasm = !1, this.frameBufLen = 0, this.flvAbrNotAligned = !1, this.seekingId = 1, this.liveShiftKwai2Params = { paramName: "offset", time: 0 }, this.liveStartTime = 0, this.liveShiftOffset = void 0, this.ee = !1, this.ne = de.NONE, this.drm = this.videoPlaybackQuality = this.mixContainerInput = this.mixCodecInput = this.mixCodecAvailable = this.multipart = this.stereoType = this.mainThreadRendering = this.wasmDecoder = this.wasmSimd = this.wasmThreads = this.wasmLibHitCache = void 0;
    }, f()(n, [{ key: "liveShiftActive", get: function() {
      return this.liveShiftType !== de.NONE && this.ee;
    }, set: function(h) {
      this.ee = h;
    } }, { key: "liveShiftType", get: function() {
      return this.isLive && (this.ne !== de.KWAI && this.ne !== de.KWAI2 || !ee.mobile) && he(this.box) ? this.ne : de.NONE;
    }, set: function(h) {
      this.ne = h;
    } }]);
  }(), jl = function() {
    function n() {
      this.re = 0, this.Ae = 0, this.se = 0, this.ue = 0, this.ae = 0;
    }
    var h = n.prototype;
    return h.reset = function() {
      this.se = performance.now(), this.re = this.Ae = this.ue = this.ae = 0;
    }, h.getFPS = function(a) {
      if (a) {
        var i, o = performance.now(), u = a.totalVideoFrames, p = a.droppedVideoFrames;
        if (u) {
          u < this.Ae && (this.Ae = 0, this.re = 0);
          var T = o - this.se, L = p - this.re, V = u - this.Ae, W = 0, $ = 0;
          this.se && (W = parseFloat((1e3 * L / T).toFixed(2)), $ = parseFloat((1e3 * V / T).toFixed(2))), this.ue = this.ue += V, this.ae = this.ae += L, this.se = o, this.re = p, this.Ae = u, i = { decoded: this.ue, dropped: this.ae, decodedFPS: $, droppedFPS: W };
        }
        return this.se = o, i;
      }
    }, n;
  }(), Kl = function() {
    function n() {
      this._$evt = new A.EventEmitter();
    }
    var h = n.prototype;
    return h.on = function(a, i) {
      var o = this;
      return this._$evt.on(a, i), { destroy: function() {
        return o._$evt.off(a, i);
      } };
    }, h.prependListener = function(a, i) {
      var o = this;
      return this._$evt.prependListener(a, i), { destroy: function() {
        return o._$evt.off(a, i);
      } };
    }, h.removeAllListeners = function(a) {
      this._$evt.removeAllListeners(a);
    }, h.off = function(a, i) {
      this._$evt.off(a, i);
    }, h.listeners = function(a) {
      return this._$evt.listeners(a);
    }, h.emit = function(a, i) {
      return this._$evt.emit(a, i);
    }, h.listenerCount = function(a) {
      return this._$evt.listenerCount(a);
    }, n;
  }(), Bn = "level-ctx", Hn = function() {
    function n(a, i) {
      this.J = void 0, this.he = void 0, this.ce = void 0, this.fe = !1, this.ve = -1, this.de = 0, this.le = 0, this.pe = [], this.me = 0, this.ye = [], this.Me = 0, this.we = [], this.be = [], this.ge = void 0, this.ke = void 0, a.i(Bn, "constructor abr:" + i), this.J = a, this.fe = i;
    }
    var h = n.prototype;
    return h.getLevel = function(a) {
      return a === void 0 && (a = P.MAIN), a === P.MAIN ? this.pe[this.de] : a === P.AUDIO ? this.ye[this.me] : a === P.SUBTITLE ? this.we[this.Me] : void 0;
    }, h.setLevelIdx = function(a, i) {
      i === void 0 && (i = P.MAIN), i === P.MAIN ? this.currentIdx = a : i === P.AUDIO ? this.audioIdx = a : i === P.SUBTITLE && (this.subtitleIdx = a);
    }, h.getLevelIdx = function(a) {
      return a === void 0 && (a = P.MAIN), a === P.MAIN ? this.de : a === P.AUDIO ? this.me : a === P.SUBTITLE ? this.Me : -1;
    }, h.setNextIdx = function(a, i) {
      i === void 0 && (i = P.MAIN), i === P.MAIN && (this.nextIdx = a);
    }, h.getNextIdx = function(a) {
      return a === void 0 && (a = P.MAIN), a === P.MAIN ? this.le : -1;
    }, h.clearFrag = function() {
      this.J.i(Bn, "clear"), [this.pe, this.ye, this.we].forEach(function(a) {
        a.forEach(function(i) {
          var o = i;
          o.fragments && o.clear();
        });
      });
    }, h.verifyLevelIdx = function(a) {
      return this.pe.length > 0 && a < this.pe.length && a >= -1;
    }, h.verifyAudioTrackIdx = function(a) {
      return this.ye.length > 0 && a < this.ye.length && a >= 0;
    }, h.verifySubtitleTracksIdx = function(a) {
      return this.we.length > 0 && a < this.we.length && a >= 0;
    }, h.abrIndexToOrign = function(a) {
      var i = this.be[a];
      return i ? i.index : 0;
    }, h.orignIndexToAbr = function(a) {
      var i = 0;
      return this.be.forEach(function(o, u) {
        o.index !== a || (i = u);
      }), i;
    }, h._e = function() {
      var a = this, i = this.ke;
      this.ge = 0, this.be = [], this.pe.forEach(function(o, u) {
        o.default && !i && (a.ge = u), o.enableAdaptive && (!i || i && i.indexOf(u) !== -1) && a.be.push(o);
      }), this.be.sort(function(o, u) {
        return o.bitrate - u.bitrate;
      });
    }, f()(n, [{ key: "hasAudio", get: function() {
      return this.he;
    }, set: function(a) {
      this.he = a;
    } }, { key: "hasVideo", get: function() {
      return this.ce;
    }, set: function(a) {
      this.ce = a;
    } }, { key: "abr", get: function() {
      return this.fe;
    }, set: function(a) {
      this.fe = a;
    } }, { key: "startIdx", get: function() {
      return this.ve;
    }, set: function(a) {
      this.ve = a;
    } }, { key: "currentIdx", get: function() {
      return this.de;
    }, set: function(a) {
      a >= 0 && (this.de = a);
    } }, { key: "nextIdx", get: function() {
      return this.le;
    }, set: function(a) {
      a >= 0 && (this.le = a);
    } }, { key: "levels", get: function() {
      return this.pe;
    }, set: function(a) {
      this.pe = a, this._e();
    } }, { key: "current", get: function() {
      return this.pe[this.de];
    } }, { key: "currentUrl", get: function() {
      var a = this.pe[this.de];
      return (a == null ? void 0 : a.currentUrl) || "";
    } }, { key: "audioIdx", get: function() {
      return this.me;
    }, set: function(a) {
      a >= 0 && (this.me = a);
    } }, { key: "audioTracks", get: function() {
      return this.ye;
    }, set: function(a) {
      this.ye = a;
    } }, { key: "audio", get: function() {
      return this.ye[this.me];
    } }, { key: "subtitleIdx", get: function() {
      return this.Me;
    }, set: function(a) {
      a >= 0 && (this.Me = a);
    } }, { key: "subtitleTracks", get: function() {
      return this.we;
    }, set: function(a) {
      this.we = a;
    } }, { key: "subtitle", get: function() {
      return this.we[this.Me];
    } }, { key: "abrLevels", get: function() {
      return this.be;
    } }, { key: "availableList", set: function(a) {
      this.ke = a, this._e();
    } }, { key: "default", get: function() {
      return this.ge || 0;
    }, set: function(a) {
      this.ge = a;
    } }, { key: "abrDefault", get: function() {
      var a = 0;
      return this.be.forEach(function(i, o) {
        i.default && (a = o);
      }), a;
    } }]);
  }(), zl = 0, It = "loader", Vn = function() {
    function n(a) {
      var i = this;
      this.J = void 0, this.j = void 0, this.Ee = void 0, this.U = null, this.Re = void 0, this.De = void 0, this.Te = void 0, this.Se = 0, this.Oe = !1, this.Ce = !1, this.Le = void 0, this.xe = void 0, this.Ne = void 0, this.Ie = void 0, this.Fe = 0, this.Be = 0, this.je = function() {
        var o;
        i.Oe = !0, i.Ce = !1;
        var u = i.Te, p = i.j;
        (o = i.U) != null && o.onLoad && i.U.onLoad(p, u), u.code = 0, u.tfirst = 0, u.loaded = 0, i.Ue(), i.Ee = new (i.Pe())(i.J), u.type = i.Ee instanceof Le ? N.FETCH : N.XHR, i.Ee && (u.id = i.Ee.tag + "-" + i.Be, i.Re.connectionTimeout && (i.Le = setTimeout(function() {
          return i.Ve(D.LOADER_CONNECT_TIMEOUT);
        }, i.Re.connectionTimeout)), i.He(p), u.tsload = Date.now(), u.tstart = performance.now(), i.J.i(It, "[" + i.Be + "]load: " + i.Ee.tag + " " + p.url + " progress: " + p.progress + " type: " + p.type + " responseType: " + p.responseType + " range: " + p.range), i.Ee.load(p, i.De));
      }, this.We = function(o, u) {
        i.Ge();
        var p = i.Te;
        i.Qe(o, p), i.Ye(), p.code = u, p.tfirst = Math.max(p.trequest, performance.now()), i.J.i(It, "[" + i.Be + "]connect code: " + u + " len: " + p.contentLength + " totalLength: " + p.contentTotalLength), i.U && i.U.onConnect && i.U.onConnect(o, p), typeof o.rangeStart == "number" && o.rangeStart > 0 && p.code !== 206 && i.U && i.U.onError && setTimeout(function() {
          i.H(new Error("range error. " + o.range + " statu code:" + p.code));
        }, 0);
      }, this.W = function(o, u) {
        try {
          var p = i.Te;
          if (i.Fe = performance.now(), !o.breakpointContinuation && p.output > p.loaded) {
            if (p.loaded + u.byteLength - p.output > 0) {
              var T = u.slice(p.output - p.loaded);
              i.Je(i.j, T, p);
            }
            p.loaded += u.byteLength;
          } else
            p.loaded += u.byteLength, i.Je(i.j, u, p);
        } catch (L) {
          i.J.i(It, "handling data error. ", L), i.H(new Error(D.HANDLING_DATA_ERROR + ". " + L));
        }
      }, this.H = function(o) {
        i.Ze(), i.ze();
        var u, p = i.Te, T = i.Re, L = i.j, V = p.type === N.FETCH && L.monkeyPatched && L.preferNative === void 0;
        i.Oe = !1, i.J.i(It, "[" + i.Be + "]error: " + o.name + " " + (o == null ? void 0 : o.message) + " code: " + p.code + " retry: " + p.retry + "/" + T.maxRetry + " " + (V ? "monkeyPatchedFetch" : "")), i.j.breakpointContinuation && p.code === 416 || V && i.Te.output === p.loaded && p.loaded > 0 ? (u = i.U) != null && u.onEnd && i.U.onEnd(i.j, null, p) : (p.fatal = !T.maxRetry || p.retry >= T.maxRetry || !T.maxRetry, p.errName = o.name, p.errMessage = o.name + ": " + o.message + ". status: " + p.code, V && (o.name === U.FETCH_READ_ERROR_NAME && !i.Te.loaded || o.message === D.LOADER_TRANS_TIMEOUT && !i.Te.loaded || o.message === D.LOADER_CONNECT_TIMEOUT || !i.Te.code) && (i.j.preferNative = !0, i.J.i(It, "monkey patched fetch error. switch to native fetch.")), i.U && i.U.onError && i.U.onError(i.j, p), p.fatal || (T.breakpointContinuation && i.Te.contentTotalLength && (i.J.i(It, "[" + i.Be + "]breakpointContinuation. " + i.Te.loaded + " / " + i.Te.contentTotalLength), i.Te.output && i.Te.loaded > 0 ? (i.Ie ? i.j.rangeStart = i.Ie + i.Te.output : i.j.rangeStart = i.Te.output, i.j.breakpointContinuation = !0) : (i.j.rangeStart = i.Ie, i.j.breakpointContinuation = !1)), p.retry++, i.U && (i.Se ? (i.Ne = setTimeout(i.je, i.Se), i.Se = 2 * i.Se) : i.je())));
      }, this.Ve = function(o) {
        i.Oe = !1, i.Ke();
        var u = new Error(o);
        i.H(u);
      }, this.J = a, this.Be = zl += 1, this.J.i(It, "[" + this.Be + "]constructor"), this.Ee = null, this.Re = { connectionTimeout: 0, transmissionTimeout: 0, maxRetry: 0, retryDelay: 0 }, this.De = { onConnect: this.We, onProgress: this.W, onEnd: this.it.bind(this), onError: this.H };
    }
    var h = n.prototype;
    return h.Pe = function() {
      return n.qe !== void 0 || (n.qe = se, ee.msie || ee.msedge ? se.isSupportChunk() ? n.qe = se : Le.isSupported() && (n.qe = Le) : Le.isSupported() ? n.qe = Le : se.isSupportChunk() && (n.qe = se)), n.qe;
    }, h.load = function(a, i, o) {
      this.Xe(a, i, o), this.je();
    }, h.destroy = function() {
      this.Ee && this.J.i(It, "[" + this.Be + "]destroy."), this.Ze(), this.Ke(!1), this.ze(), this.U = null;
    }, h.abort = function() {
      this.J.i(It, "[" + this.Be + "]abort"), this.Ze(), this.Ke();
    }, h.Xe = function(a, i, o) {
      this.j = a, this.Ie = a.rangeStart, this.U = i, this.Re = o || this.Re, this.Te = { id: "", type: N.UNKNOWN, trequest: performance.now(), retry: 0, loaded: 0, code: 0, output: 0, tfirst: 0, tload: 0, total: 0, tsload: 0, tstart: 0, fatal: !1, errName: "", errMessage: "" }, this.Re.retryDelay && (this.Se = this.Re.retryDelay);
    }, h.ze = function() {
      this.Ee && (this.Ee.destroy(), this.Ee = null);
    }, h.Ke = function(a) {
      a === void 0 && (a = !0), a && this.U && this.U.onAbort && !this.Ce && this.Oe && this.U.onAbort(this.j, this.Te), this.Ce = !0, this.Ee && this.Ee.abort();
    }, h.Ze = function() {
      this.Ge(), this.Ue(), this.$e();
    }, h.Je = function(a, i, o) {
      this.Te.output += i.byteLength, this.U && this.U.onProgress && this.U.onProgress(a, i, o);
    }, h.it = function(a, i) {
      this.Ze();
      var o = this.Te;
      this.Qe(a, o), o.total = i ? o.loaded = typeof i == "string" ? i.length || 0 : i.byteLength || 0 : o.loaded, o.tload = Math.max(o.tfirst, performance.now()), this.Oe = !1, o.output = 0, this.J.i(It, "[" + this.Be + "]end size: " + o.total + " duration: " + o.trequest + "-" + o.tload), this.U && this.U.onEnd(a, i, o);
    }, h.Ye = function() {
      var a = this;
      this.$e(), this.Fe = performance.now();
      var i = this.Re.transmissionTimeout || 0;
      i && (this.xe = setInterval(function() {
        performance.now() - a.Fe > i && a.Ve(D.LOADER_TRANS_TIMEOUT);
      }, 1e3));
    }, h.$e = function() {
      this.xe && (clearInterval(this.xe), this.xe = void 0);
    }, h.Ge = function() {
      this.Le && (clearTimeout(this.Le), this.Le = void 0);
    }, h.Ue = function() {
      this.Ne && (clearTimeout(this.Ne), this.Ne = void 0);
    }, h.He = function(a) {
      if (a.rangeEnd || a.rangeStart)
        if (a.rangeType && a.rangeType !== I.STANDARD && typeof a.url == "string") {
          var i = new Tt.a(a.url, !0);
          a.rangeEnd ? (i.query.start = (a.rangeStart || 0).toString(), i.query.end = (a.rangeEnd - 1).toString()) : a.rangeStart && (i.query.start = a.rangeStart.toString()), a.url = i.toString();
        } else
          a.rangeEnd ? a.range = "bytes=" + (a.rangeStart || 0) + "-" + (a.rangeEnd - 1) : a.rangeStart && (a.range = "bytes=" + a.rangeStart + "-");
    }, h.Qe = function(a, i) {
      if (!i.contentTotalLength || !i.contentLength) {
        var o = a.responseHeader;
        if (o) {
          if (a.range || typeof a.rangeStart == "number") {
            var u = o["content-range"];
            u && (i.contentTotalLength = parseInt((Array.isArray(u) ? u[0] || "0" : u).split("/")[1] || "0") || 0);
          }
          var p = o["content-length"];
          p && (i.contentLength = parseInt(Array.isArray(p) ? p[0] || "0" : p) || 0);
        }
      }
    }, f()(n, [{ key: "context", get: function() {
      return this.j;
    } }, { key: "config", get: function() {
      return this.Re;
    } }]);
  }();
  Vn.qe = void 0;
  var jt = { local: 0, server: 0 }, Fi = "live-time", Rt = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this) || this).J = void 0, o.tn = { abst: 0, originDTS: 0 }, o.en = void 0, o.nn = void 0, h.J = o.J = i, i.i(Fi, "constructor"), h.rn = { onError: h.An, onEnd: h.un }, h.an = { connectionTimeout: 5e3 }, o;
    }
    R()(h, n), h.load = function(i, o) {
      h.hn();
      var u = { url: "https://ntp.nc.gifshow.com/", responseType: "text", progress: !1, preferNative: o };
      (h.Ee = new Vn(i)).load(u, h.rn, h.an);
    };
    var a = h.prototype;
    return a.ntpSync = function(i) {
      this.J.i(Fi, "sync. state:", h.cn);
      var o = performance.now();
      (h.cn === "suspend" || o - h.fn > 18e5) && (this.J.i(Fi, "sync start."), h.fn = o, h.cn = "loading", h.load(this.J, i));
    }, a.onPrivNal = function(i) {
      var o = this;
      i.info.forEach(function(u) {
        typeof u.abst == "number" && typeof i.streamTimestamp == "number" && (o.tn.abst = u.abst / 1e3, o.tn.originDTS = i.streamTimestamp / 1e3);
      });
    }, a.onParsing = function(i) {
      var o = this;
      i.segments.forEach(function(u) {
        u.type === G.VIDEO ? o.en = { dts: u.startDTS, originDTS: u.originFirstDTS, parseTime: u.firstParseTime } : u.type === G.AUDIO && (o.nn = { dts: u.startDTS, originDTS: u.originFirstDTS, parseTime: u.firstParseTime });
      });
    }, a.destroy = function() {
      h.hn();
    }, a.getDisplayDelay = function(i) {
      return this.vn(i, this.en);
    }, a.getAudioRenderDelay = function(i) {
      return this.vn(i, this.nn);
    }, a.getRecDelay = function() {
      var i = this.en;
      if (this.serverNowMs && i != null && i.parseTime) {
        var o = this.tn, u = this.serverMs(1e3 * i.parseTime + h.dn);
        if (u && o.originDTS && o.abst)
          return Math.round(u - 1e3 * (i.originDTS - o.originDTS + o.abst));
      }
      return 0;
    }, a.serverMs = function(i) {
      return jt.server ? i - jt.local + jt.server : null;
    }, a.vn = function(i, o) {
      var u = this.serverNowMs, p = this.tn;
      return u && o && p.abst && p.originDTS ? Math.round(1e3 * (o.dts - i - (o.originDTS - p.originDTS + p.abst)) + u) : 0;
    }, h.hn = function() {
      h.Ee && h.Ee.destroy();
    }, f()(h, [{ key: "syncState", get: function() {
      return h.cn;
    } }, { key: "time", get: function() {
      return l()({}, jt);
    } }, { key: "now", get: function() {
      return this.serverNowMs || Date.now();
    } }, { key: "serverNowMs", get: function() {
      return jt.server ? performance.now() - jt.local + jt.server : null;
    } }], [{ key: "workerTimeOffset", set: function(i) {
      h.dn = i;
    } }]);
  }(S);
  Ui = Rt, Rt.dn = 0, Rt.Ee = void 0, Rt.rn = void 0, Rt.an = void 0, Rt.cn = "suspend", Rt.J = void 0, Rt.fn = void 0, Rt.An = function() {
    Ui.J.i(Fi, "ntp sync load error."), Ui.hn();
  }, Rt.un = function(n, h) {
    if (Ui.hn(), typeof h == "string") {
      jt.local = performance.now();
      var a = h.split(",");
      a.length > 1 && (jt.server = 1e3 * parseFloat(a[0]) + parseInt(a[1], 10) / 1e3 / 2);
    }
  };
  var Gn = Rt, Wn = function() {
    function n() {
      this.ln = 0, this.pn = [], this.mn = [], this.yn = {}, this.Mn = {}, this.wn = void 0, this.bn = 0, this.gn = 0, this.kn = 0, this._n = 0, this.En = 0, this.Rn = 0, this.Dn = 0;
    }
    var h = n.prototype;
    return h.onStreamOpen = function(a, i, o, u) {
      if (this.pn.length > 10) {
        var p = this.pn.shift();
        if (p) {
          this.yn[p.vCodecType] = (this.yn[p.vCodecType] || 0) + p.traffic;
          var T = p.qualityType || "unknown";
          this.Mn[T] = (this.Mn[T] || 0) + p.traffic;
        }
      }
      var L = this.wn ? this.wn.index + 1 : 0;
      this.wn = { index: L, startPos: a, url: i, bitrate: o, qualityType: u, traffic: 0, loadTimeCost: 0, keyFrame: 0, videoDataRate: 0, audioDataRate: 0, speed: 0, vCodecType: v.unknown, segments: [] }, this.pn.push(this.wn);
    }, h.onMediaInfo = function(a) {
      var i = this.pn[this.pn.length - 1];
      i && (a.videoCodecType && (i.vCodecType = a.videoCodecType), i.mediaInfo = l()({}, a));
    }, h.setRTCStats = function(a) {
      var i = this.wn;
      i && (i.traffic = a.totalReceive, i.audioDataRate = a.audioDataRate, i.videoDataRate = a.videoDataRate, i.speed = a.speed, i.keyFrame = a.key, this.ln = i.traffic);
    }, h.onDataReceive = function(a) {
      this.ln += a.byteLength;
      var i = this.mn;
      i.length > 200 && i.pop(), i.unshift(a);
      var o = this.wn;
      o && (o.traffic += a.byteLength, o.loadTimeCost += a.timeCost, o.speed = Math.round(o.traffic / o.loadTimeCost * 1e3) || 0);
    }, h.onParsing = function(a) {
      var i = this;
      a.segments.forEach(function(o) {
        if (i.Tn(o.type, 1e3 * (o.endDTS - o.startDTS), o.payload.byteLength), o.type === G.VIDEO) {
          var u = o.endDTS - o.startDTS;
          isNaN(u) || (i.kn += Math.round(1e3 * u)), o.fillDuration && (i.En += Math.round(1e3 * o.fillDuration)), o.droppedDuration && (i.Dn += Math.round(1e3 * o.droppedDuration));
        }
        if (o.type === G.AUDIO) {
          var p = o.endDTS - o.startDTS;
          isNaN(p) || (i.gn += Math.round(1e3 * p)), o.fillDuration && (i._n += Math.round(1e3 * o.fillDuration)), o.droppedDuration && (i.Rn += Math.round(1e3 * o.droppedDuration));
        }
      });
    }, h.onRaw = function(a) {
      if (a.samples.length) {
        var i = a.samples.reduce(function(u, p) {
          return p.yuv ? u + p.yuv.y.bytes.length + p.yuv.u.bytes.length + p.yuv.v.bytes.length : u + p.units.reduce(function(T, L) {
            return T + L.data.byteLength;
          }, 0);
        }, 0), o = a.samples[a.samples.length - 1].dts - a.samples[0].dts + (a.samples[a.samples.length - 1].duration || 0);
        this.Tn(G.VIDEO, o / 90, i);
      }
    }, h.downloadInfoByRange = function(a) {
      a === void 0 && (a = 1e3);
      var i = { size: 0, timeCost: 0 };
      if (this.mn.length)
        for (var o = performance.now(), u = 0; u < this.mn.length; u++) {
          var p = this.mn[u];
          if (!(p && p.ts > o - a))
            break;
          i.size += p.byteLength, i.timeCost += p.timeCost;
        }
      return i;
    }, h.Tn = function(a, i, o) {
      var u = this.pn[this.pn.length - 1];
      if (u) {
        var p = u.segments;
        p.push({ type: a, duration: i, byteLength: o }), p.length > 200 && p.shift();
        for (var T = 0, L = 0, V = 0; V < p.length; V++) {
          var W = p[V];
          W && W.type === a && (L += W.byteLength, T += W.duration);
        }
        T > 0 && (a === G.VIDEO ? u.videoDataRate = Math.round(8 * L / T) : a === G.AUDIO && (u.audioDataRate = Math.round(8 * L / T)));
      }
    }, f()(n, [{ key: "smoothedDownloadSpeed", get: function() {
      var a = this.mn, i = a[0];
      return i && !i.progress ? i.byteLength / i.timeCost * 1e3 : 1e3 * a.reduceRight(function(o, u) {
        var p = u.byteLength / u.timeCost;
        return o > 0 ? p * (1 - 0.9) + 0.9 * o : p;
      }, 0);
    } }, { key: "trafficGroupedByVCodecType", get: function() {
      var a = l()({}, this.yn);
      return a.total = this.ln, this.pn.forEach(function(i) {
        a[i.vCodecType] = (a[i.vCodecType] || 0) + i.traffic;
      }), a;
    } }, { key: "trafficGroupedByLevel", get: function() {
      var a = l()({}, this.Mn);
      return a.total = this.ln, this.pn.forEach(function(i) {
        var o = i.qualityType || "unknown";
        a[o] = (a[o] || 0) + i.traffic;
      }), a;
    } }, { key: "traffic", get: function() {
      return this.ln;
    } }, { key: "speed", get: function() {
      var a = this.wn, i = this.downloadInfoByRange();
      return this.mn.length ? i.timeCost ? Math.round(i.size / i.timeCost * 1e3) : 0 : (a == null ? void 0 : a.speed) || 0;
    } }, { key: "currentLoad", get: function() {
      return this.wn;
    } }, { key: "streams", get: function() {
      return this.pn;
    } }, { key: "contentLen", get: function() {
      return this.bn;
    }, set: function(a) {
      this.bn = a;
    } }, { key: "muxA", get: function() {
      return this.gn;
    } }, { key: "muxV", get: function() {
      return this.kn;
    } }, { key: "fillA", get: function() {
      return this._n;
    } }, { key: "fillV", get: function() {
      return this.En;
    } }, { key: "droppedA", get: function() {
      return this.Rn;
    } }, { key: "droppedV", get: function() {
      return this.Dn;
    } }]);
  }(), Bi = r(5), Jl = function(n) {
    return n.WIDEVINE = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed", n;
  }({});
  !dt() && window.navigator && window.navigator.requestMediaKeySystemAccess && window.navigator.requestMediaKeySystemAccess.bind(window.navigator);
  function jn(n) {
    return !n.drmSchemaId || n.drmSchemaId === Jl.WIDEVINE;
  }
  var $l = new RegExp('codecs="((/w|.)+)"'), Rr = [{ k: "video/mp4", v: y.mp4 }, { k: "video/quicktime", v: y.mp4 }, { k: "video/x-flv", v: y.flv }, { k: "video/webm", v: y.matroska }, { k: "video/x-matroska", v: y.matroska }, { k: "video/mp2t", v: y.ts }, { k: "audio/x-matroska", v: y.matroska }, { k: "audio/mp4", v: y.mp4 }, { k: "audio/mpeg", v: y.mp3 }, { k: "audio/aac", v: y.aac }, { k: "application/vnd.apple.mpegurl", v: y.hls }, { k: "application/x-mpegurl", v: y.hls }, { k: "audio/wave", v: y.wav }, { k: "audio/wav", v: y.wav }, { k: "audio/x-wav", v: y.wav }, { k: "audio/x-pn-wav", v: y.wav }];
  function Kn(n) {
    for (var h = { type: n, box: y.unknown, vCodec: v.unknown }, a = 0; a < Rr.length; a++)
      if (n.toLocaleLowerCase().indexOf(Rr[a].k) === 0) {
        h.box = Rr[a].v;
        var i = n.match($l);
        i && i.length > 2 && i[1].split(",").forEach(function(o) {
          o.indexOf("avc1") === 0 ? h.vCodec = v.h264 : o.indexOf("av01") === 0 ? h.vCodec = v.av1 : o.indexOf("hev1") !== 0 && o.indexOf("hvc1") !== 0 || (h.vCodec = v.hevc);
        });
        break;
      }
    return h;
  }
  var bi = function() {
    function n(h) {
      this.url = [], this.urlId = 0, this.bitrate = 0, this.maxBitrate = 0, this.qualityType = "", this.qualityLabel = "", this.id = 0, this.codec = "", this.audioCodec = "", this.videoCodec = "", this.hidden = !1, this.enableAdaptive = !0, this.default = !1, this.width = void 0, this.height = void 0, this.index = 0, this.drmSchemaId = "", this.drmToken = "", this.hdr = void 0, this.vCodecType = v.unknown, this.meta = void 0, this.fileName = void 0, this.fileSize = void 0, this.dropVideo = [], this.url = [h], this.urlId = 0;
    }
    return n.prototype.getKLevel = function() {
      return { width: this.width, height: this.height, qualityLabel: this.qualityLabel, qualityType: this.qualityType, bitrate: this.bitrate, maxBitrate: this.maxBitrate };
    }, f()(n, [{ key: "currentUrl", get: function() {
      return this.url[this.urlId] || "";
    } }]);
  }(), zn = function() {
    function n() {
    }
    return n.verify = function(h) {
      return !!(h && Object.prototype.hasOwnProperty.call(h, "version") && Object.prototype.hasOwnProperty.call(h, "adaptationSet") && Object.prototype.hasOwnProperty.call(h.adaptationSet, "representation") && Array.isArray(h.adaptationSet.representation) && h.adaptationSet.representation.length > 0) && h.adaptationSet.representation.reduce(function(a, i) {
        return !!(a && i.url && i.bitrate && i.qualityType);
      }, !0);
    }, n.parse = function(h) {
      var a, i = [];
      return n.verify(h) && h.adaptationSet.representation.forEach(function(o, u) {
        var p = new bi(o.url);
        p.id = o.id || u, p.maxBitrate = o.bitrate || 0, p.bitrate = o.averageBitrate || p.maxBitrate, p.qualityType = o.qualityType || "", p.qualityLabel = o.name || "", p.codec = o.codec || "", p.hidden = o.hidden || !1, p.enableAdaptive = o.enableAdaptive === void 0 || !!o.enableAdaptive, p.default = o.defaultSelect || !1, p.index = u, i.push(p), p.default && a === void 0 && (a = u);
      }), { levels: i, def: a || 0, srcType: k.KWAI_FLV_ABR };
    }, n;
  }(), ql = function() {
    return f()(function(n, h) {
      this.Sn = null, this.baseuri = void 0, this.reluri = void 0, this.method = null, this.key = null, this.iv = void 0, this.baseuri = n, this.reluri = h;
    }, [{ key: "uri", get: function() {
      return !this.Sn && this.reluri && (this.Sn = Object(Bi.buildAbsoluteURL)(this.baseuri, this.reluri, { alwaysNormalize: !0 })), this.Sn;
    } }]);
  }(), Jn = function(n) {
    return n.AUDIO = "audio", n.VIDEO = "video", n;
  }({}), $n = function() {
    function n() {
      var a;
      this.On = "", this.Cn = null, this.Ln = null, this.xn = ((a = {})[Jn.AUDIO] = !1, a[Jn.VIDEO] = !1, a), this.rawProgramDateTime = null, this.programDateTime = null, this.tagList = [], this.relurl = void 0, this.baseurl = void 0, this.duration = void 0, this.sn = 0, this.levelkey = void 0, this.level = 0, this.start = 0, this.cc = 0, this.maxStartPTS = 0, this.startPTS = void 0, this.endPTS = void 0, this.startDTS = void 0, this.endDTS = void 0, this.deltaPTS = void 0, this.dropped = 0, this.type = void 0, this.loader = void 0, this.title = null, this.urlId = 0, this.data = void 0;
    }
    var h = n.prototype;
    return h.setByteRange = function(a, i) {
      var o = a.split("@", 2), u = [];
      o.length === 1 ? u[0] = i ? i.byteRangeEndOffset : 0 : u[0] = parseInt(o[1], 10), u[1] = parseInt(o[0], 10) + u[0], this.Cn = u;
    }, h.addElementaryStream = function(a) {
      this.xn[a] = !0;
    }, h.hasElementaryStream = function(a) {
      return this.xn[a] === !0;
    }, h.createInitializationVector = function(a) {
      for (var i = new Uint8Array(16), o = 12; o < 16; o++)
        i[o] = a >> 8 * (15 - o) & 255;
      return i;
    }, h.setDecryptDataFromLevelKey = function(a, i) {
      var o = a;
      return a && a.method && a.uri && !a.iv && ((o = new ql(a.baseuri, a.reluri)).method = a.method, o.iv = this.createInitializationVector(i)), o;
    }, f()(n, [{ key: "url", get: function() {
      return !this.On && this.relurl && (this.On = Object(Bi.buildAbsoluteURL)(this.baseurl, this.relurl, { alwaysNormalize: !0 })), this.On;
    }, set: function(a) {
      this.On = a;
    } }, { key: "byteRange", get: function() {
      return this.Cn ? this.Cn : [];
    } }, { key: "byteRangeStartOffset", get: function() {
      return this.byteRange[0];
    } }, { key: "byteRangeEndOffset", get: function() {
      return this.byteRange[1];
    } }, { key: "decryptdata", get: function() {
      if (!this.levelkey && !this.Ln)
        return null;
      if (!this.Ln && this.levelkey) {
        var a = this.sn;
        typeof a != "number" && (a = 0), this.Ln = this.setDecryptDataFromLevelKey(this.levelkey, a);
      }
      return this.Ln;
    } }, { key: "endProgramDateTime", get: function() {
      if (this.programDateTime === null || !Number.isFinite(this.programDateTime))
        return null;
      var a = Number.isFinite(this.duration) ? this.duration : 0;
      return this.programDateTime + 1e3 * a;
    } }, { key: "encrypted", get: function() {
      return !(!this.decryptdata || this.decryptdata.uri === null || this.decryptdata.key !== null);
    } }]);
  }(), Hi = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this, i) || this).startSN = 0, o.endSN = 0, o.fragments = [], o.initSegment = null, o.live = !0, o.needSidxRanges = !1, o.startTimeOffset = null, o.targetduration = 0, o.totalduration = 0, o.type = null, o.version = null, o.ptsKnown = !1, o.m3u8Slice = void 0, o.audioGroupIds = void 0, o.attrs = void 0, o.averagetargetduration = void 0, o.name = void 0, o.lang = void 0, o.groupId = "", o.instreamId = "", o.autoselect = void 0, o.forced = void 0, o.size = 0, o.partOfData = !1, o.http416 = 0, o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.clear = function() {
      this.fragments = [], this.startSN = 0, this.endSN = 0, this.initSegment = null, this.m3u8Slice = void 0, this.live = !0, this.needSidxRanges = !1, this.startTimeOffset = 0;
    }, a.mergeFrom = function(i, o) {
      if (o === void 0 && (o = !1), i.fragments.length) {
        var u = this.endSN;
        if (this.endSN = i.endSN, i.partOfData || (i.initSegment && !this.initSegment && (this.initSegment = i.initSegment), this.live = i.live, this.needSidxRanges = i.needSidxRanges, this.targetduration = i.targetduration, this.ptsKnown = i.ptsKnown, this.averagetargetduration = i.averagetargetduration, this.hasFrag || (this.m3u8Slice = i.m3u8Slice, this.audioGroupIds = i.audioGroupIds, this.attrs = i.attrs, this.name = i.name, this.lang = i.lang, this.groupId = i.groupId, this.instreamId = i.instreamId, this.autoselect = i.autoselect, this.forced = i.forced)), o && this.fragments.length) {
          for (var p, T = i.fragments.length, L = 0; L < i.fragments.length; L++) {
            var V = i.fragments[L].sn;
            if (typeof V == "number" && V > u) {
              T = L;
              break;
            }
          }
          if (this.fragments.length && i.fragments.splice(0, T), i.partOfData) {
            var W = this.fragments[this.fragments.length - 1], $ = W.endPTS, te = W.cc;
            $ && i.fragments.forEach(function(be) {
              be.start = be.startPTS = $, be.endPTS = be.startPTS + be.duration, $ = be.endPTS, be.cc = te + be.cc;
            });
          }
          (p = this.fragments).push.apply(p, i.fragments), this.totalduration = this.fragments.reduce(function(be, ie) {
            return be + ie.duration;
          }, 0), i.partOfData ? this.size += i.size : this.size = i.size;
        } else
          this.startSN = i.startSN, this.fragments = i.fragments, this.totalduration = i.totalduration, this.size = i.size;
      }
    }, a.getTimeInfoAfter = function(i) {
      i === void 0 && (i = 0);
      var o, u, p = [], T = [];
      return this.fragments.forEach(function(L) {
        typeof L.sn == "number" && (L.sn >= i && typeof u == "number" && u !== L.cc && (o ? o.push({ sn: L.sn, start: L.start }) : o = [{ sn: L.sn, start: L.start }]), u = L.cc, L.sn >= i && (p.push(L.start), typeof L.programDateTime == "number" && T.push(L.programDateTime)));
      }), { live: this.live, startSn: this.startSN, endSn: this.endSN, duration: this.totalduration, times: p, utcs: T, discontinuity: o, targetduration: this.targetduration };
    }, f()(h, [{ key: "timeInfo", get: function() {
      return this.getTimeInfoAfter();
    } }, { key: "hasProgramDateTime", get: function() {
      return !(!this.fragments[0] || typeof this.fragments[0].programDateTime != "number" || !Number.isFinite(this.fragments[0].programDateTime));
    } }, { key: "hasFrag", get: function() {
      return this.fragments.length > 0;
    } }]);
  }(bi), qn = function() {
    function n() {
    }
    return n.verify = function(h) {
      return !!(h && Object.prototype.hasOwnProperty.call(h, "segments") && Array.isArray(h.segments) && h.segments.length > 0) && (h.segments.forEach(function(a) {
        if (!a.url || !a.duration || !a.time)
          return !1;
      }), !0);
    }, n.parse = function(h, a) {
      a === void 0 && (a = "");
      var i = [], o = { levels: i, withCredentials: !1, hasVideo: !0, hasAudio: !0 };
      if (n.verify(h)) {
        var u = new Hi("");
        i.push(u);
        var p = h;
        o.withCredentials = !!p.withCredentials, p.hasAudio !== void 0 && (o.hasAudio = !!p.hasAudio), p.hasVideo !== void 0 && (o.hasVideo = !!p.hasVideo);
        var T = 0, L = 0, V = 0, W = 0, $ = 0;
        p.segments.forEach(function(te, be) {
          var ie = new $n();
          ie.sn = be, typeof te.startUtcTime == "string" ? ie.programDateTime = parseInt(te.startUtcTime) : typeof te.startUtcTime == "number" && (ie.programDateTime = te.startUtcTime), typeof te.duration == "string" ? ie.duration = (parseFloat(te.duration) || 0) / 1e3 : ie.duration = (te.duration || 0) / 1e3, ie.start = T, ie.baseurl = a, ie.relurl = te.url, te.filesize && ($ += te.filesize), ie.duration > W && (W = ie.duration), T += ie.duration, be > 0 && V !== te.periodId && (ie.tagList.push(["DIS"]), L++), ie.cc = L, V = te.periodId, u.fragments.push(ie);
        }), u.bitrate = 8 * $ / 1024 / u.totalduration, u.live = !1, u.type = P.MAIN, u.startSN = 0, u.endSN = u.fragments.length - 1, u.totalduration = T, u.targetduration = W, u.averagetargetduration = T / u.fragments.length;
      }
      return o;
    }, n;
  }(), Yn = function() {
    function n() {
    }
    return n.verify = function(h) {
      return !!(h && h.adaptationSet && h.adaptationSet.representation && h.adaptationSet.representation.length) && h.adaptationSet.representation.reduce(function(a, i) {
        return !!(i.url && i.bandwidth && a);
      }, !0);
    }, n.parse = function(h) {
      var a = [];
      return n.verify(h) && h.adaptationSet.representation.forEach(function(i) {
        if (i && (i.url || i.m3u8)) {
          var o = new Hi(i.baseUrl ? Object(Bi.buildAbsoluteURL)(i.baseUrl, i.url, { alwaysNormalize: !0 }) : i.url);
          o.bitrate = Math.floor(i.bandwidth / 1e3), o.maxBitrate = Math.floor(i.bandwidth / 1e3), o.qualityType = i.qualityType || "", o.qualityLabel = i.qualityLabel || "", i.width && i.height && (o.width = i.width, o.height = i.height), Nl(i.codecs || "", o), o.audioCodec = "", o.m3u8Slice = i.m3u8 || i.m3u8Slice, o.totalduration = i.duration, i.backupUrl && i.backupUrl.length && (o.url = o.url.concat(i.backupUrl)), o.default = i.defaultSelect || !1, o.urlId = 0, a.push(o);
        }
      }), { levels: a, def: 0 };
    }, n;
  }(), Yl = function(n) {
    return n[n.LongVideo = 1] = "LongVideo", n[n.ShortVideo = 2] = "ShortVideo", n[n.LiveGame = 3] = "LiveGame", n[n.LiveShow = 4] = "LiveShow", n[n.LivePlayBack = 5] = "LivePlayBack", n;
  }({}), Ql = { 1: y.hls_ts, 2: y.mp4, 3: y.flv, 4: y.hls_fmp4 }, Qn = { avc: v.h264, hevc: v.hevc, av1: v.av1, kvc3: v.kvc3, kvc4: v.kvc4, kvc5: v.kvc5, kvc6: v.kvc6, kvc30: v.kvc30 };
  function Zn(n) {
    var h = y.unknown;
    if (n && n.length < 2048)
      for (var a = n.split(`
`), i = 0; i < a.length; i++) {
        var o = a[i].trim();
        o && o.indexOf("#") !== 0 && (h = et(o));
      }
    return h === y.ts ? y.hls_ts : h === y.mp4 ? y.hls_fmp4 : y.unknown;
  }
  var Sr, Xn = function() {
    function n() {
    }
    return n.verify = function(h) {
      return !!(h && h.adaptationSet && h.adaptationSet.length) && h.adaptationSet.reduce(function(a, i) {
        return !!(a && i.representation && i.representation.length);
      }, !0);
    }, n.parse = function(h, a) {
      a === void 0 && (a = !1);
      var i, o, u, p, T, L, V, W, $, te = [], be = !1, ie = 0, Te = [], Re = {};
      if (n.verify(h)) {
        var ve = h;
        L = Ql[ve.mediaType], V = ve.stereoType === 1 ? Q.V360 : Q.Normal, ve.businessType !== void 0 && (W = ve.businessType >= 3 && ve.businessType <= 5), ve.businessType === Yl.LivePlayBack && ($ = !0), ve.version && (Re.version = ve.version), ve.videoId && (Re.videoId = ve.videoId), ve.videoBaseFeature && (Re.videoBaseFeature = ve.videoBaseFeature), ve.videoAestheticFeature && (Re.videoAestheticFeature = ve.videoAestheticFeature), ve.videoFeature && (Re.videoFeature = ve.videoFeature), typeof ve.programStartTime == "number" && (Re.programStartTime = ve.programStartTime), ve.adaptationSet.forEach(function(Qe) {
          var Ot = Qe.duration / 1e3;
          W === void 0 && Ot && (W = !1), !ie && Ot && (ie = Ot);
          var vu = Qe.drmSchemaId, _u = Qe.drmToken;
          Qe.drmSchemaId && (be = !0);
          var yt = P.MAIN;
          if (Qe.mimeType && (Qe.mimeType.indexOf("video") !== -1 ? Re.videoMimeType = Qe.mimeType : Qe.mimeType.indexOf("audio") !== -1 ? (Re.audioMimeType = Qe.mimeType, yt = P.AUDIO) : Qe.mimeType === "text/vtt" ? (Re.subtitleMimeType = Qe.mimeType, yt = P.SUBTITLE) : yt = void 0), yt) {
            yt === P.MAIN ? Re.videoDuration = Qe.duration : yt === P.AUDIO && (Re.audioDuration = Qe.duration);
            var Nr = Qe.representation.map(function(xe, wi) {
              var ke;
              if (!L && xe.m3u8Slice && (L = Zn(xe.m3u8Slice)), L || (L = et(xe.url)), he(L) ? ((ke = new Hi(xe.url)).lang = Qe.language || "", ke.default = !!xe.defaultSelect, ke.id = xe.id || wi, ke.m3u8Slice = xe.m3u8Slice, ke.totalduration = Ot || ie) : ke = new bi(xe.url), typeof xe.fileSize == "number" && (ke.fileSize = xe.fileSize), ke.vCodecType = v.unknown, ke.hdr = xe.hdrType || 0, ke.maxBitrate = xe.maxBitrate || 0, ke.bitrate = xe.avgBitrate || ke.maxBitrate, ke.qualityType = xe.qualityType || "", ke.qualityLabel = xe.qualityLabel || "", ke.codec = xe.codecs || "", ke.codec) {
                var mu = Cn(ke.codec);
                ke.videoCodec = mu.video || "", ke.vCodecType = Dn(ke.videoCodec);
              }
              return xe.videoCodec && Qn[xe.videoCodec] && (ke.vCodecType = Qn[xe.videoCodec] || v.unknown), Te.push(ke.vCodecType), ve.adaptationSet.length === 1 && (ke.audioCodec = ""), xe.width && xe.height && (ke.width = xe.width, ke.height = xe.height), ke.hidden = xe.hidden || !1, ke.enableAdaptive = xe.disableAdaptive === void 0 || !xe.disableAdaptive, ke.default = xe.defaultSelect || !1, ke.index = wi, ke.drmSchemaId = xe.drmSchemaId || vu, ke.drmToken = xe.drmToken || _u, ke.drmSchemaId && (be = !0), xe.backupUrl && xe.backupUrl.length && (ke.url = ke.url.concat(xe.backupUrl)), ke.urlId = 0, ke.default && u === void 0 && (yt === P.MAIN ? u = wi : yt === P.AUDIO ? p = wi : yt === P.SUBTITLE && (T = wi)), (xe.comment || xe.kvqScore) && (ke.meta = { comment: xe.comment, kvqScore: xe.kvqScore }), ke;
            });
            yt === P.MAIN ? te = te.concat(Nr) : yt === P.AUDIO ? (i || (i = []), i = i.concat(Nr)) : yt === P.SUBTITLE && (o || (o = []), o = o.concat(Nr));
          }
        });
      }
      if (o && n.processingSubtitleType(o, ie), a)
        return [{ codecType: Te.length === 1 ? Te[0] : v.unknown, mediaLevels: { levels: te, def: u || 0, audioTracks: i, defAudio: p || 0, subtitleTracks: o, defSubtitle: T || 0, drm: be, box: L, stereoType: V, isLive: W, meta: Re } }];
      var Pe = {};
      te.forEach(function(Qe) {
        var Ot = Pe[Qe.vCodecType];
        Ot || (Pe[Qe.vCodecType] = Ot = { def: 0, levels: [] }), Qe.default && (Ot.def = Ot.levels.length), Ot.levels.push(Qe);
      });
      var Ye = Object.keys(Pe).length, lt = [];
      for (var Ei in Pe) {
        var Dt = Pe[Ei];
        if (Dt) {
          var Mr = Dt.levels[0];
          if (Ye > 1 && Mr && Mr.m3u8Slice) {
            var wo = Zn(Mr.m3u8Slice);
            he(wo) && (L = wo);
          }
          lt.push({ codecType: Ei, mediaLevels: { levels: Dt.levels, def: Dt.def, audioTracks: i, defAudio: p || 0, subtitleTracks: o, defSubtitle: T || 0, drm: be, box: L, stereoType: V, isLive: W, isLiveShift: $, meta: Re } });
        }
      }
      return lt;
    }, n.processingSubtitleType = function(h, a) {
      h.forEach(function(i, o) {
        if (et(i.currentUrl) === y.hls) {
          i.live = !1, i.index = o, i.totalduration = a, i.targetduration = a, i.endSN = 1;
          var u = new $n();
          u.type = P.SUBTITLE, u.start = 0, u.sn = 1, u.level = o, u.cc = 0, u.url = i.currentUrl, u.duration = a, i.fragments = [u];
        }
      });
    }, n.getAdaptationIdxByType = function(h, a) {
      for (var i = 0; i < h.adaptationSet.length; i++) {
        var o = h.adaptationSet[i];
        if (o) {
          var u;
          if (o.mimeType === void 0)
            return a === "video" ? 0 : -1;
          if (((u = o.mimeType) == null ? void 0 : u.indexOf(a)) === 0)
            return i;
        }
      }
      return -1;
    }, n;
  }(), eo = new RegExp("^((http|https)://)|blob:"), Zl = [y.matroska, y.mp3, y.aac], Xl = [y.flv, y.raw, y.webrtc, y.ivf], eu = [y.mp4, y.flv, y.hls, y.raw, y.hls_fmp4, y.hls_ts, y.ts, y.ivf], to = Object.values(v), Ce = "media-src", io = function() {
    function n() {
    }
    return n.verifyMix = function(h) {
      var a = 0;
      for (var i in h)
        to.indexOf(i) !== -1 && a++;
      return a > 0;
    }, n.isSrcEmpty = function(h) {
      try {
        if (typeof h == "string") {
          if (!(h = h.trim()))
            return !0;
          if (!eo.test(h))
            return Object.keys(JSON.parse(h)).length === 0;
        } else if (!(h instanceof Blob))
          return !h || Object.keys(h).length === 0;
      } catch (a) {
      }
      return !1;
    }, n.filteringLevels = function(h, a, i) {
      i === void 0 && (i = !1), h.i(Ce, "filteringLevels. input: " + a.levels.length + ". mse: " + _e.isMSEAvailable() + " mixCodec: " + i);
      var o = ee.chrome || ee.firefox;
      a.levels.forEach(function(T) {
        o && T.audioCodec && T.audioCodec.indexOf("mp4a.40.34") !== -1 && (T.audioCodec = "");
      });
      var u = _e.isMSEAvailable() ? _e.isMSECodecStrSupportedInMp4 : _e.isVideoCodecStrSupportedInMp4, p = _e.isMSEAvailable() ? _e.isMSECodecSupported : _e.isVideoCodecSupported;
      return a.levels = a.levels.filter(function(T) {
        var L = !T.audioCodec || u(T.audioCodec, "audio"), V = typeof T.hdr == "number" && T.hdr > 0, W = !0;
        (i || T.vCodecType === v.av1 || ee.mobile) && ((W = T.videoCodec ? u(T.videoCodec) : T.vCodecType === v.unknown || p(T.vCodecType, _e.getPlayTestDefinition(T), V)) || h.i(Ce, "filteringLevels. " + T.qualityType + " v unsupported. codec: " + T.vCodecType + " hdr: " + V), T.qualityType.toLocaleLowerCase().indexOf("4k") >= 0 && (ee.mobile && (W = !1), W || h.i(Ce, "filteringLevels. " + T.qualityType + " v unsupported. mobile: " + ee.mobile)));
        var $ = jn(T);
        return $ || h.i(Ce, "filteringLevels. " + T.qualityType + " v unsupported. drm: " + T.drmSchemaId), L && W && $;
      }), a.audioTracks && (a.audioTracks = a.audioTracks.filter(function(T) {
        var L = !T.audioCodec || u(T.audioCodec, "audio");
        L || h.i(Ce, "filteringLevels. " + T.qualityType + " a unsupported. codec: " + T.audioCodec);
        var V = jn(T);
        return V || h.i(Ce, "filteringLevels. " + T.qualityType + " a unsupported. drm: " + T.drmSchemaId), L && V;
      }), a.audioTracks.forEach(function(T) {
        o && T.audioCodec && T.audioCodec.indexOf("mp4a.40.34") !== -1 && (T.audioCodec = "");
      })), n.initLevelsDefault(h, a), a;
    }, n.initLevelsDefault = function(h, a) {
      return h.i(Ce, "init level default"), a.def = -1, a.levels.forEach(function(i, o) {
        i.index = o, i.default && (a.def = o);
      }), a.def < 0 && (a.def = a.levels.reduce(function(i, o, u) {
        return o.bitrate < a.levels[i].bitrate ? u : i;
      }, 0), h.i(Ce, "no default main level, select lowest bit rate idx: " + a.def)), h.i(Ce, "audio level default: " + a.def), a.audioTracks && a.audioTracks.length && (a.defAudio = void 0, a.audioTracks.forEach(function(i, o) {
        i.index = o, i.default && (a.defAudio = o);
      }), a.defAudio === void 0 && (a.defAudio = 0), h.i(Ce, "audio level default: " + a.defAudio)), a.subtitleTracks && a.subtitleTracks.length && (a.subtitleTracks.forEach(function(i, o) {
        i.index = o, i.default && (a.defSubtitle = o);
      }), a.defSubtitle === void 0 && (a.defSubtitle = 0), h.i(Ce, "subtitle level default: " + a.defSubtitle)), a;
    }, n.preParse = function(h, a, i, o, u) {
      if (u === void 0 && (u = ""), h.i(Ce, "pre parse. native: " + i + ", codecType: " + o + ", baseUrl: " + u), typeof a == "string") {
        var p = this.Nn(h, a);
        if (!p)
          return [{ src: a, box: y.unknown, srcType: k.OTHERS }];
        a = p;
      } else
        a instanceof Blob || (a = JSON.parse(JSON.stringify(a)));
      if (Array.isArray(a)) {
        h.i(Ce, "input mix container.", a.length);
        var T = [], L = [];
        a.forEach(function($) {
          if ($ != null && $.src) {
            var te = { info: n.In(h, $.src, i, o, u), priority: 0, mime: void 0 };
            T.push(te.info.box), $.type && (te.mime = Kn($.type)), L.push(te);
          }
        });
        for (var V = 0; V < L.length; V++) {
          var W = L[V];
          if (W.info && W.info.src) {
            if (W.mime && (W.mime.box !== y.unknown && (W.info.box = W.mime.box), W.mime.vCodec !== v.unknown && (W.info.codecType = W.mime.vCodec)), i !== void 0 && i !== W.info.nativeFirst || W.priority++, W.info.nativeFirst)
              W.priority += W.info.box === y.unknown ? 1 : _e.isVideoBoxSupported(W.info.box) ? 2 : -100, W.priority += W.info.codecType === v.unknown ? 1 : o && o === W.info.codecType || _e.isVideoCodecSupported(W.info.codecType) ? 2 : -100;
            else {
              if (!_e.isMSEAvailable())
                continue;
              W.priority += W.info.box === y.unknown ? 1 : eu.indexOf(W.info.box) >= 0 ? 2 : -100, W.priority += W.info.codecType === v.unknown ? 1 : o && o === W.info.codecType || _e.isMSECodecSupported(W.info.codecType) ? 2 : -100;
            }
            h.i(Ce, "input mix container. media desc " + V + ". box: " + W.info.box + " codec: " + W.info.codecType + " priority: " + W.priority);
          }
        }
        return L.sort(function($, te) {
          return te.priority - $.priority;
        }).filter(function($) {
          return $.priority > 0;
        }).map(function($) {
          return $.info;
        });
      }
      return [n.In(h, a, i, o, u)];
    }, n.In = function(h, a, i, o, u) {
      if (u === void 0 && (u = ""), h.i(Ce, "parse media desc. native: " + i + " codecType: " + o), typeof a == "string") {
        var p = this.Nn(h, a);
        if (!p)
          return { src: a, box: y.unknown, srcType: k.OTHERS };
        a = p;
      }
      var T, L = _e.isMSEAvailable();
      if (n.verifyMix(a)) {
        h.i(Ce, "input mix codec.", Object.keys(a));
        var V = a, W = [];
        for (var $ in V) {
          var te = $;
          if (to.indexOf(te) !== -1) {
            var be = V[te];
            if (typeof be == "string" && (be = be.trim()), !be) {
              h.i(Ce, $ + " src is empty.");
              continue;
            }
            var ie = this.Fn(h, be, u, te, !0), Te = Array.isArray(ie) ? this.Bn(ie, te) || ie[0] : ie;
            if (!Te)
              continue;
            Te.codecType = te, W.push(Te);
          }
        }
        T = this.jn(h, W, i, o);
      } else {
        var Re = this.Fn(h, a, u);
        Array.isArray(Re) ? Re.length > 1 ? (h.i(Ce, "input aas v2 mix codec."), T = this.jn(h, Re, i, o)) : Re.length === 1 && ((T = Re[0]).nativeFirst = this.Un(h, T.box, L, i)) : (T = Re).nativeFirst = this.Un(h, T.box, L, i);
      }
      return T || (T = { src: a, box: y.unknown, srcType: k.OTHERS }), T;
    }, n.jn = function(h, a, i, o) {
      var u, p, T = this, L = {}, V = {}, W = [], $ = _e.isMSEAvailable();
      a.forEach(function(ve) {
        var Pe = ve.codecType;
        if (Pe)
          if (ve.nativeFirst = T.Un(h, ve.box, $, i), W.push(Pe), $ && !ve.nativeFirst) {
            var Ye = _e.getVideoCodecCompatibilityByCodec(Pe);
            V[Pe] = Ye.decoder, Pe === v.h264 && (Ye.decoder = E.buildin, Ye.smooth = !0), Ye.smooth && Ye.decoder === E.buildin && ve.mediaLevels && (ve.compatibility = Ye, L[Pe] = ve);
          } else {
            var lt = _e.isVideoCodecSupported(Pe);
            V[Pe] = lt ? E.buildin : E.unsupported, (Pe === v.h264 || lt) && (ve.compatibility = { decoder: E.buildin, smooth: !0, mix: !1 }, L[Pe] = ve);
          }
      });
      var te, be, ie = (u = L[v.hevc]) != null && u.mediaLevels && L[v.hevc].mediaLevels.levels.length ? L[v.hevc] : void 0, Te = (p = L[v.av1]) != null && p.mediaLevels && L[v.av1].mediaLevels.levels.length ? L[v.av1] : void 0, Re = L[v.h264];
      return h.i(Ce, "input vcodec. hevc: " + !!ie + " av1: " + !!Te + " h264: " + !!Re), o && L[o] && (te = L[o], h.i(Ce, "selected the specified codec: " + o)), te || ((te = Te || ie || Re) && (te.nativeFirst = this.Un(h, te.box, $, i)), h.i(Ce, "selected src: " + ((be = te) == null ? void 0 : be.codecType), te)), te && (W.length && (te.mixCodecInput = W), te.mixCodecAvailable = V), te;
    }, n.Bn = function(h, a) {
      for (var i = 0; i < h.length; i++)
        if (h[i].codecType === a)
          return h[i];
    }, n.Un = function(h, a, i, o) {
      if (!i || Zl.indexOf(a) !== -1)
        return h.i(Ce, "get native first true. box: " + a + " mse: " + i), !0;
      if (Xl.indexOf(a) !== -1 || !_e.isVideoBoxSupported(a))
        return h.i(Ce, "get native first false. box: " + a), !1;
      if (!ee.mobile) {
        if (o) {
          var u = _e.isVideoBoxSupported(a), p = !!u;
          return h.i(Ce, "get native first pc " + p + ". box: " + a + " nativeFirstParams: true video box supported: " + u), p;
        }
        if (o === void 0) {
          var T = _e.isMSEAvailable(), L = !T;
          return h.i(Ce, "get native first pc " + L + ". box: " + a + " nativeFirstParams: undefined mse supported: " + T), L;
        }
        return h.i(Ce, "get native first pc false. nativeFirstParams: false"), !1;
      }
      if (a === y.mp4 || a === y.hls || a === y.hls_ts || a === y.ts) {
        if (o === void 0 || o) {
          var V = _e.isVideoBoxSupported(a), W = !!V;
          return h.i(Ce, "get native first mobile " + W + ". box: " + a + " nativeFirstParams: " + o + " video box supported: " + V), W;
        }
        return h.i(Ce, "get native first mobile false. nativeFirstParams: " + o), !1;
      }
      if (a === y.hls_fmp4) {
        if (o === void 0 || o) {
          var $ = _e.isVideoBoxSupported(a), te = !(!$ || !ee.x5 && !ee.xweb);
          return h.i(Ce, "get native first mobile " + te + ". box: " + a + " nativeFirstParams: " + o + " video box supported: " + $ + " x5: " + ee.x5 + " xweb: " + ee.xweb), te;
        }
        return h.i(Ce, "get native first mobile false. nativeFirstParams: " + o), !1;
      }
    }, n.Fn = function(h, a, i, o, u) {
      var p = this;
      i === void 0 && (i = ""), o === void 0 && (o = v.unknown), u === void 0 && (u = !1);
      var T = { src: a, box: y.unknown, srcType: k.OTHERS };
      if (typeof a == "string") {
        var L = new bi(a);
        L.vCodecType = o, T.box = et(a), T.mediaLevels = { levels: [L], def: 0 }, T.isLive = this.Pn(T.box);
      } else if (a instanceof Blob) {
        var V = "unknow";
        a instanceof File ? (T.box = et(a.name), V = a.name) : T.box = Kn(a.type).box;
        var W = he(T.box) ? new Hi(URL.createObjectURL(a)) : new bi(URL.createObjectURL(a));
        W.vCodecType = o, W.fileName = V, T.mediaLevels = { levels: [W], def: 0 }, T.srcType = k.FILE, T.isLive = !1;
      } else {
        if (Xn.verify(a)) {
          var $ = Xn.parse(a);
          return h.i(Ce, "kwai manifest"), $.map(function(ie) {
            var Te, Re;
            h.i(Ce, "kwai manifest codec: " + ie.codecType + " meta:", ie.mediaLevels.meta), n.Vn(ie.mediaLevels.levels, o);
            var ve = { meta: ie.mediaLevels.meta, mediaLevels: n.filteringLevels(h, ie.mediaLevels, u || $.length > 1), src: a, box: ie.mediaLevels.box || et(((Te = ie.mediaLevels.levels[0]) == null ? void 0 : Te.url[0]) || ""), srcType: k.KWAI, isLive: p.Pn(T.box), isLiveShift: ie.mediaLevels.isLiveShift, codecType: ie.codecType };
            return typeof ((Re = ve.mediaLevels) == null ? void 0 : Re.isLive) == "boolean" && (ve.isLive = ve.mediaLevels.isLive), he(ve.box) && (ve.multipart = !0), ve;
          });
        }
        if (zn.verify(a)) {
          h.i(Ce, "flv abr manifest", o);
          var te = zn.parse(a);
          n.Vn(te.levels, o), T.mediaLevels = n.filteringLevels(h, te, u), T.box = y.flv, T.isLive = !0, T.srcType = k.KWAI_FLV_ABR;
        } else if (qn.verify(a)) {
          h.i(Ce, "flv multipart");
          var be = qn.parse(a, i);
          T.mediaLevels = l()({ def: 0 }, be), n.Vn(T.mediaLevels.levels, o), T.box = y.flv, T.isLive = !1, T.multipart = !0, T.srcType = k.KWAI_FLV_MP;
        } else
          Yn.verify(a) && (T.mediaLevels = n.filteringLevels(h, Yn.parse(a), u), T.box = y.hls, T.srcType = k.KWAI);
      }
      return he(T.box) && (T.multipart = !0), T;
    }, n.Vn = function(h, a) {
      a === void 0 && (a = v.unknown), h.forEach(function(i) {
        i.vCodecType === v.unknown && a !== v.unknown && (i.vCodecType = a);
      });
    }, n.Pn = function(h) {
      var a;
      return [y.flv, y.hls, y.unknown, y.ivf, y.yuv].indexOf(h) === -1 && (a = !1), h === y.webrtc && (a = !0), a;
    }, n.Nn = function(h, a) {
      var i = a.trim();
      if (i) {
        if (!eo.test(i)) {
          try {
            i = JSON.parse(i);
          } catch (o) {
            h.i(Ce, "formatStrData error", o);
          }
          typeof i == "string" && (i = Object(Bi.buildAbsoluteURL)(location.href, i, { alwaysNormalize: !0 }));
        }
        return i;
      }
    }, n;
  }(), tu = ((Sr = {})[O.FHD] = "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAA1Btb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAADmAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACenRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAADmAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAHgAAABDgAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA5gAAXcAAAEAAAAAAfJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAEk+AABJPgFXEAAAAAAAhaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAAAAAAGpbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABaXN0YmwAAAEFc3RzZAAAAAAAAAABAAAA9Wh2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAHgAQ4AEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAB7aHZjQwEBYAAAAJAAAAAAAHjwAPz9+PgAAA8DoAABABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAmhAAEALkIBAQFgAAADAJAAAAMAAAMAeKADwIAQ5ZZWaSTK8BagIIBAgAAAAwCAAAADAISiAAEAB0QBwXK0YkAAAAAQcGFzcAAAAAEAAAABAAAAFGJ0cnQAAAAAAAAV+AAAFfgAAAAYc3R0cwAAAAAAAAABAAAAAQAST4AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAACvwAAAAEAAAAUc3RjbwAAAAAAAAABAAADfAAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNjAuMTYuMTAwAAAACGZyZWUAAALHbWRhdAAAABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAkAAAAuQgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDlllZpJMrwFqAggECAAAADAIAAAAMAhAAAAAdEAcFytGJAAAACYigBrxMImujggedddccbbbbbbuZo4//8Qs/H9kAtWJjtrvgCQAzQ8gAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwFbpe9yuAXAHyJgAAADAAADAAADAAADAAADAAADAAADAAADAAFJkwKEKkAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAZEhwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwPuAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAHpAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwABzQAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAUMAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwBsQAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwGHAAADAAADAAADAAADAAADAAADAAADAAADAAADAtoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAWMAAADAAADAAADAAADAAADAAADAAADAAADAAAJCAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAADygAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAABawAAADAAADAAADAAADAAADAAADAAADAAADAAAhYAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAALeAFwEAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAUUA=", Sr[O.UHD_4K] = "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAA1Ftb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAADmAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACe3RyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAADmAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAPAAAACHAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA5gAAXcAAAEAAAAAAfNtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAEk+AABJPgFXEAAAAAAAhaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAAAAAAGqbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABanN0YmwAAAEGc3RzZAAAAAAAAAABAAAA9mh2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAPAAhwAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAB8aHZjQwEBYAAAAJAAAAAAAJbwAPz9+PgAAA8DoAABABhAAQwB//8BYAAAAwCQAAADAAADAJaVmAmhAAEAL0IBAQFgAAADAJAAAAMAAAMAlqAB4CACHFllZpJMrwFqAggECAAAAwAIAAADAAhAogABAAdEAcFytGJAAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAAQGgAAEBoAAAAGHN0dHMAAAAAAAAAAQAAAAEAEk+AAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAABRzdHN6AAAAAAAACA0AAAABAAAAFHN0Y28AAAAAAAAAAQAAA30AAABidWR0YQAAAFptZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAAC1pbHN0AAAAJal0b28AAAAdZGF0YQAAAAEAAAAATGF2ZjYwLjE2LjEwMAAAAAhmcmVlAAAIFW1kYXQAAAAYQAEMAf//AWAAAAMAkAAAAwAAAwCWlZgJAAAAL0IBAQFgAAADAJAAAAMAAAMAlqAB4CACHFllZpJMrwFqAggECAAAAwAIAAADAAhAAAAAB0QBwXK0YkAAAAevKAGvEwRHlP3jty4cOG7Zs2bNmzZs2bNWrVq1atWrVq1atWvmaOP//ELPx/ZALViY7a74AkAM0PIAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAX8Cl73K4BcAfImAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAIWAkwKEKkAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMDMocAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMCkgAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAABgwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAasAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAFZAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAg4AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMCJgAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAABFQAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAkIAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAPqAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAHJAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAACugAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAABDQAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAX8AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAIqAAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAC2gAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAA54AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAASkAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAXUAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAdMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAhYAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAmoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAq4AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAvoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA04AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA5IAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA84AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA+oAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABCwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABEwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABHQAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAgIA=", Sr), ro = "kwai-kernel-hevc", xt = "playback-hevc-test", no = function() {
    function n(a) {
      var i = this;
      this.J = void 0, this.Ii = new Er(), this.Hn = void 0, this.Wn = [O.FHD, O.UHD_4K], this.Gn = 0, this.Qn = void 0, this.Yn = function() {
        var o, u;
        i.J.i(xt, "on video event. " + ((o = n.Jn) == null ? void 0 : o.videoWidth) + " " + ((u = n.Jn) == null ? void 0 : u.error)), i.Qn ? (i.Qn[i.Wn[i.Gn]] = !!n.Jn && n.Jn.videoWidth > 0 && !n.Jn.error, i.Gn++, i.Gn < i.Wn.length ? (i.Zn(), i.zn(i.Wn[i.Gn])) : i.Kn()) : i.Kn();
      }, this.J = a;
    }
    var h = n.prototype;
    return h.init = function(a) {
      if (this.J.i(xt, "init"), a > 0) {
        var i = this.Ii.read(ro, a);
        this.J.i(xt, "load from ls", i);
        try {
          i !== void 0 && Object.prototype.hasOwnProperty.call(i, O.FHD) && Object.prototype.hasOwnProperty.call(i, O.UHD_4K) && (_e.playHEVCTest = i, this.Qn = _e.playHEVCTest);
        } catch (o) {
          this.J.i(xt, "load ls error");
        }
      }
    }, h.start = function() {
      var a;
      this.J.i(xt, "start");
      var i = this.Qn !== void 0 || n.Jn;
      this.J.i(xt, "start. tested: " + i), i || (a = n.Jn) != null && a.src || this.qn();
    }, h.destroy = function() {
      this.Ze(), this.Zn();
    }, h.Kn = function() {
      this.J.i(xt, "complete result:", this.Qn, performance.now()), this.Ze(), this.Zn(), _e.playHEVCTest = this.Qn, this.Ii.write(ro, this.Qn);
    }, h.qn = function() {
      var a;
      this.J.i(xt, "start video test"), dt() ? this.Kn() : (this.Xn(), this.Qn = ((a = {})[O.FHD] = !1, a[O.UHD_4K] = !1, a), this.Gn = 0, this.zn(this.Wn[0]));
    }, h.zn = function(a) {
      this.J.i(xt, "test: " + a), n.Jn || (n.Jn = document.createElement("video")), n.Jn.preload = "metadata", n.Jn.addEventListener("error", this.Yn), n.Jn.addEventListener("loadeddata", this.Yn), n.Jn.addEventListener("loadedmetadata", this.Yn), n.Jn.src = tu[a], n.Jn.play().catch(function() {
      });
    }, h.Zn = function() {
      n.Jn && (n.Jn.removeEventListener("error", this.Yn), n.Jn.removeEventListener("loadeddata", this.Yn), n.Jn.removeEventListener("loadedmetadata", this.Yn), n.Jn.src = "");
    }, h.Xn = function() {
      var a = this;
      this.Ze(), this.Hn = setTimeout(function() {
        a.J.i(xt, "timeout"), a.Kn();
      }, 1e3);
    }, h.Ze = function() {
      this.Hn && (clearTimeout(this.Hn), this.Hn = void 0);
    }, n;
  }();
  no.Jn = void 0;
  var iu = no, ru = r(9), nu = r.n(ru), ze = "av-ctx", oo = function(n) {
    function h(i, o) {
      var u;
      return (u = n.call(this) || this).video = void 0, u.mse = void 0, u.stat = new Wl(), u.loadRec = void 0, u.lctx = void 0, u.$n = [], u.tr = 0, u.ir = 0, u.er = void 0, u.Re = void 0, u.nr = !1, u.rr = !1, u.Ar = void 0, u.sr = void 0, u.ur = new jl(), u.ar = void 0, u.hr = void 0, u._ = void 0, u.J = void 0, u.ot = void 0, u.cr = void 0, u.vr = void 0, u.dr = void 0, u._ = Tr.next(), u.J = new yi.Logger().setName("kwai-k").setId(u._), u.ot = new Kl(), u.video = o, u.sr = new Gn(u.J), u.hr = new iu(u.J), u.lctx = new Hn(u.J, !0), u.cr = new El(u), u.vr = new Hl(u), u.dr = new Fl(u), u.lr(ce.processConfig(i)), u.sr && u.F.push(u.sr), u.F.push(u.hr, u.cr, u.vr, u.dr), u;
    }
    R()(h, n);
    var a = h.prototype;
    return a.destroy = function() {
      var i;
      this.logger.i(ze, "destroy"), (i = this.stat.muxWorker) == null || i.terminate(), this.pr(), this.mr(), this.ot.removeAllListeners(), n.prototype.destroy.call(this);
    }, a.updateVideoPlaybackQuality = function(i, o) {
      this.stat.videoPlaybackQuality ? (this.stat.videoPlaybackQuality.droppedVideoFrames = o, this.stat.videoPlaybackQuality.totalVideoFrames = i) : this.stat.videoPlaybackQuality = { corruptedVideoFrames: 0, creationTime: 0, droppedVideoFrames: o, totalVideoFrames: i };
    }, a.isTimeinBuffered = function(i) {
      if (this.video) {
        for (var o = this.video.buffered, u = 0; u < o.length; u++)
          if (i >= o.start(u) && i < o.end(u))
            return !0;
      }
      return !1;
    }, a.currentBuffer = function(i) {
      if (this.video)
        for (var o = this.video.buffered, u = 0; u < o.length; u++) {
          var p = o.start(u), T = o.end(u);
          if (p <= i && i < T)
            return { start: p, end: T };
        }
    }, a.nextBuffer = function(i) {
      if (this.video)
        for (var o = this.video.buffered, u = 0; u < o.length; u++) {
          var p = o.start(u), T = o.end(u);
          if (p > i)
            return { start: p, end: T };
        }
    }, a.getLiveShiftKwai2OffsetUTC = function(i) {
      return this.stat.liveStartTime + i;
    }, a.getLiveShiftKwai2Duration = function() {
      return (this.sr.now - this.stat.liveStartTime) / 1e3;
    }, a.getKwai2LiveShiftReloadInterval = function() {
      var i = this.lctx.current;
      if (i) {
        if (i.fragments.length > 1 && typeof this.stat.liveShiftOffset == "number") {
          var o = i.fragments[i.fragments.length - 2];
          return Math.max((i.averagetargetduration || i.targetduration) * Gt, (this.stat.liveShiftOffsetAligned || this.stat.liveShiftOffset) + o.start * Gt - this.currentTime * Gt) / this.playbackRate;
        }
        return (i.averagetargetduration || i.targetduration) * Gt / this.playbackRate;
      }
      return 1e4 / this.playbackRate;
    }, a.getKwai2LiveShiftUrl = function(i) {
      var o = this.lctx.current, u = Tt()(i, !0), p = this.stat.liveShiftKwai2Params;
      if (this.sr) {
        if (p.paramName === "seqId") {
          var T = o.fragments[o.fragments.length - 1], L = p.seqId || (T == null ? void 0 : T.sn);
          if (typeof L == "number")
            return u.query.seqID = L.toString(), u.toString();
        }
        return p.time = Math.round(this.getLiveShiftKwai2OffsetUTC(this.stat.liveShiftOffset || 0)), u.query.startTime = p.time.toString(), u.toString();
      }
      return u.toString();
    }, a.getLiveDelay = function() {
      var i = this.stat, o = this.Re, u = 10;
      if (i.multipart) {
        var p = this.lctx.current;
        u = (p == null ? void 0 : p.averagetargetduration) || (p == null ? void 0 : p.targetduration) || u;
      }
      return i.box === y.flv ? -this.Re.defaultSpts : he(i.box) ? this.isLiveShift ? o.liveShiftDelaySec * Gt : u * Gt * (o.liveDelayFragNum || 1) : -this.Re.defaultSpts;
    }, a.initLiveShiftKwai2StartSec = function() {
      if (this.isLiveShiftKwai2) {
        var i = this.stat.startFromSec >= 0 ? this.stat.startFromSec : this.liveLocalTime;
        this.J.i(ze, "init liveshift kwai2 start from sec: " + i + " startFromSec: " + this.stat.startFromSec + " live: " + this.liveLocalTime + " duration: " + this.getLiveShiftKwai2Duration()), i > 0 && (this.stat.startFromSec = i, this.stat.liveShiftOffset = 1e3 * i, this.stat.liveShiftOffsetAligned = void 0, this.updateLiveShiftStatuByTime(i));
      }
    }, a.getRemuxConfig = function() {
      var i = this.Re, o = { isLive: this.stat.isLive, logLevel: i.logLevel, enableSoftwareAES: i.enableSoftwareAES, gopRemux: this.stat.gopRemux, preferDecoder: i.preferDecoder, streamingMux: this.streamingMux, ensureVideo: i.ensureVideo, maxAudioFramesDrift: i.maxAudioFramesDrift, forceKeyFrameOnDiscontinuity: i.forceKeyFrameOnDiscontinuity, wasmDecoderEnabled: i.wasmDecoderEnabled, enableAacPriv: i.enableAacPriv, audioEnabled: i.audioEnabled, videoEnabled: i.videoEnabled, mseDecErrSkip: i.mseDecErrSkip, adjustFragTime: i.adjustFragTime };
      return this.video instanceof HTMLAudioElement && (this.J.i(ze, "HTMLAudioElement. set videoEnabled false."), o.videoEnabled = !1), o.preferDecoder = void 0, o;
    }, a.getDecConfig = function() {
      var i = this.Re;
      return { logLevel: i.logLevel, videoDropFramePolicy: i.videoDropFramePolicy, videoFrameBufferSize: i.videoFrameBufferSize, videoDecBlockPolicy: i.videoDecBlockPolicy, maxVideoDecThreads: i.maxVideoDecThreads, mainThreadRendering: i.mainThreadRendering, mainThreadDecoding: i.mainThreadDecoding, preferCanvasType: i.preferCanvasType, preferCanvasColorSpace: i.preferCanvasColorSpace };
    }, a.setSrc = function(i, o) {
      this.logger.i(ze, "set src", i), i && (this.jt(), this.resetStreamingEnabled(), this.ar = void 0, this.loadRec = new Wn()), this.yr(i, o);
    }, a.reProcessSrc = function(i, o) {
      this.logger.i(ze, "reprocess src. codecType: " + i + " native: " + o + ", has origin src: " + !!this.er), this.er && this.Mr(this.er, i, o);
    }, a.updateLiveShiftStatuByTime = function(i) {
      var o;
      if (this.isLiveShift && (i === void 0 && (i = (o = this.video) == null ? void 0 : o.currentTime), this.lctx.current && typeof i == "number" && Number.isFinite(i))) {
        var u = this.liveLocalTime;
        u > 0 && (this.stat.liveShiftActive = !!(u && i < u - 5), this.J.i(ze, "update live shift statu by time. type: " + this.stat.liveShiftType + " " + this.stat.liveShiftActive + ", time: " + i + " ed: " + u));
      }
    }, a.resetStreamingEnabled = function() {
      var i = this.Re;
      this.nr = this.rr = !(!i.streamingMux || !ce.isStreamingSupported() || ee.msie || ee.safari && (this.stat.isLive === !1 || this.stat.multipart) || ee.msedge && ee.version.major < 88 && (this.stat.isLive === !1 || this.stat.multipart)), this.logger.i(ze, "resetStreamingEnabled: " + this.nr);
    }, a.resetGopRemux = function() {
      this.stat.multipart && !this.nr ? this.stat.gopRemux = !1 : this.stat.gopRemux = !!(ee.safari || ee.opera && ee.version.major < 37), this.logger.i(ze, "resetGopRemux: " + this.stat.gopRemux);
    }, a.hasNextMediaDesc = function() {
      return this.tr + 1 < this.$n.length;
    }, a.nextMediaDesc = function() {
      if (this.hasNextMediaDesc()) {
        this.tr++;
        var i = this.$n[this.tr];
        if (i)
          return this.J.i(ze, "next media desc."), this.wr(i), !0;
      }
      return !1;
    }, a.lr = function(i) {
      if (this.Re = i, !i.logLevel) {
        var o = yi.Logger.loadLogLevel("kwai-kernel-log");
        i.logLevel = o || yi.DEFAULT_LOG_LEVEL;
      }
      var u;
      if (i.logger && this.J.setOutput(i.logger), this.J.setLevel(i.logLevel), this.J.getLevel() !== yi.LogLevel.NONE && (u = h.version, ee.msie || console.log("%c kwai-player-kernel %c " + u + " %c", "background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px;  color: #fff", "background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0;  color: #fff", "background:transparent")), this.logger.i(ze, "logger init."), this.logger.i(ze, "set config"), this.hr.init(this.Re.playbackAbilityCacheTimeout), this.resetStreamingEnabled(), this.logger.i(ze, "browser", JSON.stringify(ee)), dt() || this.logger.i(ze, "ua", navigator.userAgent), this.jt(), this.ar = void 0, this.stat.startFromSec = i.startFromSec >= 0 ? i.startFromSec : typeof i.startFrom == "number" && i.startFrom >= 0 ? i.startFrom / 1e3 : -1, this.stat.webWorker = i.webWorker && !!it.a, typeof i.preferNativeLoader == "boolean" && (this.stat.preferNativeLoader = i.preferNativeLoader), this.Re.autoPlaybackRateConf)
        this.logger.i(ze, "use config.autoPlaybackRateConf", this.Re.autoPlaybackRateConf), this.stat.autoPlaybackRateConf = this.Re.autoPlaybackRateConf;
      else {
        var p = -Math.floor(this.Re.defaultSpts / Gt);
        this.stat.autoPlaybackRateConf = function(T, L, V) {
          V === void 0 && (V = 3);
          var W = { startDelay: 0, interval: 0.6, rule: [] };
          return Pn(T, L, V, W), W;
        }(this.J, p), this.logger.i(ze, "use default autoPlaybackRateConf", this.stat.autoPlaybackRateConf), this.J.i(ze, "get by delay: " + p);
      }
      try {
        this.stat.webWorker && (this.stat.muxWorker = nu()(3)), Gn.workerTimeOffset = performance.now(), this.logger.i(ze, "init mux worker");
      } catch (T) {
      }
      i.lazyLoadMaxDuration > 0 && i.lazyLoadRecoverDuration > 0 && i.lazyLoadMaxDuration >= i.lazyLoadRecoverDuration && (this.stat.lazyLoadMaxDuration = i.lazyLoadMaxDuration, this.stat.lazyLoadRecoverDuration = i.lazyLoadRecoverDuration), this.loadRec = new Wn(), i.src && this.yr(i.src);
    }, a.jt = function() {
      this.logger.i(ze, "reset stat");
      var i = this.Re, o = this.stat;
      this.rr = this.nr;
      var u = o.preferNativeLoader;
      o.reset(), this.resetGopRemux(), this.vr.reset(), this.cr.reset(), o.isLive = i.isLive, o.native = i.nativeFirst, o.liveShiftType = this.Re.liveShiftType, o.preferNativeLoader = u, this.stat = o;
    }, a.yr = function(i, o) {
      this.tr = 0, this.ir = Date.now(), this.Mr(i, o);
    }, a.Mr = function(i, o, u) {
      this.J.i(ze, "process src. codec: " + o + " native: " + u), i && (this.er = i);
      var p = this.config;
      this.$n = io.preParse(this.J, i, typeof u == "boolean" ? u : p.nativeFirst, o, p.baseURL);
      var T = this.$n[this.tr];
      T && this.wr(T);
    }, a.wr = function(i) {
      var o, u, p, T, L, V, W = this.config, $ = this.stat;
      (o = this.Ar) == null || o.reset(), this.stat.srcType === k.FILE && this.pr();
      var te, be, ie = this.lctx = new Hn(this.J, W.adaptive);
      if ($.codecType = i.codecType ? i.codecType : v.unknown, $.box = W.box || i.box || y.unknown, $.srcType = i.srcType, $.mixContainerInput = i.mixContainerInput, $.mixCodecInput = i.mixCodecInput, $.mixCodecAvailable = i.mixCodecAvailable, $.multipart = i.multipart, $.stereoType = (u = i.mediaLevels) == null ? void 0 : u.stereoType, (p = i.mediaLevels) != null && p.meta && ($.srcMeta = (te = i.mediaLevels) == null ? void 0 : te.meta, this.liveTime && typeof i.mediaLevels.meta.programStartTime == "number" && (this.stat.liveStartTime = i.mediaLevels.meta.programStartTime)), W.liveDelayFragNum && W.liveDelayFragNum > 0 && $.multipart && !W.autoPlaybackRateConf) {
        var Te = this.getLiveDelay();
        Pn(this.J, Te / 1e3, 10, $.autoPlaybackRateConf), this.J.i(ze, "update by delay: " + Te + ".", W);
      }
      i.nativeFirst !== void 0 && ($.native = i.nativeFirst), typeof i.isLive == "boolean" && ($.isLive = i.isLive), i.isLiveShift === !0 && ($.liveShiftType = de.KWAI2), typeof ((T = i.mediaLevels) == null ? void 0 : T.isLive) == "boolean" && ($.isLive = i.mediaLevels.isLive), ie.hasAudio = (L = i.mediaLevels) == null ? void 0 : L.hasAudio, ie.hasVideo = (V = i.mediaLevels) == null ? void 0 : V.hasVideo, !i.mediaLevels || i.srcType === k.OTHERS && he($.box) && !$.native || (this.J.i(ze, "src. get levels from src."), $.drm = i.mediaLevels.drm, this.lctx.levels = i.mediaLevels.levels, this.lctx.default = this.lctx.currentIdx = i.mediaLevels.def, i.mediaLevels.audioTracks && (this.lctx.audioTracks = i.mediaLevels.audioTracks, this.lctx.audioIdx = i.mediaLevels.defAudio || 0), i.mediaLevels.subtitleTracks && (this.lctx.subtitleTracks = i.mediaLevels.subtitleTracks, this.lctx.subtitleIdx = i.mediaLevels.defSubtitle || 0)), this.lctx.default = function(Re) {
        if (!ee.mobile || Re.levels.length <= 1 || Re.levels[0].vCodecType !== v.hevc)
          return Re.default;
        var ve, Pe;
        if (Re.levels.forEach(function(lt, Ei) {
          if (lt.width && lt.height) {
            var Dt = Math.min(lt.width, lt.height);
            Dt > 720 ? Pe = Pe && Dt > Pe.minWH ? Pe : { idx: Ei, minWH: Dt } : ve = ve && ve.minWH > Dt ? ve : { idx: Ei, minWH: Dt };
          }
        }), !ve || !Pe)
          return Re.default;
        if (ee.android)
          return parseFloat(ee.platformVersion || "") >= 10 ? Pe.idx : ve.idx;
        if (ee.iphone) {
          var Ye = Un();
          return Ye === "unknown" ? typeof window < "u" && window.screen && (window.screen.width > 400 || window.devicePixelRatio > 2) ? Pe.idx : ve.idx : [nt.SERIES_1, nt.SERIES_2, nt.SERIES_3, nt.SERIES_4, nt.SERIES_8].indexOf(Ye) === -1 ? Pe.idx : ve.idx;
        }
        return Re.default;
      }(this.lctx), this.config.ntp && this.stat.isLive !== !1 && this.stat.box === y.flv && ((be = this.sr) == null || be.ntpSync(this.stat.preferNativeLoader)), this.resetStreamingEnabled(), this.resetGopRemux(), this.logger.i(ze, "use media desc complete. box: " + $.box + " live: " + $.isLive + " native: " + $.native + " mobile: " + !!ee.mobile + " gopRemux: " + $.gopRemux + " streamingMux: " + this.streamingMux + " liveShift: " + $.liveShiftType + " mixCodec: " + $.mixCodecInput + " levelCnt: " + ie.levels.length + " hasVideo: " + ie.hasVideo + " hasAudio: " + ie.hasAudio);
    }, a.pr = function() {
      this.lctx && this.lctx.levels.forEach(function(i) {
        i.url.forEach(function(o) {
          o.indexOf("blob:") === 0 && URL.revokeObjectURL(o);
        });
      });
    }, a.mr = function() {
      this.Ar && (this.Ar.destroy(), this.Ar = void 0);
    }, f()(h, [{ key: "isLiveShiftKwai2", get: function() {
      return this.stat.liveShiftType === de.KWAI2;
    } }, { key: "isLiveShift", get: function() {
      return this.stat.liveShiftType !== de.NONE;
    } }, { key: "logger", get: function() {
      return this.J;
    } }, { key: "id", get: function() {
      return this._;
    } }, { key: "live", get: function() {
      return !(!this.stat.isLive || this.stat.liveShiftActive);
    } }, { key: "isDownloadInterruptible", get: function() {
      return !(this.live && this.stat.multipart === !1);
    } }, { key: "liveLocalTime", get: function() {
      var i = this.lctx.current;
      if (this.isLiveShift) {
        var o, u, p = Number.isFinite((o = this.video) == null ? void 0 : o.duration) ? (u = this.video) == null ? void 0 : u.duration : this.isLiveShiftKwai2 ? this.getLiveShiftKwai2Duration() : (i == null ? void 0 : i.totalduration) || 0;
        if (p)
          return p - (this.getLiveDelay() / Gt + 0.1);
      } else if (i && i.totalduration)
        return i.totalduration - (this.getLiveDelay() / Gt + 0.1);
      return 0;
    } }, { key: "yuvParams", get: function() {
      return this.ar;
    } }, { key: "canCodecFallback", get: function() {
      return !(!this.stat.mixCodecInput || this.stat.codecType === v.h264 || this.stat.mixCodecInput.indexOf(v.h264) === -1 || this.stat.decoder !== E.buildin);
    } }, { key: "fps", get: function() {
      return this.ur;
    } }, { key: "liveTime", get: function() {
      return this.sr;
    } }, { key: "cOutput", get: function() {
      if (it.a)
        return this.Ar || (this.Ar = new it.a(this.J, this.Re)), this.Ar;
    } }, { key: "isAbrAvailable", get: function() {
      return this.Re.adaptive && this.lctx.levels.length > 1 && !this.isSwitchLevelByReload && !this.isLiveShift;
    } }, { key: "isSwitchLevelByReload", get: function() {
      return !(this.stat.box === y.flv && this.stat.isLive !== !1 && !ee.firefox && this.Re.videoEnabled !== !1 || he(this.stat.box));
    } }, { key: "mediaBufferedSec", get: function() {
      return this.video && this.video.buffered && this.video.buffered.length ? { start: this.video.buffered.start(0), end: this.video.buffered.end(this.video.buffered.length - 1) } : { start: 0, end: 0 };
    } }, { key: "bufferedSt", get: function() {
      return this.video && this.video.buffered.length ? this.video.buffered.start(0) : -1;
    } }, { key: "bufferedEnd", get: function() {
      return this.video && this.video.buffered.length ? this.video.buffered.end(this.video.buffered.length - 1) : 0;
    } }, { key: "bufferedSec", get: function() {
      return this.video && this.video.buffered.length > 0 ? Math.max(0, this.video.buffered.end(this.video.buffered.length - 1) - this.video.currentTime) : 0;
    } }, { key: "bufferSliceNum", get: function() {
      return this.video ? this.video.buffered.length : 0;
    } }, { key: "currentTime", get: function() {
      return this.video ? this.video.currentTime : 0;
    } }, { key: "playbackRate", get: function() {
      return this.video ? this.video.playbackRate : 1;
    } }, { key: "config", get: function() {
      return this.Re;
    } }, { key: "src", get: function() {
      var i;
      return ((i = this.$n[this.tr]) == null ? void 0 : i.src) || "";
    } }, { key: "srcUpdateTime", get: function() {
      return this.ir;
    } }, { key: "originSrc", get: function() {
      return this.er;
    } }, { key: "videoPlaybackQuality", get: function() {
      return this.stat.videoPlaybackQuality ? this.stat.videoPlaybackQuality : this.video instanceof HTMLVideoElement ? this.video.getVideoPlaybackQuality !== void 0 ? this.video.getVideoPlaybackQuality() : { corruptedVideoFrames: 0, creationTime: 0, droppedVideoFrames: this.video.webkitDecodedFrameCount || 0, totalVideoFrames: this.video.webkitDroppedFrameCount || 0 } : void 0;
    } }, { key: "demuxerType", get: function() {
      return this.stat.demuxerType;
    }, set: function(i) {
      this.logger.i(ze, "set demuxer type", i);
      var o = this.stat;
      if (i !== o.demuxerType) {
        var u = o.box === void 0 || o.box === y.unknown;
        i === Ve.RAW ? (o.box = y.raw, o.isLive = !1) : i === Ve.FLV ? (o.box = y.flv, o.multipart && (o.isLive = !1)) : i === Ve.MP4 || i === Ve.FMP4 ? (u && (o.box = y.mp4), o.multipart || (o.isLive = !1)) : i === Ve.TS ? u && (o.box = y.ts) : i === Ve.IVF && (o.box = y.ivf, o.isLive = !1), o.demuxerType = i, this.resetGopRemux();
      }
    } }, { key: "streamingMuxEnabled", get: function() {
      return this.nr && !(this.src instanceof Blob);
    }, set: function(i) {
      this.nr = i;
    } }, { key: "streamingMux", get: function() {
      return this.stat.box === y.flv && this.stat.isLive !== !1 || this.streamingMuxEnabled && this.rr;
    }, set: function(i) {
      this.rr = i;
    } }, { key: "hevcTest", get: function() {
      return this.hr;
    } }, { key: "evt", get: function() {
      return this.ot;
    } }, { key: "fallback", get: function() {
      return this.cr;
    } }, { key: "streamTime", get: function() {
      return this.vr;
    } }], [{ key: "packName", get: function() {
      return "mini_es";
    } }, { key: "version", get: function() {
      return "3.3.37";
    } }, { key: "buildTime", get: function() {
      return "Mon Jan 20 2025 18:07:08 GMT+0800 (中国标准时间)";
    } }]);
  }(S);
  oo.instanceCount = 0;
  var _t = oo, St = function(n) {
    return n.NORMEL = "normal", n.SEEK = "seek", n.END = "end", n.LEVEL_SWITCH = "levelSwitch", n.FIRST_FRAME = "firstFrame", n.LOAD = "load", n.BACKUP = "backup", n;
  }({}), Ge = function(n) {
    return n.START = "start", n.MANIFEST = "manifest", n.LEVEL = "level", n.STREAM_CONNECTED = "streamConnected", n.DATA = "data", n.DEMUX = "demux", n.SEGMENT = "segment", n.CANPLAY = "canplay", n.LOADEDMETADATA = "loadedmetadata", n.LOADEDDATA = "loadeddata", n.SEEKED = "seeked", n;
  }(Ge || {}), ao = [{ event: Ge.START, detailName: "first-loader-open" }, { event: Ge.MANIFEST, detailName: "manifest-duration" }, { event: Ge.LEVEL, detailName: "level-duration" }, { event: Ge.STREAM_CONNECTED, detailName: "stream-connected-duration" }, { event: Ge.DATA, detailName: "first-package-duration" }, { event: Ge.DEMUX, detailName: "first-remux-duration" }, { event: Ge.SEGMENT, detailName: "first-segment-duration" }, { event: Ge.LOADEDMETADATA, detailName: "first-meta-duration" }, { event: [Ge.LOADEDDATA, Ge.CANPLAY, Ge.SEEKED], detailName: "first-frame-duration" }], Lr = "first-frame", ou = function() {
    function n(a) {
      this.br = 0, this.gr = 0, this.C = void 0, this.kr = 0, this._r = 0, this.Er = {}, this.ut = void 0, this.J = void 0, this.C = ao.slice(0), this.ut = a, this.J = a.logger;
    }
    var h = n.prototype;
    return h.start = function() {
      this.J.i(Lr, "start"), this.br = 0, this.kr = performance.now(), this.gr = 0, this.C = ao.slice(0), this._r = 0, this.Er = {}, this.process(Ge.START, this.kr);
    }, h.process = function(a, i) {
      var o;
      if (i === void 0 && (i = 0), this.J.i(Lr, "process type: " + a + " " + i + " complete: " + this.br), this.br)
        return !1;
      var u = this.C, p = -1;
      i = i || performance.now();
      for (var T = 0; T < u.length; T++) {
        var L = u[T];
        if (Array.isArray(L.event)) {
          if (L.event.indexOf(a) !== -1) {
            p = T;
            break;
          }
        } else if (L.event === a) {
          p = T;
          break;
        }
      }
      if (p === -1)
        return !1;
      var V = u.splice(0, p + 1).pop(), W = ((o = this.ut.mse) == null ? void 0 : o.readyState) === "closed";
      if ((u.length === 0 || W && a === Ge.SEGMENT) && (this.gr = i - this.kr, this.br = Date.now(), this.J.i(Lr, "complete " + this.gr + " " + this.br)), V) {
        var $ = Math.round(i - this._r);
        this._r === 0 && ($ = Date.now()), this._r = i, this.Er[V.detailName] = $;
      }
      return !!this.br;
    }, h.onDownloadError = function() {
      this.Er.download_retry ? this.Er.download_retry++ : this.Er.download_retry = 1;
    }, h.onRetry = function() {
      this.Er.retry ? this.Er.retry++ : this.Er.retry = 1;
    }, f()(n, [{ key: "complete", get: function() {
      return this.br;
    } }, { key: "duration", get: function() {
      return this.gr;
    } }, { key: "details", get: function() {
      return this.Er;
    } }]);
  }(), so = [/headless/, /spider/, /[a-z0-9]+bot[^a-z0-9]/], Ct = function(n) {
    return n.none = "", n.probably = "probably", n.maybe = "maybe", n;
  }(Ct || {}), lo = function() {
    if (dt())
      return Ct.none;
    if (navigator.webdriver)
      return Ct.probably;
    for (var n = navigator.userAgent.toLowerCase(), h = 0; h < so.length; h++)
      if (so[h].test(n))
        return Ct.probably;
    if (window.innerWidth <= 0 && window.innerHeight <= 0)
      return Ct.probably;
    if (_e.isMSEAvailable() && !_e.isMSECodecCapabilityNormal())
      return Ct.maybe;
    try {
      var a = document.createElement("canvas");
      a.width = 4, a.width = 4;
      var i = a.getContext("2d");
      if (i) {
        i.fillStyle = "#FFFFFF", i == null || i.fillRect(0, 0, a.width, a.height);
        for (var o = i.getImageData(0, 0, a.width, a.height).data, u = 0; u < o.length; u++)
          if (o[u] !== 0)
            return Ct.none;
        return Ct.maybe;
      }
    } catch (p) {
      return Ct.probably;
    }
    return Ct.none;
  }(), kr, mt = {};
  try {
    var uo;
    (uo = navigator.userAgentData) == null || uo.getHighEntropyValues(["architecture", "bitness", "model", "platform", "platformVersion"]).then(function(n) {
      l()(mt, n);
    });
  } catch (n) {
  }
  var au = new Uint8Array(16);
  function su() {
    if (!kr && !(kr = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto)))
      throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
    return kr(au);
  }
  for (var lu = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, uu = function(n) {
    return typeof n == "string" && lu.test(n);
  }, ot = [], Ir = 0; Ir < 256; ++Ir)
    ot.push((Ir + 256).toString(16).substr(1));
  var cu = function(n) {
    var h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, a = (ot[n[h + 0]] + ot[n[h + 1]] + ot[n[h + 2]] + ot[n[h + 3]] + "-" + ot[n[h + 4]] + ot[n[h + 5]] + "-" + ot[n[h + 6]] + ot[n[h + 7]] + "-" + ot[n[h + 8]] + ot[n[h + 9]] + "-" + ot[n[h + 10]] + ot[n[h + 11]] + ot[n[h + 12]] + ot[n[h + 13]] + ot[n[h + 14]] + ot[n[h + 15]]).toLowerCase();
    if (!uu(a))
      throw TypeError("Stringified UUID is invalid");
    return a;
  }, xr, du = function(n, h, a) {
    var i = (n = n || {}).random || (n.rng || su)();
    if (i[6] = 15 & i[6] | 64, i[8] = 63 & i[8] | 128, h) {
      a = a || 0;
      for (var o = 0; o < 16; ++o)
        h[a + o] = i[o];
      return h;
    }
    return cu(i);
  }, hu = (/* @__PURE__ */ new Date()).getTimezoneOffset() / -60;
  function Cr() {
    return xr || (xr = { support_mse: _e.isMSEAvailable() ? 1 : 0, support_aac_mse: _e.TYPE_SUPPORTED.aac ? 1 : 0, support_aac: _e.isVideoCodecSupported(v.aac) ? 1 : 0, support_h264_mse: _e.TYPE_SUPPORTED.h264 ? 1 : 0, support_h264: _e.isVideoCodecSupported(v.h264) ? 1 : 0, support_h265_mse: _e.TYPE_SUPPORTED.hevc ? 1 : 0, support_h265: _e.isVideoCodecSupported(v.hevc) ? 1 : 0, support_av1_mse: _e.TYPE_SUPPORTED.av1 ? 1 : 0, support_simd: _e.isSupportSimd ? 1 : 0, support_thread: _e.isSupportThreads ? 1 : 0, support_hw: _e.isSupportHW ? 1 : 0, support_change_type: _e.isChangeTypeSupported() ? 1 : 0, support_streaming: ce.isStreamingSupported() ? 1 : 0, hardware_concurrency: Pi() || 0, wasm_dec_smooth: _e.wasmSmooth ? 1 : 0 }), xr;
  }
  function co(n, h) {
    var a, i;
    return typeof navigator < "u" && (navigator.webdriver && (a = navigator.webdriver ? 1 : 0), navigator.onLine !== void 0 && (i = navigator.onLine ? 1 : 0)), { session_id: h.sessionId, kernel_version: _t.version, pack_name: _t.packName, creation_time: h.creationTime, time_zone: hu, src_update_time: n.srcUpdateTime, load_start_time: h.loadStartTime, instance_count: _t.instanceCount, webdriver: a, on_line: i };
  }
  function ho() {
    var n = {};
    if (typeof navigator < "u") {
      navigator.onLine !== void 0 && (n.network_on_line = navigator.onLine ? 1 : 0);
      var h = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
      (h == null ? void 0 : h.rtt) !== void 0 && (n.network_rtt = h.rtt), (h == null ? void 0 : h.rtt) !== void 0 && (n.network_downlink = h.downlink), (h == null ? void 0 : h.effectiveType) !== void 0 && (n.network_effective_type = h.effectiveType), (h == null ? void 0 : h.saveData) !== void 0 && (n.network_save_data = h.saveData ? 1 : 0);
    }
    return n;
  }
  function fo(n, h) {
    var a, i, o, u = (a = n.video) == null ? void 0 : a.duration, p = n.lctx.current, T = (p == null ? void 0 : p.currentUrl) || "", L = l()({ play_url: (p == null ? void 0 : p.fileName) || T, url_id: (p == null ? void 0 : p.urlId) || 0, stream_host: T ? new Tt.a(T).host : "", reuse: h.reuse, metadata_time: h.metadataTime, play_start_time: h.playStartTime, playing_start_time: h.playingStartTime, stream_duration: Math.round(1e3 * (u && Number.isFinite(u) ? u : 0)), max_bitrate: (p == null ? void 0 : p.maxBitrate) || 0, codec: h.codecs, play_pos: h.playPos || 0, v_data_rate: Math.round(((i = n.loadRec.currentLoad) == null ? void 0 : i.videoDataRate) || 0), a_data_rate: Math.round(((o = n.loadRec.currentLoad) == null ? void 0 : o.audioDataRate) || 0), drm: n.stat.drm ? 1 : 0, adaptive_multi_rate: n.lctx.abr ? 1 : 0, use_backup: h.useBackup, play_to_end: h.playToEnd, v_decoder: n.stat.decoder, video_codec_type: n.stat.codecType || v.unknown, start_codec: h.startCodec, demuxer: n.stat.demuxerType || Ve.UNKNOWN, core_type: n.stat.coreType, mms: n.stat.mms ? 1 : 0, box: n.stat.box, kwai_slice: n.stat.isKwaiSlice ? 1 : 0, monkey_patched_fetch: h.monkeyPatchedFetch }, co(n, h), ho(), function($) {
      var te = $.video;
      return te ? { elem_crossorigin: te.crossOrigin, elem_autoplay: te.autoplay ? 1 : 0, elem_loop: te.loop ? 1 : 0, elem_volume: te.volume, elem_muted: te.muted ? 1 : 0, elem_preload: te.preload, elem_controls: te.controls ? 1 : 0, elem_ready_state: te.readyState, elem_network_state: te.networkState, elem_playback_rate: te.playbackRate, elem_paused: te.paused ? 1 : 0, elem_ended: te.ended ? 1 : 0, elem_seeking: te.seeking ? 1 : 0, elem_tag_name: te.tagName } : {};
    }(n));
    n.stat.flvAbrNotAligned && (L.flv_abr_not_aligned = 1), typeof _e.playHEVCTest == "boolean" && (L.play_hevc_test = _e.playHEVCTest ? 1 : 0), n.stat.isLive !== void 0 && (L.live = n.stat.isLive ? 1 : 0), L.live_shift_type = n.stat.liveShiftType;
    var V = _l((p == null ? void 0 : p.fileName) || T);
    n.stat.box === y.flv && n.stat.isLive !== !1 && (L.stream_id = V.streamID), h.httpHeader && (L.response_header = B(h.httpHeader)), p != null && p.bitrate && (L.bitrate = Math.round(p.bitrate)), p != null && p.qualityType && (L.quality_type = p.qualityType), p != null && p.qualityLabel && (L.quality_label = p.qualityLabel), h.startQualityType && (L.start_quality_type = h.startQualityType), V.transcodingTpl && (L.transcoding_template = V.transcodingTpl), V.filename && (L.filename = V.filename), typeof navigator < "u" && navigator.deviceMemory && (L.device_memory = navigator.deviceMemory);
    var W = yr();
    return W.renderer && (L.gpu_renderer = W.renderer), lo && (L.bot = lo), h.canvasCtxType && (L.canvas_ctx = h.canvasCtxType), n.stat.wasmDecoder && (L.wasm_dec = n.stat.wasmDecoder, L.wasm_dec_simd = n.stat.wasmSimd ? 1 : 0, L.wasm_dec_threads = n.stat.wasmThreads || 0), L;
  }
  function Ao(n) {
    var h = {};
    if (n.metadata)
      for (var a in n.metadata) {
        if (Object.keys(h).length > 50)
          break;
        var i = n.metadata[a];
        typeof i == "string" ? h[a] = i.substring(0, 50) : typeof i != "number" && typeof i != "boolean" || (h[a] = i);
      }
    return h;
  }
  function Dr() {
    var n = {};
    return mt && (mt.architecture && (n.architecture = mt.architecture), mt.bitness && (n.bitness = mt.bitness), mt.model && (n.model = mt.model), mt.platform && (n.platform = mt.platform), mt.platformVersion && (n.platform_version = mt.platformVersion)), n;
  }
  function Or() {
    var n = {};
    return ee.platformVersion && (n.platform = ee.platform || "", n.platform_version = ee.platformVersion || 0), ee.iphone ? n.model = Un() : ee.model && (n.model = ee.model), ee.version && (n.browser_name = ee.name || "", n.browser_major = ee.version.major || 0), n;
  }
  function po() {
    var n, h, a, i = {};
    return dt() || ((n = window.screen) != null && n.width && (i.screen_w = window.screen.width), (h = window.screen) != null && h.height && (i.screen_h = window.screen.height), (a = window.screen) != null && a.colorDepth && (i.screen_color_depth = window.screen.colorDepth), i.device_pixel_ratio = window.devicePixelRatio || 1), i;
  }
  function vo(n) {
    var h = {};
    return n && (n.fps && (h.fps = Math.round(1e3 * n.fps) / 1e3), n.width && (h.width = n.width), n.height && (h.height = n.height), n.codedWidth && (h.coded_width = n.codedWidth), n.codedHeight && (h.coded_height = n.codedHeight), n.sar && n.sar.width !== n.sar.height && (h.sar = n.sar), n.enhancedFlv && (h.enhanced_flv = n.enhancedFlv ? 1 : 0)), h;
  }
  function _o(n) {
    var h = { src_type: n.stat.srcType };
    return n.stat.stereoType && (h.stereo_type = n.stat.stereoType), n.stat.mixCodecInput && n.stat.mixCodecInput.length && (h.mix_codec_input = n.stat.mixCodecInput), n.stat.mixContainerInput && n.stat.mixContainerInput.length && (h.mix_container_input = n.stat.mixContainerInput), n.stat.mixCodecAvailable && (h.mix_codec_available = n.stat.mixCodecAvailable), h;
  }
  function mo(n) {
    var h = {};
    return n.stat.srcMeta && (h.src_meta = n.stat.srcMeta), h;
  }
  function go(n) {
    var h, a, i, o = {};
    return (h = n.lctx.current) != null && h.meta && (o.current_level_meta = n.lctx.current.meta, n.lctx.current.meta.comment && n.lctx.current.meta.comment.split("/").forEach(function(u) {
      u.indexOf("tt=") === 0 && (o.transcoding_template = u.substring(3)), u.indexOf("ttExplain=") === 0 && (o.transcoding_template_explain = u.substring(10));
    })), (a = n.lctx.current) != null && a.fileSize && (o.filesize = (i = n.lctx.current) == null ? void 0 : i.fileSize), o;
  }
  function yo(n) {
    var h = performance.now();
    return { play: Math.round(n.playDuration + (n.playStartMS ? h - n.playStartMS : 0)), actualPlay: Math.round(n.actualPlayDuration + (n.actualPlayStartMS ? h - n.actualPlayStartMS : 0)), pause: Math.round(n.pauseDuration + (n.pauseStartMS ? h - n.pauseStartMS : 0)), buffer: Math.round(n.bufferTime + (n.bufferingStartMS ? h - n.bufferingStartMS : 0)) };
  }
  function bo() {
    return document.hidden || document.webkitHidden || document.mozHidden || !0;
  }
  var fu = function() {
    function n(a, i) {
      this.Rr = void 0, this.ut = void 0, this.Dr = void 0, this.Tr = 1, this.Sr = 0, this.Or = 0, this.Cr = !0, this.Lr = void 0, this.Nr = void 0, this.Ir = 0, this.Fr = 0, this.Br = "", this.jr = new Fn(), this.Rr = a, this.ut = i, this.Tr = 1, this.Dr = { play: 0, actualPlay: 0, pause: 0, buffer: 0, blockCount: 0, pauseCnt: 0, renderBlockCount: 0, seekCnt: 0, seekLoadCnt: 0, decodedFrames: 0, droppedFrames: 0, muxDroppedFrames: 0, traffic: 0, download: 0, mseUpdate: 0, mseRemove: 0, segment: 0, muxA: 0, muxV: 0, fillA: 0, fillV: 0, droppedA: 0, droppedV: 0, keyFrame: 0, onLineChange: 0, visibilityChange: 0, heartbeatTimeout: 0, loadCnt: 0, refreshCnt: 0, wasmDecErr: 0, videoRemuxSampleCount: 0, audioRemuxSampleCount: 0, videoRemuxDuration: 0, audioRemuxDuration: 0 }, this.Ur();
    }
    var h = n.prototype;
    return h.Pr = function(a, i) {
      var o = {};
      for (var u in i) {
        var p = a[u], T = i[u];
        typeof p == "number" && typeof T == "number" && (o[u] = p - T, i[u] = p);
      }
      return o;
    }, h.Ur = function() {
      this.Sr = performance.now(), this.Or = Date.now(), this.Nr = void 0, this.Lr = void 0, this.Fr = 0, this.Br = "";
    }, h.setFirstScreenDuration = function(a, i, o) {
      this.Nr = Math.round(a), this.Lr = i, this.Cr = !0, this.Ir = o;
    }, h.setError = function(a, i) {
      this.Fr = a, this.Br = i;
    }, h.build = function() {
      var a, i = this.Rr, o = this.ut, u = this.ut.stat, p = performance.now(), T = Math.round(p - this.Sr), L = this.Pr(i, this.Dr), V = o.mse ? this.Pr((a = o.mse) == null ? void 0 : a.stat, this.Dr) : void 0, W = this.Pr(yo(this.Rr), this.Dr), $ = this.Pr(this.ut.loadRec, this.Dr), te = this.ut.loadRec.downloadInfoByRange(T), be = te.timeCost ? Math.round(te.size / te.timeCost * 1e3) : 0, ie = { tick_index: this.Tr, tick_start: this.Or, tick_duration: T, error_code: this.Fr, error_message: this.Br, block_cnt: L.blockCount || 0, render_block_cnt: L.renderBlockCount || 0, decoded_video_frames: L.decodedFrames || 0, dropped_video_frames: (L.droppedFrames || 0) + (L.muxDroppedFrames || 0), segment_cnt: L.segment || 0, play_duration: W.play || 0, buffer_time: W.buffer || 0, actual_play_duration: W.actualPlay || 0, played_video_duration: W.play || 0, traffic: Math.round((($ == null ? void 0 : $.traffic) || 0) / 1024), hidden: bo() ? 1 : 0, download: L.download, download_speed: be, seek_cnt: L.seekCnt, seek_load_cnt: L.seekLoadCnt, pause_duration: W.pause, pause_cnt: L.pauseCnt, on_line_change: L.onLineChange, visibility_change: L.visibilityChange, heartbeat_timeout: L.heartbeatTimeout, load_cnt: L.loadCnt, refresh_cnt: L.refreshCnt, media_buffered_a: i.bufferedEndA, media_buffered_v: i.bufferedEndV };
      return l()(ie, Cr(), fo(o, i), Or(), Dr(), function(Te) {
        var Re, ve, Pe, Ye, lt;
        return Te.mse ? (Ye = Te.mse.bufferedByType(G.VIDEO), lt = Te.mse.bufferedByType(G.AUDIO)) : Ye = lt = Te.mediaBufferedSec, { a_buf_start: Math.round(1e3 * lt.start) || 0, a_buf_end: Math.round(1e3 * lt.end) || 0, a_buf_len: Math.round(1e3 * Math.max(0, lt.end - Te.currentTime)) || 0, a_buf_slices: ((Re = Te.mse) == null ? void 0 : Re.bufferSliceNumByType(G.AUDIO)) || Te.bufferSliceNum || 0, v_buf_start: Math.round(1e3 * Ye.start) || 0, v_buf_end: Math.round(1e3 * Ye.end) || 0, v_buf_len: Math.round(1e3 * Math.max(0, Ye.end - Te.currentTime)) || 0, v_buf_slices: ((ve = Te.mse) == null ? void 0 : ve.bufferSliceNumByType(G.VIDEO)) || Te.bufferSliceNum || 0, buffer_queue_cnt: ((Pe = Te.mse) == null ? void 0 : Pe.pendingNum()) || 0 };
      }(o), function(Te) {
        if (Te.stat.isLive && Te.stat.box === y.flv) {
          var Re, ve, Pe, Ye = (Re = Te.liveTime) == null ? void 0 : Re.getDisplayDelay(Te.currentTime);
          if (Ye)
            return { v_rec_delay: (ve = Te.liveTime) == null ? void 0 : ve.getRecDelay(), v_render_delay: Ye || 0, a_render_delay: ((Pe = Te.liveTime) == null ? void 0 : Pe.getAudioRenderDelay(Te.currentTime)) || 0 };
        }
        return {};
      }(o), go(o)), this.jr.hasData && (ie.retry_record = this.jr.beacon, ie.retry_cnt = this.jr.retryCount, this.jr.clear()), L.wasmDecErr && (ie.wasm_dec_err = L.wasmDecErr), $.muxA && (ie.mux_a = $.muxA), $.muxV && (ie.mux_v = $.muxV), $.fillA && (ie.fill_a = $.fillA), $.fillV && (ie.fill_v = $.fillV), $.droppedA && (ie.dropped_a = $.droppedA), $.droppedV && (ie.dropped_v = $.droppedV), L.muxDroppedFrames && (ie.mux_dropped_video_frames = L.muxDroppedFrames), u.coreType === H.mse && (ie.mse_update_cnt = (V == null ? void 0 : V.mseUpdate) || 0, ie.mse_remove_cnt = (V == null ? void 0 : V.mseRemove) || 0, ie.key_frame_cnt = L.keyFrame, u.isLive ? (ie.live_shift_type = o.stat.liveShiftType, o.isLiveShift && (ie.live_shift = o.stat.liveShiftActive ? 1 : 0)) : (ie.lazyload_min = Math.floor(u.lazyLoadRecoverDuration), ie.lazyload_max = Math.floor(u.lazyLoadMaxDuration)), L.audioRemuxSampleCount && (ie.a_remux_sample_cnt = L.audioRemuxSampleCount), L.videoRemuxSampleCount && (ie.v_remux_sample_cnt = L.videoRemuxSampleCount), L.audioRemuxDuration && (ie.a_remux_duration = Math.floor(1e3 * L.audioRemuxDuration)), L.videoRemuxDuration && (ie.v_remux_duration = Math.floor(1e3 * L.videoRemuxDuration))), this.Cr && (this.Nr === void 0 ? ie.first_screen_total_duration = 0 : (ie.first_screen_total_duration = this.Nr, ie.first_screen_details = this.Lr, u.coreType === H.mse && u.box === y.mp4 && (ie.mp4_moov_size = i.mp4MoovSize, i.mp4FastStart !== void 0 && (ie.mp4_fast_start = i.mp4FastStart ? 0 : 1)), this.Lr = void 0, this.Nr = void 0, this.Cr = !1)), typeof this.Ir == "number" && i.playStartTime && (ie.click_to_first_frame = this.Ir, this.Ir > 0 && (this.Ir = void 0)), this.Tr === 1 && l()(ie, Cr(), _o(this.ut), po()), this.Ur(), this.Tr++, ie;
    }, n;
  }(), gt = "monitor", Au = function(n) {
    function h(i) {
      var o;
      return (o = n.call(this) || this).Vr = void 0, o.Hr = void 0, o.Wr = void 0, o.ut = void 0, o.J = void 0, o.Gr = void 0, o.Rr = void 0, o.Qr = void 0, o.Yr = !1, o.Jr = !1, o.Zr = !1, o.zr = !1, o.Kr = function() {
        o.Rr.onLineChange++;
      }, o.qr = function(u) {
        var p;
        u === void 0 && (u = St.NORMEL);
        try {
          var T;
          p = (T = o.Qr) == null ? void 0 : T.build();
        } catch (V) {
        }
        if (p) {
          var L;
          u === St.NORMEL && p.first_screen_total_duration > 0 ? (p.type = St.FIRST_FRAME, p.metadata = Ao(o.data)) : (u === St.LOAD && l()(p, mo(o.ut)), p.type = u), o.zr && (l()(p, vo((L = o.ut.loadRec.currentLoad) == null ? void 0 : L.mediaInfo)), o.zr = !1), o.ut.stat.isLive || (p.seek_record = o.Rr.seekRecord.slice(0), o.Rr.seekRecord = []), o.J.i(gt, "realtime beacon", p), o.emit(q.REPORT, { type: ht.REALTIME_BEACON, value: p });
        }
      }, o.Wr = performance.now(), o.Hr = Date.now(), o.Gr = new ou(i), o.ut = i, o.J = i.logger, o.Xr(), dt || (window.addEventListener("online", o.Kr), window.addEventListener("offline", o.Kr)), o;
    }
    R()(h, n);
    var a = h.prototype;
    return a.getName = function() {
      return gt;
    }, a.Xr = function() {
      var i;
      this.Jr = !1, this.Zr = !1, this.zr = !1, this.Rr = (i = { decodedFrames: 0, droppedFrames: 0, muxDroppedFrames: 0, sessionId: du(), creationTime: 0, startTime: 0, loadStartTime: 0, playStartTime: 0, metadataTime: 0, playingStartTime: 0, playDuration: 0, actualPlayDuration: 0, pauseDuration: 0, pauseCnt: 0, bufferTime: 0, blockCount: 0, renderBlockCount: 0, seekCnt: 0, seekDuration: 0, seekLoadCnt: 0, seekLoadDuration: 0, seekStartTime: 0, unknownTSPacketCount: 0, audioNonMonotonous: 0, startBitrate: 0, smoothBitrate: -1, useBackup: 0, aacOverhead: 0, errorCode: 0, errorMessage: "", download: 0, reuse: 0, playPos: 0, seekRecord: [], codecs: "", firstScreenTotalDuration: 0, clickToFirstFrame: 0, playToEnd: 0, keyFrame: 0, onLineChange: 0, visibilityChange: 0, lastHeartbeatTime: 0, heartbeatTimeout: 0, loadCnt: 0, refreshCnt: 0, monkeyPatchedFetch: "", bufferedEndA: 0, bufferedEndV: 0, wasmDecErr: 0, audioRemuxSampleCount: 0, videoRemuxSampleCount: 0, audioRemuxDuration: 0, videoRemuxDuration: 0 }, Le.isSupported() && (i.monkeyPatchedFetch = je(fetch, "fetch")), i), this.Rr.creationTime = this.Hr, this.J.i(gt, "reset", this.Rr.sessionId), this.ut.fps.reset(), this.ut.fps.getFPS(this.ut.videoPlaybackQuality);
    }, a.onRendererInitComplete = function(i) {
      this.J.i(gt, "renderer init complete. type: " + i.type), this.data.canvasCtxType = i.type;
    }, a.onLoaderChunkArrival = function(i) {
      this.ut.loadRec.onDataReceive(i), this.$r(Ge.DATA);
    }, a.onMediaConnected = function(i) {
      i.headers && (this.Rr.httpHeader = i.headers), this.$r(Ge.STREAM_CONNECTED);
    }, a.onMediaDemux = function() {
      this.$r(Ge.DEMUX, performance.now());
    }, a.onKeyFrame = function(i) {
      this.ut.loadRec.currentLoad && this.ut.loadRec.currentLoad.keyFrame++, this.data.keyFrame++, i && this.emit(q.REPORT, { type: ht.KEY_FRAME, value: i });
    }, a.onDecLibLoaded = function(i) {
      this.Rr.decLibLoadDuration = i.duration, this.Rr.decLibCacheHit = i.hitCache;
    }, a.onNewSource = function(i) {
      var o = this.Rr, u = this.ut.lctx.current;
      u ? (this.ut.loadRec.onStreamOpen(i.sync, u.currentUrl, u.bitrate, u.qualityType), o.level = this.ut.lctx.currentIdx, o.startQualityType || (o.startQualityType = u.qualityType)) : this.ut.loadRec.onStreamOpen(i.sync, "", 0, "unknown");
    }, a.onDiscontinuity = function(i) {
      this.emit(q.REPORT, { type: ht.DISCONTINUITY, value: i });
    }, a.onDownload = function(i) {
      var o = this, u = this.Rr;
      i.error_code && !this.Gr.complete && this.Gr.onDownloadError(), u.download++;
      var p = l()({ use_backup: u.useBackup, first_screen: u.firstScreenTotalDuration ? 1 : 0 }, co(this.ut, u), Or(), Dr(), ho(), i);
      i.error_code === 1009 ? setTimeout(function() {
        o.emit(q.REPORT, { type: ht.DOWNLOAD, value: p });
      }, 0) : this.emit(q.REPORT, { type: ht.DOWNLOAD, value: p });
    }, a.onHeartbeat = function() {
      var i, o, u = this.Rr, p = this.ut, T = p.fps.getFPS(this.ut.videoPlaybackQuality), L = {}, V = p.loadRec, W = performance.now();
      u.lastHeartbeatTime && W - u.lastHeartbeatTime > 1500 && u.heartbeatTimeout++, u.lastHeartbeatTime = performance.now(), (p.stat.coreType === H.mse || p.stat.coreType === H.rtc) && (L.totalReceive = V.traffic, L.speed = V.speed, L.videoDataRate = ((i = V.currentLoad) == null ? void 0 : i.videoDataRate) || 0, L.audioDataRate = ((o = V.currentLoad) == null ? void 0 : o.audioDataRate) || 0), p.mse && (L.videoBuffered = u.bufferedEndV = Math.round(Math.max(0, 1e3 * (p.mse.bufferedEndByType(G.VIDEO) - p.currentTime))), L.audioBuffered = u.bufferedEndA = Math.round(Math.max(0, 1e3 * (p.mse.bufferedEndByType(G.AUDIO) - p.currentTime))), L.fillAudio = V.fillA, L.fillVideo = V.fillV, L.keyFrame = u.keyFrame, p.stat.isLive ? (L.isLive = p.stat.isLive, p.stat.liveShiftType && (L.liveShift = p.stat.liveShiftActive)) : (L.lazyloadMin = p.stat.lazyLoadRecoverDuration, L.lazyloadMax = p.stat.lazyLoadMaxDuration)), L.buffered = Math.round(1e3 * p.bufferedSec), L.decodedFPS = (T == null ? void 0 : T.decodedFPS) || 0, L.droppedFPS = (T == null ? void 0 : T.droppedFPS) || 0, u.decodedFrames = L.decodedFrames = (T == null ? void 0 : T.decoded) || 0, u.droppedFrames = L.droppedFrames = ((T == null ? void 0 : T.dropped) || 0) + u.muxDroppedFrames, p.stat.isLive && p.stat.box === y.flv && p.liveTime && (L.audioRenderDelay = p.liveTime.getAudioRenderDelay(p.currentTime), L.displayDelay = p.liveTime.getDisplayDelay(p.currentTime), L.recDelay = p.liveTime.getRecDelay()), p.stat.decoder === E.wasm && (L.wasmFrameBufLen = p.stat.frameBufLen), L.playPos = 1e3 * p.currentTime, this.J.i(gt, "heartbeat", L), this.emit(q.REPORT, { type: ht.HEARTBEAT, value: L });
    }, a.destroy = function() {
      this.J.i(gt, "destroy"), this.qr(St.END), this.tA(), dt() || (window.removeEventListener("online", this.Kr), window.removeEventListener("offline", this.Kr)), n.prototype.destroy.call(this);
    }, a.onLoad = function(i) {
      if (this.J.i(gt, "on load: " + i.type), this.Rr.loadCnt++, this.Rr.metadata = void 0, i.type)
        i.type !== ue.internal && i.type !== ue.retry || this.Gr.complete || this.Gr.start(), this.Rr.errorCode = 0, this.Rr.errorMessage = "";
      else {
        var o;
        if ((o = this.ut.lctx.current) == null || o.currentUrl, this.Rr.startTime) {
          var u = this.Rr.reuse;
          this.Xr(), this.Rr.reuse = u + 1;
        }
        this.Rr.startTime = performance.now(), this.Rr.loadStartTime = Date.now(), this.Gr.start(), this.Yr = bo(), this.tA(), this.Qr = new fu(this.Rr, this.ut), this.qr(St.LOAD);
      }
    }, a.onStopLoad = function() {
      this.qr(St.END), this.tA(), this.iA();
    }, a.onManifestParsed = function(i) {
      this.J.i(gt, "on manifest:", i);
      var o = this.ut.lctx.current;
      o && (this.Rr.startBitrate || (this.Rr.startBitrate = o.bitrate)), this.$r(Ge.MANIFEST);
    }, a.onLevelUpdated = function(i) {
      this.$r(Ge.LEVEL);
    }, a.onAudioTrackUpdated = function() {
    }, a.onMediaInfo = function(i) {
      var o, u, p, T = this.ut;
      (i = i || {}).box = T.stat.box, i.tagName = (o = T.video) == null ? void 0 : o.tagName, T.stat.srcMeta && (i.srcMeta = T.stat.srcMeta), (u = T.lctx.current) != null && u.meta && (i.currentLevelMeta = (p = T.lctx.current) == null ? void 0 : p.meta), typeof T.stat.isLive == "boolean" && (i.isLive = T.stat.isLive), i.liveShiftEnabled = T.isLiveShift, i.liveShiftType = T.stat.liveShiftType, i.packName = _t.packName, T.loadRec.onMediaInfo(i);
      var L = [];
      i.videoCodec && L.push(i.videoCodec), i.audioCodec && L.push(i.audioCodec), this.Rr.codecs = L.join(","), this.Rr.startCodec || (this.Rr.startCodec = this.Rr.codecs), i.sid = this.Rr.sessionId, i.hardwareAccelerated = _e.isSupportHW, i.coreType = T.stat.coreType, !i.streamHost && T.lctx.currentUrl && (i.streamHost = new Tt.a(T.lctx.currentUrl).host);
      var V, W = yr();
      W.renderer && (i.gpu = W.renderer), T.loadRec.currentLoad && (T.loadRec.currentLoad.mediaInfo = i), T.config.ntp && T.stat.isLive !== !1 && T.stat.box === y.flv && ((V = T.liveTime) == null || V.ntpSync(T.stat.preferNativeLoader)), T.stat.isKwaiSlice && (i.isKwaiSlice = T.stat.isKwaiSlice);
      var $ = JSON.stringify(i);
      this.J.i(gt, "mediainfo", $), this.zr = !0, this.emit(q.REPORT, { type: ht.MEDIA_INFO, value: JSON.parse($) });
    }, a.onParsingData = function(i) {
      var o = this.Rr;
      i.extra && i.extra.stat && (o.unknownTSPacketCount = o.unknownTSPacketCount || i.extra.stat.unknownTSPacketCount || 0, o.audioNonMonotonous = o.audioNonMonotonous || i.extra.stat.audioNonMonotonous || 0, o.aacOverhead = o.aacOverhead || i.extra.stat.aacOverhead || 0), i.segments.forEach(function(u) {
        u.type === G.VIDEO ? (u.droppedFrames && (o.muxDroppedFrames += u.droppedFrames), o.videoRemuxSampleCount += u.sampleCount, o.videoRemuxDuration += u.endDTS - u.startDTS) : u.type === G.AUDIO && (o.audioRemuxSampleCount += u.sampleCount, o.audioRemuxDuration += u.endDTS - u.startDTS);
      }), this.$r(Ge.SEGMENT);
    }, a.onPrivNal = function(i) {
      var o;
      (o = this.ut.liveTime) == null || o.onPrivNal(i), this.emit(q.REPORT, { type: ht.PRIV_NAL, value: i });
    }, a.onSei = function(i) {
      this.emit(q.REPORT, { type: ht.SEI, value: i });
    }, a.onAacPriv = function(i) {
      this.emit(q.REPORT, { type: ht.AAC_PRIV, value: i });
    }, a.onPlay = function() {
      this.Rr.playStartTime || (this.Rr.playStartTime = Date.now()), this.eA();
    }, a.onLoadedmetadata = function() {
      this.$r(Ge.LOADEDMETADATA), this.Rr.metadataTime || (this.Rr.metadataTime = Date.now());
    }, a.onLoadeddata = function() {
      this.$r(Ge.LOADEDDATA), this.iA();
    }, a.onCanplay = function() {
      this.$r(Ge.CANPLAY), ee.safari && this.ut.stat.coreType !== H.mse || this.iA();
    }, a.onPlaying = function() {
      var i;
      ee.ios && ((i = this.ut.video) == null ? void 0 : i.readyState) !== 4 || (this.Jr || (this.Jr = !0), this.nA(), this.rA(), this.iA());
    }, a.onPause = function() {
      var i;
      (i = this.ut.video) != null && i.seeking || !this.Jr || (this.AA(), this.oA(), this.Jr = !1);
    }, a.onEnded = function() {
      this.Rr.playToEnd++, this.Jr = !1, this.AA(), this.rA(), this.iA(), this.qr(St.END), this.tA();
    }, a.onWaiting = function(i) {
      this.Rr.playPos = Math.round(1e3 * this.ut.currentTime), this.Jr && this.Gr.complete && i.block && this.sA(i.bufferedSec);
    }, a.onSeeking = function(i) {
      this.Rr.seekRecord.push({ from: this.Rr.playPos, to: Math.round(1e3 * this.ut.currentTime), time: Date.now() }), this.Rr.seekRecord.length > 50 && this.Rr.seekRecord.shift(), this.ut.stat.isLive || i != null && i.internal || (this.Rr.seekStartTime = performance.now());
    }, a.onSeekWithLoad = function() {
      this.Gr.complete && (this.qr(St.SEEK), this.uA(), this.Zr = !0);
    }, a.onSeeked = function() {
      if (this.ut.fps.getFPS(this.ut.videoPlaybackQuality), this.Rr.seekStartTime) {
        this.Rr.seekCnt++;
        var i = Math.round(performance.now() - this.Rr.seekStartTime);
        this.Rr.seekDuration += i, this.Rr.seekStartTime = 0, this.Zr && (this.Rr.seekLoadCnt++, this.Rr.seekLoadDuration += i);
      }
      this.Zr = !1, this.Gr.complete || this.ut.stat.coreType === H.mse || !ee.safari && !ee.msie || this.$r(Ge.SEEKED);
    }, a.onTimeupdate = function() {
      var i, o, u = this.ut, p = u.video;
      if (p) {
        p.loop && !u.stat.isLive && u.currentTime === 0 && Number.isFinite(p.duration) && p.duration > 0 && p.duration - this.Rr.playPos / 1e3 < 1 && this.Rr.playToEnd++;
        var T = Math.round(1e3 * u.currentTime);
        ee.msie && u.stat.coreType !== H.mse && this.Rr.bufferingStartMS && this.Rr.playPos !== T && this.onPlaying(), this.Rr.playPos = T, !ee.ios || typeof this.Rr.bufferingStartMS != "number" || ((i = this.ut.video) == null ? void 0 : i.readyState) !== 4 || (o = this.ut.video) != null && o.paused || this.onPlaying();
      }
    }, a.onProgress = function() {
      var i;
      ee.safari && this.ut.stat.coreType !== H.mse && this.Rr.bufferingStartMS && ((i = this.ut.video) == null ? void 0 : i.readyState) === 4 && this.iA();
    }, a.mediaCapabilities = function(i) {
      this.Rr.smoothBitrate = i;
    }, a.onLevelSwitching = function(i) {
      i.smooth || (this.qr(St.LEVEL_SWITCH), this.uA());
    }, a.onRetry = function(i) {
      this.ut.stat.retryInfo.append(i), i.type === w.BACKUP && (this.Rr.useBackup = 1), this.Gr.onRetry(), i.type === w.BACKUP && (this.Qr && this.Qr.setError(i.code || 0, i.message || ""), this.qr(St.BACKUP), this.Qr && this.Qr.setError(0, ""));
    }, a.onRefresh = function() {
      this.Rr.refreshCnt++;
    }, a.onMetadata = function(i) {
      this.Rr.metadata || (this.Rr.metadata = i), i.mp4MoovSize && (this.Rr.mp4MoovSize = i.mp4MoovSize), typeof i.mp4FastStart == "boolean" && (this.Rr.mp4FastStart = i.mp4FastStart), typeof i.mp4MoovNoPs == "boolean" && (this.Rr.mp4MoovNoPs = i.mp4MoovNoPs), typeof i.compatible_brands == "string" && (this.Rr.mp4CompatibleBrands = i.compatible_brands), this.J.i(gt, "metadata", i), this.emit(q.REPORT, { type: ht.METADATA, value: i });
    }, a.onVisibilityChange = function() {
      this.Rr.visibilityChange++;
    }, a.onError = function(i) {
      i.preventFollowUp || (i.fatal ? (this.J.i(gt, "error", i), this.Rr.errorCode = i.code, this.Rr.errorMessage = i.reason, this.Qr && this.Qr.setError(i.code, i.reason), this.AA(), this.rA(), this.iA()) : i.details === ge.DECODER_DEC_ERROR && this.Rr.wasmDecErr++);
    }, a.$r = function(i, o) {
      o === void 0 && (o = 0), !this.Gr.complete && this.Gr.process(i, o) && this.aA();
    }, a.nA = function() {
      this.Rr.playingStartTime || (this.Rr.playingStartTime = Date.now()), this.Rr.playStartMS = this.Rr.playStartMS || performance.now(), this.Rr.actualPlayStartMS = this.Rr.actualPlayStartMS || performance.now();
    }, a.AA = function() {
      this.Rr.playStartMS && (this.Rr.playDuration += performance.now() - this.Rr.playStartMS), this.Rr.actualPlayStartMS && (this.Rr.actualPlayDuration += performance.now() - this.Rr.actualPlayStartMS), this.Rr.playStartMS = void 0, this.Rr.actualPlayStartMS = void 0;
    }, a.oA = function() {
      this.Rr.pauseCnt++, this.Rr.pauseStartMS = this.Rr.pauseStartMS || performance.now();
    }, a.rA = function() {
      this.Rr.pauseStartMS && (this.Rr.pauseDuration += performance.now() - this.Rr.pauseStartMS), this.Rr.pauseStartMS = void 0;
    }, a.sA = function(i) {
      this.Rr.bufferingStartMS || (this.Rr.blockCount++, this.Rr.bufferingStartMS = performance.now(), i > 0.6 && this.Rr.renderBlockCount++), this.Rr.actualPlayStartMS && (this.Rr.actualPlayDuration += performance.now() - this.Rr.actualPlayStartMS), this.Rr.actualPlayStartMS = void 0;
    }, a.iA = function() {
      this.Rr.bufferingStartMS && (this.Rr.bufferTime += performance.now() - this.Rr.bufferingStartMS, this.Rr.bufferingStartMS = void 0);
    }, a.aA = function() {
      this.J.i(gt, "first frame"), this.ut.stat.firstFrameLoaded = !0;
      var i = this.Rr;
      i.firstScreenTotalDuration = i.firstScreenTotalDuration || Math.round(this.Gr.duration), i.firstScreenDetails = i.firstScreenDetails || this.Gr.details, i.playStartTime && this.Gr.complete ? i.clickToFirstFrame = i.clickToFirstFrame || Math.max(1, this.Gr.complete - i.playStartTime) : i.clickToFirstFrame = 1, this.Qr && this.Qr.setFirstScreenDuration(this.Gr.duration, this.Gr.details, i.clickToFirstFrame), this.ut.video && !this.ut.video.paused && this.nA();
    }, a.eA = function() {
      this.Vr === void 0 && (this.Vr = setInterval(this.qr, 1e4));
    }, a.tA = function() {
      this.Vr && (clearTimeout(this.Vr), this.Vr = void 0);
    }, a.uA = function() {
      this.tA(), this.eA();
    }, f()(h, [{ key: "runningStartTime", get: function() {
      return this.Wr;
    } }, { key: "sid", get: function() {
      return this.Rr.sessionId;
    } }, { key: "snapshot", get: function() {
      var i = this.ut.loadRec, o = this.ut.stat;
      return l()({ streams: i.streams, live: o.isLive, liveShift: o.liveShiftActive, demuxer: o.demuxerType, decSimd: o.wasmSimd, decThreads: o.wasmThreads, decoderType: o.wasmDecoder }, this.Rr);
    } }, { key: "data", get: function() {
      return this.Rr;
    } }, { key: "audienceStat", get: function() {
      var i, o = this.Rr, u = yo(o), p = this.ut.stat, T = this.ut.loadRec, L = { play_duration: u.play, actual_play_duration: u.actualPlay, traffic: Math.round(T.traffic / 1024), buffer_time: u.buffer, block_cnt: o.blockCount, render_block_cnt: o.renderBlockCount, click_to_first_frame: o.playStartTime && o.clickToFirstFrame || 0, first_screen_total_duration: Math.round(o.firstScreenTotalDuration) || 0, first_screen_details: o.firstScreenDetails || this.Gr.details || null, error_code: o.errorCode || 0, error_message: o.errorMessage || "", remux_process_type: (this.ut.streamingMuxEnabled ? 1 : 0) + (p.gopRemux ? 1 : 0), hidden_start: this.Yr ? 1 : 0, current_running_time: Math.round(performance.now() - o.startTime), running_time: Math.round(performance.now() - this.Wr), smooth_bitrate: o.smoothBitrate, start_bitrate: o.startBitrate || 0, abr: this.ut.config.adaptive ? 1 : 0, pause_cnt: o.pauseCnt, traffic_vcodec: T.trafficGroupedByVCodecType, traffic_level: T.trafficGroupedByLevel, decoded_video_frames: o.decodedFrames, dropped_video_frames: o.droppedFrames + o.muxDroppedFrames, pause_duration: u.pause, seek_cnt: o.seekCnt, seek_duration: o.seekDuration, seek_load_cnt: o.seekLoadCnt, seek_load_duration: o.seekLoadDuration, start_sec: p.isLive ? 0 : Math.round(this.ut.config.startFromSec || 0), on_line_change: o.onLineChange, visibility_change: o.visibilityChange, heartbeat_timeout: o.heartbeatTimeout, load_cnt: o.loadCnt, refresh_cnt: o.refreshCnt, media_buffered_v: o.bufferedEndV, media_buffered_a: o.bufferedEndA, remux_worker: this.ut.stat.webWorker ? 1 : 0, av_separated: this.ut.stat.avSeparated ? 1 : 0 };
      if (p.retryInfo.hasData && (L.retry_record = p.retryInfo.mergedBeacon, L.retry_cnt = p.retryInfo.retryCount), o.wasmDecErr && (L.wasm_dec_err = o.wasmDecErr), l()(L, Cr(), fo(this.ut, o), Or(), Dr(), vo((i = this.ut.loadRec.currentLoad) == null ? void 0 : i.mediaInfo), _o(this.ut), mo(this.ut), go(this.ut), po()), L.metadata = Ao(o), p.coreType === H.mse && this.ut.mse && (L.mse_buffer_full = this.ut.mse.stat.mseBufferFull, L.mse_remove = this.ut.mse.stat.mseRemove, L.key_frame_cnt = o.keyFrame, p.box === y.mp4 && (L.mp4_moov_size = o.mp4MoovSize, o.mp4CompatibleBrands !== void 0 && (L.mp4_compatible_brands = o.mp4CompatibleBrands), o.mp4FastStart !== void 0 && (L.mp4_fast_start = o.mp4FastStart ? 1 : 0), o.mp4MoovNoPs !== void 0 && (L.mp4_moov_no_ps = o.mp4MoovNoPs ? 1 : 0)), L.a_remux_sample_cnt = o.audioRemuxSampleCount, L.v_remux_sample_cnt = o.videoRemuxSampleCount, L.a_remux_duration = Math.floor(1e3 * o.audioRemuxDuration), L.v_remux_duration = Math.floor(1e3 * o.videoRemuxDuration)), typeof this.ut.config.audioEnabled == "boolean" && (L.a_enabled = this.ut.config.audioEnabled ? 1 : 0), typeof this.ut.config.videoEnabled == "boolean" && (L.v_enabled = this.ut.config.videoEnabled ? 1 : 0), T.muxA && (L.mux_a = T.muxA), T.muxV && (L.mux_v = T.muxV), T.fillA && (L.fill_a = T.fillA), T.fillV && (L.fill_v = T.fillV), T.droppedA && (L.dropped_a = T.droppedA), T.droppedV && (L.dropped_v = T.droppedV), o.muxDroppedFrames && (L.mux_dropped_video_frames = o.muxDroppedFrames), he(p.box) && (L.unknown_ts_packet_count = o.unknownTSPacketCount, L.audio_non_monotonous = o.audioNonMonotonous, L.aac_overhead = o.aacOverhead), typeof o.decLibLoadDuration == "number" && (L.dec_lib_load_duration = Math.round(o.decLibLoadDuration), L.dec_lib_hit = o.decLibCacheHit || ""), this.ut.stat.coreType === H.native) {
        var V = this.ut.stat.retryInfo.getLastMseError();
        V && (L.last_error_code = o.errorCode, L.last_error_message = o.errorMessage, L.error_code = V.code, L.error_message = V.reason);
      }
      return L;
    } }]);
  }(mr), ye = "kernel", Eo = function(n) {
    function h(i, o) {
      var u;
      return (u = n.call(this) || this).zt = void 0, u.ut = void 0, u.hA = void 0, u.ii = void 0, u.cA = new A.EventEmitter(), u.J = void 0, u.fA = !1, u.vA = void 0, u.ot = void 0, u.dA = void 0, u.lA = function(p) {
        var T = u.ut;
        p.levels = T.lctx.levels.map(function(W) {
          return W.getKLevel();
        }), p.currentLevel = T.lctx.currentIdx, p.auto = T.lctx.abr, p.levels = T.lctx.levels.map(function(W) {
          return W.getKLevel();
        });
        var L = T.lctx.audioTracks;
        L && L.length && (p.audioTrack = T.lctx.audioIdx, p.audioTracks = L.map(function(W) {
          return { lang: W.lang, qualityLabel: W.qualityLabel, qualityType: W.qualityType, bitrate: W.bitrate, groupId: W.groupId };
        }));
        var V = T.lctx.subtitleTracks;
        V && V.length && (p.subtitleTrack = T.lctx.subtitleIdx, p.subtitleTracks = V.map(function(W) {
          return { lang: W.lang, name: W.name, groupId: W.groupId };
        })), p.currentLevel = T.lctx.currentIdx, p.auto = T.lctx.abr, p.isLive = T.stat.isLive, T.stat.stereoType !== void 0 && (p.stereoType = T.stat.stereoType);
      }, u.pA = function(p) {
        u.mA(p);
      }, u.yA = function(p) {
        p.type === ue.retry && (u.ii = void 0);
      }, u.MA = function(p) {
        p.pos = Math.floor(u.zt.currentTime), p.ts = Math.floor(performance.now());
      }, u.H = function(p) {
        if (u.J.i(ye, "on error", p), !p.preventFollowUp) {
          var T = u.ut;
          if (p.details === ge.MANIFEST_PARSING_ERROR)
            try {
              io.isSrcEmpty(u.ut.src) && (u.J.i(ye, "src empty", u.ut.src), p.details = ge.SRC_EMPTY), T.src ? typeof T.src == "string" ? p.reason += "src str:" + T.src.slice(0, 1024) : T.src instanceof Blob ? p.reason += "src: blob" : p.reason += "src other:" + JSON.stringify(T.src).slice(0, 1024) : p.reason += "src:" + T.src;
            } catch (V) {
              p.reason += V.message;
            }
          var L = ae(p.details, p.reason, p.statusCode || 0);
          p.code = L, u.ii || (u.ii = p), p.fatal && u.stopLoad();
        }
      }, u.wA = function(p) {
        u.J.i(ye, "window error:", p.message);
        try {
          u.J.i(ye, "window error stack:", p.error.stack);
        } catch (T) {
        }
      }, u.bA = function() {
        u.ut.evt.emit(q.VISIBILITY_CHANGE, { hidden: document.hidden });
      }, u.zt = i, u.ut = new _t(o || {}, u.zt), u.gA(), u.J = u.ut.logger, typeof location < "u" && u.J.i(ye, "href: " + location.href), u.J.i(ye, _t.packName + ", " + _t.version + " build: " + _t.buildTime + " cors: " + (i == null ? void 0 : i.crossOrigin) + " autoplay: " + (i == null ? void 0 : i.autoplay) + " dom: " + i.tagName, o), (!u.ut.config || u.ut.config.audioEnabled === !1 && u.ut.config.videoEnabled === !1) && setTimeout(function() {
        u.kA(le(Ue.OTHER_ERROR, ge.CONFIG_ERROR, "config data error"));
      }, 0), u.hA = new Au(u.ut), u.ut.config.src && (u.dA = u._A()), u.vA = new Cl(u.ut, function(p) {
        var T;
        return (T = u.dA) == null ? void 0 : T.internalSeek(p);
      }), u.ot = new yl(u.J, u.ut.evt), u.ot.register(u.vA), u.ot.register(u.hA), u.ot.register(new bl(u.ut, u.cA)), u.F.push(u.ot, u.vA, u.hA), u.J.i(ye, "config", u.ut.config), _t.instanceCount++, dt() || (window.addEventListener("error", u.wA), document.addEventListener("visibilitychange", u.bA)), u;
    }
    R()(h, n), h.isSupport = function(i) {
      if (y.webrtc === (i == null ? void 0 : i.box))
        return _e.isWebRTCSupported();
      if (i != null && i.nativeFirst)
        return _e.isVideoBoxSupported(i == null ? void 0 : i.box);
      var o = _e.isSupported();
      if (o) {
        var u = !0;
        i && (u = !(!i.isLive || i.box !== y.flv));
        var p = !u || ce.isStreamingSupported();
        return o && !!p;
      }
      return _e.isVideoBoxSupported(i == null ? void 0 : i.box);
    }, h.videoCodecCapabilities = function(i) {
      return _e.getVideoCodecCompatibilityByCodec(i);
    };
    var a = h.prototype;
    return a.on = function(i, o) {
      this.J.i(ye, "call on " + i), this.cA.on(i, o);
    }, a.once = function(i, o) {
      this.J.i(ye, "call once " + i), this.cA.once(i, o);
    }, a.removeAllListeners = function(i) {
      this.J.i(ye, "call removeAllListeners"), this.cA.removeAllListeners(i);
    }, a.off = function(i, o) {
      this.J.i(ye, "call off " + i), this.cA.off(i, o);
    }, a.listeners = function(i) {
      return this.cA.listeners(i);
    }, a.emit = function(i, o) {
      return this.cA.emit(i, o);
    }, a.listenerCount = function(i) {
      return this.cA.listenerCount(i);
    }, a.prependListener = function(i, o) {
      this.cA.prependListener(i, o);
    }, a.prependOnceListener = function(i, o) {
      this.cA.prependOnceListener(i, o);
    }, a.load = function(i, o) {
      var u, p = this;
      if (this.J.i(ye, "call kernel load", i, o), this.hA.data.startTime > 0 && this.J.i(ye, "play summary data:", this.hA.audienceStat), i && this.ut.setSrc(i), this.ut.src)
        if (h.isSupport({ box: this.ut.stat.box, isLive: this.ut.stat.isLive, nativeFirst: this.ut.stat.native })) {
          var T, L;
          typeof (o == null ? void 0 : o.startFromSec) == "number" ? this.ut.stat.startFromSec = o.startFromSec : i && (this.ut.stat.startFromSec = -1), this.ut.stat.multipart && this.ut.config.resourceBuffer && ml(this.ut.config.resourceBufferSize), i && ((u = this.dA) == null ? void 0 : u.type) !== ((L = this.ut).stat.box === y.webrtc ? H.rtc : L.stat.native ? H.native : H.mse) && ((T = this.dA) == null || T.destroy(), this.dA = void 0), this.ut.fallback.register(Ie.NEXT_DESC, new wl(this.ut).setRetryFunc(this.EA.bind(this))), this.ut.fallback.register(Ie.SWAP_264, new xl(this.ut).setRetryFunc(this.EA.bind(this))), this.Zt();
        } else
          setTimeout(function() {
            p.kA(le(Ue.OTHER_ERROR, ge.UNSUPPORTED, "unsupported: " + p.ut.stat.box + " live: " + p.ut.stat.isLive + " native: " + p.ut.stat.native));
          }, 0);
      else
        this.kA(le(Ue.OTHER_ERROR, ge.SRC_EMPTY, "url empty"));
    }, a.getTimeNow = function() {
      var i;
      return ((i = this.ut.liveTime) == null ? void 0 : i.serverNowMs) || null;
    }, a.setAvailableAbrLevels = function(i) {
      this.J.i(ye, "setAvailableAbrLevels", i), this.ut.lctx.availableList = i.splice(0), this.dA && "onAbrLevelsUpdated" in this.dA && this.dA.onAbrLevelsUpdated();
    }, a.preload = function(i, o) {
      this.J.i(ye, "call preload");
    }, a.isTimeinBuffered = function(i) {
      return this.ut.stat.box !== y.webrtc && this.ut.isTimeinBuffered(i);
    }, a.resume = function() {
      var i, o, u = this;
      this.J.i(ye, "call resume"), (i = this.dA) == null || i.resume(), this.zt.paused && ((o = this.zt.play()) == null || o.catch(function(p) {
        return u.J.i(ye, "resume, call play() fail.", p);
      }));
    }, a.destroy = function() {
      var i;
      this.J.i(ye, "call kernel destroy. play summary data:", this.hA.audienceStat), this.fA && (_t.instanceCount--, this.fA = !0), performance.removeEventListener && performance.removeEventListener("resourcetimingbufferfull", wn), this.ut.fallback.unregisterAndDestroy(Ie.NEXT_DESC), this.ut.fallback.unregisterAndDestroy(Ie.SWAP_264), this.ut.fallback.unregisterAndDestroy(Ie.SWAP_CORE), n.prototype.destroy.call(this), (i = this.dA) == null || i.destroy(), this.ut.destroy(), this.removeAllListeners(), dt() || (window.removeEventListener("error", this.wA), document.removeEventListener("visibilitychange", this.bA));
    }, a.refresh = function() {
      var i, o;
      this.J.i(ye, "call kernel refresh"), this.hA.onRefresh(), this.ii = void 0, (i = this.ut.cOutput) == null || i.reset(), (o = this.dA) == null || o.refresh();
    }, a.stopLoad = function() {
      var i;
      this.J.i(ye, "call kernel stopLoad"), (i = this.dA) == null || i.stopLoad();
    }, a.getStreamTime = function(i) {
      var o = this.ut.streamTime.getStreamTime(i / 1e3);
      return o ? 1e3 * o : NaN;
    }, a.getAudienceStat = function() {
      return this.hA.audienceStat;
    }, a.getMediaInfo = function() {
      var i;
      return l()({}, (i = this.ut.loadRec.currentLoad) == null ? void 0 : i.mediaInfo);
    }, a.experiment = function(i) {
      this.J.i(ye, "experiment", i);
    }, a.liveEnd = function() {
      this.J.i(ye, "call liveEnd"), this.dA && "liveEnd" in this.dA && this.dA.liveEnd();
    }, a.seekToNextFrame = function() {
      this.J.i(ye, "call seekToNextFrame"), this.dA && "seekToNextFrame" in this.dA ? this.dA.seekToNextFrame() : this.RA();
    }, a.seekToPrevFrame = function() {
      this.J.i(ye, "call seekToPrevFrame"), this.dA && "seekToPrevFrame" in this.dA ? this.dA.seekToPrevFrame() : this.RA();
    }, a.seekByFrameIndex = function(i) {
      if (this.J.i(ye, "call seekByFrameIndex", i), this.dA && "setCurretVideoFrame" in this.dA)
        return this.dA.setCurretVideoFrame(i);
      this.RA();
    }, a.screenshot = function(i) {
      var o;
      i && (i = JSON.parse(JSON.stringify(i))), this.J.i(ye, "call screenshot", i), (o = this.dA) == null || o.screenshot(i);
    }, a.Zt = function(i) {
      this.ii = void 0, this.dA || (this.dA = this._A()), this.dA && (this.dA.load(i), this.ut.stat.coreType = this.dA.type);
    }, a._A = function() {
      var i = this.ut, o = function(u) {
        return u.stat.native ? new Ul(u) : u.stat.box !== y.webrtc && it.a || u.stat.box === y.webrtc && it.a ? new it.a(u) : void 0;
      }(i);
      if (o)
        return this.J.i(ye, "init av core. type: " + o.type), i.stat.coreType = o.type, o;
      this.kA(le(Ue.OTHER_ERROR, ge.UNSUPPORTED, "init core error. " + i.stat.box + " native: " + i.stat.native + " unsupported."));
    }, a.DA = function() {
      this.EA(H.native);
    }, a.TA = function() {
      this.EA(H.mse);
    }, a.EA = function(i) {
      var o, u, p = this, T = this.zt.paused;
      !this.ut.live && this.ut.stat.startFromSec <= 0 && (this.ut.stat.startFromSec = this.zt.currentTime), (o = this.dA) == null || o.destroy(), this.dA = void 0, i !== void 0 && (this.ut.stat.native = i !== H.mse), this.ut.stat.demuxerType = void 0, this.Zt(ue.retry), T || (u = this.zt.play()) == null || u.catch(function(L) {
        return p.J.i(ye, "recover, call play() fail.", L);
      });
    }, a.mA = function(i) {
      var o = this.ut.cOutput;
      o && (i === void 0 && (i = { enabled: !0, type: o.rendererType, canvas: o.rendererType === x.canvas && o.canvas ? o.canvas : void 0 }), this.J.i(ye, "video renderer change", i), i.canvas && this.emit(q.H265_DETECTED, { canvas: i.canvas, message: "", enabled: i.enabled, decoder: E.wasm }));
    }, a.RA = function() {
      this.kA(le(Ue.MEDIA_ERROR, ge.CANNOT_SEEK_BY_FRAME_INDEX, "unsupported", { fatal: !1 }));
    }, a.kA = function(i) {
      this.ut.evt.emit(q.ERROR, i);
    }, a.gA = function() {
      var i = this.ut.evt;
      i.on(q.ERROR, this.H), i.on(q.MANIFEST_PARSED, this.lA), i.on(q.VIDEO_RENDERER_CHANGE, this.pA), i.on(q.LOAD, this.yA), i.on(q.RETRY, this.MA);
    }, f()(h, [{ key: "liveShiftType", get: function() {
      return this.ut.stat.liveShiftType;
    } }, { key: "liveShift", get: function() {
      return this.ut.stat.liveShiftActive;
    } }, { key: "liveShiftDelaySec", get: function() {
      return this.ut.config.liveShiftDelaySec;
    } }, { key: "currentVideoFrame", get: function() {
      return this.dA && "getCurrentVideoFrame" in this.dA ? this.dA.getCurrentVideoFrame() : 0;
    }, set: function(i) {
      this.J.i(ye, "call set currentVideoFrame", i), this.dA && "setCurretVideoFrame" in this.dA && this.dA.setCurretVideoFrame(i);
    } }, { key: "totalVideoFrames", get: function() {
      return this.dA && "getTotalVideoFrames" in this.dA ? this.dA.getTotalVideoFrames() : 0;
    } }, { key: "audioTrack", get: function() {
      return this.ut.lctx.audioIdx || 0;
    }, set: function(i) {
      var o;
      this.J.i(ye, "call set audioTrack", i), this.ut.config.audioEnabled === !1 && (this.J.i(ye, "set audioTrack failed. conf audio enabled false"), this.emit(q.AUDIO_TRACK_SWITCH_FAILED)), this.dA && "setAudioTrack" in this.dA && ((o = this.dA) == null || o.setAudioTrack(i));
    } }, { key: "subtitleTrack", get: function() {
      return this.ut.lctx.subtitleIdx || 0;
    }, set: function(i) {
      var o;
      this.J.i(ye, "call set subtitleTrack", i), this.dA && "setSubtitleTrack" in this.dA && ((o = this.dA) == null || o.setSubtitleTrack(i));
    } }, { key: "currentLevel", get: function() {
      return this.ut.lctx.currentIdx || 0;
    }, set: function(i) {
      if (this.J.i(ye, "call set currentLevel from: " + this.ut.lctx.currentIdx + " to: " + i + " ", this.ut.lctx.abr), this.dA && "setCurrentLevel" in this.dA)
        if (i < 0 && !this.ut.isAbrAvailable)
          this.J.i(ye, "set currentLevel failed. unsupported auto"), this.emit(q.LEVEL_SWITCH_FAILED);
        else if (this.ut.config.videoEnabled === !1)
          this.J.i(ye, "set currentLevel failed. conf video enabled false"), this.emit(q.LEVEL_SWITCH_FAILED);
        else {
          var o;
          (o = this.dA) == null || o.setCurrentLevel(i);
        }
      else
        this.J.i(ye, "set nextLevel failed. unsupported"), this.emit(q.LEVEL_SWITCH_FAILED);
    } }, { key: "nextLevel", get: function() {
      return this.ut.lctx.nextIdx || 0;
    }, set: function(i) {
      if (this.J.i(ye, "call set nextLevel from: " + this.ut.lctx.nextIdx + " to " + i), this.dA && "setNextLevel" in this.dA)
        if (i < 0 && !this.ut.isAbrAvailable)
          this.J.i(ye, "set nextLevel failed. unsupported auto"), this.emit(q.LEVEL_SWITCH_FAILED);
        else if (this.ut.config.videoEnabled === !1)
          this.J.i(ye, "set nextLevel failed. conf video enabled false"), this.emit(q.LEVEL_SWITCH_FAILED);
        else {
          var o;
          (o = this.dA) == null || o.setNextLevel(i);
        }
      else
        this.J.i(ye, "set nextLevel failed. unsupported"), this.emit(q.LEVEL_SWITCH_FAILED);
    } }, { key: "startLevel", get: function() {
      return this.ut.lctx.startIdx || 0;
    }, set: function(i) {
      this.J.i(ye, "call set startLevel", i), this.ut.lctx.startIdx = i;
    } }, { key: "outputLog", get: function() {
      return this.ut.logger.getOutput();
    }, set: function(i) {
      this.J.i(ye, "call set output log", i), this.ut.logger.setOutput(i);
    } }, { key: "autoLevelEnabled", get: function() {
      return this.ut.lctx.abr;
    } }, { key: "monitorData", get: function() {
      return this.hA && this.dA ? l()(this.hA.snapshot, { trackBufInfo: this.dA.getTrackBufInfo() }) : null;
    } }, { key: "currentLevelTimeInfo", get: function() {
      var i = this.ut.lctx.current;
      if (i && i.timeInfo)
        return i.timeInfo;
    } }, { key: "instanceId", get: function() {
      return this.ut.id;
    } }], [{ key: "version", get: function() {
      return _t.version;
    } }, { key: "buildTime", get: function() {
      return _t.buildTime;
    } }, { key: "MediaBox", get: function() {
      return y;
    } }, { key: "Events", get: function() {
      return { REPORT: q.REPORT, ERROR: q.ERROR, LEVEL_SWITCHING: q.LEVEL_SWITCHING, LEVEL_SWITCHED: q.LEVEL_SWITCHED, LEVEL_SWITCH_PLAYING: q.LEVEL_SWITCH_PLAYING, LEVEL_SWITCH_FAILED: q.LEVEL_SWITCH_FAILED, AUDIO_TRACK_SWITCHING: q.AUDIO_TRACK_SWITCHING, AUDIO_TRACK_SWITCHED: q.AUDIO_TRACK_SWITCHED, AUDIO_TRACK_UPDATED: q.AUDIO_TRACK_UPDATED, SUBTITLE_TRACK_SWITCHED: q.SUBTITLE_TRACK_SWITCHED, MANIFEST_PARSED: q.MANIFEST_PARSED, LEVEL_UPDATED: q.LEVEL_UPDATED, LOAD_END: q.LOAD_END, VIDEO_RENDERER_CHANGE: q.VIDEO_RENDERER_CHANGE, SCREENSHOT: q.SCREENSHOT };
    } }, { key: "Reports", get: function() {
      return l()({}, ht);
    } }]);
  }(S);
  function pu(n, h) {
    return dt() ? void 0 : new Eo(n, h);
  }
}]);
Je === void 0 && console.error("esm-webpack-plugin: nothing exported!");
const _c = Je.default;
Je.createKernel;
Je.AbstractDestroyable;
Je.CanvasContextType;
Je.CodecType;
Je.DestroyableList;
Je.Decoder;
Je.DemuxerType;
Je.DownloadStatus;
Je.ErrorDetails;
Je.ErrorTypes;
Je.HttpRangeType;
const ft = Je.KEvents;
Je.LiveShiftType;
Je.LogLevel;
Je.MediaBox;
Je.ReportTypes;
Je.StereoType;
Je.VideoDecBlockPolicy;
Je.VideoDropFramePolicy;
Je.VideoRendererType;
Je.WasmDecoder;
const Nt = {
  "kwai-player": "_kwai-player_1ufc0_2",
  "kwai-player-video-interactive": "_kwai-player-video-interactive_1ufc0_11",
  "kwai-player-poster": "_kwai-player-poster_1ufc0_19",
  "kwai-player-video": "_kwai-player-video_1ufc0_11",
  "kwai-player-disable-scroll": "_kwai-player-disable-scroll_1ufc0_52",
  "kwai-player-yoda": "_kwai-player-yoda_1ufc0_56"
}, Fr = "kwai-player-id", Zr = class Kt {
  static next() {
    if (xa.available) {
      const e = Kt._ls.read(Fr, !1);
      let r = Kt._id;
      return typeof e == "number" ? (r = this.getNextId(e), this._ls.write(Fr, r)) : (r = this.getNextId(r), this._ls.write(Fr, r)), Kt._id = r, r;
    } else
      return Kt._id = Kt.getNextId(Kt._id), Kt._id;
  }
  static get MAX_ID() {
    return 999;
  }
  static getNextId(e) {
    return e++, e > Kt.MAX_ID ? 0 : e;
  }
};
X(Zr, "_id", 0), X(Zr, "_ls", new xa());
let mc = Zr, Xr = class en {
  static verify(e) {
    return !!(e && e.liveStreamId && (Array.isArray(e.liveAdaptiveManifest) && e.liveAdaptiveManifest.length || Array.isArray(e.multiResolutionPlayUrls) && e.multiResolutionPlayUrls.length || Array.isArray(e.playUrls) && e.playUrls.length || e.hlsPlayUrl));
  }
  static parse(e) {
    if (en.verify(e)) {
      let r;
      return e.liveAdaptiveManifest && e.liveAdaptiveManifest.length ? r = e.liveAdaptiveManifest[0] : e.multiResolutionPlayUrls && e.multiResolutionPlayUrls.length && (r = en._multiResolution2Manifest(e.multiResolutionPlayUrls)), ci && e.hlsPlayUrl ? r ? [{ src: r }, { src: e.hlsPlayUrl }] : e.hlsPlayUrl : r;
    }
  }
  static _multiResolution2Manifest(e) {
    return {
      version: "1",
      adaptationSet: {
        representation: e.map((r, s) => {
          var l;
          return {
            id: s,
            url: (l = r.urls[0]) == null ? void 0 : l.url,
            name: r.name,
            bitrate: 0,
            qualityType: r.type,
            defaultSelect: r.defaultSelect
          };
        }).filter((r) => r.url)
      }
    };
  }
};
var Oa = /* @__PURE__ */ ((t) => (t[t.CTOR_ERROR = 1e4] = "CTOR_ERROR", t))(Oa || {});
class gc {
  /**
   * 验证数据有效性
   * @param data - 待验证数据
   */
  static verify(e) {
    return e && Object.prototype.hasOwnProperty.call(e, "version") && Object.prototype.hasOwnProperty.call(e, "adaptationSet") && Object.prototype.hasOwnProperty.call(e.adaptationSet, "representation") && Array.isArray(e.adaptationSet.representation) && e.adaptationSet.representation.length > 0 ? e.adaptationSet.representation.reduce((r, s) => !!(r && s.url && s.bitrate && s.qualityType), !0) : !1;
  }
}
class yc {
  /**
   * 验证数据有效性
   * @param data - 待验证数据
   */
  static verify(e) {
    return e && e.adaptationSet && e.adaptationSet.length ? e.adaptationSet.reduce((r, s) => !!(r && s.representation && s.representation.length), !0) : !1;
  }
}
const bc = /\.[^./\\?#]+(?=$|[?#])/i;
function Ec(t) {
  const e = t.toLocaleLowerCase().match(bc);
  return e ? e[0] : "";
}
let wc = class $i {
  static parse(e) {
    if (typeof e == "string")
      try {
        return e = JSON.parse(e), $i._parseManifest(e);
      } catch (r) {
        return $i._parseUrl(e);
      }
    else if (typeof e == "object")
      return $i._parseManifest(e);
  }
  static _parseUrl(e) {
    return Ec(e) === ".flv" ? {
      isLive: !0,
      src: {
        liveStreamId: "",
        playUrls: [{
          url: e
        }]
      }
    } : {
      isLive: !1,
      src: [{ url: e }]
    };
  }
  static _parseManifest(e) {
    return yc.verify(e) ? {
      isLive: !1,
      src: e
    } : gc.verify(e) ? {
      isLive: !0,
      src: {
        liveStreamId: "",
        liveAdaptiveManifest: [e]
      }
    } : Xr.verify(e) ? {
      isLive: !0,
      src: e
    } : {
      isLive: !1
    };
  }
};
const Oo = typeof document > "u" ? void 0 : document.createElement("video");
function Tc() {
  return !!(Oo != null && Oo.requestPictureInPicture);
}
const Mo = "fullscreen";
class Rc {
  constructor(e, r) {
    X(this, "_evt"), X(this, "_logger"), X(this, "_element"), X(this, "_isFillWindow", !1), X(this, "_originStyle"), X(this, "_isSupportFullscreen", !0), X(this, "_onFullscreenChange", () => {
      this._logger.i(Mo, "_onFullscreenChange", this.isFull()), this.isFull() || (this._recoverStyle(), document.body.classList.remove(Nt["kwai-player-disable-scroll"])), this._isFillWindow = !1, this._evt.emit("fullChange", {
        type: Mt.SYSTEM,
        isFull: this.isFull()
      });
    }), this._evt = e, this._logger = r, !(typeof document > "u") && (this._isSupportFullscreen = typeof this._getExitFullscreenFunc() < "u" && !(Pt.os.name === "iOS" && Pt.device.type === "mobile"), "onfullscreenchange" in document ? (document.addEventListener("fullscreenchange", this._onFullscreenChange), document.addEventListener("fullscreenerror", this._onFullscreenChange)) : "onwebkitfullscreenchange" in document && (document.addEventListener("webkitfullscreenchange", this._onFullscreenChange), document.addEventListener("webkitfullscreenerror", this._onFullscreenChange)));
  }
  destroy() {
    document.removeEventListener("fullscreenchange", this._onFullscreenChange), document.removeEventListener("fullscreenerror", this._onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange), document.removeEventListener("webkitfullscreenerror", this._onFullscreenChange);
  }
  /**
   * 全屏或网页全屏
   * @param e 需要全屏的元素
   */
  requestFull(e, r) {
    r === Mt.SYSTEM ? this.requestFullscreen(e) : r === Mt.WINDOW ? this.requestFillWindow(e) : this._isSupportFullscreen ? this.requestFullscreen(e) : this.requestFillWindow(e);
  }
  /**
   * 退出全屏或网页全屏
   */
  exitFull(e) {
    if (e === Mt.SYSTEM)
      return this.exitFullscreen();
    if (e === Mt.WINDOW)
      return this.exitFillWindow();
    this.isFull(Mt.SYSTEM) ? this.exitFullscreen() : this.exitFillWindow();
  }
  /**
   * 是否是全屏或网页全屏状态
   * @returns 全屏状态
   */
  isFull(e) {
    return e === Mt.SYSTEM ? this.isFullScreen() : e === Mt.WINDOW ? this.isFillWindow() : this.isFullScreen() || this.isFillWindow();
  }
  /**
   * 全屏
   * @param element 需要全屏的元素
   * @returns
   */
  requestFullscreen(e) {
    this._element = e, this._originStyle || this._saveOriginStyle(e), (Pt.os.name === "Mac OS" || Pt.browser.name === "IE" || Pt.os.name === "iOS" && Pt.device.type !== "mobile") && (e.style.width = "100%", e.style.height = "100%", e.style.background = "black");
    const r = e;
    let s;
    r.requestFullscreen ? s = r.requestFullscreen() : r.mozRequestFullscreen ? s = r.mozRequestFullscreen() : r.mozRequestFullScreen ? s = r.mozRequestFullScreen() : r.webkitRequestFullscreen ? s = r.webkitRequestFullscreen() : r.webkitRequestFullScreen ? s = r.webkitRequestFullScreen() : r.msRequestFullscreen && (s = r.msRequestFullscreen()), typeof Promise < "u" && s instanceof Promise && s.catch((l) => this._logger.e(Mo, l));
  }
  /**
   * 退出全屏
   */
  exitFullscreen() {
    this._recoverStyle(), this._element = void 0;
    const e = document;
    e.exitFullscreen ? e.exitFullscreen() : e.webkitCancelFullScreen ? e.webkitCancelFullScreen() : e.mozCancelFullScreen ? e.mozCancelFullScreen() : e.msExitFullscreen && e.msExitFullscreen();
  }
  /**
   * 当前是否是全屏状态
   * @returns 全屏状态
   */
  isFullScreen() {
    const e = document;
    return !!(e.fullscreen || e.fullscreenElement || e.isFullScreen || e.webkitIsFullScreen || e.mozFullScreen || e.msFullscreenElement);
  }
  /**
   * 网页全屏
   * @param element 需要全屏的元素
   * @returns
   */
  requestFillWindow(e) {
    this._element = e, this._originStyle || this._saveOriginStyle(e), e.style.width = "100%", e.style.height = "100%", e.style.background = "black", e.style.position = "fixed", e.style.left = "0", e.style.top = "0", e.style.zIndex = "99999", document.body.classList.add(Nt["kwai-player-disable-scroll"]), this._isFillWindow = !0, this._evt.emit("fullChange", {
      type: "window",
      isFull: !0
    });
  }
  /**
   * 退出网页全屏
   */
  exitFillWindow() {
    this._recoverStyle(), this._isFillWindow = !1, this._element && (this._element.style.zIndex = "auto"), this._element = void 0, document.body.classList.remove(Nt["kwai-player-disable-scroll"]), this._evt.emit("fullChange", {
      type: "window",
      isFull: !1
    });
  }
  /**
   * 当前是否是网页全屏状态
   * @returns 网页全屏状态
   */
  isFillWindow() {
    return this._isFillWindow;
  }
  isFullscreenAvailable(e) {
    return e !== Mt.WINDOW && typeof document < "u" ? !!document.body.requestFullscreen || !!document.body.webkitRequestFullscreen || !!document.body.msRequestFullscreen || !!document.body.mozRequestFullscreen : !0;
  }
  _getExitFullscreenFunc() {
    const e = document;
    return e.exitFullscreen || e.webkitCancelFullScreen || e.mozCancelFullScreen || e.msExitFullscreen;
  }
  _saveOriginStyle(e) {
    this._originStyle = {
      position: e.style.position,
      background: e.style.background,
      width: e.style.width,
      height: e.style.height,
      left: e.style.left,
      right: e.style.right
    };
  }
  _recoverStyle() {
    if (this._element)
      for (const e in this._originStyle)
        this._element.style[e] = this._originStyle[e];
    this._originStyle = void 0;
  }
}
const Sc = "ControlsPlugin", Lc = "I18nPlugin", kc = "LoggerPlugin", Ic = "HotkeyPlugin", xc = "PlayInfoPlugin", Cc = "RotatePlugin", Dc = "PreviewPlugin", Oc = "MaskPlugin", Mc = "VRPlugin", Nc = "DanmakuPlugin";
var Pc = /* @__PURE__ */ ((t) => (t.DARK = "dark", t.LIGHT = "light", t))(Pc || {}), Uc = /* @__PURE__ */ ((t) => (t.BOTTOM = "bottom", t.PLAY_BAR = "playBar", t.NONE = "none", t))(Uc || {}), Fc = /* @__PURE__ */ ((t) => (t.PLAY_BAR_LEFT = "playBarLeft", t.PLAY_BAR_RIGHT = "playBarRight", t.CONTEXT_MENU = "contextMenu", t))(Fc || {});
class Ef {
  constructor() {
    X(this, "_callbacks", []);
  }
  add(e) {
    this._callbacks.push(e);
  }
  remove(e) {
    const r = this._callbacks.findIndex((s) => s === e);
    r >= 0 && this._callbacks.splice(r, 1);
  }
  call(e) {
    this._callbacks.forEach((r) => r(e));
  }
  destroy() {
    this._callbacks.splice(0, this._callbacks.length);
  }
}
let ut = class extends Da {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  static isInstanceOfPlugin(e) {
    return typeof e.beforeInstall == "function" && typeof e.afterInstall == "function" && typeof e.beforeUninstall == "function" && typeof e.afterUninstall == "function" && typeof e.getLabel == "function";
  }
  /**
   * 控制条插槽按钮
   */
  get controlsSoltBtns() {
  }
  /**
   * 播放器实例化前钩子
   * @param player 播放器实例
   * @param options 实例化播放器时指定的当前插件的参数
   */
  beforeInstall(e, r) {
  }
  /**
   * 播放器实例化后钩子
   * @param player 播放器实例
   * @param options 实例化播放器时指定的当前插件的参数
   */
  afterInstall(e, r) {
  }
  /**
   * 播放器销毁前钩子
   * @param player 播放器实例
   */
  beforeUninstall(e) {
  }
  /**
   * 播放器销毁后钩子
   * @param player 播放器实例
   */
  afterUninstall(e) {
  }
};
X(ut, "label"), /**
* 版本
*/
X(ut, "version"), /**
* 当前环境是否支持
*/
X(ut, "isSupported");
const Ma = class Na extends ut {
  /**
   * @override
   */
  getLabel() {
    return Na.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
};
X(Ma, "label", Sc);
let Tf = Ma;
const Pa = class Ua extends ut {
  /**
   * @override
   */
  getLabel() {
    return Ua.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
};
X(Pa, "label", Lc);
let Rf = Pa;
const Fa = class Ba extends ut {
  /**
   * @override
   */
  getLabel() {
    return Ba.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
  /**
   * 增加业务相关数据
   * @param key 上报数据key
   * @param value 上报数据
   */
  addBizLog(e, r) {
  }
  appendSummaryField(e, r) {
  }
};
X(Fa, "label", kc);
let Sf = Fa;
const Ha = class Va extends ut {
  /**
   * @override
   */
  getLabel() {
    return Va.label;
  }
};
X(Ha, "label", Ic);
let Lf = Ha;
const Ga = class Wa extends ut {
  /**
   * @override
   */
  getLabel() {
    return Wa.label;
  }
};
X(Ga, "label", xc);
let kf = Ga;
const ja = class Ka extends ut {
  /**
   * @override
   */
  getLabel() {
    return Ka.label;
  }
};
X(ja, "label", Cc);
let If = ja;
const za = class Ja extends ut {
  /**
   * @override
   */
  getLabel() {
    return Ja.label;
  }
};
X(za, "label", Dc);
let xf = za;
const $a = class qa extends ut {
  /**
   * @override
   */
  getLabel() {
    return qa.label;
  }
};
X($a, "label", Oc);
let Cf = $a;
const Ya = class Qa extends ut {
  /**
   * @override
   */
  getLabel() {
    return Qa.label;
  }
};
X(Ya, "label", Mc);
let Df = Ya;
const Za = class Xa extends ut {
  /**
   * @override
   */
  getLabel() {
    return Xa.label;
  }
};
X(Za, "label", Nc);
let Of = Za;
const at = "pluginBase", es = class ts {
  constructor() {
    X(this, "_instances", []);
  }
  static register(e, r = "append") {
    Ze.i(at, "register", e.label, e.version), e.label || Ze.i(at, "register plugin label is empty.");
    const s = this._plugins.findIndex((l) => l.label === e.label);
    s >= 0 ? (Ze.i(at, `register plugin label: ${e.label} exists.`), this._plugins.splice(s, 1, e)) : r === "append" ? this._plugins.push(e) : this._plugins.unshift(e);
  }
  static deregister(e) {
    if (typeof e == "string") {
      Ze.i(at, "deregister", e);
      const r = this._plugins.findIndex((s) => s.label === e);
      if (r === -1) {
        Ze.i(`${e} plugin unregistered`);
        return;
      }
      this._plugins.splice(r, 1);
    } else {
      Ze.i(at, "deregister", e.label);
      const r = this._plugins.indexOf(e);
      if (r === -1) {
        Ze.i(`${e.label} plugin unregistered`);
        return;
      }
      this._plugins.splice(r, 1);
    }
  }
  initialize(e) {
    const r = this._instances;
    for (const s of ts._plugins)
      try {
        if (e && e[s.label] === !1)
          continue;
        if (s.isSupported === !1) {
          Ze.i(at, `initialize ${s.label}, ${s.version}. The current browser does not support this plugin.`);
          continue;
        }
        Ze.i(at, "initialize", s.label, s.version, e);
        const l = new s();
        ut.isInstanceOfPlugin(l) ? r.push(l) : Ze.e(at, `plugin type error: ${l}`);
      } catch (l) {
        Ze.e(at, "plugin initialize error", l);
      }
  }
  beforeInstallPlugins(e, r) {
    for (const s of this._instances) {
      const l = s.getLabel();
      Ze.i(at, "beforeInstallPlugins", r, l);
      try {
        if (!s.beforeInstall)
          continue;
        r && typeof r[l] == "object" ? s.beforeInstall(e, r[l]) : s.beforeInstall(e);
      } catch (d) {
        Ze.e(at, "beforeInstallPlugins error", d);
      }
    }
  }
  afterInstallPlugins(e, r) {
    for (const s of this._instances) {
      const l = s.getLabel();
      Ze.i(at, "afterInstallPlugins", l, r);
      try {
        if (!s.afterInstall)
          continue;
        r && typeof r[l] == "object" ? s.afterInstall(e, r[l]) : s.afterInstall(e);
      } catch (d) {
        Ze.e(at, "afterInstallPlugins error", d);
      }
    }
  }
  beforeUninstallPlugins(e) {
    for (const r of this._instances)
      try {
        if (Ze.i(at, "beforeUninstallPlugins", r.getLabel()), !r.beforeUninstall)
          continue;
        r.beforeUninstall.call(r, e);
      } catch (s) {
        Ze.e(at, "plugin beforeUninstall error", s);
      }
  }
  afterUninstallPlugins(e) {
    for (const r of this._instances)
      try {
        if (Ze.i(at, "afterUninstallPlugins", r.getLabel()), !r.afterUninstall)
          continue;
        r.afterUninstall.call(r, e);
      } catch (s) {
        Ze.e(at, "plugin afterUninstall error", s);
      }
    this._instances = [];
  }
  getPlugin(e) {
    for (let r = 0; r < this._instances.length; r++)
      if (this._instances[r].getLabel() === e)
        return this._instances[r];
  }
  getAllPlugins() {
    return this._instances;
  }
};
X(es, "_plugins", []);
let Br = es;
const Bc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAC1JREFUWEft0EERAAAAAUH6lxbDZxU4s815PffjAAECBAgQIECAAAECBAgQIDAaPwAh6O5R/QAAAABJRU5ErkJggg==", re = "kwai-player", tn = class Et {
  constructor(e, r) {
    X(this, "_pluginBase", new Br()), X(this, "_eventHandlers"), X(this, "_evt"), X(this, "_mainDom"), X(this, "_video"), X(this, "_kernel"), X(this, "_error"), X(this, "_config"), X(this, "_src", ""), X(this, "_autoplay", !1), X(this, "_preload", "none"), X(this, "_poster", ""), X(this, "_controls", "default"), X(this, "_videoWidth", 0), X(this, "_videoHeight", 0), X(this, "_kernelLoaded", !1), X(this, "_livePaused", !1), X(this, "_canvas"), X(this, "_mediaInfo"), X(this, "_logger"), X(this, "_isLiveShift", !1), X(this, "_full"), X(this, "_subContainerNumber", 0), X(this, "_data"), X(this, "_id"), X(this, "_videoLayer"), X(this, "_videoInteractiveLayer"), X(this, "_posterLayer"), X(this, "_preprocessSrcFunc"), X(this, "_preprocessURL"), X(this, "_kernelStartTimeout", 0), X(this, "_instanceId"), X(this, "_yodaDom"), X(this, "_yoda"), X(this, "_kernelType", "unknown"), X(this, "_outputLogger"), X(this, "_yodaEnabled", !0), X(this, "_screenshotId", 1), X(this, "_screenshotQueue", []), X(this, "_observer"), X(this, "_objectFit", ""), X(this, "requestFullscreen", (f) => {
      if (this._logger.i(re, "requestFullscreen"), !!this._mainDom) {
        if (this._yoda) {
          this._yoda.isFullscreen() || this._yoda.fullScreen("portrait");
          return;
        }
        this._full.isFull(f) || this._full.requestFull(this._mainDom, f);
      }
    }), X(this, "exitFullscreen", (f) => {
      if (this._logger.i(re, "exitFullscreen"), !!this._mainDom) {
        if (this._yoda) {
          this._yoda.exitFullScreen();
          return;
        }
        this._full.isFull(f) && this._full.exitFull(f);
      }
    }), X(this, "_onFullscreenchange", (f) => {
      this.emit(J.FULLSCREEN_CHANGE, f);
    }), X(this, "_onMutedChange", (f) => {
      this._video && (this._video.muted = f);
    }), X(this, "_onVideoLoadstart", () => {
      this.emit(J.LOADSTART);
    }), X(this, "_onVideoProgress", () => {
      this.emit(J.PROGRESS);
    }), X(this, "_onVideoSuspend", () => {
      this.emit(J.SUSPEND);
    }), X(this, "_onVideoAbort", () => {
      this.emit(J.ABORT);
    }), X(this, "_onVideoEmptied", () => {
      this.emit(J.EMPTIED);
    }), X(this, "_onVideoStalled", () => {
      this.emit(J.STALLED);
    }), X(this, "_onVideoLoadedmetadata", () => {
      this.emit(J.LOADEDMETADATA);
    }), X(this, "_onVideoLoadeddata", () => {
      this.emit(J.LOADEDDATA);
    }), X(this, "_onVideoCanplay", () => {
      this.emit(J.CANPLAY);
    }), X(this, "_onVideoCanplaythrough", () => {
      this.emit(J.CANPLAYTHROUGH);
    }), X(this, "_onVideoPlaying", () => {
      Pt.os.name !== "iOS" && Pt.os.name !== "Android" && this._hidePosterDom(), this.emit(J.PLAYING);
    }), X(this, "_onVideoWaiting", () => {
      this.emit(J.WAITING);
    }), X(this, "_onVideoSeeking", () => {
      this.emit(J.SEEKING);
    }), X(this, "_onVideoSeeked", () => {
      this.emit(J.SEEKED), this.kernel && this._updateIsLiveShift(this.kernel.liveShift);
    }), X(this, "_onVideoEnded", () => {
      this.emit(J.ENDED);
    }), X(this, "_onVideoDurationchange", () => {
      this.emit(J.DURATIONCHANGE);
    }), X(this, "_onVideoTimeupdate", () => {
      var f, c;
      this._posterLayer.style.display !== "none" && ((f = this._video) == null ? void 0 : f.readyState) === 4 && !((c = this._video) != null && c.paused) && this._hidePosterDom(), this.emit(J.TIMEUPDATE);
    }), X(this, "_onVideoPlay", () => {
      this.emit(J.PLAY);
    }), X(this, "_onVideoPause", () => {
      this.emit(J.PAUSE);
    }), X(this, "_onVideoRatechange", () => {
      this.emit(J.RATECHANGE);
    }), X(this, "_onVideoResize", () => {
      this.emit(J.RESIZE);
    }), X(this, "_onVideoVolumechange", () => {
      this.emit(J.VOLUMECHANGE);
    }), X(this, "_onVideoEnterpictureinpicture", () => {
      this.emit(J.ENTER_PICTURE_IN_PICTURE);
    }), X(this, "_onVideoLeavepictureinpicture", () => {
      this.emit(J.LEAVE_PICTURE_IN_PICTURE);
    });
    var s;
    if (this._instanceId = mc.next(), this._logger = new Aa().setLevel(Qr).setName(Ca).setId(this._instanceId), r != null && r.logger && this._logger.setOutput(r.logger), Cu("kwai-player", Et.packVersion), this._logger.i(re, Et.packVersion, Et.version, this._instanceId, e.toString(), r), this._data = r || {}, typeof e == "string" ? (this._id = e, this._mainDom = document.querySelector(e)) : (this._id = `kp_${Math.random() * 1e3 | 0}`, this._mainDom = e), this._evt = new Da(), this._evt.setMaxListeners(30), this._full = new Rc(this._evt, this._logger), this._evt.on("fullChange", this._onFullscreenchange), this._eventHandlers = {
      loadstart: this._onVideoLoadstart,
      progress: this._onVideoProgress,
      suspend: this._onVideoSuspend,
      abort: this._onVideoAbort,
      emptied: this._onVideoEmptied,
      stalled: this._onVideoStalled,
      loadedmetadata: this._onVideoLoadedmetadata,
      loadeddata: this._onVideoLoadeddata,
      canplay: this._onVideoCanplay,
      canplaythrough: this._onVideoCanplaythrough,
      playing: this._onVideoPlaying,
      waiting: this._onVideoWaiting,
      seeking: this._onVideoSeeking,
      seeked: this._onVideoSeeked,
      ended: this._onVideoEnded,
      durationchange: this._onVideoDurationchange,
      timeupdate: this._onVideoTimeupdate,
      play: this._onVideoPlay,
      pause: this._onVideoPause,
      ratechange: this._onVideoRatechange,
      resize: this._onVideoResize,
      volumechange: this._onVideoVolumechange,
      enterpictureinpicture: this._onVideoEnterpictureinpicture,
      leavepictureinpicture: this._onVideoLeavepictureinpicture
    }, r && typeof r.controls < "u" && (this.controls = r.controls), this._videoLayer = document.createElement("div"), this._videoLayer.className = Nt["kwai-player-video"], this._posterLayer = document.createElement("div"), this._posterLayer.className = Nt["kwai-player-poster"], this._posterLayer.dataset.kpRole = "poster", this._videoLayer.appendChild(this._posterLayer), this._videoInteractiveLayer = document.createElement("div"), this._videoInteractiveLayer.className = Nt["kwai-player-video-interactive"], this._video = document.createElement("video"), !this._mainDom) {
      this._logger.i(re, `container not found.${e}`), this._setError({ code: Oa.CTOR_ERROR, message: `container not found.${e}` });
      return;
    }
    this._observer = new MutationObserver((f) => {
      for (const c of f)
        c.type === "attributes" && c.attributeName === "style" && this._applyObjectFit();
    });
    const l = { attributes: !0, attributeFilter: ["style"] };
    this._observer.observe(this._mainDom, l), this._applyObjectFit(), this._mainDom.className = this._mainDom.className ? `${this._mainDom.className} ${Nt["kwai-player"]}` : Nt["kwai-player"], this._mainDom.setAttribute("role", "player"), this._mainDom.appendChild(this._videoLayer), this._mainDom.appendChild(this._videoInteractiveLayer), this._video.controls = !1, this._videoLayer.appendChild(this.video), Et._yodaClass && (this._yodaDom = document.createElement("div"), this._yodaDom.className = Nt["kwai-player-yoda"], this._videoLayer.appendChild(this._yodaDom)), this._bindVideo(), this._pluginBase.initialize(r == null ? void 0 : r.plugins), this._pluginBase.beforeInstallPlugins(this, r == null ? void 0 : r.plugins), r && this._parseData(r);
    const d = ((s = this._config) == null ? void 0 : s.src) || this._src;
    d && this._initKernel(!1), this._pluginBase.afterInstallPlugins(this, r == null ? void 0 : r.plugins), d && (this._kernelStartTimeout = +setTimeout(() => {
      this._clearKernelStartTimer(), this._kernelStart();
    }, 0)), this._logger.i(re, "constructor completed.");
  }
  static get version() {
    return "1.1.0";
  }
  /**
   * 获取版本号
   */
  get version() {
    return Et.version;
  }
  /**
   * 获取包版本号
   */
  get packVersion() {
    return Et.packVersion;
  }
  /**
   * 实例ID
   */
  get instanceId() {
    return this._instanceId;
  }
  /**
   * 获取内核类型
   */
  get kernelType() {
    return this._kernelType;
  }
  /**
   * 本地日志实例
   */
  get logger() {
    return this._logger;
  }
  get outputLogger() {
    return this._outputLogger;
  }
  set outputLogger(e) {
    this._logger.i(re, "call set output logger", e), this._outputLogger = e, this._logger.setOutput(e), this._kernel && (this._kernel.outputLog = e);
  }
  /**
   * 配置
   */
  get config() {
    return this._logger.i(re, "call get config", this._config), this._config;
  }
  set config(e) {
    this._logger.i(re, "call set config", e), this._config = e, this._yoda || (this._initKernel(), this.emit(J.ATTRIBUTE_CHANGE_CONFIG));
  }
  /**
   * 获取当前错误
   */
  get error() {
    return this._logger.i(re, "call get error", this._error), this._error;
  }
  /**
   * videoId
   */
  get videoId() {
    var e;
    return (e = this._data) == null ? void 0 : e.videoId;
  }
  set videoId(e) {
    this._data && (this._data.videoId = e, this.emit(J.ATTRIBUTE_CHANGE_VIDEO_ID));
  }
  /**
   * 设置预览图url
   * @remark 依赖预览图插件
   */
  get previewUrl() {
    var e;
    return (e = this._data) == null ? void 0 : e.previewUrl;
  }
  set previewUrl(e) {
    this._logger.i(re, "call set previewUrl", e), this._data && (this._data.previewUrl = e, this.emit(J.ATTRIBUTE_CHANGE_PREVIEW_URL));
  }
  /**
   * 设置弹幕防挡url
   * @remark 依赖弹幕防挡插件
   */
  get maskUrl() {
    var e;
    return (e = this._data) == null ? void 0 : e.maskUrl;
  }
  set maskUrl(e) {
    this._logger.i(re, "call set maskUrl", e), this._data && (this._data.maskUrl = e, this.emit(J.ATTRIBUTE_CHANGE_MASK_URL));
  }
  /**
   * 禁用弹幕防挡url
   */
  get disableMask() {
    var e;
    return (e = this._data) == null ? void 0 : e.disableMask;
  }
  set disableMask(e) {
    this._logger.i(re, "call set disableMask", e), this._data && (this._data.disableMask = e, this.emit(J.ATTRIBUTE_CHANGE_DISABLE_MASK));
  }
  /**
   * 获取播放地址
   */
  get src() {
    return this._logger.v(re, "call get src", this._src), this._src;
  }
  set src(e) {
    this._logger.i(re, "call set src", e), this._src = this._preprocessSrcFunc ? this._preprocessSrcFunc(e) : e, this._destroyKernel(), this.emit(J.ATTRIBUTE_CHANGE_SRC), this._initKernel();
  }
  /**
   * 获取当前是否时移回放
   */
  get isLiveShift() {
    return this._isLiveShift;
  }
  set liveShiftType(e) {
    this._logger.i(re, "call set liveShiftType", e), this._data && (this._data.liveShiftType = e, this.emit(J.LIVE_SHIFT_TYPE_CHANGE));
  }
  /**
   * 直播时移类型
   */
  get liveShiftType() {
    var e;
    return ((e = this._data) == null ? void 0 : e.liveShiftType) || hi.NONE;
  }
  set crossOrigin(e) {
    this._logger.i(re, "call set crossOrigin", e), this._video && (this._video.crossOrigin = e), this.emit(J.ATTRIBUTE_CHANGE_CROSS_ORIGIN);
  }
  /**
   * 跨域配置
   */
  get crossOrigin() {
    var e;
    return this._logger.v(re, "call get crossOrigin", (e = this._video) == null ? void 0 : e.crossOrigin), this._video ? this._video.crossOrigin : null;
  }
  /**
   * 网络状态
   */
  get networkState() {
    var e;
    return this._logger.v(re, "call get networkState", (e = this._video) == null ? void 0 : e.networkState), this._video ? this._video.networkState : 0;
  }
  /**
   * 预加载配置
   */
  get preload() {
    return this._logger.v(re, "call get preload", this._preload), this._preload;
  }
  set preload(e) {
    this._logger.i(re, "call set preload", e), this._preload = e, this._video.preload = e, this.emit(J.ATTRIBUTE_CHANGE_PRELOAD);
  }
  /**
   * 获取预加载配置
   */
  get buffered() {
    var e;
    if (!this._yoda)
      return (e = this._video) == null ? void 0 : e.buffered;
  }
  /**
   * 获取video元素readyState
   */
  get readyState() {
    return this._yoda ? this._yoda.readyState : this._video ? this._video.readyState : 0;
  }
  /**
   * 获取video元素seeking状态
   */
  get seeking() {
    var e;
    return this._yoda ? this._yoda.seeking : !!((e = this._video) != null && e.seeking);
  }
  /**
   * 获取video播放时间
   */
  get currentTime() {
    return this._yoda ? this._yoda.currentTime : this._video ? this._video.currentTime : 0;
  }
  set currentTime(e) {
    this._logger.i(re, "call set currentTime", e);
    try {
      this._yoda && (this._yoda.currentTime = e), this._video && (this._video.currentTime = e), this.emit(J.ATTRIBUTE_CHANGE_CURRENT_TIME);
    } catch (r) {
    }
  }
  /**
   * 获取video时长
   */
  get duration() {
    return this._yoda ? this._yoda.duration : this._video ? this._video.duration : NaN;
  }
  /**
   * 获取暂停状态
   */
  get paused() {
    return this._yoda ? this._yoda.paused : this._video ? this._video.paused : !0;
  }
  /**
   * 获取默认倍速
   */
  get defaultPlaybackRate() {
    var e;
    return this._logger.v(re, "call get defaultPlaybackRate", (e = this._video) == null ? void 0 : e.defaultPlaybackRate), this._video ? this._video.defaultPlaybackRate : 1;
  }
  set defaultPlaybackRate(e) {
    this._logger.i(re, "call set defaultPlaybackRate", e), this._yoda && (this._yoda.defaultPlaybackRate = e), this._video && (this._video.defaultPlaybackRate = e), this.emit(J.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE);
  }
  /**
   * 获取当前倍速
   */
  get playbackRate() {
    return this._video ? this._video.playbackRate : 1;
  }
  set playbackRate(e) {
    this._logger.i(re, "call set playbackRate", e), this._yoda && (this._yoda.playbackRate = e), this._video && (this._video.playbackRate = e), this.emit(J.ATTRIBUTE_CHANGE_PLAYBACK_RATE);
  }
  /**
   * 获取是否播放
   * yoda返回undefined
   */
  get played() {
    var e;
    if (!this._yoda)
      return (e = this._video) == null ? void 0 : e.played;
  }
  /**
   * 获取是否可以seek
   * yoda返回undefined
   */
  get seekable() {
    var e;
    if (!this._yoda)
      return (e = this._video) == null ? void 0 : e.seekable;
  }
  /**
   * 获取是否播放完成
   */
  get ended() {
    return this._yoda ? this._yoda.ended : this._video ? this._video.ended : !1;
  }
  /**
   * 获取是否自动播放
   */
  get autoplay() {
    return this._autoplay;
  }
  set autoplay(e) {
    this._logger.i(re, "call set autoplay", e), this._autoplay = e, this._yoda && (this._yoda.autoplay = e), this.emit(J.ATTRIBUTE_CHANGE_AUTOPLAY);
  }
  /**
   * 获取是否循环播放
   */
  get loop() {
    return this._yoda ? this._yoda.loop : this._video ? this._video.loop : !1;
  }
  set loop(e) {
    this._logger.i(re, "call set loop", e), this._video && (this._video.loop = e), this.emit(J.ATTRIBUTE_CHANGE_LOOP);
  }
  /**
   * 获取是否显示控制条
   */
  get controls() {
    return this._controls;
  }
  set controls(e) {
    this._logger.i(re, "call set controls", e), e !== this._controls && (this._controls = e), this.emit(J.ATTRIBUTE_CHANGE_CONTROLS);
  }
  /**
   * 音量
   * yoda始终返回1
   */
  get volume() {
    return this._yoda ? 1 : this._video ? this._video.volume : 1;
  }
  set volume(e) {
    this._video && (this._video.volume = e < 0 ? 0 : e > 1 ? 1 : e, this.emit(J.ATTRIBUTE_CHANGE_VOLUME));
  }
  /**
   * 获取静音状态
   */
  get muted() {
    return this._yoda ? this._yoda.muted : this._video ? this._video.muted : !1;
  }
  set muted(e) {
    this._logger.i(re, `call set muted: ${e}, hasVideo: ${!!this._video}`), this._yoda && (this._yoda.muted = e), this._video && (this._video.muted = e), this.emit(J.ATTRIBUTE_CHANGE_MUTED);
  }
  /**
   * 获取默认静音状态
   */
  get defaultMuted() {
    return this._yoda ? this._yoda.defaultMuted : this._video ? this._video.defaultMuted : !1;
  }
  set defaultMuted(e) {
    this._logger.i(re, "call set defaultMuted", e), this._yoda && (this._yoda.defaultMuted = e), this._video && (this._video.defaultMuted = e), this.emit(J.ATTRIBUTE_CHANGE_DEFAULT_MUTED);
  }
  /*
   * public set width(val: number | string) {
   *     this._width = val;
   * }
   */
  /*
   * public set height(val: number | string) {
   *     this._height = val;
   * }
   */
  /**
   * 获取视频宽
   */
  get videoWidth() {
    var e;
    return this._videoWidth || ((e = this._video) == null ? void 0 : e.videoWidth);
  }
  /**
   * 获取视频高
   */
  get videoHeight() {
    var e;
    return this._videoHeight || ((e = this._video) == null ? void 0 : e.videoHeight);
  }
  /**
   * 获取封面图
   */
  get poster() {
    return this._poster;
  }
  set poster(e) {
    this._logger.i(re, "call set poster", e), this._poster = e, this._updatePosterDom(), this.emit(J.ATTRIBUTE_CHANGE_POSTER);
  }
  /**
   * 获取禁用画中画状态
   * yoda无效
   */
  get disablePictureInPicture() {
    var e;
    return this._yoda ? !0 : !!((e = this._video) != null && e.disablePictureInPicture);
  }
  set disablePictureInPicture(e) {
    this._logger.i(re, "call set disablePictureInPicture", e), !this._yoda && this._video && (this._video.disablePictureInPicture = e, this.emit(J.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE));
  }
  /**
   * UI中是否展示下载按钮
   */
  get disableDownload() {
    var e;
    return (e = this._data) == null ? void 0 : e.disableDownload;
  }
  set disableDownload(e) {
    this._logger.i(re, "call set disableDownload", e), this._data && (this._data.disableDownload = e, this.emit(J.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD));
  }
  /**
   * 获取是否内联(inline)播放
   */
  get playsinline() {
    var e;
    return !!((e = this._video) != null && e.hasAttribute("playsinline"));
  }
  set playsinline(e) {
    this._logger.i(re, "call set playsinline", e), this._video && (this._video.playsInline = e, this._video.webKitPlaysInline = e, e ? (this._video.setAttribute("playsinline", "playsinline"), this._video.setAttribute("webkit-playsinline", "webkit-playsinline"), this._video.setAttribute("x5-playsinline", "x5-playsinline")) : (this._video.removeAttribute("playsinline"), this._video.removeAttribute("webkit-playsinline"), this._video.removeAttribute("x5-playsinline")), this.emit(J.ATTRIBUTE_CHANGE_PLAYSINLINE));
  }
  /**
   * 获取自适应码率开关状态
   */
  get disableAdaptive() {
    var e;
    return (e = this._data) == null ? void 0 : e.disableAdaptive;
  }
  set disableAdaptive(e) {
    this._logger.i(re, "call set disableAdaptive", e), this._data && (this._data.disableAdaptive = e, this.emit(J.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE));
  }
  /**
   * 获取当前视频轨id
   */
  get currentLevel() {
    var e;
    return ((e = this._kernel) == null ? void 0 : e.currentLevel) || 0;
  }
  set currentLevel(e) {
    var r, s, l;
    if (this._logger.i(re, "call set currentLevel", e, !!this._kernel, this._livePaused), this._kernel) {
      const d = this._video.paused;
      this._livePaused ? ((r = this._kernel) == null || r.refresh(), this._kernel.currentLevel = e) : (this._kernel.currentLevel = e, this.emit(J.ATTRIBUTE_CHANGE_CURRENT_LEVEL)), !d && this._video.paused && (this._logger.i(re, "set level. play"), (l = (s = this._video) == null ? void 0 : s.play()) == null || l.catch((f) => this._logger.i(re, "set current level, call play() fail.", f)));
    }
  }
  /**
   * 获取即将切换的视频轨id
   */
  get nextLevel() {
    var e;
    return ((e = this._kernel) == null ? void 0 : e.nextLevel) || 0;
  }
  set nextLevel(e) {
    var r, s, l;
    if (this._logger.i(re, "call set nextLevel", e), this._kernel) {
      const d = this._video.paused;
      this._livePaused ? ((r = this._kernel) == null || r.refresh(), this._kernel.currentLevel = e) : (this._kernel.nextLevel = e, this.emit(J.ATTRIBUTE_CHANGE_NEXT_LEVEL)), !d && this._video.paused && (this._logger.i(re, "set next level. play"), (l = (s = this._video) == null ? void 0 : s.play()) == null || l.catch((f) => this._logger.i(re, "set next level, call play() fail.", f)));
    }
  }
  /**
   * 获取当前播放帧数
   */
  get currentVideoFrame() {
    var e;
    return ((e = this._kernel) == null ? void 0 : e.currentVideoFrame) || 0;
  }
  set currentVideoFrame(e) {
    this._kernel && (this._kernel.currentVideoFrame = e, this.emit(J.ATTRIBUTE_CHANGE_CURRENT_FRAME));
  }
  /**
   * 获取当前视频总帧数
   */
  get totalVideoFrames() {
    var e;
    return ((e = this._kernel) == null ? void 0 : e.totalVideoFrames) || 0;
  }
  /**
   * 当前清晰度时间信息
   */
  get currentLevelTimeInfo() {
    var e;
    return (e = this._kernel) == null ? void 0 : e.currentLevelTimeInfo;
  }
  /**
   * 返回当前video
   */
  get video() {
    return this._video;
  }
  /**
   * 返回当前canvas,视频渲染在canvas时有值
   */
  get canvas() {
    return this._canvas;
  }
  get yodaDom() {
    return this._yodaDom;
  }
  /**
   * 获取当前音频轨id
   */
  get audioTrack() {
    return this._kernel ? this._kernel.audioTrack : -1;
  }
  set audioTrack(e) {
    this._logger.i(re, "call set audioTrack", e), this._kernel && (this._kernel.audioTrack = e, this.emit(J.ATTRIBUTE_CHANGE_AUDIO_TRACK));
  }
  /**
   * 产品ID,用于上报
   */
  get productName() {
    var e;
    return (e = this._data) == null ? void 0 : e.productName;
  }
  set productName(e) {
    this._logger.i(re, "call set productName", e), this._data && (this._data.productName = e);
  }
  /**
   * 获取当前是否开启连接预热
   * @remarks 依赖预加载插件
   */
  get prefetch() {
    var e;
    return (e = this._data) == null ? void 0 : e.prefetch;
  }
  set prefetch(e) {
    this._logger.i(re, "call set prefetch", e), this._data && (this._data.prefetch = e, this.emit(J.ATTRIBUTE_CHANGE_PREFETCH));
  }
  /**
   * 获取是否显示进度条
   * @remarks 依赖控制条插件
   */
  get showProgress() {
    var e;
    return (e = this._data) == null ? void 0 : e.showProgress;
  }
  set showProgress(e) {
    this._logger.i(re, "call set showProgress", e), this._data && (this._data.showProgress = e, this.emit(J.ATTRIBUTE_CHANGE_SHOW_PROGRESS));
  }
  /**
   * 是否显示时间
   * @remarks 依赖控制条插件
   */
  get showTime() {
    var e;
    return (e = this._data) == null ? void 0 : e.showTime;
  }
  set showTime(e) {
    this._logger.i(re, "call set showTime", e), this._data && (this._data.showTime = e, this.emit(J.ATTRIBUTE_CHANGE_SHOW_TIME));
  }
  /**
   * 获取是否启用热键
   * @remarks 依赖热键插件
   */
  get disableHotkey() {
    var e;
    return (e = this._data) == null ? void 0 : e.disableHotkey;
  }
  set disableHotkey(e) {
    this._logger.i(re, "call set disableHotkey", e), this._data && (this._data.disableHotkey = e, this.emit(J.ATTRIBUTE_CHANGE_DISABLE_HOTKEY));
  }
  /**
   * 弹幕是否可用
   * @remark 依赖弹幕插件
   */
  get disableDanmaku() {
    var e;
    return (e = this._data) == null ? void 0 : e.disableDanmaku;
  }
  set disableDanmaku(e) {
    this._logger.i(re, "call set disableDanmaku", e), this._data && (this._data.disableDanmaku = e, this.emit(J.ATTRIBUTE_CHANGE_DISABLE_DANMAKU));
  }
  /**
   * 是否渲染弹幕
   * @remark 依赖弹幕插件
   */
  get danmakuRendering() {
    var e;
    return (e = this._data) == null ? void 0 : e.danmakuRendering;
  }
  set danmakuRendering(e) {
    this._logger.i(re, "call set danmakuRendering", e), this._data && (this._data.danmakuRendering = e, this.emit(J.ATTRIBUTE_CHANGE_DANMAKU_RENDERING));
  }
  /**
   * 设置是否显示信息面板
   * @remarks 依赖信息面板插件
   */
  get showInfoPanel() {
    var e;
    return (e = this._data) == null ? void 0 : e.showInfoPanel;
  }
  set showInfoPanel(e) {
    this._logger.i(re, "call set showInfoPanel", e), this._data && (this._data.showInfoPanel = e, this.emit(J.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL));
  }
  /**
   * 是否显示下一个按钮,与UI相关
   */
  get showNext() {
    var e;
    return (e = this._data) == null ? void 0 : e.showNext;
  }
  set showNext(e) {
    this._logger.i(re, "call set showNext", e), this._data && (this._data.showNext = e, this.emit(J.ATTRIBUTE_CHANGE_SHOW_NEXT));
  }
  /**
   * 是否显示上一个按钮,与UI相关
   */
  get showPrev() {
    var e;
    return (e = this._data) == null ? void 0 : e.showPrev;
  }
  set showPrev(e) {
    this._logger.i(re, "call set showPrev", e), this._data && (this._data.showPrev = e, this.emit(J.ATTRIBUTE_CHANGE_SHOW_PREV));
  }
  /**
   * 业务参数
   */
  get bizData() {
    var e;
    return (e = this._data) == null ? void 0 : e.bizData;
  }
  set bizData(e) {
    this._logger.i(re, "set biz data", e), this._data && (this._data.bizData = e), this._yoda && this._yoda.updateUserConfig({ biz: JSON.parse(JSON.stringify(e)) }), this.emit(J.ATTRIBUTE_CHANGE_BIZ_DATA);
  }
  /**
   * 当前场次直播时间信息,配合直播时移功能
   * @alpha
   */
  get liveTime() {
    var e;
    return (e = this._data) != null && e.liveTime ? { start: this._data.liveTime.start, end: this._data.liveTime.end } : void 0;
  }
  set liveTime(e) {
    this._logger.i(re, "set live time", e), this._data && (this._data.liveTime = Object.assign({}, e)), this.emit(J.ATTRIBUTE_CHANGE_LIVE_TIME);
  }
  get objectFit() {
    return this._objectFit;
  }
  /**
   * 返回当前的内核实例
   */
  get kernel() {
    return this._kernel;
  }
  setPreprocessURL(e) {
    this._preprocessURL = e;
  }
  setPreprocessSrcFunc(e) {
    this._preprocessSrcFunc = e;
  }
  /**
   * 加载视频
   */
  load() {
    var e;
    this._logger.i(re, "call load"), (e = this._kernel) == null || e.load(), this._kernelLoaded = !0;
  }
  /**
   * 播放视频
   */
  play() {
    var e, r, s, l, d;
    return this._logger.i(re, "call play", this._kernelLoaded, this._livePaused), this._yoda ? ((r = (e = this._video) == null ? void 0 : e.play()) == null || r.catch((f) => this._logger.i(re, "play, call play() fail.", f)), this._yoda.play()) : (this._livePaused && !this._isLiveShiftMode() ? (s = this._kernel) == null || s.refresh() : this._kernelLoaded || this.load(), this._video.paused ? (d = (l = this._video) == null ? void 0 : l.play()) == null ? void 0 : d.catch((f) => this._logger.i(re, "play, call play() fail.", f)) : Promise.resolve());
  }
  /**
   * 暂停视频
   */
  pause() {
    var e, r, s;
    if (this._logger.i(re, "call pause", (e = this._mediaInfo) == null ? void 0 : e.isLive), this._yoda) {
      this._yoda.pause();
      return;
    }
    return this._kernel && (r = this._mediaInfo) != null && r.isLive && !this._isLiveShiftMode() && (this._logger.i(re, "live stop load"), this._kernel.stopLoad(), this._livePaused = !0), this._isLiveShiftMode() && !this._isLiveShift && this._updateIsLiveShift(!0), (s = this._video) == null ? void 0 : s.pause();
  }
  /**
   * 开启画中画
   */
  requestPictureInPicture() {
    return this._logger.i(re, "call requestPictureInPicture"), this._yoda ? Promise.reject("not support requestPictureInPicture. yoda") : this._video && "requestPictureInPicture" in this._video ? this._video.requestPictureInPicture() : Promise.reject("not support requestPictureInPicture");
  }
  isPictureInPictureAvailable() {
    return this._yoda ? !1 : Tc();
  }
  /**
   * 销毁播放器
   */
  destroy() {
    var e, r, s;
    this._logger.i(re, "call destroy"), (e = this._observer) == null || e.disconnect(), this._observer = void 0, this._clearKernelStartTimer(), this._preprocessSrcFunc = void 0, this._screenshotQueue = [], this._pluginBase.beforeUninstallPlugins(this), this._evt.removeAllListeners(), this._destroyKernel(), this._unbindVideo(), this._destroyYoda(), (r = this._videoLayer.parentElement) == null || r.removeChild(this._videoLayer), (s = this._videoLayer.parentElement) == null || s.removeChild(this._videoInteractiveLayer), this.removeAllListeners(), this._pluginBase.afterUninstallPlugins(this);
  }
  /**
   * 重新加载视频
   */
  refresh() {
    var e;
    this._logger.i(re, "call refresh"), (e = this._kernel) == null || e.refresh();
  }
  /**
   * 支持时移时回到直播状态
   */
  jumpToLive() {
    var e, r;
    this._logger.i(re, `call jumpToLive type: ${(e = this._data) == null ? void 0 : e.liveShiftType}`), this.kernel && (r = this._data) != null && r.liveShiftType && this._isLiveShiftMode() && (this.video.currentTime = this.video.duration - this.kernel.liveShiftDelaySec, this.kernel && this._updateIsLiveShift(!0));
  }
  /**
   * 获取流时间
   * @param val 播放时间,ms
   * @returns 播放时间对应的流时间,ms
   */
  getStreamTime(e) {
    var r;
    return this._yoda ? 0 : ((r = this._kernel) == null ? void 0 : r.getStreamTime(e)) || 0;
  }
  /**
   * 注册播放器插件
   * @param plugin plugin需继承自PluginModule
   */
  static register(e, r = "append") {
    Br.register(e, r);
  }
  /**
   * 注销播放器插件
   * @param plugin 插件或插件名称
   */
  static deregister(e) {
    Br.deregister(e);
  }
  /**
   * 设置yoda kernel 定义
   * @param val yoda kernel
   */
  static setYoda(e) {
    Et._yodaClass = e;
  }
  /**
   * 根据插件名获取插件实例
   * @param label 插件名
   * @returns plugin
   */
  getPluginInstance(e) {
    return this._pluginBase.getPlugin(e);
  }
  /**
   * 获取所有的插件实例
   * @returns 所有的插件实例
   */
  getAllPlugins() {
    return this._pluginBase.getAllPlugins();
  }
  /**
   * 创建一个子容器
   * @returns HTMLDivELement
   */
  createSubContainer(e = Ji.DEFAULT) {
    const r = document.createElement("div");
    r.id = `${this._id}-sub-${Math.round(this._subContainerNumber++)}`;
    let s = this._mainDom;
    if (e === Ji.VIDEO && (s = this._videoLayer), e === Ji.VIDEO_INTERACTIVE && (s = this._videoInteractiveLayer), s)
      s.children.length ? s.children[s.children.length - 1].insertAdjacentElement("afterend", r) : s.appendChild(r);
    else
      throw new Error("cteate sub container error. no parent found.");
    return r;
  }
  /**
   * 是否全屏
   * @returns boolean
   */
  isFullscreen(e) {
    return this._yoda ? this._yoda.isFullscreen() : this._full.isFull(e);
  }
  isFullscreenAvailable(e) {
    return this._yoda ? !0 : this._full.isFullscreenAvailable(e);
  }
  _applyObjectFit() {
    var e;
    const r = ((e = this._mainDom) == null ? void 0 : e.style.objectFit) || "";
    this._logger.i(re, `apply objectFit: ${r}`), this._video.style.objectFit = r, this._canvas && (this._canvas.style.objectFit = r), this._yoda && (this._yoda.objectFit = r || "contain"), this._objectFit = r, this.emit(J.OBJECT_FIT_CHANGE);
  }
  removeSubContainer(e) {
    e.parentElement && e.parentElement.removeChild(e);
  }
  /**
   * 当前画面截图
   * yoda暂不支持截图
   * @returns 截图
   */
  screenshot() {
    const e = this._kernel;
    return this._yoda ? (this._logger.i(re, "screenshot yoda"), this._yoda.screenshot()) : e ? (this._screenshotId++, new Promise((r) => {
      const s = this._screenshotId.toString();
      this._screenshotQueue.push({
        id: s,
        timer: setTimeout(() => {
          this._logger.i(re, `screenshot[${s}] timeout.`), this._resolveScreenShotFromQueue(s);
        }, 500),
        callback: r
      }), e.screenshot({ id: s }), this._logger.i(re, `screenshot[${s}] kernel`);
    })) : (this._logger.i(re, "screenshot player not ready."), Promise.resolve());
  }
  _resolveScreenShotFromQueue(e, r) {
    for (let s = 0; s < this._screenshotQueue.length; s++)
      if (e === this._screenshotQueue[s].id) {
        clearTimeout(this._screenshotQueue[s].timer), this._screenshotQueue[s].callback(r), this._screenshotQueue.splice(s, 1);
        return;
      }
    this._logger.i(re, `screenshot[${e}] not found.`);
  }
  /**
   * 获取主容器
   * @returns
   */
  get mainContainer() {
    return this._mainDom;
  }
  get videoLayer() {
    return this._videoLayer;
  }
  get videoInteractiveLayer() {
    return this._videoInteractiveLayer;
  }
  /**
   * 获取当前QOS信息
   * @returns
   */
  get audienceStat() {
    var e;
    return (e = this._kernel) == null ? void 0 : e.getAudienceStat();
  }
  /** @internal */
  _updatePosterDom() {
    ci ? (this._video.poster = this._poster || "", this._hidePosterDom()) : this._poster ? (this._video.poster = Bc, this._posterLayer.className = Nt["kwai-player-poster"], this._posterLayer.style.backgroundImage = `url(${this._poster})`) : (this._video.poster = "", this._posterLayer.className = "", this._posterLayer.style.backgroundImage = "");
  }
  /** @internal */
  _hidePosterDom() {
    this._posterLayer.style.display = "none";
  }
  /** @internal */
  _setIsUseCanvas(e) {
    this._video && (this._video.style.display = e ? "none" : "block");
  }
  /** @internal */
  _setError(e) {
    this._error = e, this._error && setTimeout(() => {
      try {
        this.emit(J.ERROR, this._error);
      } catch (r) {
      }
    }, 0);
  }
  /** @internal */
  _resetPlayerStat() {
    if (this._canvas) {
      try {
        this._videoLayer.removeChild(this._canvas);
      } catch (e) {
      }
      this._canvas = void 0;
    }
    this._setError(void 0), this._setIsUseCanvas(!1), this._mediaInfo = void 0, this._isLiveShift = !1;
  }
  /** @internal */
  _destroyKernel() {
    this._kernel && (this._kernelLoaded = !1, this._livePaused = !1, this.pause(), this._kernel.destroy(), this._kernel = void 0);
  }
  /** @internal */
  _destroyYoda() {
    this._yoda && (this._yoda.destroy(), this._yoda = void 0);
  }
  /** @internal */
  _initYodaKernel(e) {
    if (this._logger.i(re, "yoda init"), !Et._yodaClass || !this._yodaDom || !this._src)
      return !1;
    const r = wc.parse(this._src);
    return r && r.src ? (this._yoda || (this._logger.i(re, "yoda new instance."), this._yoda = new Et._yodaClass(this._yodaDom, this._logger, e), this._bindYoda(this._yoda), this._kernelType = "yoda"), this._logger.i(re, "yoda instance already exists. try update conf"), r.isLive ? this._yoda.src = { isLive: r.isLive, src: r.src } : this._yoda.src = { isLive: r.isLive, src: r.src }, this.emit(J.ATTRIBUTE_CHANGE_MUTED), !0) : !1;
  }
  /** @internal */
  _bindYoda(e) {
    this._logger.i(re, "yoda bind event."), e.on("play", this._onVideoPlay), e.on("playing", this._onVideoPlaying), e.on("pause", this._onVideoPause), e.on("loadedmetadata", () => {
      this._onVideoLoadedmetadata(), this._onVideoDurationchange();
    }), e.on("timeupdate", this._onVideoTimeupdate), e.on("ended", this._onVideoEnded), e.on("waiting", this._onVideoWaiting), e.on("seeked", this._onVideoSeeked), e.on("seeking", this._onVideoSeeking), e.on("resize", (r) => {
      this._videoWidth = r.data.width, this._videoHeight = r.data.height, this._onVideoResize();
    }), e.on("error", (r) => {
      if (r.data.type === "initFailed" || r.data.type === "canNotInsert" || r.data.type === "internal" || r.data.type === "domLost") {
        const s = e.actionOnReady === "play";
        this._destroyYoda(), this._yodaEnabled = !1, this._initKernel(), s && this.play();
        return;
      }
      this._setError(Object.assign({ code: 0 }, r.data.originalError));
    });
  }
  /** @internal */
  _bindVideo() {
    if (this._video)
      for (const e in this._eventHandlers)
        this._video.addEventListener(e, this._eventHandlers[e]);
  }
  /** @internal */
  _unbindVideo() {
    if (this._video)
      for (const e in this._eventHandlers)
        this._video.removeEventListener(e, this._eventHandlers[e]);
  }
  /** @internal */
  _parseData(e) {
    this._logger.i(re, "parse data.", e), e.src && (this._src = this._preprocessSrcFunc ? this._preprocessSrcFunc(e.src) : e.src), e.config && (this._config = e.config), e.crossOrigin && (this.crossOrigin = e.crossOrigin), typeof e.preload < "u" && (this.preload = e.preload), typeof e.defaultPlaybackRate == "number" && (this.defaultPlaybackRate = e.defaultPlaybackRate), typeof e.playbackRate == "number" && (this.playbackRate = e.playbackRate), typeof e.autoplay < "u" && (this.autoplay = e.autoplay), typeof e.loop < "u" && (this.loop = e.loop), typeof e.controls < "u" && (this.controls = e.controls), typeof e.volume == "number" && (this.volume = e.volume), typeof e.muted < "u" && (this.muted = e.muted), typeof e.defaultMuted < "u" && (this.defaultMuted = e.defaultMuted), typeof e.disablePictureInPicture < "u" && (this.disablePictureInPicture = e.disablePictureInPicture), typeof e.disableAdaptive < "u" && (this.disableAdaptive = e.disableAdaptive), typeof e.playsinline < "u" && (this.playsinline = e.playsinline), typeof e.liveShiftType < "u" && (this.liveShiftType = e.liveShiftType), typeof e.logger < "u" && (this._outputLogger = e.logger), this.poster = e.poster || "";
  }
  /** @internal */
  _initKernel(e = !0) {
    var r, s, l, d, f;
    if (this._logger.i(re, "init kernel"), !this._video)
      return;
    if (this._posterLayer.style.display = ci ? "none" : "block", this._destroyKernel(), !this._src && !((r = this._config) != null && r.src)) {
      this._video.src = "", this._resetPlayerStat();
      return;
    }
    this._config || (this._config = {});
    const c = Object.assign({}, this._config, {
      adaptive: ((s = this._data) == null ? void 0 : s.disableAdaptive) === !1,
      liveShiftType: (l = this._data) == null ? void 0 : l.liveShiftType,
      ntp: !1
    });
    if (Xr.verify(this._src) ? (this._logger.i(re, "live feed to media desc"), c.src = Xr.parse(this._src)) : c.src = this._src, this._preprocessURL && (c.preprocessUrl = this._preprocessURL), typeof c.nativeFirst > "u" && ci && (c.nativeFirst = !0), this._isLiveShiftMode() && (c.catchUpPausedLive = !1), (d = this._data) != null && d.logger && (c.logger = this._data.logger), this._resetPlayerStat(), this._logger.i(re, `yoda check mobile: ${ci} liveshift: ${this.liveShiftType} class: ${!!Et._yodaClass}`), ci && this._yodaEnabled && this.liveShiftType === hi.NONE && Et._yodaClass) {
      const A = {
        defaultMuted: this.defaultMuted,
        muted: this.muted,
        defaultPlaybackRate: this.defaultPlaybackRate,
        playbackRate: this.playbackRate,
        autoplay: this._autoplay,
        loop: this.loop,
        objectFit: this._objectFit || "contain",
        biz: (f = this._data) == null ? void 0 : f.bizData
      };
      if (this._initYodaKernel(A)) {
        e && this._clearKernelStartTimer();
        return;
      }
    } else
      this._destroyYoda();
    this._kernelType = "kwai-player-kernel", this._logger.i(re, "init kernel", this._kernelType);
    const R = this._kernel = new _c(this._video, c);
    R.on(ft.VIDEO_RENDERER_CHANGE, (A) => {
      const v = this._videoLayer;
      if (A.type === "canvas" && (this._setIsUseCanvas(!0), this._canvas = A.canvas, this._canvas && v.insertAdjacentElement("afterbegin", this._canvas)), A.type === "video") {
        this._setIsUseCanvas(!1);
        try {
          this._canvas && v.removeChild(this._canvas);
        } catch (O) {
        }
        this._canvas = void 0;
      }
      this._applyObjectFit(), this.emit(J.VIDEO_RENDERER_CHANGE, A);
    }), R.on(ft.MANIFEST_PARSED, (A) => {
      this._logger.i(re, ft.MANIFEST_PARSED, A), this.emit(J.MANIFEST_PARSED, A);
    }), R.on(ft.LEVEL_SWITCHING, (A) => {
      this.emit(J.LEVEL_SWITCHING, A);
    }), R.on(ft.LEVEL_SWITCHED, (A) => {
      this.emit(J.LEVEL_SWITCHED, A);
    }), R.on(ft.LEVEL_SWITCH_PLAYING, (A) => {
      this.emit(J.LEVEL_SWITCH_PLAYING, A);
    }), R.on(ft.LEVEL_SWITCH_FAILED, () => {
      this.emit(J.LEVEL_SWITCH_FAILED);
    }), R.on(ft.LEVEL_UPDATED, (A) => {
      this.emit(J.LEVEL_UPDATED, A);
    }), R.on(ft.AUDIO_TRACK_SWITCHING, (A) => {
      this.emit(J.AUDIO_TRACKS_SWITCHING, A);
    }), R.on(ft.AUDIO_TRACK_SWITCHED, (A) => {
      this.emit(J.AUDIO_TRACKS_SWITCHED, A);
    }), R.on(ft.ERROR, (A) => {
      this._setError({ code: A.code, message: A.reason });
    }), R.on(ft.REPORT, (A) => {
      A.type === "mediaInfo" && (this._videoWidth = A.value.width || 0, this._videoHeight = A.value.height || 0, this._mediaInfo = A.value, this._data && A.value.liveShiftType && (this.liveShiftType = A.value.liveShiftType)), this.emit(J.REPORT, A);
    }), R.on(ft.SCREENSHOT, (A) => {
      this._logger.i(re, `screenshot[${A.id}] kernel evt. id: ${A.id}  img: ${!!A.image}`), A.id && this._resolveScreenShotFromQueue(A.id, A.image);
    }), e && (this._clearKernelStartTimer(), this._kernelStart());
  }
  /** @internal */
  _clearKernelStartTimer() {
    this._kernelStartTimeout && (clearTimeout(this._kernelStartTimeout), this._kernelStartTimeout = 0);
  }
  /** @internal */
  _kernelStart() {
    if (!(!this._kernel || !this._video) && (this._autoplay || this._preload === "" || this._preload === "auto" || this._preload === "metadata") && (this._kernel.load(), this._kernelLoaded = !0, this.autoplay)) {
      const e = this._video.play();
      e instanceof Promise && e.catch(() => {
        var r;
        this._logger.i(re, "autoplay fail, retry."), this._onMutedChange(!0), (r = this._video) == null || r.play().catch(() => {
        });
      });
    }
  }
  /** @internal */
  _updateIsLiveShift(e) {
    e !== this._isLiveShift && (this._isLiveShift = e, this.emit(J.LIVE_SHIFT_CHANGE));
  }
  /** @internal */
  _isLiveShiftMode() {
    var e;
    return !!((e = this._data) != null && e.liveShiftType) && this._data.liveShiftType !== hi.NONE;
  }
  on(e, r) {
    this._evt.on(e, r);
  }
  once(e, r) {
    this._evt.once(e, r);
  }
  removeAllListeners(e) {
    this._logger.i(re, "call removeAllListeners"), this._evt.removeAllListeners(e);
  }
  off(e, r) {
    this._evt.off(e, r);
  }
  listeners(e) {
    return this._evt.listeners(e);
  }
  emit(e, r) {
    return this._evt.emit(e, r);
  }
  listenerCount(e) {
    return this._evt.listenerCount(e);
  }
};
X(tn, "packVersion", "1.1.0"), /** @internal */
X(tn, "_yodaClass");
let Ii = tn;
const Hc = ["id"], Oe = "vue3", No = /* @__PURE__ */ Eu({
  __name: "Player",
  props: {
    id: { default: "" },
    config: { default: void 0 },
    plugins: { default: void 0 },
    src: { default: "" },
    controls: { type: [Boolean, String], default: !0 },
    videoId: { default: "" },
    autoplay: { type: Boolean, default: !1 },
    crossOrigin: { default: null },
    defaultMuted: { type: Boolean, default: !1 },
    defaultPlaybackRate: { default: 1 },
    loop: { type: Boolean, default: !1 },
    muted: { type: Boolean, default: !1 },
    preload: { default: void 0 },
    poster: { default: "" },
    currentTime: {},
    playbackRate: { default: 1 },
    volume: { default: 1 },
    disablePictureInPicture: { type: Boolean, default: !1 },
    playsinline: { type: Boolean, default: !1 },
    disableDownload: { type: Boolean, default: !0 },
    disableAdaptive: { type: Boolean, default: !0 },
    disableHotkey: { type: Boolean, default: !1 },
    disableMask: { type: Boolean, default: !1 },
    currentLevel: { default: 0 },
    nextLevel: { default: 0 },
    audioTrack: { default: 0 },
    currentVideoFrame: { default: 0 },
    showProgress: { type: Boolean, default: void 0 },
    showTime: { type: Boolean, default: void 0 },
    prefetch: { type: Boolean, default: !0 },
    showInfoPanel: { type: Boolean, default: !1 },
    productName: { default: "" },
    previewUrl: { default: "" },
    maskUrl: { default: "" },
    disableDanmaku: { type: Boolean },
    danmakuRendering: { type: Boolean, default: !0 },
    bizData: {},
    liveShiftType: {}
  },
  setup(t, { expose: e, emit: r }) {
    const s = [
      J.LOADSTART,
      J.PROGRESS,
      J.SUSPEND,
      J.ABORT,
      J.ERROR,
      J.EMPTIED,
      J.STALLED,
      J.LOADEDMETADATA,
      J.LOADEDDATA,
      J.CANPLAY,
      J.CANPLAYTHROUGH,
      J.PLAYING,
      J.WAITING,
      J.SEEKING,
      J.SEEKED,
      J.ENDED,
      J.DURATIONCHANGE,
      J.TIMEUPDATE,
      J.PLAY,
      J.PAUSE,
      J.RATECHANGE,
      J.RESIZE,
      J.VOLUMECHANGE,
      J.MANIFEST_PARSED,
      J.LEVEL_SWITCHING,
      J.LEVEL_SWITCHED,
      J.LEVEL_SWITCH_PLAYING,
      J.LEVEL_SWITCH_FAILED,
      J.AUDIO_TRACKS_SWITCHING,
      J.AUDIO_TRACKS_SWITCHED,
      J.FULLSCREEN_CHANGE,
      J.LEVEL_UPDATED,
      J.CLICK_NEXT,
      J.CLICK_REGISTER,
      J.CLICK_LOGIN,
      J.CLICK_VIP,
      J.INTERACTION,
      J.ATTRIBUTE_CHANGE,
      J.REPORT
    ], l = r, d = t, f = wu(hc());
    let c, R;
    return De(() => d.config, (A) => {
      c && (R == null || R.i(Oe, "call set config", A), c.config = A);
    }), De(() => d.controls, (A) => {
      c && (c.logger.i(Oe, "call set controls", A), c.controls = A);
    }), De(() => d.videoId, (A) => {
      c && (c.logger.i(Oe, "call set videoId", A), c.videoId = A);
    }), De(() => d.src, (A) => {
      c && (c.logger.i(Oe, "call set src", A), c.src = A || "");
    }), De(() => d.autoplay, (A) => {
      c && (c.logger.i(Oe, "call set autoplay", A), c.autoplay = !!A);
    }), De(() => d.crossOrigin, (A) => {
      c && (c.logger.i(Oe, "call set crossorigin", A), c.crossOrigin = A || null);
    }), De(() => d.defaultMuted, (A) => {
      c && (c.logger.i(Oe, "call set defaultMuted", A), c.defaultMuted = !!A);
    }), De(() => d.defaultPlaybackRate, (A) => {
      c && (c.logger.i(Oe, "call set defaultPlaybackRate", A), c.defaultPlaybackRate = A || 1);
    }), De(() => d.loop, (A) => {
      c && (c.logger.i(Oe, "call set loop", A), c.loop = !!A);
    }), De(() => d.muted, (A) => {
      c && (c.logger.i(Oe, "call set muted", A), c.muted = !!A);
    }), De(() => d.preload, (A) => {
      c && (c.logger.i(Oe, "call set preload", A), c.preload = A || "none");
    }), De(() => d.poster, (A) => {
      c && (c.logger.i(Oe, "call set poster", A), c.poster = A || "");
    }), De(() => d.currentTime, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set currentTime", A), c.currentTime = A);
    }), De(() => d.playbackRate, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set playbackRate", A), c.playbackRate = A);
    }), De(() => d.volume, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set volume", A), c.volume = A);
    }), De(() => d.disablePictureInPicture, (A) => {
      c && (c.logger.i(Oe, "call set disablePictureInPicture", A), c.disablePictureInPicture = !!A);
    }), De(() => d.playsinline, (A) => {
      c && (c.logger.i(Oe, "call set playsinline", A), c.playsinline = !!A);
    }), De(() => d.disableDownload, (A) => {
      c && (c.logger.i(Oe, "call set disableDownload", A), c.disableDownload = !!A);
    }), De(() => d.disableAdaptive, (A) => {
      c && (c.logger.i(Oe, "call set disableAdaptive", A), c.disableAdaptive = A || !0);
    }), De(() => d.disableHotkey, (A) => {
      c && (c.logger.i(Oe, "call set disableHotkey", A), c.disableHotkey = !!A);
    }), De(() => d.disableMask, (A) => {
      c && (c.logger.i(Oe, "call set disableMask", A), c.disableMask = !!A);
    }), De(() => d.currentLevel, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set currentLevel", A), c.currentLevel = A);
    }), De(() => d.nextLevel, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set nextLevel", A), c.nextLevel = A);
    }), De(() => d.audioTrack, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set audioTrack", A), c.audioTrack = A);
    }), De(() => d.currentVideoFrame, (A) => {
      c && typeof A == "number" && (c.logger.i(Oe, "call set currentVideoFrame", A), c.currentVideoFrame = A);
    }), De(() => d.showProgress, (A) => {
      c && (c.logger.i(Oe, "call set showProgress", A), c.showProgress = A || !0);
    }), De(() => d.showTime, (A) => {
      c && (c.logger.i(Oe, "call set showTime", A), c.showTime = A || !0);
    }), De(() => d.prefetch, (A) => {
      c && (c.logger.i(Oe, "call set prefetch", A), c.prefetch = A);
    }), De(() => d.showInfoPanel, (A) => {
      c && (c.logger.i(Oe, "call set showInfoPanel", A), c.showInfoPanel = A);
    }), De(() => d.previewUrl, (A) => {
      c && (c.logger.i(Oe, "call set previewUrl", A), c.previewUrl = A);
    }), De(() => d.maskUrl, (A) => {
      c && (c.logger.i(Oe, "call set maskUrl", A), c.maskUrl = A);
    }), De(() => d.disableDanmaku, (A) => {
      c && (c.logger.i(Oe, "call set disableDanmaku", A), c.disableDanmaku = !!A);
    }), De(() => d.danmakuRendering, (A) => {
      c && (c.logger.i(Oe, "call set danmakuRendering", A), c.danmakuRendering = !!A);
    }), De(() => d.bizData, (A) => {
      c && (c.logger.i(Oe, "call set bizData", A), c.bizData = A);
    }, { deep: !0 }), De(() => d.liveShiftType, (A) => {
      c && (c.logger.i(Oe, "call set liveShiftType", A), c.liveShiftType = A || hi.NONE);
    }), e({
      load: () => c == null ? void 0 : c.load(),
      play: () => c == null ? void 0 : c.play(),
      pause: () => c == null ? void 0 : c.pause(),
      destroy: () => c == null ? void 0 : c.destroy(),
      requestPictureInPicture: () => c == null ? void 0 : c.requestPictureInPicture(),
      isFullscreen: (A) => c == null ? void 0 : c.isFullscreen(A),
      requestFullscreen: (A) => c == null ? void 0 : c.requestFullscreen(A),
      exitFullscreen: (A) => c == null ? void 0 : c.exitFullscreen(A),
      isFullscreenAvailable: (A) => c == null ? void 0 : c.isFullscreenAvailable(A),
      screenshot: () => c == null ? void 0 : c.screenshot(),
      getError: () => c == null ? void 0 : c.error,
      getNetworkState: () => c ? c.networkState : 0,
      getBuffered: () => c == null ? void 0 : c.buffered,
      getSeeking: () => c ? c.seeking : !1,
      getReadyState: () => c ? c.readyState : 0,
      getDuration: () => c ? c.duration : NaN,
      getPaused: () => c ? c.paused : !0,
      getSeekable: () => c == null ? void 0 : c.seekable,
      getEnded: () => c ? c.ended : !1,
      getVideoWidth: () => c ? c.videoWidth : 0,
      getVideoHeight: () => c ? c.videoHeight : 0,
      getTotalVideoFrames: () => c ? c.totalVideoFrames : 0,
      setSrc: (A) => {
        c && (c.src = A);
      },
      getSrc: () => c == null ? void 0 : c.src,
      setConfig: (A) => {
        c && (c.config = A);
      },
      getConfig: () => c ? c.config : d.config,
      setCrossOrigin: (A) => {
        c && (c.crossOrigin = A);
      },
      getCrossOrigin: () => c ? c.crossOrigin : d.crossOrigin,
      setPreload: (A) => {
        c && (c.preload = A);
      },
      getPreload: () => c ? c.preload : d.preload || "",
      setCurrentTime: (A) => {
        c && (c.currentTime = A);
      },
      getCurrentTime: () => c ? c.currentTime : 0,
      setDefaultPlaybackRate: (A) => {
        c && (c.defaultPlaybackRate = A);
      },
      getDefaultPlaybackRate: () => c ? c.defaultPlaybackRate : d.defaultPlaybackRate,
      setPlaybackRate: (A) => {
        c && (c.playbackRate = A);
      },
      getPlaybackRate: () => c ? c.playbackRate : d.playbackRate,
      setAutoplay: (A) => {
        c && (c.autoplay = A);
      },
      getAutoplay: () => c ? c.autoplay : d.autoplay,
      setLoop: (A) => {
        c && (c.loop = A);
      },
      getLoop: () => c ? c.loop : d.loop,
      setControls: (A) => {
        c && (c.controls = A);
      },
      getControls: () => c ? c.controls : d.controls,
      setVideoId: (A) => {
        c && (c.videoId = A);
      },
      getVideoId: () => c ? c.videoId : d.videoId,
      setVolume: (A) => {
        c && (c.volume = A);
      },
      getVolume: () => c ? c.volume : 1,
      setMuted: (A) => {
        c && (c.muted = A);
      },
      getMuted: () => c ? c.muted : d.muted,
      setDefaultMuted: (A) => {
        c && (c.defaultMuted = A);
      },
      getDefaultMuted: () => c ? c.defaultMuted : d.defaultMuted,
      setPoster: (A) => {
        c && (c.poster = A);
      },
      getPoster: () => c ? c.poster : d.poster,
      setDisablePictureInPicture: (A) => {
        c && (c.disablePictureInPicture = A);
      },
      getDisablePictureInPicture: () => c ? c.disablePictureInPicture : d.disablePictureInPicture,
      setPlaysinline: (A) => {
        c && (c.playsinline = A);
      },
      getPlaysinline: () => c ? c.playsinline : d.playsinline,
      setDisableDownload: (A) => {
        c && (c.disableDownload = A);
      },
      getDisableDownload: () => c ? c.disableDownload : d.disableDownload,
      setDisableAdaptive: (A) => {
        c && (c.disableAdaptive = A);
      },
      getDisableAdaptive: () => c ? c.disableAdaptive : d.disableAdaptive,
      setDisableHotkey: (A) => {
        c && (c.disableHotkey = A);
      },
      getDisableHotkey: () => c ? c.disableHotkey : d.disableHotkey,
      setDisableMask: (A) => {
        c && (c.disableMask = A);
      },
      getDisableMask: () => c ? c.disableMask : d.disableMask,
      setCurrentLevel: (A) => {
        c && (c.currentLevel = A);
      },
      getCurrentLevel: () => c ? c.currentLevel : 0,
      setNextLevel: (A) => {
        c && (c.nextLevel = A);
      },
      getNextLevel: () => c ? c.nextLevel : 0,
      setAudioTrack: (A) => {
        c && (c.audioTrack = A);
      },
      getAudioTrack: () => c ? c.audioTrack : -1,
      setCurrentVideoFrame: (A) => {
        c && (c.currentVideoFrame = A);
      },
      getCurrentVideoFrame: () => (c == null ? void 0 : c.currentVideoFrame) || 0,
      setShowProgress: (A) => {
        c && (c.showProgress = A);
      },
      getShowProgress: () => c ? c.showProgress : d.showProgress,
      setShowTime: (A) => {
        c && (c.showTime = A);
      },
      getShowTime: () => c == null ? void 0 : c.showTime,
      setPrefetch: (A) => {
        c && (c.prefetch = A);
      },
      getPrefetch: () => c == null ? void 0 : c.prefetch,
      setShowInfoPanel: (A) => {
        c && (c.showInfoPanel = A);
      },
      getShowInfoPanel: () => c ? c.showInfoPanel : d.showInfoPanel,
      setProductName: (A) => {
        c && (c.productName = A);
      },
      getProductName: () => c ? c.productName : d.productName,
      setPreviewUrl: (A) => {
        c && (c.previewUrl = A);
      },
      getPreviewUrl: () => c ? c.previewUrl : d.previewUrl,
      setMaskUrl: (A) => {
        c && (c.maskUrl = A);
      },
      getMaskUrl: () => c ? c.maskUrl : d.maskUrl,
      setDisableDanmaku: (A) => {
        c && (c.disableDanmaku = A);
      },
      getDisableDanmaku: () => c ? c.disableDanmaku : d.disableDanmaku,
      setDanmakuRendering: (A) => {
        c && (c.danmakuRendering = A);
      },
      getDanmakuRendering: () => c == null ? void 0 : c.danmakuRendering,
      getStreamTime: (A) => c ? c.getStreamTime(A) : 0,
      getAudienceStat: () => c == null ? void 0 : c.audienceStat,
      getIsLiveShift: () => c ? c.isLiveShift : !1,
      getLiveShiftType: () => c ? c.liveShiftType : hi.NONE,
      setLiveShiftType: (A) => {
        c && (c.liveShiftType = A);
      },
      getVersion: () => Ii.version,
      getPluginInstance: (A) => c == null ? void 0 : c.getPluginInstance(A),
      getAllPlugins: () => c == null ? void 0 : c.getAllPlugins()
    }), Tu(() => {
      const A = c = new Ii(`#${f.value}`, {
        config: d.config,
        src: d.src,
        crossOrigin: d.crossOrigin,
        preload: d.preload,
        defaultPlaybackRate: d.defaultPlaybackRate,
        playbackRate: d.playbackRate,
        autoplay: d.autoplay,
        loop: d.loop,
        controls: d.controls,
        videoId: d.videoId,
        volume: d.volume,
        muted: d.muted,
        defaultMuted: d.defaultMuted,
        poster: d.poster,
        disablePictureInPicture: d.disablePictureInPicture,
        disableDownload: d.disableDownload,
        disableAdaptive: d.disableAdaptive,
        disableHotkey: d.disableHotkey,
        disableMask: d.disableMask,
        playsinline: d.playsinline,
        showProgress: d.showProgress,
        showTime: d.showTime,
        prefetch: d.prefetch,
        showInfoPanel: d.showInfoPanel,
        productName: d.productName,
        previewUrl: d.previewUrl,
        maskUrl: d.maskUrl,
        disableDanmaku: d.disableDanmaku,
        danmakuRendering: d.danmakuRendering,
        plugins: d.plugins,
        bizData: d.bizData,
        liveShiftType: d.liveShiftType
      });
      R = A.logger, s.forEach((v) => {
        A.on(v, (O) => l(v, O));
      });
    }), Ru(() => {
      c == null || c.destroy(), c = void 0;
    }), (A, v) => (Su(), Lu("div", { id: f.value }, [
      ku(A.$slots, "watermark")
    ], 8, Hc));
  }
});
No.install = (t) => {
  t.component("KwaiPlayerVue3", No);
};
var Vc = Object.defineProperty, Gc = (t, e, r) => e in t ? Vc(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, is = (t, e, r) => (Gc(t, typeof e != "symbol" ? e + "" : e, r), r), Zt = function(t) {
  var e = {};
  function r(s) {
    if (e[s])
      return e[s].exports;
    var l = e[s] = { i: s, l: !1, exports: {} };
    return t[s].call(l.exports, l, l.exports, r), l.l = !0, l.exports;
  }
  return r.m = t, r.c = e, r.d = function(s, l, d) {
    r.o(s, l) || Object.defineProperty(s, l, { enumerable: !0, get: d });
  }, r.r = function(s) {
    typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
  }, r.t = function(s, l) {
    if (1 & l && (s = r(s)), 8 & l || 4 & l && typeof s == "object" && s && s.__esModule)
      return s;
    var d = /* @__PURE__ */ Object.create(null);
    if (r.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & l && typeof s != "string")
      for (var f in s)
        r.d(d, f, function(c) {
          return s[c];
        }.bind(null, f));
    return d;
  }, r.n = function(s) {
    var l = s && s.__esModule ? function() {
      return s.default;
    } : function() {
      return s;
    };
    return r.d(l, "a", l), l;
  }, r.o = function(s, l) {
    return Object.prototype.hasOwnProperty.call(s, l);
  }, r.p = "", r(r.s = 8);
}([function(t, e, r) {
  var s = r(5);
  function l(d, f) {
    for (var c = 0; c < f.length; c++) {
      var R = f[c];
      R.enumerable = R.enumerable || !1, R.configurable = !0, "value" in R && (R.writable = !0), Object.defineProperty(d, s(R.key), R);
    }
  }
  t.exports = function(d, f, c) {
    return f && l(d.prototype, f), c && l(d, c), Object.defineProperty(d, "prototype", { writable: !1 }), d;
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  function r(s) {
    return t.exports = r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
      return typeof l;
    } : function(l) {
      return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r(s);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(7)();
  t.exports = s;
  try {
    regeneratorRuntime = s;
  } catch (l) {
    typeof globalThis == "object" ? globalThis.regeneratorRuntime = s : Function("r", "regeneratorRuntime = r")(s);
  }
}, function(t, e) {
  function r() {
    return t.exports = r = Object.assign ? Object.assign.bind() : function(s) {
      for (var l = 1; l < arguments.length; l++) {
        var d = arguments[l];
        for (var f in d)
          Object.prototype.hasOwnProperty.call(d, f) && (s[f] = d[f]);
      }
      return s;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r.apply(this, arguments);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e) {
  function r(s, l, d, f, c, R, A) {
    try {
      var v = s[R](A), O = v.value;
    } catch (m) {
      return void d(m);
    }
    v.done ? l(O) : Promise.resolve(O).then(f, c);
  }
  t.exports = function(s) {
    return function() {
      var l = this, d = arguments;
      return new Promise(function(f, c) {
        var R = s.apply(l, d);
        function A(O) {
          r(R, f, c, A, v, "next", O);
        }
        function v(O) {
          r(R, f, c, A, v, "throw", O);
        }
        A(void 0);
      });
    };
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(1).default, l = r(6);
  t.exports = function(d) {
    var f = l(d, "string");
    return s(f) == "symbol" ? f : f + "";
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(1).default;
  t.exports = function(l, d) {
    if (s(l) != "object" || !l)
      return l;
    var f = l[Symbol.toPrimitive];
    if (f !== void 0) {
      var c = f.call(l, d || "default");
      if (s(c) != "object")
        return c;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (d === "string" ? String : Number)(l);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(1).default;
  function l() {
    /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
    t.exports = l = function() {
      return f;
    }, t.exports.__esModule = !0, t.exports.default = t.exports;
    var d, f = {}, c = Object.prototype, R = c.hasOwnProperty, A = Object.defineProperty || function(C, M, B) {
      C[M] = B.value;
    }, v = typeof Symbol == "function" ? Symbol : {}, O = v.iterator || "@@iterator", m = v.asyncIterator || "@@asyncIterator", x = v.toStringTag || "@@toStringTag";
    function g(C, M, B) {
      return Object.defineProperty(C, M, { value: B, enumerable: !0, configurable: !0, writable: !0 }), C[M];
    }
    try {
      g({}, "");
    } catch (C) {
      g = function(M, B, Z) {
        return M[B] = Z;
      };
    }
    function E(C, M, B, Z) {
      var K = M && M.prototype instanceof I ? M : I, se = Object.create(K.prototype), pe = new z(Z || []);
      return A(se, "_invoke", { value: S(C, B, pe) }), se;
    }
    function k(C, M, B) {
      try {
        return { type: "normal", arg: C.call(M, B) };
      } catch (Z) {
        return { type: "throw", arg: Z };
      }
    }
    f.wrap = E;
    var y = "suspendedStart", w = "executing", _ = "completed", b = {};
    function I() {
    }
    function P() {
    }
    function G() {
    }
    var H = {};
    g(H, O, function() {
      return this;
    });
    var Q = Object.getPrototypeOf, ue = Q && Q(Q(Y([])));
    ue && ue !== c && R.call(ue, O) && (H = ue);
    var de = G.prototype = I.prototype = Object.create(H);
    function j(C) {
      ["next", "throw", "return"].forEach(function(M) {
        g(C, M, function(B) {
          return this._invoke(M, B);
        });
      });
    }
    function F(C, M) {
      function B(K, se, pe, he) {
        var we = k(C[K], C, se);
        if (we.type !== "throw") {
          var ee = we.arg, je = ee.value;
          return je && s(je) == "object" && R.call(je, "__await") ? M.resolve(je.__await).then(function(Le) {
            B("next", Le, pe, he);
          }, function(Le) {
            B("throw", Le, pe, he);
          }) : M.resolve(je).then(function(Le) {
            ee.value = Le, pe(ee);
          }, function(Le) {
            return B("throw", Le, pe, he);
          });
        }
        he(we.arg);
      }
      var Z;
      A(this, "_invoke", { value: function(K, se) {
        function pe() {
          return new M(function(he, we) {
            B(K, se, he, we);
          });
        }
        return Z = Z ? Z.then(pe, pe) : pe();
      } });
    }
    function S(C, M, B) {
      var Z = y;
      return function(K, se) {
        if (Z === w)
          throw Error("Generator is already running");
        if (Z === _) {
          if (K === "throw")
            throw se;
          return { value: d, done: !0 };
        }
        for (B.method = K, B.arg = se; ; ) {
          var pe = B.delegate;
          if (pe) {
            var he = D(pe, B);
            if (he) {
              if (he === b)
                continue;
              return he;
            }
          }
          if (B.method === "next")
            B.sent = B._sent = B.arg;
          else if (B.method === "throw") {
            if (Z === y)
              throw Z = _, B.arg;
            B.dispatchException(B.arg);
          } else
            B.method === "return" && B.abrupt("return", B.arg);
          Z = w;
          var we = k(C, M, B);
          if (we.type === "normal") {
            if (Z = B.done ? _ : "suspendedYield", we.arg === b)
              continue;
            return { value: we.arg, done: B.done };
          }
          we.type === "throw" && (Z = _, B.method = "throw", B.arg = we.arg);
        }
      };
    }
    function D(C, M) {
      var B = M.method, Z = C.iterator[B];
      if (Z === d)
        return M.delegate = null, B === "throw" && C.iterator.return && (M.method = "return", M.arg = d, D(C, M), M.method === "throw") || B !== "return" && (M.method = "throw", M.arg = new TypeError("The iterator does not provide a '" + B + "' method")), b;
      var K = k(Z, C.iterator, M.arg);
      if (K.type === "throw")
        return M.method = "throw", M.arg = K.arg, M.delegate = null, b;
      var se = K.arg;
      return se ? se.done ? (M[C.resultName] = se.value, M.next = C.nextLoc, M.method !== "return" && (M.method = "next", M.arg = d), M.delegate = null, b) : se : (M.method = "throw", M.arg = new TypeError("iterator result is not an object"), M.delegate = null, b);
    }
    function U(C) {
      var M = { tryLoc: C[0] };
      1 in C && (M.catchLoc = C[1]), 2 in C && (M.finallyLoc = C[2], M.afterLoc = C[3]), this.tryEntries.push(M);
    }
    function N(C) {
      var M = C.completion || {};
      M.type = "normal", delete M.arg, C.completion = M;
    }
    function z(C) {
      this.tryEntries = [{ tryLoc: "root" }], C.forEach(U, this), this.reset(!0);
    }
    function Y(C) {
      if (C || C === "") {
        var M = C[O];
        if (M)
          return M.call(C);
        if (typeof C.next == "function")
          return C;
        if (!isNaN(C.length)) {
          var B = -1, Z = function K() {
            for (; ++B < C.length; )
              if (R.call(C, B))
                return K.value = C[B], K.done = !1, K;
            return K.value = d, K.done = !0, K;
          };
          return Z.next = Z;
        }
      }
      throw new TypeError(s(C) + " is not iterable");
    }
    return P.prototype = G, A(de, "constructor", { value: G, configurable: !0 }), A(G, "constructor", { value: P, configurable: !0 }), P.displayName = g(G, x, "GeneratorFunction"), f.isGeneratorFunction = function(C) {
      var M = typeof C == "function" && C.constructor;
      return !!M && (M === P || (M.displayName || M.name) === "GeneratorFunction");
    }, f.mark = function(C) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(C, G) : (C.__proto__ = G, g(C, x, "GeneratorFunction")), C.prototype = Object.create(de), C;
    }, f.awrap = function(C) {
      return { __await: C };
    }, j(F.prototype), g(F.prototype, m, function() {
      return this;
    }), f.AsyncIterator = F, f.async = function(C, M, B, Z, K) {
      K === void 0 && (K = Promise);
      var se = new F(E(C, M, B, Z), K);
      return f.isGeneratorFunction(M) ? se : se.next().then(function(pe) {
        return pe.done ? pe.value : se.next();
      });
    }, j(de), g(de, x, "Generator"), g(de, O, function() {
      return this;
    }), g(de, "toString", function() {
      return "[object Generator]";
    }), f.keys = function(C) {
      var M = Object(C), B = [];
      for (var Z in M)
        B.push(Z);
      return B.reverse(), function K() {
        for (; B.length; ) {
          var se = B.pop();
          if (se in M)
            return K.value = se, K.done = !1, K;
        }
        return K.done = !0, K;
      };
    }, f.values = Y, z.prototype = { constructor: z, reset: function(C) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = d, this.done = !1, this.delegate = null, this.method = "next", this.arg = d, this.tryEntries.forEach(N), !C)
        for (var M in this)
          M.charAt(0) === "t" && R.call(this, M) && !isNaN(+M.slice(1)) && (this[M] = d);
    }, stop: function() {
      this.done = !0;
      var C = this.tryEntries[0].completion;
      if (C.type === "throw")
        throw C.arg;
      return this.rval;
    }, dispatchException: function(C) {
      if (this.done)
        throw C;
      var M = this;
      function B(we, ee) {
        return se.type = "throw", se.arg = C, M.next = we, ee && (M.method = "next", M.arg = d), !!ee;
      }
      for (var Z = this.tryEntries.length - 1; Z >= 0; --Z) {
        var K = this.tryEntries[Z], se = K.completion;
        if (K.tryLoc === "root")
          return B("end");
        if (K.tryLoc <= this.prev) {
          var pe = R.call(K, "catchLoc"), he = R.call(K, "finallyLoc");
          if (pe && he) {
            if (this.prev < K.catchLoc)
              return B(K.catchLoc, !0);
            if (this.prev < K.finallyLoc)
              return B(K.finallyLoc);
          } else if (pe) {
            if (this.prev < K.catchLoc)
              return B(K.catchLoc, !0);
          } else {
            if (!he)
              throw Error("try statement without catch or finally");
            if (this.prev < K.finallyLoc)
              return B(K.finallyLoc);
          }
        }
      }
    }, abrupt: function(C, M) {
      for (var B = this.tryEntries.length - 1; B >= 0; --B) {
        var Z = this.tryEntries[B];
        if (Z.tryLoc <= this.prev && R.call(Z, "finallyLoc") && this.prev < Z.finallyLoc) {
          var K = Z;
          break;
        }
      }
      K && (C === "break" || C === "continue") && K.tryLoc <= M && M <= K.finallyLoc && (K = null);
      var se = K ? K.completion : {};
      return se.type = C, se.arg = M, K ? (this.method = "next", this.next = K.finallyLoc, b) : this.complete(se);
    }, complete: function(C, M) {
      if (C.type === "throw")
        throw C.arg;
      return C.type === "break" || C.type === "continue" ? this.next = C.arg : C.type === "return" ? (this.rval = this.arg = C.arg, this.method = "return", this.next = "end") : C.type === "normal" && M && (this.next = M), b;
    }, finish: function(C) {
      for (var M = this.tryEntries.length - 1; M >= 0; --M) {
        var B = this.tryEntries[M];
        if (B.finallyLoc === C)
          return this.complete(B.completion, B.afterLoc), N(B), b;
      }
    }, catch: function(C) {
      for (var M = this.tryEntries.length - 1; M >= 0; --M) {
        var B = this.tryEntries[M];
        if (B.tryLoc === C) {
          var Z = B.completion;
          if (Z.type === "throw") {
            var K = Z.arg;
            N(B);
          }
          return K;
        }
      }
      throw Error("illegal catch attempt");
    }, delegateYield: function(C, M, B) {
      return this.delegate = { iterator: Y(C), resultName: M, nextLoc: B }, this.method === "next" && (this.arg = d), b;
    } }, f;
  }
  t.exports = l, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  r.r(e), r.d(e, "KwaiVideoLocalLog", function() {
    return de;
  }), r.d(e, "LogLevel", function() {
    return m;
  }), r.d(e, "DefaultLogger", function() {
    return k;
  }), r.d(e, "Logger", function() {
    return E;
  }), r.d(e, "printVersion", function() {
    return R;
  }), r.d(e, "DEFAULT_LOG_LEVEL", function() {
    return x;
  });
  var s = r(0), l = r.n(s), d = r(3), f = r.n(d), c = { idbName: "kwai-video-local-log", idbMaxDataCount: 25e3, idbMaxFoldLog: 20, maxLogLen: 4096 };
  function R(j, F) {
    console.log("%c " + j + " %c " + F + " %c", "background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px;  color: #fff", "background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0;  color: #fff", "background:transparent");
  }
  var A = function() {
    function j() {
      this.timeout = 6048e5;
    }
    var F = j.prototype;
    return F.write = function(S, D) {
      if (j.available)
        try {
          localStorage.setItem(S, JSON.stringify({ value: D, time: Date.now() }));
        } catch (U) {
        }
    }, F.read = function(S, D) {
      if (D === void 0 && (D = !0), j.available)
        try {
          var U = localStorage.getItem(S);
          if (U) {
            var N = JSON.parse(U), z = N.value, Y = N.time, C = Y === void 0 ? 0 : Y;
            if (!D || Date.now() - C < (typeof D == "number" ? D : this.timeout))
              return z;
          }
        } catch (M) {
        }
    }, l()(j, null, [{ key: "available", get: function() {
      if (j._available === void 0)
        try {
          localStorage.setItem("alg", "test"), j._available = !0;
        } catch (S) {
          j._available = !1;
        }
      return j._available;
    } }]);
  }();
  A._available = void 0;
  var v, O = A, m = function(j) {
    return j.NONE = "none", j.ERROR = "e", j.WARN = "w", j.INFO = "i", j.DEBUG = "d", j.VERBOSE = "v", j;
  }({}), x = m.ERROR, g = ((v = {})[m.NONE] = { value: 1, str: "N" }, v[m.ERROR] = { value: 100, str: "E" }, v[m.WARN] = { value: 200, str: "W" }, v[m.INFO] = { value: 300, str: "I" }, v[m.DEBUG] = { value: 400, str: "D" }, v[m.VERBOSE] = { value: 500, str: "V" }, v), E = function() {
    function j(S) {
      if (this._name = "kwai-v", this._level = x, this._id = -1, this._output = void 0, this._workerTag = "main", typeof location < "u" && location.protocol === "blob:") {
        var D, U = location.href.split("/"), N = (D = U[U.length - 1]) == null ? void 0 : D.match(/(\w+)-/);
        N && (this._workerTag = S ? S + "-" + N[1] : N[1]);
      } else
        S && (this._workerTag = S);
    }
    j.loadLogLevel = function(S, D) {
      if (D === void 0 && (D = !0), location.href) {
        var U = new RegExp(S + "=([a-z]{1})"), N = location.href.match(U);
        if (N && N.length > 1) {
          var z = N[1];
          if (this._isValueInLevel(z))
            return z;
        }
      }
      var Y = new O().read(S, D);
      if (this._isValueInLevel(Y))
        return Y;
    }, j.saveLogLevel = function(S, D) {
      this._isValueInLevel(D) && new O().write(S, D);
    }, j._isValueInLevel = function(S) {
      return Object.values(m).indexOf(S) !== -1;
    };
    var F = j.prototype;
    return F.setOutput = function(S) {
      return this._output = S, this;
    }, F.setLevel = function(S) {
      return this._level = S, this;
    }, F.setId = function(S) {
      return this._id = S, this;
    }, F.setName = function(S) {
      return this._name = S, this;
    }, F.getLevel = function() {
      return this._level;
    }, F.getOutput = function() {
      return this._output;
    }, F.hasOutput = function() {
      return !!this._output;
    }, F.e = function(S) {
      if (this._isLevelEnabled(this._level, m.ERROR)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.ERROR, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.e.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.w = function(S) {
      if (this._isLevelEnabled(this._level, m.WARN)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.WARN, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.w.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.i = function(S) {
      if (this._isLevelEnabled(this._level, m.INFO)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.INFO, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.i.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.d = function(S) {
      if (this._isLevelEnabled(this._level, m.DEBUG)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.DEBUG, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.d.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F.v = function(S) {
      if (this._isLevelEnabled(this._level, m.VERBOSE)) {
        for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
          U[N - 1] = arguments[N];
        var z = this._printLog(m.VERBOSE, S, U);
        try {
          var Y;
          (Y = this._output) == null || Y.v.apply(Y, [z].concat(U));
        } catch (C) {
        }
      }
    }, F._isLevelEnabled = function(S, D) {
      return g[S].value >= g[D].value;
    }, F._printLog = function(S, D, U) {
      var N, z, Y = typeof D;
      if (Y === "object")
        D = ((z = D) == null ? void 0 : z.constructor.name) || "unknown";
      else if (Y === "function") {
        var C;
        D = ((C = Object.getOwnPropertyDescriptor(D, "name")) == null ? void 0 : C.value) || "unknown";
      }
      var M, B, Z = (((N = g[S]) == null ? void 0 : N.str) || "") + "|" + this._name + "[" + (typeof this._id == "function" ? this._id() : this._id) + "][" + this._workerTag + "]::" + D;
      return S === m.ERROR ? (M = console).error.apply(M, [Z].concat(U.slice(0))) : (B = console).log.apply(B, [Z].concat(U.slice(0))), Z;
    }, j;
  }(), k = new E(), y = function() {
    return l()(function j(F) {
      this._logger = void 0, this._id = 0, this._config = c, this._id = j._id, j._id++, this._logger = new E().setId(this._id).setLevel(m.INFO), this._config = f()({}, c, F);
    }, [{ key: "config", get: function() {
      return this._config;
    } }, { key: "logger", get: function() {
      return this._logger;
    } }, { key: "id", get: function() {
      return this._id;
    } }], [{ key: "packName", get: function() {
      return "ll_es";
    } }, { key: "version", get: function() {
      return "1.0.13";
    } }, { key: "buildTime", get: function() {
      return "Tue Oct 08 2024 17:18:49 GMT+0800 (中国标准时间)";
    } }]);
  }();
  y._id = 0;
  var w = r(4), _ = r.n(w), b = r(2), I = r.n(b), P = function() {
    function j(S, D, U, N, z) {
      var Y = this;
      z === void 0 && (z = 1), this._logger = void 0, this._name = void 0, this._storeName = void 0, this._dbIndex = void 0, this._version = void 0, this._taskQueue = [], this._openReq = void 0, this._isTransactionActive = !1, this._runTaskQueue = function() {
        for (; Y._taskQueue.length; ) {
          var C = Y._taskQueue.shift();
          C && Y.run(C.task, C.mode);
        }
      }, this._logger = S, this._name = D, this._storeName = U, this._dbIndex = N, this._version = z;
    }
    var F = j.prototype;
    return F.init = function() {
      var S = this;
      if (!this._openReq && indexedDB) {
        var D = this._openReq = indexedDB.open(this._name, this._version);
        this._logger.i("idb-wrapper", "open", D), D.onerror = function() {
          S._logger.i("idb-wrapper", "open error.");
        }, D.onsuccess = function() {
          S._logger.i("idb-wrapper", "open success."), S._runTaskQueue();
        }, D.onupgradeneeded = function() {
          S._logger.i("idb-wrapper", "open upgradeneeded."), D.result.objectStoreNames.contains(S._storeName) && D.result.deleteObjectStore(S._storeName);
          var U = D.result.createObjectStore(S._storeName, { keyPath: "id", autoIncrement: !0 });
          S._dbIndex && S._dbIndex.forEach(function(N) {
            U.createIndex(N.name, N.keyPath, N.option);
          });
        };
      }
    }, F.run = function(S, D) {
      if (D === void 0 && (D = "readwrite"), this.init(), this._openReq && this._openReq.readyState === "done" && !this._openReq.error)
        return this._doTask(S, D);
      this.state !== "error" && (this._taskQueue.push({ task: S, mode: D }), this._taskQueue.length > 1e3 && this._taskQueue.shift());
    }, F.close = function() {
      var S = this;
      this._logger.i("idb-wrapper", "close"), this._openReq && (this._openReq.readyState === "done" ? (this._openReq.result.close(), this._openReq = void 0) : this._openReq.onsuccess = function() {
        S.close();
      });
    }, F.destroy = function() {
      this._logger.i("idb-wrapper", "destroy"), this.close(), this._taskQueue = [];
    }, F._doTask = function(S, D) {
      var U = this;
      if (D === void 0 && (D = "readwrite"), this._openReq && !this._openReq.error)
        try {
          this._isTransactionActive = !0;
          var N = this._openReq.result.transaction(this._storeName, D), z = void 0;
          N.oncomplete = function() {
            U._isTransactionActive = !1, S.callback && S.callback(z), U._runTaskQueue();
          }, N.onabort = N.onerror = function() {
            U._isTransactionActive = !1, S.callback && S.callback(z), U._runTaskQueue();
          }, z = S.exec(N.objectStore(this._storeName));
        } catch (Y) {
        }
      else
        S.callback && S.callback();
    }, l()(j, [{ key: "isTransactionActive", get: function() {
      return this._isTransactionActive;
    } }, { key: "state", get: function() {
      return this._openReq && this._openReq.readyState === "done" ? this._openReq.error ? "error" : "ready" : "idle";
    } }]);
  }(), G = [{ name: "id", keyPath: "id", option: { unique: !0 } }], H = [function() {
    function j(S) {
      this._ctx = void 0, this._idb = void 0, this._logCount = 0, this._saveCount = 0, this._reCountOnSaveCount = 100, this._reduceData = !1, this._ctx = S, this._idb = new P(S.logger, S.config.idbName, S.config.idbName, G), this._reCountOnSaveCount = Math.min(200, Math.max(50, Math.round(this._ctx.config.idbMaxDataCount / 10))), this._count();
    }
    j.isSupported = function() {
      return typeof indexedDB < "u";
    };
    var F = j.prototype;
    return F.saveLog = function(S) {
      var D = this, U = { exec: function(N) {
        return N.add({ value: S });
      }, callback: function(N) {
        D._saveCount++, D._saveCount % D._reCountOnSaveCount == 0 && D._count(), N != null && N.error && D._ctx.logger.i("idb-backend", "save log err", N.error);
      } };
      this._idb.run(U);
    }, F.exportLog = function() {
      var S = _()(I.a.mark(function D() {
        var U = this;
        return I.a.wrap(function(N) {
          for (; ; )
            switch (N.prev = N.next) {
              case 0:
                return N.abrupt("return", new Promise(function(z, Y) {
                  U._ctx.logger.i("idb-backend", "export start");
                  var C = { exec: function(M) {
                    return M.getAll();
                  }, callback: function(M) {
                    z(M === void 0 ? "" : U._mergeGetAll(M.result));
                  } };
                  U._idb.run(C, "readonly");
                }));
              case 1:
              case "end":
                return N.stop();
            }
        }, D);
      }));
      return function() {
        return S.apply(this, arguments);
      };
    }(), F.destroy = function() {
      this._idb.destroy();
    }, F.clean = function() {
      this._idb.run({ exec: function(S) {
        return S.clear();
      } });
    }, F._count = function() {
      var S = this, D = { exec: function(U) {
        return U.count();
      }, callback: function(U) {
        U != null && U.error || U == null || !U.result || (S._ctx.logger.i("idb-backend", "count: " + U.result + " max: " + S._ctx.config.idbMaxDataCount), S._logCount = U.result, S._logCount >= S._ctx.config.idbMaxDataCount && !S._reduceData && S._deleteFromHead(S._logCount - Math.round(S._ctx.config.idbMaxDataCount / 2)));
      } };
      this._idb.run(D);
    }, F._deleteFromHead = function(S) {
      var D = this;
      this._ctx.logger.i("idb-backend", "delete from head"), this._reduceData = !0;
      var U = { exec: function(N) {
        return N.openCursor();
      }, callback: function(N) {
        if (D._reduceData = !1, N != null && N.result) {
          var z = IDBKeyRange.bound(N.result.key, N.result.key + S, !1, !1), Y = { exec: function(C) {
            return D._ctx.logger.i("idb-backend", "del: " + z.lower + "~" + z.upper), C.delete(z);
          }, callback: function(C) {
            D._ctx.logger.i("idb-backend", "del result: " + !(C == null || !C.error));
          } };
          D._idb.run(Y);
        }
      } };
      this._idb.run(U);
    }, F._mergeGetAll = function(S) {
      return S.length ? S.reduce(function(D, U) {
        return "" + D + U.value + `
`;
      }, "") : "";
    }, l()(j, [{ key: "isActive", get: function() {
      return this._idb.state !== "error";
    } }]);
  }()];
  function Q(j, F, S) {
    var D = /* @__PURE__ */ new Date();
    typeof j != "string" && (j = j.toString());
    var U = D.toLocaleString() + "." + D.getMilliseconds().toString().padStart(3, "0") + "|" + j + "|";
    return F.forEach(function(N) {
      U += typeof N == "object" ? JSON.stringify(N) + " " : N + " ";
    }), U.length > S ? U.substring(0, S) : U;
  }
  function ue(j) {
    return j.join(`
`);
  }
  var de = function() {
    function j(S) {
      var D = this;
      this._ctx = void 0, this._backend = void 0, this._delayTimer = void 0, this._logCache = [], this._loggerForAdd = void 0, this._downloadHref = void 0, this._startDelay = function() {
        D._delayTimer = setInterval(function() {
          D._saveLog(!0);
        }, 1e3);
      }, this._stopDelay = function() {
        D._delayTimer && (clearTimeout(D._delayTimer), D._delayTimer = void 0);
      }, R("kwai-video-local-log", "1.0.13"), this._ctx = new y(S);
      var U = function(N) {
        for (var z = arguments.length, Y = new Array(z > 1 ? z - 1 : 0), C = 1; C < z; C++)
          Y[C - 1] = arguments[C];
        D.addLog.apply(D, [N].concat(Y));
      };
      this._loggerForAdd = { e: U, w: U, i: U, d: U, v: U }, this._ctx.logger.setOutput(this._loggerForAdd), this._ctx.logger.i("kwai-video-local-log", "constructor", S, this._ctx.config), this._backend = function(N) {
        for (var z = 0; z < H.length; z++) {
          var Y = H[z];
          if (Y != null && Y.isSupported())
            return new Y(N);
        }
      }(this._ctx), this._backend && this._startDelay();
    }
    j.isSupported = function() {
      return function() {
        for (var S = 0; S < H.length; S++) {
          var D = H[S];
          if (D != null && D.isSupported())
            return !0;
        }
        return !1;
      }();
    };
    var F = j.prototype;
    return F.addLog = function(S) {
      for (var D = arguments.length, U = new Array(D > 1 ? D - 1 : 0), N = 1; N < D; N++)
        U[N - 1] = arguments[N];
      this._logCache.push(Q(S, U, this._ctx.config.maxLogLen)), this._saveLog();
    }, F.cleanLog = function() {
      var S;
      this._ctx.logger.i("kwai-video-local-log", "clean"), (S = this._backend) == null || S.clean();
    }, F.exportLog = function() {
      var S = this;
      return this._ctx.logger.i("kwai-video-local-log", "export log"), new Promise(function(D, U) {
        S._backend ? S._backend.exportLog().then(function(N) {
          D(ue([N].concat(S._logCache)));
        }) : D("");
      });
    }, F.downloadLog = function(S) {
      var D = this;
      this._ctx.logger.i("kwai-video-local-log", "download log: " + S), this._destroyDownloadHref(), this.exportLog().then(function(U) {
        var N = new Blob([U], { type: "text/plain" });
        if (document) {
          var z = document.createElement("a");
          D._downloadHref = z.href = URL.createObjectURL(N), z.download = S || "Log_web_" + (/* @__PURE__ */ new Date()).toLocaleString() + ".log", document.body.appendChild(z), z.click(), z.remove();
        } else
          console.log("无document,当前是否在worker中");
      });
    }, F.destroy = function() {
      var S;
      this._destroyDownloadHref(), (S = this._backend) == null || S.destroy(), this._stopDelay();
    }, F.getLoggerForAdd = function() {
      return this._loggerForAdd;
    }, F._destroyDownloadHref = function() {
      try {
        this._downloadHref && (URL.revokeObjectURL(this._downloadHref), this._downloadHref = void 0);
      } catch (S) {
      }
    }, F._saveLog = function(S) {
      if (S === void 0 && (S = !1), this._backend && this._backend.isActive && (this._logCache.length >= this._ctx.config.idbMaxFoldLog || this._logCache.length > 0 && S)) {
        var D = ue(this._logCache);
        this._logCache.splice(0, this._logCache.length), D && this._backend.saveLog(D);
      }
    }, l()(j, null, [{ key: "version", get: function() {
      return "1.0.13";
    } }]);
  }();
  e.default = de;
}]);
Zt === void 0 && console.error("esm-webpack-plugin: nothing exported!");
const Po = Zt.KwaiVideoLocalLog, rs = Zt.LogLevel, Wc = Zt.DefaultLogger, jc = Zt.Logger;
Zt.printVersion;
Zt.DEFAULT_LOG_LEVEL;
Zt.default;
var rn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function ns(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var vn = { exports: {} }, fi = typeof Reflect == "object" ? Reflect : null, Uo = fi && typeof fi.apply == "function" ? fi.apply : function(t, e, r) {
  return Function.prototype.apply.call(t, e, r);
}, qi;
fi && typeof fi.ownKeys == "function" ? qi = fi.ownKeys : Object.getOwnPropertySymbols ? qi = function(t) {
  return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));
} : qi = function(t) {
  return Object.getOwnPropertyNames(t);
};
function Kc(t) {
  console && console.warn && console.warn(t);
}
var os = Number.isNaN || function(t) {
  return t !== t;
};
function Be() {
  Be.init.call(this);
}
vn.exports = Be;
vn.exports.once = qc;
Be.EventEmitter = Be;
Be.prototype._events = void 0;
Be.prototype._eventsCount = 0;
Be.prototype._maxListeners = void 0;
var Fo = 10;
function hr(t) {
  if (typeof t != "function")
    throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
}
Object.defineProperty(Be, "defaultMaxListeners", {
  enumerable: !0,
  get: function() {
    return Fo;
  },
  set: function(t) {
    if (typeof t != "number" || t < 0 || os(t))
      throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
    Fo = t;
  }
});
Be.init = function() {
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
};
Be.prototype.setMaxListeners = function(t) {
  if (typeof t != "number" || t < 0 || os(t))
    throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
  return this._maxListeners = t, this;
};
function as(t) {
  return t._maxListeners === void 0 ? Be.defaultMaxListeners : t._maxListeners;
}
Be.prototype.getMaxListeners = function() {
  return as(this);
};
Be.prototype.emit = function(t) {
  for (var e = [], r = 1; r < arguments.length; r++)
    e.push(arguments[r]);
  var s = t === "error", l = this._events;
  if (l !== void 0)
    s = s && l.error === void 0;
  else if (!s)
    return !1;
  if (s) {
    var d;
    if (e.length > 0 && (d = e[0]), d instanceof Error)
      throw d;
    var f = new Error("Unhandled error." + (d ? " (" + d.message + ")" : ""));
    throw f.context = d, f;
  }
  var c = l[t];
  if (c === void 0)
    return !1;
  if (typeof c == "function")
    Uo(c, this, e);
  else
    for (var R = c.length, A = ds(c, R), r = 0; r < R; ++r)
      Uo(A[r], this, e);
  return !0;
};
function ss(t, e, r, s) {
  var l, d, f;
  if (hr(r), d = t._events, d === void 0 ? (d = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (d.newListener !== void 0 && (t.emit(
    "newListener",
    e,
    r.listener ? r.listener : r
  ), d = t._events), f = d[e]), f === void 0)
    f = d[e] = r, ++t._eventsCount;
  else if (typeof f == "function" ? f = d[e] = s ? [r, f] : [f, r] : s ? f.unshift(r) : f.push(r), l = as(t), l > 0 && f.length > l && !f.warned) {
    f.warned = !0;
    var c = new Error("Possible EventEmitter memory leak detected. " + f.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
    c.name = "MaxListenersExceededWarning", c.emitter = t, c.type = e, c.count = f.length, Kc(c);
  }
  return t;
}
Be.prototype.addListener = function(t, e) {
  return ss(this, t, e, !1);
};
Be.prototype.on = Be.prototype.addListener;
Be.prototype.prependListener = function(t, e) {
  return ss(this, t, e, !0);
};
function zc() {
  if (!this.fired)
    return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
}
function ls(t, e, r) {
  var s = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, l = zc.bind(s);
  return l.listener = r, s.wrapFn = l, l;
}
Be.prototype.once = function(t, e) {
  return hr(e), this.on(t, ls(this, t, e)), this;
};
Be.prototype.prependOnceListener = function(t, e) {
  return hr(e), this.prependListener(t, ls(this, t, e)), this;
};
Be.prototype.removeListener = function(t, e) {
  var r, s, l, d, f;
  if (hr(e), s = this._events, s === void 0)
    return this;
  if (r = s[t], r === void 0)
    return this;
  if (r === e || r.listener === e)
    --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete s[t], s.removeListener && this.emit("removeListener", t, r.listener || e));
  else if (typeof r != "function") {
    for (l = -1, d = r.length - 1; d >= 0; d--)
      if (r[d] === e || r[d].listener === e) {
        f = r[d].listener, l = d;
        break;
      }
    if (l < 0)
      return this;
    l === 0 ? r.shift() : Jc(r, l), r.length === 1 && (s[t] = r[0]), s.removeListener !== void 0 && this.emit("removeListener", t, f || e);
  }
  return this;
};
Be.prototype.off = Be.prototype.removeListener;
Be.prototype.removeAllListeners = function(t) {
  var e, r, s;
  if (r = this._events, r === void 0)
    return this;
  if (r.removeListener === void 0)
    return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : r[t] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete r[t]), this;
  if (arguments.length === 0) {
    var l = Object.keys(r), d;
    for (s = 0; s < l.length; ++s)
      d = l[s], d !== "removeListener" && this.removeAllListeners(d);
    return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
  }
  if (e = r[t], typeof e == "function")
    this.removeListener(t, e);
  else if (e !== void 0)
    for (s = e.length - 1; s >= 0; s--)
      this.removeListener(t, e[s]);
  return this;
};
function us(t, e, r) {
  var s = t._events;
  if (s === void 0)
    return [];
  var l = s[e];
  return l === void 0 ? [] : typeof l == "function" ? r ? [l.listener || l] : [l] : r ? $c(l) : ds(l, l.length);
}
Be.prototype.listeners = function(t) {
  return us(this, t, !0);
};
Be.prototype.rawListeners = function(t) {
  return us(this, t, !1);
};
Be.listenerCount = function(t, e) {
  return typeof t.listenerCount == "function" ? t.listenerCount(e) : cs.call(t, e);
};
Be.prototype.listenerCount = cs;
function cs(t) {
  var e = this._events;
  if (e !== void 0) {
    var r = e[t];
    if (typeof r == "function")
      return 1;
    if (r !== void 0)
      return r.length;
  }
  return 0;
}
Be.prototype.eventNames = function() {
  return this._eventsCount > 0 ? qi(this._events) : [];
};
function ds(t, e) {
  for (var r = new Array(e), s = 0; s < e; ++s)
    r[s] = t[s];
  return r;
}
function Jc(t, e) {
  for (; e + 1 < t.length; e++)
    t[e] = t[e + 1];
  t.pop();
}
function $c(t) {
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
    e[r] = t[r].listener || t[r];
  return e;
}
function qc(t, e) {
  return new Promise(function(r, s) {
    function l(f) {
      t.removeListener(e, d), s(f);
    }
    function d() {
      typeof t.removeListener == "function" && t.removeListener("error", l), r([].slice.call(arguments));
    }
    hs(t, e, d, { once: !0 }), e !== "error" && Yc(t, l, { once: !0 });
  });
}
function Yc(t, e, r) {
  typeof t.on == "function" && hs(t, "error", e, r);
}
function hs(t, e, r, s) {
  if (typeof t.on == "function")
    s.once ? t.once(e, r) : t.on(e, r);
  else if (typeof t.addEventListener == "function")
    t.addEventListener(e, function l(d) {
      s.once && t.removeEventListener(e, l), r(d);
    });
  else
    throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
}
var Qc = vn.exports, fs = function() {
  if (typeof Map < "u")
    return Map;
  function t(e, r) {
    var s = -1;
    return e.some(function(l, d) {
      return l[0] === r ? (s = d, !0) : !1;
    }), s;
  }
  return (
    /** @class */
    function() {
      function e() {
        this.__entries__ = [];
      }
      return Object.defineProperty(e.prototype, "size", {
        /**
         * @returns {boolean}
         */
        get: function() {
          return this.__entries__.length;
        },
        enumerable: !0,
        configurable: !0
      }), e.prototype.get = function(r) {
        var s = t(this.__entries__, r), l = this.__entries__[s];
        return l && l[1];
      }, e.prototype.set = function(r, s) {
        var l = t(this.__entries__, r);
        ~l ? this.__entries__[l][1] = s : this.__entries__.push([r, s]);
      }, e.prototype.delete = function(r) {
        var s = this.__entries__, l = t(s, r);
        ~l && s.splice(l, 1);
      }, e.prototype.has = function(r) {
        return !!~t(this.__entries__, r);
      }, e.prototype.clear = function() {
        this.__entries__.splice(0);
      }, e.prototype.forEach = function(r, s) {
        s === void 0 && (s = null);
        for (var l = 0, d = this.__entries__; l < d.length; l++) {
          var f = d[l];
          r.call(s, f[1], f[0]);
        }
      }, e;
    }()
  );
}(), nn = typeof window < "u" && typeof document < "u" && window.document === document, rr = function() {
  return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
}(), Zc = function() {
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(rr) : function(t) {
    return setTimeout(function() {
      return t(Date.now());
    }, 1e3 / 60);
  };
}(), Xc = 2;
function ed(t, e) {
  var r = !1, s = !1, l = 0;
  function d() {
    r && (r = !1, t()), s && c();
  }
  function f() {
    Zc(d);
  }
  function c() {
    var R = Date.now();
    if (r) {
      if (R - l < Xc)
        return;
      s = !0;
    } else
      r = !0, s = !1, setTimeout(f, e);
    l = R;
  }
  return c;
}
var td = 20, id = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], rd = typeof MutationObserver < "u", nd = (
  /** @class */
  function() {
    function t() {
      this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = ed(this.refresh.bind(this), td);
    }
    return t.prototype.addObserver = function(e) {
      ~this.observers_.indexOf(e) || this.observers_.push(e), this.connected_ || this.connect_();
    }, t.prototype.removeObserver = function(e) {
      var r = this.observers_, s = r.indexOf(e);
      ~s && r.splice(s, 1), !r.length && this.connected_ && this.disconnect_();
    }, t.prototype.refresh = function() {
      var e = this.updateObservers_();
      e && this.refresh();
    }, t.prototype.updateObservers_ = function() {
      var e = this.observers_.filter(function(r) {
        return r.gatherActive(), r.hasActive();
      });
      return e.forEach(function(r) {
        return r.broadcastActive();
      }), e.length > 0;
    }, t.prototype.connect_ = function() {
      !nn || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), rd ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
        attributes: !0,
        childList: !0,
        characterData: !0,
        subtree: !0
      })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
    }, t.prototype.disconnect_ = function() {
      !nn || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
    }, t.prototype.onTransitionEnd_ = function(e) {
      var r = e.propertyName, s = r === void 0 ? "" : r, l = id.some(function(d) {
        return !!~s.indexOf(d);
      });
      l && this.refresh();
    }, t.getInstance = function() {
      return this.instance_ || (this.instance_ = new t()), this.instance_;
    }, t.instance_ = null, t;
  }()
), As = function(t, e) {
  for (var r = 0, s = Object.keys(e); r < s.length; r++) {
    var l = s[r];
    Object.defineProperty(t, l, {
      value: e[l],
      enumerable: !1,
      writable: !1,
      configurable: !0
    });
  }
  return t;
}, vi = function(t) {
  var e = t && t.ownerDocument && t.ownerDocument.defaultView;
  return e || rr;
}, ps = fr(0, 0, 0, 0);
function nr(t) {
  return parseFloat(t) || 0;
}
function Bo(t) {
  for (var e = [], r = 1; r < arguments.length; r++)
    e[r - 1] = arguments[r];
  return e.reduce(function(s, l) {
    var d = t["border-" + l + "-width"];
    return s + nr(d);
  }, 0);
}
function od(t) {
  for (var e = ["top", "right", "bottom", "left"], r = {}, s = 0, l = e; s < l.length; s++) {
    var d = l[s], f = t["padding-" + d];
    r[d] = nr(f);
  }
  return r;
}
function ad(t) {
  var e = t.getBBox();
  return fr(0, 0, e.width, e.height);
}
function sd(t) {
  var e = t.clientWidth, r = t.clientHeight;
  if (!e && !r)
    return ps;
  var s = vi(t).getComputedStyle(t), l = od(s), d = l.left + l.right, f = l.top + l.bottom, c = nr(s.width), R = nr(s.height);
  if (s.boxSizing === "border-box" && (Math.round(c + d) !== e && (c -= Bo(s, "left", "right") + d), Math.round(R + f) !== r && (R -= Bo(s, "top", "bottom") + f)), !ud(t)) {
    var A = Math.round(c + d) - e, v = Math.round(R + f) - r;
    Math.abs(A) !== 1 && (c -= A), Math.abs(v) !== 1 && (R -= v);
  }
  return fr(l.left, l.top, c, R);
}
var ld = function() {
  return typeof SVGGraphicsElement < "u" ? function(t) {
    return t instanceof vi(t).SVGGraphicsElement;
  } : function(t) {
    return t instanceof vi(t).SVGElement && typeof t.getBBox == "function";
  };
}();
function ud(t) {
  return t === vi(t).document.documentElement;
}
function cd(t) {
  return nn ? ld(t) ? ad(t) : sd(t) : ps;
}
function dd(t) {
  var e = t.x, r = t.y, s = t.width, l = t.height, d = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, f = Object.create(d.prototype);
  return As(f, {
    x: e,
    y: r,
    width: s,
    height: l,
    top: r,
    right: e + s,
    bottom: l + r,
    left: e
  }), f;
}
function fr(t, e, r, s) {
  return { x: t, y: e, width: r, height: s };
}
var hd = (
  /** @class */
  function() {
    function t(e) {
      this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = fr(0, 0, 0, 0), this.target = e;
    }
    return t.prototype.isActive = function() {
      var e = cd(this.target);
      return this.contentRect_ = e, e.width !== this.broadcastWidth || e.height !== this.broadcastHeight;
    }, t.prototype.broadcastRect = function() {
      var e = this.contentRect_;
      return this.broadcastWidth = e.width, this.broadcastHeight = e.height, e;
    }, t;
  }()
), fd = (
  /** @class */
  function() {
    function t(e, r) {
      var s = dd(r);
      As(this, { target: e, contentRect: s });
    }
    return t;
  }()
), Ad = (
  /** @class */
  function() {
    function t(e, r, s) {
      if (this.activeObservations_ = [], this.observations_ = new fs(), typeof e != "function")
        throw new TypeError("The callback provided as parameter 1 is not a function.");
      this.callback_ = e, this.controller_ = r, this.callbackCtx_ = s;
    }
    return t.prototype.observe = function(e) {
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      if (!(typeof Element > "u" || !(Element instanceof Object))) {
        if (!(e instanceof vi(e).Element))
          throw new TypeError('parameter 1 is not of type "Element".');
        var r = this.observations_;
        r.has(e) || (r.set(e, new hd(e)), this.controller_.addObserver(this), this.controller_.refresh());
      }
    }, t.prototype.unobserve = function(e) {
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      if (!(typeof Element > "u" || !(Element instanceof Object))) {
        if (!(e instanceof vi(e).Element))
          throw new TypeError('parameter 1 is not of type "Element".');
        var r = this.observations_;
        r.has(e) && (r.delete(e), r.size || this.controller_.removeObserver(this));
      }
    }, t.prototype.disconnect = function() {
      this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
    }, t.prototype.gatherActive = function() {
      var e = this;
      this.clearActive(), this.observations_.forEach(function(r) {
        r.isActive() && e.activeObservations_.push(r);
      });
    }, t.prototype.broadcastActive = function() {
      if (this.hasActive()) {
        var e = this.callbackCtx_, r = this.activeObservations_.map(function(s) {
          return new fd(s.target, s.broadcastRect());
        });
        this.callback_.call(e, r, e), this.clearActive();
      }
    }, t.prototype.clearActive = function() {
      this.activeObservations_.splice(0);
    }, t.prototype.hasActive = function() {
      return this.activeObservations_.length > 0;
    }, t;
  }()
), vs = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new fs(), _s = (
  /** @class */
  function() {
    function t(e) {
      if (!(this instanceof t))
        throw new TypeError("Cannot call a class as a function.");
      if (!arguments.length)
        throw new TypeError("1 argument required, but only 0 present.");
      var r = nd.getInstance(), s = new Ad(e, r, this);
      vs.set(this, s);
    }
    return t;
  }()
);
[
  "observe",
  "unobserve",
  "disconnect"
].forEach(function(t) {
  _s.prototype[t] = function() {
    var e;
    return (e = vs.get(this))[t].apply(e, arguments);
  };
});
(function() {
  return typeof rr.ResizeObserver < "u" ? rr.ResizeObserver : _s;
})();
var pd = function(t, e) {
  if (e = e.split(":")[0], t = +t, !t)
    return !1;
  switch (e) {
    case "http":
    case "ws":
      return t !== 80;
    case "https":
    case "wss":
      return t !== 443;
    case "ftp":
      return t !== 21;
    case "gopher":
      return t !== 70;
    case "file":
      return !1;
  }
  return t !== 0;
}, _n = {}, vd = Object.prototype.hasOwnProperty, _d;
function Ho(t) {
  try {
    return decodeURIComponent(t.replace(/\+/g, " "));
  } catch (e) {
    return null;
  }
}
function Vo(t) {
  try {
    return encodeURIComponent(t);
  } catch (e) {
    return null;
  }
}
function md(t) {
  for (var e = /([^=?#&]+)=?([^&]*)/g, r = {}, s; s = e.exec(t); ) {
    var l = Ho(s[1]), d = Ho(s[2]);
    l === null || d === null || l in r || (r[l] = d);
  }
  return r;
}
function gd(t, e) {
  e = e || "";
  var r = [], s, l;
  typeof e != "string" && (e = "?");
  for (l in t)
    if (vd.call(t, l)) {
      if (s = t[l], !s && (s === null || s === _d || isNaN(s)) && (s = ""), l = Vo(l), s = Vo(s), l === null || s === null)
        continue;
      r.push(l + "=" + s);
    }
  return r.length ? e + r.join("&") : "";
}
_n.stringify = gd;
_n.parse = md;
var ms = pd, Ar = _n, yd = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, gs = /[\n\r\t]/g, bd = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, ys = /:\d+$/, Ed = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, wd = /^[a-zA-Z]:/;
function mn(t) {
  return (t || "").toString().replace(yd, "");
}
var on = [
  ["#", "hash"],
  // Extract from the back.
  ["?", "query"],
  // Extract from the back.
  function(t, e) {
    return Ft(e.protocol) ? t.replace(/\\/g, "/") : t;
  },
  ["/", "pathname"],
  // Extract from the back.
  ["@", "auth", 1],
  // Extract from the front.
  [NaN, "host", void 0, 1, 1],
  // Set left over value.
  [/:(\d*)$/, "port", void 0, 1],
  // RegExp the back.
  [NaN, "hostname", void 0, 1, 1]
  // Set left over.
], Go = { hash: 1, query: 1 };
function bs(t) {
  var e;
  typeof window < "u" ? e = window : typeof rn < "u" ? e = rn : typeof self < "u" ? e = self : e = {};
  var r = e.location || {};
  t = t || r;
  var s = {}, l = typeof t, d;
  if (t.protocol === "blob:")
    s = new Bt(unescape(t.pathname), {});
  else if (l === "string") {
    s = new Bt(t, {});
    for (d in Go)
      delete s[d];
  } else if (l === "object") {
    for (d in t)
      d in Go || (s[d] = t[d]);
    s.slashes === void 0 && (s.slashes = bd.test(t.href));
  }
  return s;
}
function Ft(t) {
  return t === "file:" || t === "ftp:" || t === "http:" || t === "https:" || t === "ws:" || t === "wss:";
}
function Es(t, e) {
  t = mn(t), t = t.replace(gs, ""), e = e || {};
  var r = Ed.exec(t), s = r[1] ? r[1].toLowerCase() : "", l = !!r[2], d = !!r[3], f = 0, c;
  return l ? d ? (c = r[2] + r[3] + r[4], f = r[2].length + r[3].length) : (c = r[2] + r[4], f = r[2].length) : d ? (c = r[3] + r[4], f = r[3].length) : c = r[4], s === "file:" ? f >= 2 && (c = c.slice(2)) : Ft(s) ? c = r[4] : s ? l && (c = c.slice(2)) : f >= 2 && Ft(e.protocol) && (c = r[4]), {
    protocol: s,
    slashes: l || Ft(s),
    slashesCount: f,
    rest: c
  };
}
function Td(t, e) {
  if (t === "")
    return e;
  for (var r = (e || "/").split("/").slice(0, -1).concat(t.split("/")), s = r.length, l = r[s - 1], d = !1, f = 0; s--; )
    r[s] === "." ? r.splice(s, 1) : r[s] === ".." ? (r.splice(s, 1), f++) : f && (s === 0 && (d = !0), r.splice(s, 1), f--);
  return d && r.unshift(""), (l === "." || l === "..") && r.push(""), r.join("/");
}
function Bt(t, e, r) {
  if (t = mn(t), t = t.replace(gs, ""), !(this instanceof Bt))
    return new Bt(t, e, r);
  var s, l, d, f, c, R, A = on.slice(), v = typeof e, O = this, m = 0;
  for (v !== "object" && v !== "string" && (r = e, e = null), r && typeof r != "function" && (r = Ar.parse), e = bs(e), l = Es(t || "", e), s = !l.protocol && !l.slashes, O.slashes = l.slashes || s && e.slashes, O.protocol = l.protocol || e.protocol || "", t = l.rest, (l.protocol === "file:" && (l.slashesCount !== 2 || wd.test(t)) || !l.slashes && (l.protocol || l.slashesCount < 2 || !Ft(O.protocol))) && (A[3] = [/(.*)/, "pathname"]); m < A.length; m++) {
    if (f = A[m], typeof f == "function") {
      t = f(t, O);
      continue;
    }
    d = f[0], R = f[1], d !== d ? O[R] = t : typeof d == "string" ? (c = d === "@" ? t.lastIndexOf(d) : t.indexOf(d), ~c && (typeof f[2] == "number" ? (O[R] = t.slice(0, c), t = t.slice(c + f[2])) : (O[R] = t.slice(c), t = t.slice(0, c)))) : (c = d.exec(t)) && (O[R] = c[1], t = t.slice(0, c.index)), O[R] = O[R] || s && f[3] && e[R] || "", f[4] && (O[R] = O[R].toLowerCase());
  }
  r && (O.query = r(O.query)), s && e.slashes && O.pathname.charAt(0) !== "/" && (O.pathname !== "" || e.pathname !== "") && (O.pathname = Td(O.pathname, e.pathname)), O.pathname.charAt(0) !== "/" && Ft(O.protocol) && (O.pathname = "/" + O.pathname), ms(O.port, O.protocol) || (O.host = O.hostname, O.port = ""), O.username = O.password = "", O.auth && (c = O.auth.indexOf(":"), ~c ? (O.username = O.auth.slice(0, c), O.username = encodeURIComponent(decodeURIComponent(O.username)), O.password = O.auth.slice(c + 1), O.password = encodeURIComponent(decodeURIComponent(O.password))) : O.username = encodeURIComponent(decodeURIComponent(O.auth)), O.auth = O.password ? O.username + ":" + O.password : O.username), O.origin = O.protocol !== "file:" && Ft(O.protocol) && O.host ? O.protocol + "//" + O.host : "null", O.href = O.toString();
}
function Rd(t, e, r) {
  var s = this;
  switch (t) {
    case "query":
      typeof e == "string" && e.length && (e = (r || Ar.parse)(e)), s[t] = e;
      break;
    case "port":
      s[t] = e, ms(e, s.protocol) ? e && (s.host = s.hostname + ":" + e) : (s.host = s.hostname, s[t] = "");
      break;
    case "hostname":
      s[t] = e, s.port && (e += ":" + s.port), s.host = e;
      break;
    case "host":
      s[t] = e, ys.test(e) ? (e = e.split(":"), s.port = e.pop(), s.hostname = e.join(":")) : (s.hostname = e, s.port = "");
      break;
    case "protocol":
      s.protocol = e.toLowerCase(), s.slashes = !r;
      break;
    case "pathname":
    case "hash":
      if (e) {
        var l = t === "pathname" ? "/" : "#";
        s[t] = e.charAt(0) !== l ? l + e : e;
      } else
        s[t] = e;
      break;
    case "username":
    case "password":
      s[t] = encodeURIComponent(e);
      break;
    case "auth":
      var d = e.indexOf(":");
      ~d ? (s.username = e.slice(0, d), s.username = encodeURIComponent(decodeURIComponent(s.username)), s.password = e.slice(d + 1), s.password = encodeURIComponent(decodeURIComponent(s.password))) : s.username = encodeURIComponent(decodeURIComponent(e));
  }
  for (var f = 0; f < on.length; f++) {
    var c = on[f];
    c[4] && (s[c[1]] = s[c[1]].toLowerCase());
  }
  return s.auth = s.password ? s.username + ":" + s.password : s.username, s.origin = s.protocol !== "file:" && Ft(s.protocol) && s.host ? s.protocol + "//" + s.host : "null", s.href = s.toString(), s;
}
function Sd(t) {
  (!t || typeof t != "function") && (t = Ar.stringify);
  var e, r = this, s = r.host, l = r.protocol;
  l && l.charAt(l.length - 1) !== ":" && (l += ":");
  var d = l + (r.protocol && r.slashes || Ft(r.protocol) ? "//" : "");
  return r.username ? (d += r.username, r.password && (d += ":" + r.password), d += "@") : r.password ? (d += ":" + r.password, d += "@") : r.protocol !== "file:" && Ft(r.protocol) && !s && r.pathname !== "/" && (d += "@"), (s[s.length - 1] === ":" || ys.test(r.hostname) && !r.port) && (s += ":"), d += s + r.pathname, e = typeof r.query == "object" ? t(r.query) : r.query, e && (d += e.charAt(0) !== "?" ? "?" + e : e), r.hash && (d += r.hash), d;
}
Bt.prototype = { set: Rd, toString: Sd };
Bt.extractProtocol = Es;
Bt.location = bs;
Bt.trimLeft = mn;
Bt.qs = Ar;
var Ld = Bt;
const Wo = /* @__PURE__ */ ns(Ld);
var mi = function(t) {
  var e = {};
  function r(s) {
    if (e[s])
      return e[s].exports;
    var l = e[s] = { i: s, l: !1, exports: {} };
    return t[s].call(l.exports, l, l.exports, r), l.l = !0, l.exports;
  }
  return r.m = t, r.c = e, r.d = function(s, l, d) {
    r.o(s, l) || Object.defineProperty(s, l, { enumerable: !0, get: d });
  }, r.r = function(s) {
    typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
  }, r.t = function(s, l) {
    if (1 & l && (s = r(s)), 8 & l || 4 & l && typeof s == "object" && s && s.__esModule)
      return s;
    var d = /* @__PURE__ */ Object.create(null);
    if (r.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & l && typeof s != "string")
      for (var f in s)
        r.d(d, f, function(c) {
          return s[c];
        }.bind(null, f));
    return d;
  }, r.n = function(s) {
    var l = s && s.__esModule ? function() {
      return s.default;
    } : function() {
      return s;
    };
    return r.d(l, "a", l), l;
  }, r.o = function(s, l) {
    return Object.prototype.hasOwnProperty.call(s, l);
  }, r.p = "", r(r.s = 4);
}([function(t, e) {
  function r(s) {
    return t.exports = r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
      return typeof l;
    } : function(l) {
      return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
    }, t.exports.__esModule = !0, t.exports.default = t.exports, r(s);
  }
  t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(2);
  function l(d, f) {
    for (var c = 0; c < f.length; c++) {
      var R = f[c];
      R.enumerable = R.enumerable || !1, R.configurable = !0, "value" in R && (R.writable = !0), Object.defineProperty(d, s(R.key), R);
    }
  }
  t.exports = function(d, f, c) {
    return f && l(d.prototype, f), c && l(d, c), Object.defineProperty(d, "prototype", { writable: !1 }), d;
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(0).default, l = r(3);
  t.exports = function(d) {
    var f = l(d, "string");
    return s(f) == "symbol" ? f : f + "";
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  var s = r(0).default;
  t.exports = function(l, d) {
    if (s(l) != "object" || !l)
      return l;
    var f = l[Symbol.toPrimitive];
    if (f !== void 0) {
      var c = f.call(l, d || "default");
      if (s(c) != "object")
        return c;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (d === "string" ? String : Number)(l);
  }, t.exports.__esModule = !0, t.exports.default = t.exports;
}, function(t, e, r) {
  function s(g, E) {
    console.log("%c " + g + " %c " + E + " %c", "background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px;  color: #fff", "background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0;  color: #fff", "background:transparent");
  }
  r.r(e), r.d(e, "LogLevel", function() {
    return A;
  }), r.d(e, "DefaultLogger", function() {
    return x;
  }), r.d(e, "Logger", function() {
    return m;
  }), r.d(e, "printVersion", function() {
    return s;
  }), r.d(e, "DEFAULT_LOG_LEVEL", function() {
    return v;
  });
  var l = r(1), d = r.n(l), f = function() {
    function g() {
      this.timeout = 6048e5;
    }
    var E = g.prototype;
    return E.write = function(k, y) {
      if (g.available)
        try {
          localStorage.setItem(k, JSON.stringify({ value: y, time: Date.now() }));
        } catch (w) {
        }
    }, E.read = function(k, y) {
      if (y === void 0 && (y = !0), g.available)
        try {
          var w = localStorage.getItem(k);
          if (w) {
            var _ = JSON.parse(w), b = _.value, I = _.time, P = I === void 0 ? 0 : I;
            if (!y || Date.now() - P < (typeof y == "number" ? y : this.timeout))
              return b;
          }
        } catch (G) {
        }
    }, d()(g, null, [{ key: "available", get: function() {
      if (g._available === void 0)
        try {
          localStorage.setItem("alg", "test"), g._available = !0;
        } catch (k) {
          g._available = !1;
        }
      return g._available;
    } }]);
  }();
  f._available = void 0;
  var c, R = f, A = function(g) {
    return g.NONE = "none", g.ERROR = "e", g.WARN = "w", g.INFO = "i", g.DEBUG = "d", g.VERBOSE = "v", g;
  }({}), v = A.ERROR, O = ((c = {})[A.NONE] = { value: 1, str: "N" }, c[A.ERROR] = { value: 100, str: "E" }, c[A.WARN] = { value: 200, str: "W" }, c[A.INFO] = { value: 300, str: "I" }, c[A.DEBUG] = { value: 400, str: "D" }, c[A.VERBOSE] = { value: 500, str: "V" }, c), m = function() {
    function g(k) {
      if (this._name = "kwai-v", this._level = v, this._id = -1, this._output = void 0, this._workerTag = "main", typeof location < "u" && location.protocol === "blob:") {
        var y, w = location.href.split("/"), _ = (y = w[w.length - 1]) == null ? void 0 : y.match(/(\w+)-/);
        _ && (this._workerTag = k ? k + "-" + _[1] : _[1]);
      } else
        k && (this._workerTag = k);
    }
    g.loadLogLevel = function(k, y) {
      if (y === void 0 && (y = !0), location.href) {
        var w = new RegExp(k + "=([a-z]{1})"), _ = location.href.match(w);
        if (_ && _.length > 1) {
          var b = _[1];
          if (this._isValueInLevel(b))
            return b;
        }
      }
      var I = new R().read(k, y);
      if (this._isValueInLevel(I))
        return I;
    }, g.saveLogLevel = function(k, y) {
      this._isValueInLevel(y) && new R().write(k, y);
    }, g._isValueInLevel = function(k) {
      return Object.values(A).indexOf(k) !== -1;
    };
    var E = g.prototype;
    return E.setOutput = function(k) {
      return this._output = k, this;
    }, E.setLevel = function(k) {
      return this._level = k, this;
    }, E.setId = function(k) {
      return this._id = k, this;
    }, E.setName = function(k) {
      return this._name = k, this;
    }, E.getLevel = function() {
      return this._level;
    }, E.getOutput = function() {
      return this._output;
    }, E.hasOutput = function() {
      return !!this._output;
    }, E.e = function(k) {
      if (this._isLevelEnabled(this._level, A.ERROR)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.ERROR, k, w);
        try {
          var I;
          (I = this._output) == null || I.e.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.w = function(k) {
      if (this._isLevelEnabled(this._level, A.WARN)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.WARN, k, w);
        try {
          var I;
          (I = this._output) == null || I.w.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.i = function(k) {
      if (this._isLevelEnabled(this._level, A.INFO)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.INFO, k, w);
        try {
          var I;
          (I = this._output) == null || I.i.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.d = function(k) {
      if (this._isLevelEnabled(this._level, A.DEBUG)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.DEBUG, k, w);
        try {
          var I;
          (I = this._output) == null || I.d.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E.v = function(k) {
      if (this._isLevelEnabled(this._level, A.VERBOSE)) {
        for (var y = arguments.length, w = new Array(y > 1 ? y - 1 : 0), _ = 1; _ < y; _++)
          w[_ - 1] = arguments[_];
        var b = this._printLog(A.VERBOSE, k, w);
        try {
          var I;
          (I = this._output) == null || I.v.apply(I, [b].concat(w));
        } catch (P) {
        }
      }
    }, E._isLevelEnabled = function(k, y) {
      return O[k].value >= O[y].value;
    }, E._printLog = function(k, y, w) {
      var _, b, I = typeof y;
      if (I === "object")
        y = ((b = y) == null ? void 0 : b.constructor.name) || "unknown";
      else if (I === "function") {
        var P;
        y = ((P = Object.getOwnPropertyDescriptor(y, "name")) == null ? void 0 : P.value) || "unknown";
      }
      var G, H, Q = (((_ = O[k]) == null ? void 0 : _.str) || "") + "|" + this._name + "[" + (typeof this._id == "function" ? this._id() : this._id) + "][" + this._workerTag + "]::" + y;
      return k === A.ERROR ? (G = console).error.apply(G, [Q].concat(w.slice(0))) : (H = console).log.apply(H, [Q].concat(w.slice(0))), Q;
    }, g;
  }(), x = new m();
}]);
mi === void 0 && console.error("esm-webpack-plugin: nothing exported!");
mi.LogLevel;
const Li = mi.DefaultLogger;
mi.Logger;
mi.printVersion;
mi.DEFAULT_LOG_LEVEL;
/*! js-cookie v3.0.5 | MIT */
function Wi(t) {
  for (var e = 1; e < arguments.length; e++) {
    var r = arguments[e];
    for (var s in r)
      t[s] = r[s];
  }
  return t;
}
var kd = {
  read: function(t) {
    return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
  },
  write: function(t) {
    return encodeURIComponent(t).replace(
      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
      decodeURIComponent
    );
  }
};
function an(t, e) {
  function r(l, d, f) {
    if (!(typeof document > "u")) {
      f = Wi({}, e, f), typeof f.expires == "number" && (f.expires = new Date(Date.now() + f.expires * 864e5)), f.expires && (f.expires = f.expires.toUTCString()), l = encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
      var c = "";
      for (var R in f)
        f[R] && (c += "; " + R, f[R] !== !0 && (c += "=" + f[R].split(";")[0]));
      return document.cookie = l + "=" + t.write(d, l) + c;
    }
  }
  function s(l) {
    if (!(typeof document > "u" || arguments.length && !l)) {
      for (var d = document.cookie ? document.cookie.split("; ") : [], f = {}, c = 0; c < d.length; c++) {
        var R = d[c].split("="), A = R.slice(1).join("=");
        try {
          var v = decodeURIComponent(R[0]);
          if (f[v] = t.read(A, v), l === v)
            break;
        } catch (O) {
        }
      }
      return l ? f[l] : f;
    }
  }
  return Object.create(
    {
      set: r,
      get: s,
      remove: function(l, d) {
        r(
          l,
          "",
          Wi({}, d, {
            expires: -1
          })
        );
      },
      withAttributes: function(l) {
        return an(this.converter, Wi({}, this.attributes, l));
      },
      withConverter: function(l) {
        return an(Wi({}, this.converter, l), this.attributes);
      }
    },
    {
      attributes: { value: Object.freeze(e) },
      converter: { value: Object.freeze(t) }
    }
  );
}
var Hr = an(kd, { path: "/" });
const ki = "did", Vr = "kwai_player_device_id";
function jo() {
  try {
    const t = Math.random() * 1e9 >>> 0, e = [], r = "0123456789ABCDEF";
    for (let l = 0; l < 7; l++)
      e.push(r.charAt(Math.random() * 16));
    const s = `web_${t}${e.join("")}`;
    return Li.i(ki, "generate nanoId", s), s;
  } catch (t) {
  }
  return "web_did_generation_failed";
}
function Id() {
  let t = "";
  try {
    t = (Hr.get("did") || Hr.get("_did") || Hr.get("weblogger_did") || "").trim(), Li.i(ki, "generate deviceId from cookie", t);
  } catch (e) {
    Li.i(ki, "generate deviceId from cookie err", e);
  }
  try {
    t ? localStorage == null || localStorage.setItem(Vr, t) : (t = ((localStorage == null ? void 0 : localStorage.getItem(Vr)) || "").trim(), Li.i(ki, "generate deviceId from ls", t)), t || (t = jo(), localStorage == null || localStorage.setItem(Vr, t));
  } catch (e) {
    Li.i(ki, "generate deviceId from ls err", e);
  }
  return t || jo();
}
function xd(t) {
  or = t;
}
let or = Id();
const ws = class ri {
  constructor() {
    is(this, "timeout", 7 * 24 * 3600 * 1e3);
  }
  write(e, r) {
    if (ri.available)
      try {
        localStorage.setItem(
          e,
          JSON.stringify({ value: r, time: Date.now() })
        );
      } catch (s) {
      }
  }
  read(e, r = !0) {
    if (ri.available)
      try {
        const s = localStorage.getItem(e);
        if (s) {
          const { value: l, time: d = 0 } = JSON.parse(s);
          if (!r || Date.now() - d < (typeof r == "number" ? r : this.timeout))
            return l;
        }
      } catch (s) {
      }
  }
  static get available() {
    if (typeof ri._available > "u")
      try {
        localStorage.setItem("alg", "test"), ri._available = !0;
      } catch (e) {
        ri._available = !1;
      }
    return ri._available;
  }
};
is(ws, "_available");
let Ts = ws;
var sn = { exports: {} };
(function(t, e) {
  (function(r, s) {
    var l = "1.0.2", d = "", f = "?", c = "function", R = "undefined", A = "object", v = "string", O = "major", m = "model", x = "name", g = "type", E = "vendor", k = "version", y = "architecture", w = "console", _ = "mobile", b = "tablet", I = "smarttv", P = "wearable", G = "embedded", H = 255, Q = "Amazon", ue = "Apple", de = "ASUS", j = "BlackBerry", F = "Browser", S = "Chrome", D = "Edge", U = "Firefox", N = "Google", z = "Huawei", Y = "LG", C = "Microsoft", M = "Motorola", B = "Opera", Z = "Samsung", K = "Sony", se = "Xiaomi", pe = "Zebra", he = "Facebook", we = function(oe, le) {
      var ne = {};
      for (var me in oe)
        le[me] && le[me].length % 2 === 0 ? ne[me] = le[me].concat(oe[me]) : ne[me] = oe[me];
      return ne;
    }, ee = function(oe) {
      for (var le = {}, ne = 0; ne < oe.length; ne++)
        le[oe[ne].toUpperCase()] = oe[ne];
      return le;
    }, je = function(oe, le) {
      return typeof oe === v ? Le(le).indexOf(Le(oe)) !== -1 : !1;
    }, Le = function(oe) {
      return oe.toLowerCase();
    }, Ht = function(oe) {
      return typeof oe === v ? oe.replace(/[^\d\.]/g, d).split(".")[0] : s;
    }, it = function(oe, le) {
      if (typeof oe === v)
        return oe = oe.replace(/^\s\s*/, d).replace(/\s\s*$/, d), typeof le === R ? oe : oe.substring(0, H);
    }, fe = function(oe, le) {
      for (var ne = 0, me, ae, wt, Ae, et, $e; ne < le.length && !et; ) {
        var Tt = le[ne], Xt = le[ne + 1];
        for (me = ae = 0; me < Tt.length && !et; )
          if (et = Tt[me++].exec(oe), et)
            for (wt = 0; wt < Xt.length; wt++)
              $e = et[++ae], Ae = Xt[wt], typeof Ae === A && Ae.length > 0 ? Ae.length === 2 ? typeof Ae[1] == c ? this[Ae[0]] = Ae[1].call(this, $e) : this[Ae[0]] = Ae[1] : Ae.length === 3 ? typeof Ae[1] === c && !(Ae[1].exec && Ae[1].test) ? this[Ae[0]] = $e ? Ae[1].call(this, $e, Ae[2]) : s : this[Ae[0]] = $e ? $e.replace(Ae[1], Ae[2]) : s : Ae.length === 4 && (this[Ae[0]] = $e ? Ae[3].call(this, $e.replace(Ae[1], Ae[2])) : s) : this[Ae] = $e || s;
        ne += 2;
      }
    }, He = function(oe, le) {
      for (var ne in le)
        if (typeof le[ne] === A && le[ne].length > 0) {
          for (var me = 0; me < le[ne].length; me++)
            if (je(le[ne][me], oe))
              return ne === f ? s : ne;
        } else if (je(le[ne], oe))
          return ne === f ? s : ne;
      return oe;
    }, Lt = {
      "1.0": "/8",
      "1.2": "/1",
      "1.3": "/3",
      "2.0": "/412",
      "2.0.2": "/416",
      "2.0.3": "/417",
      "2.0.4": "/419",
      "?": "/"
    }, ce = {
      ME: "4.90",
      "NT 3.11": "NT3.51",
      "NT 4.0": "NT4.0",
      2e3: "NT 5.0",
      XP: ["NT 5.1", "NT 5.2"],
      Vista: "NT 6.0",
      7: "NT 6.1",
      8: "NT 6.2",
      "8.1": "NT 6.3",
      10: ["NT 6.4", "NT 10.0"],
      RT: "ARM"
    }, Ve = {
      browser: [
        [
          /\b(?:crmo|crios)\/([\w\.]+)/i
          // Chrome for Android/iOS
        ],
        [k, [x, "Chrome"]],
        [
          /edg(?:e|ios|a)?\/([\w\.]+)/i
          // Microsoft Edge
        ],
        [k, [x, "Edge"]],
        [
          // Presto based
          /(opera mini)\/([-\w\.]+)/i,
          // Opera Mini
          /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
          // Opera Mobi/Tablet
          /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
          // Opera
        ],
        [x, k],
        [
          /opios[\/ ]+([\w\.]+)/i
          // Opera mini on iphone >= 8.0
        ],
        [k, [x, B + " Mini"]],
        [
          /\bopr\/([\w\.]+)/i
          // Opera Webkit
        ],
        [k, [x, B]],
        [
          // Mixed
          /(kindle)\/([\w\.]+)/i,
          // Kindle
          /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
          // Lunascape/Maxthon/Netfront/Jasmine/Blazer
          // Trident based
          /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,
          // Avant/IEMobile/SlimBrowser
          /(ba?idubrowser)[\/ ]?([\w\.]+)/i,
          // Baidu Browser
          /(?:ms|\()(ie) ([\w\.]+)/i,
          // Internet Explorer
          // Webkit/KHTML based                                               // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
          /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,
          // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
          /(weibo)__([\d\.]+)/i
          // Weibo
        ],
        [x, k],
        [
          /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
          // UCBrowser
        ],
        [k, [x, "UC" + F]],
        [
          /\bqbcore\/([\w\.]+)/i
          // WeChat Desktop for Windows Built-in Browser
        ],
        [k, [x, "WeChat(Win) Desktop"]],
        [
          /micromessenger\/([\w\.]+)/i
          // WeChat
        ],
        [k, [x, "WeChat"]],
        [
          /konqueror\/([\w\.]+)/i
          // Konqueror
        ],
        [k, [x, "Konqueror"]],
        [
          /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
          // IE11
        ],
        [k, [x, "IE"]],
        [
          /yabrowser\/([\w\.]+)/i
          // Yandex
        ],
        [k, [x, "Yandex"]],
        [
          /(avast|avg)\/([\w\.]+)/i
          // Avast/AVG Secure Browser
        ],
        [[x, /(.+)/, "$1 Secure " + F], k],
        [
          /\bfocus\/([\w\.]+)/i
          // Firefox Focus
        ],
        [k, [x, U + " Focus"]],
        [
          /\bopt\/([\w\.]+)/i
          // Opera Touch
        ],
        [k, [x, B + " Touch"]],
        [
          /coc_coc\w+\/([\w\.]+)/i
          // Coc Coc Browser
        ],
        [k, [x, "Coc Coc"]],
        [
          /dolfin\/([\w\.]+)/i
          // Dolphin
        ],
        [k, [x, "Dolphin"]],
        [
          /coast\/([\w\.]+)/i
          // Opera Coast
        ],
        [k, [x, B + " Coast"]],
        [
          /miuibrowser\/([\w\.]+)/i
          // MIUI Browser
        ],
        [k, [x, "MIUI " + F]],
        [
          /fxios\/([-\w\.]+)/i
          // Firefox for iOS
        ],
        [k, [x, U]],
        [
          /\bqihu|(qi?ho?o?|360)browser/i
          // 360
        ],
        [[x, "360 " + F]],
        [
          /(oculus|samsung|sailfish)browser\/([\w\.]+)/i
        ],
        [[x, /(.+)/, "$1 " + F], k],
        [
          // Oculus/Samsung/Sailfish Browser
          /(comodo_dragon)\/([\w\.]+)/i
          // Comodo Dragon
        ],
        [[x, /_/g, " "], k],
        [
          /(electron)\/([\w\.]+) safari/i,
          // Electron-based App
          /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
          // Tesla
          /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i
          // QQBrowser/Baidu App/2345 Browser
        ],
        [x, k],
        [
          /(metasr)[\/ ]?([\w\.]+)/i,
          // SouGouBrowser
          /(lbbrowser)/i
          // LieBao Browser
        ],
        [x],
        [
          // WebView
          /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
          // Facebook App for iOS & Android
        ],
        [[x, he], k],
        [
          /safari (line)\/([\w\.]+)/i,
          // Line App for iOS
          /\b(line)\/([\w\.]+)\/iab/i,
          // Line App for Android
          /(chromium|instagram)[\/ ]([-\w\.]+)/i
          // Chromium/Instagram
        ],
        [x, k],
        [
          /\bgsa\/([\w\.]+) .*safari\//i
          // Google Search Appliance on iOS
        ],
        [k, [x, "GSA"]],
        [
          /headlesschrome(?:\/([\w\.]+)| )/i
          // Chrome Headless
        ],
        [k, [x, S + " Headless"]],
        [
          / wv\).+(chrome)\/([\w\.]+)/i
          // Chrome WebView
        ],
        [[x, S + " WebView"], k],
        [
          /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
          // Android Browser
        ],
        [k, [x, "Android " + F]],
        [
          /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
          // Chrome/OmniWeb/Arora/Tizen/Nokia
        ],
        [x, k],
        [
          /version\/([\w\.]+) .*mobile\/\w+ (safari)/i
          // Mobile Safari
        ],
        [k, [x, "Mobile Safari"]],
        [
          /version\/([\w\.]+) .*(mobile ?safari|safari)/i
          // Safari & Safari Mobile
        ],
        [k, x],
        [
          /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
          // Safari < 3.0
        ],
        [x, [k, He, Lt]],
        [
          /(webkit|khtml)\/([\w\.]+)/i
        ],
        [x, k],
        [
          // Gecko based
          /(navigator|netscape\d?)\/([-\w\.]+)/i
          // Netscape
        ],
        [[x, "Netscape"], k],
        [
          /mobile vr; rv:([\w\.]+)\).+firefox/i
          // Firefox Reality
        ],
        [k, [x, U + " Reality"]],
        [
          /ekiohf.+(flow)\/([\w\.]+)/i,
          // Flow
          /(swiftfox)/i,
          // Swiftfox
          /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
          // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
          /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
          // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
          /(firefox)\/([\w\.]+)/i,
          // Other Firefox-based
          /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
          // Mozilla
          // Other
          /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
          // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
          /(links) \(([\w\.]+)/i
          // Links
        ],
        [x, k]
      ],
      cpu: [
        [
          /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
          // AMD64 (x64)
        ],
        [[y, "amd64"]],
        [
          /(ia32(?=;))/i
          // IA32 (quicktime)
        ],
        [[y, Le]],
        [
          /((?:i[346]|x)86)[;\)]/i
          // IA32 (x86)
        ],
        [[y, "ia32"]],
        [
          /\b(aarch64|arm(v?8e?l?|_?64))\b/i
          // ARM64
        ],
        [[y, "arm64"]],
        [
          /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
          // ARMHF
        ],
        [[y, "armhf"]],
        [
          // PocketPC mistakenly identified as PowerPC
          /windows (ce|mobile); ppc;/i
        ],
        [[y, "arm"]],
        [
          /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
          // PowerPC
        ],
        [[y, /ower/, d, Le]],
        [
          /(sun4\w)[;\)]/i
          // SPARC
        ],
        [[y, "sparc"]],
        [
          /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
          // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
        ],
        [[y, Le]]
      ],
      device: [
        [
          //////////////////////////
          // MOBILES & TABLETS
          // Ordered by popularity
          /////////////////////////
          // Samsung
          /\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
        ],
        [m, [E, Z], [g, b]],
        [
          /\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,
          /samsung[- ]([-\w]+)/i,
          /sec-(sgh\w+)/i
        ],
        [m, [E, Z], [g, _]],
        [
          // Apple
          /\((ip(?:hone|od)[\w ]*);/i
          // iPod/iPhone
        ],
        [m, [E, ue], [g, _]],
        [
          /\((ipad);[-\w\),; ]+apple/i,
          // iPad
          /applecoremedia\/[\w\.]+ \((ipad)/i,
          /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
        ],
        [m, [E, ue], [g, b]],
        [
          // Huawei
          /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
        ],
        [m, [E, z], [g, b]],
        [
          /(?:huawei|honor)([-\w ]+)[;\)]/i,
          /\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i
        ],
        [m, [E, z], [g, _]],
        [
          // Xiaomi
          /\b(poco[\w ]+)(?: bui|\))/i,
          // Xiaomi POCO
          /\b; (\w+) build\/hm\1/i,
          // Xiaomi Hongmi 'numeric' models
          /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
          // Xiaomi Hongmi
          /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
          // Xiaomi Redmi
          /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
          // Xiaomi Mi
        ],
        [[m, /_/g, " "], [E, se], [g, _]],
        [
          /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
          // Mi Pad tablets
        ],
        [[m, /_/g, " "], [E, se], [g, b]],
        [
          // OPPO
          /; (\w+) bui.+ oppo/i,
          /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
        ],
        [m, [E, "OPPO"], [g, _]],
        [
          // Vivo
          /vivo (\w+)(?: bui|\))/i,
          /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
        ],
        [m, [E, "Vivo"], [g, _]],
        [
          // Realme
          /\b(rmx[12]\d{3})(?: bui|;|\))/i
        ],
        [m, [E, "Realme"], [g, _]],
        [
          // Motorola
          /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
          /\bmot(?:orola)?[- ](\w*)/i,
          /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
        ],
        [m, [E, M], [g, _]],
        [
          /\b(mz60\d|xoom[2 ]{0,2}) build\//i
        ],
        [m, [E, M], [g, b]],
        [
          // LG
          /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
        ],
        [m, [E, Y], [g, b]],
        [
          /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
          /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
          /\blg-?([\d\w]+) bui/i
        ],
        [m, [E, Y], [g, _]],
        [
          // Lenovo
          /(ideatab[-\w ]+)/i,
          /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
        ],
        [m, [E, "Lenovo"], [g, b]],
        [
          // Nokia
          /(?:maemo|nokia).*(n900|lumia \d+)/i,
          /nokia[-_ ]?([-\w\.]*)/i
        ],
        [[m, /_/g, " "], [E, "Nokia"], [g, _]],
        [
          // Google
          /(pixel c)\b/i
          // Google Pixel C
        ],
        [m, [E, N], [g, b]],
        [
          /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
          // Google Pixel
        ],
        [m, [E, N], [g, _]],
        [
          // Sony
          /droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
        ],
        [m, [E, K], [g, _]],
        [
          /sony tablet [ps]/i,
          /\b(?:sony)?sgp\w+(?: bui|\))/i
        ],
        [[m, "Xperia Tablet"], [E, K], [g, b]],
        [
          // OnePlus
          / (kb2005|in20[12]5|be20[12][59])\b/i,
          /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
        ],
        [m, [E, "OnePlus"], [g, _]],
        [
          // Amazon
          /(alexa)webm/i,
          /(kf[a-z]{2}wi)( bui|\))/i,
          // Kindle Fire without Silk
          /(kf[a-z]+)( bui|\)).+silk\//i
          // Kindle Fire HD
        ],
        [m, [E, Q], [g, b]],
        [
          /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
          // Fire Phone
        ],
        [[m, /(.+)/g, "Fire Phone $1"], [E, Q], [g, _]],
        [
          // BlackBerry
          /(playbook);[-\w\),; ]+(rim)/i
          // BlackBerry PlayBook
        ],
        [m, E, [g, b]],
        [
          /\b((?:bb[a-f]|st[hv])100-\d)/i,
          /\(bb10; (\w+)/i
          // BlackBerry 10
        ],
        [m, [E, j], [g, _]],
        [
          // Asus
          /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
        ],
        [m, [E, de], [g, b]],
        [
          / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
        ],
        [m, [E, de], [g, _]],
        [
          // HTC
          /(nexus 9)/i
          // HTC Nexus 9
        ],
        [m, [E, "HTC"], [g, b]],
        [
          /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
          // HTC
          // ZTE
          /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
          /(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i
          // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
        ],
        [E, [m, /_/g, " "], [g, _]],
        [
          // Acer
          /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
        ],
        [m, [E, "Acer"], [g, b]],
        [
          // Meizu
          /droid.+; (m[1-5] note) bui/i,
          /\bmz-([-\w]{2,})/i
        ],
        [m, [E, "Meizu"], [g, _]],
        [
          // Sharp
          /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
        ],
        [m, [E, "Sharp"], [g, _]],
        [
          // MIXED
          /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,
          // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
          /(hp) ([\w ]+\w)/i,
          // HP iPAQ
          /(asus)-?(\w+)/i,
          // Asus
          /(microsoft); (lumia[\w ]+)/i,
          // Microsoft Lumia
          /(lenovo)[-_ ]?([-\w]+)/i,
          // Lenovo
          /(jolla)/i,
          // Jolla
          /(oppo) ?([\w ]+) bui/i
          // OPPO
        ],
        [E, m, [g, _]],
        [
          /(archos) (gamepad2?)/i,
          // Archos
          /(hp).+(touchpad(?!.+tablet)|tablet)/i,
          // HP TouchPad
          /(kindle)\/([\w\.]+)/i,
          // Kindle
          /(nook)[\w ]+build\/(\w+)/i,
          // Nook
          /(dell) (strea[kpr\d ]*[\dko])/i,
          // Dell Streak
          /(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
          // Le Pan Tablets
          /(trinity)[- ]*(t\d{3}) bui/i,
          // Trinity Tablets
          /(gigaset)[- ]+(q\w{1,9}) bui/i,
          // Gigaset Tablets
          /(vodafone) ([\w ]+)(?:\)| bui)/i
          // Vodafone
        ],
        [E, m, [g, b]],
        [
          /(surface duo)/i
          // Surface Duo
        ],
        [m, [E, C], [g, b]],
        [
          /droid [\d\.]+; (fp\du?)(?: b|\))/i
          // Fairphone
        ],
        [m, [E, "Fairphone"], [g, _]],
        [
          /(u304aa)/i
          // AT&T
        ],
        [m, [E, "AT&T"], [g, _]],
        [
          /\bsie-(\w*)/i
          // Siemens
        ],
        [m, [E, "Siemens"], [g, _]],
        [
          /\b(rct\w+) b/i
          // RCA Tablets
        ],
        [m, [E, "RCA"], [g, b]],
        [
          /\b(venue[\d ]{2,7}) b/i
          // Dell Venue Tablets
        ],
        [m, [E, "Dell"], [g, b]],
        [
          /\b(q(?:mv|ta)\w+) b/i
          // Verizon Tablet
        ],
        [m, [E, "Verizon"], [g, b]],
        [
          /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
          // Barnes & Noble Tablet
        ],
        [m, [E, "Barnes & Noble"], [g, b]],
        [
          /\b(tm\d{3}\w+) b/i
        ],
        [m, [E, "NuVision"], [g, b]],
        [
          /\b(k88) b/i
          // ZTE K Series Tablet
        ],
        [m, [E, "ZTE"], [g, b]],
        [
          /\b(nx\d{3}j) b/i
          // ZTE Nubia
        ],
        [m, [E, "ZTE"], [g, _]],
        [
          /\b(gen\d{3}) b.+49h/i
          // Swiss GEN Mobile
        ],
        [m, [E, "Swiss"], [g, _]],
        [
          /\b(zur\d{3}) b/i
          // Swiss ZUR Tablet
        ],
        [m, [E, "Swiss"], [g, b]],
        [
          /\b((zeki)?tb.*\b) b/i
          // Zeki Tablets
        ],
        [m, [E, "Zeki"], [g, b]],
        [
          /\b([yr]\d{2}) b/i,
          /\b(dragon[- ]+touch |dt)(\w{5}) b/i
          // Dragon Touch Tablet
        ],
        [[E, "Dragon Touch"], m, [g, b]],
        [
          /\b(ns-?\w{0,9}) b/i
          // Insignia Tablets
        ],
        [m, [E, "Insignia"], [g, b]],
        [
          /\b((nxa|next)-?\w{0,9}) b/i
          // NextBook Tablets
        ],
        [m, [E, "NextBook"], [g, b]],
        [
          /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
          // Voice Xtreme Phones
        ],
        [[E, "Voice"], m, [g, _]],
        [
          /\b(lvtel\-)?(v1[12]) b/i
          // LvTel Phones
        ],
        [[E, "LvTel"], m, [g, _]],
        [
          /\b(ph-1) /i
          // Essential PH-1
        ],
        [m, [E, "Essential"], [g, _]],
        [
          /\b(v(100md|700na|7011|917g).*\b) b/i
          // Envizen Tablets
        ],
        [m, [E, "Envizen"], [g, b]],
        [
          /\b(trio[-\w\. ]+) b/i
          // MachSpeed Tablets
        ],
        [m, [E, "MachSpeed"], [g, b]],
        [
          /\btu_(1491) b/i
          // Rotor Tablets
        ],
        [m, [E, "Rotor"], [g, b]],
        [
          /(shield[\w ]+) b/i
          // Nvidia Shield Tablets
        ],
        [m, [E, "Nvidia"], [g, b]],
        [
          /(sprint) (\w+)/i
          // Sprint Phones
        ],
        [E, m, [g, _]],
        [
          /(kin\.[onetw]{3})/i
          // Microsoft Kin
        ],
        [[m, /\./g, " "], [E, C], [g, _]],
        [
          /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
          // Zebra
        ],
        [m, [E, pe], [g, b]],
        [
          /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
        ],
        [m, [E, pe], [g, _]],
        [
          ///////////////////
          // CONSOLES
          ///////////////////
          /(ouya)/i,
          // Ouya
          /(nintendo) ([wids3utch]+)/i
          // Nintendo
        ],
        [E, m, [g, w]],
        [
          /droid.+; (shield) bui/i
          // Nvidia
        ],
        [m, [E, "Nvidia"], [g, w]],
        [
          /(playstation [345portablevi]+)/i
          // Playstation
        ],
        [m, [E, K], [g, w]],
        [
          /\b(xbox(?: one)?(?!; xbox))[\); ]/i
          // Microsoft Xbox
        ],
        [m, [E, C], [g, w]],
        [
          ///////////////////
          // SMARTTVS
          ///////////////////
          /smart-tv.+(samsung)/i
          // Samsung
        ],
        [E, [g, I]],
        [
          /hbbtv.+maple;(\d+)/i
        ],
        [[m, /^/, "SmartTV"], [E, Z], [g, I]],
        [
          /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
          // LG SmartTV
        ],
        [[E, Y], [g, I]],
        [
          /(apple) ?tv/i
          // Apple TV
        ],
        [E, [m, ue + " TV"], [g, I]],
        [
          /crkey/i
          // Google Chromecast
        ],
        [[m, S + "cast"], [E, N], [g, I]],
        [
          /droid.+aft(\w)( bui|\))/i
          // Fire TV
        ],
        [m, [E, Q], [g, I]],
        [
          /\(dtv[\);].+(aquos)/i
          // Sharp
        ],
        [m, [E, "Sharp"], [g, I]],
        [
          /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
          // Roku
          /hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i
          // HbbTV devices
        ],
        [[E, it], [m, it], [g, I]],
        [
          /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
          // SmartTV from Unidentified Vendors
        ],
        [[g, I]],
        [
          ///////////////////
          // WEARABLES
          ///////////////////
          /((pebble))app/i
          // Pebble
        ],
        [E, m, [g, P]],
        [
          /droid.+; (glass) \d/i
          // Google Glass
        ],
        [m, [E, N], [g, P]],
        [
          /droid.+; (wt63?0{2,3})\)/i
        ],
        [m, [E, pe], [g, P]],
        [
          /(quest( 2)?)/i
          // Oculus Quest
        ],
        [m, [E, he], [g, P]],
        [
          ///////////////////
          // EMBEDDED
          ///////////////////
          /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
          // Tesla
        ],
        [E, [g, G]],
        [
          ////////////////////
          // MIXED (GENERIC)
          ///////////////////
          /droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i
          // Android Phones from Unidentified Vendors
        ],
        [m, [g, _]],
        [
          /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
          // Android Tablets from Unidentified Vendors
        ],
        [m, [g, b]],
        [
          /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
          // Unidentifiable Tablet
        ],
        [[g, b]],
        [
          /(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i
          // Unidentifiable Mobile
        ],
        [[g, _]],
        [
          /(android[-\w\. ]{0,9});.+buil/i
          // Generic Android Device
        ],
        [m, [E, "Generic"]]
      ],
      engine: [
        [
          /windows.+ edge\/([\w\.]+)/i
          // EdgeHTML
        ],
        [k, [x, D + "HTML"]],
        [
          /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
          // Blink
        ],
        [k, [x, "Blink"]],
        [
          /(presto)\/([\w\.]+)/i,
          // Presto
          /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
          // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
          /ekioh(flow)\/([\w\.]+)/i,
          // Flow
          /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
          // KHTML/Tasman/Links
          /(icab)[\/ ]([23]\.[\d\.]+)/i
          // iCab
        ],
        [x, k],
        [
          /rv\:([\w\.]{1,9})\b.+(gecko)/i
          // Gecko
        ],
        [k, x]
      ],
      os: [
        [
          // Windows
          /microsoft (windows) (vista|xp)/i
          // Windows (iTunes)
        ],
        [x, k],
        [
          /(windows) nt 6\.2; (arm)/i,
          // Windows RT
          /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,
          // Windows Phone
          /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i
        ],
        [x, [k, He, ce]],
        [
          /(win(?=3|9|n)|win 9x )([nt\d\.]+)/i
        ],
        [[x, "Windows"], [k, He, ce]],
        [
          // iOS/macOS
          /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
          // iOS
          /cfnetwork\/.+darwin/i
        ],
        [[k, /_/g, "."], [x, "iOS"]],
        [
          /(mac os x) ?([\w\. ]*)/i,
          /(macintosh|mac_powerpc\b)(?!.+haiku)/i
          // Mac OS
        ],
        [[x, "Mac OS"], [k, /_/g, "."]],
        [
          // Mobile OSes
          /droid ([\w\.]+)\b.+(android[- ]x86)/i
          // Android-x86
        ],
        [k, x],
        [
          // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
          /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
          /(blackberry)\w*\/([\w\.]*)/i,
          // Blackberry
          /(tizen|kaios)[\/ ]([\w\.]+)/i,
          // Tizen/KaiOS
          /\((series40);/i
          // Series 40
        ],
        [x, k],
        [
          /\(bb(10);/i
          // BlackBerry 10
        ],
        [k, [x, j]],
        [
          /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
          // Symbian
        ],
        [k, [x, "Symbian"]],
        [
          /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
          // Firefox OS
        ],
        [k, [x, U + " OS"]],
        [
          /web0s;.+rt(tv)/i,
          /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
          // WebOS
        ],
        [k, [x, "webOS"]],
        [
          // Google Chromecast
          /crkey\/([\d\.]+)/i
          // Google Chromecast
        ],
        [k, [x, S + "cast"]],
        [
          /(cros) [\w]+ ([\w\.]+\w)/i
          // Chromium OS
        ],
        [[x, "Chromium OS"], k],
        [
          // Console
          /(nintendo|playstation) ([wids345portablevuch]+)/i,
          // Nintendo/Playstation
          /(xbox); +xbox ([^\);]+)/i,
          // Microsoft Xbox (360, One, X, S, Series X, Series S)
          // Other
          /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
          // Joli/Palm
          /(mint)[\/\(\) ]?(\w*)/i,
          // Mint
          /(mageia|vectorlinux)[; ]/i,
          // Mageia/VectorLinux
          /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
          // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
          /(hurd|linux) ?([\w\.]*)/i,
          // Hurd/Linux
          /(gnu) ?([\w\.]*)/i,
          // GNU
          /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
          // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
          /(haiku) (\w+)/i
          // Haiku
        ],
        [x, k],
        [
          /(sunos) ?([\w\.\d]*)/i
          // Solaris
        ],
        [[x, "Solaris"], k],
        [
          /((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
          // Solaris
          /(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
          // AIX
          /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,
          // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
          /(unix) ?([\w\.]*)/i
          // UNIX
        ],
        [x, k]
      ]
    }, Ne = function(oe, le) {
      if (typeof oe === A && (le = oe, oe = s), !(this instanceof Ne))
        return new Ne(oe, le).getResult();
      var ne = oe || (typeof r !== R && r.navigator && r.navigator.userAgent ? r.navigator.userAgent : d), me = le ? we(Ve, le) : Ve;
      return this.getBrowser = function() {
        var ae = {};
        return ae[x] = s, ae[k] = s, fe.call(ae, ne, me.browser), ae.major = Ht(ae.version), ae;
      }, this.getCPU = function() {
        var ae = {};
        return ae[y] = s, fe.call(ae, ne, me.cpu), ae;
      }, this.getDevice = function() {
        var ae = {};
        return ae[E] = s, ae[m] = s, ae[g] = s, fe.call(ae, ne, me.device), ae;
      }, this.getEngine = function() {
        var ae = {};
        return ae[x] = s, ae[k] = s, fe.call(ae, ne, me.engine), ae;
      }, this.getOS = function() {
        var ae = {};
        return ae[x] = s, ae[k] = s, fe.call(ae, ne, me.os), ae;
      }, this.getResult = function() {
        return {
          ua: this.getUA(),
          browser: this.getBrowser(),
          engine: this.getEngine(),
          os: this.getOS(),
          device: this.getDevice(),
          cpu: this.getCPU()
        };
      }, this.getUA = function() {
        return ne;
      }, this.setUA = function(ae) {
        return ne = typeof ae === v && ae.length > H ? it(ae, H) : ae, this;
      }, this.setUA(ne), this;
    };
    Ne.VERSION = l, Ne.BROWSER = ee([x, k, O]), Ne.CPU = ee([y]), Ne.DEVICE = ee([m, E, g, w, _, I, b, P, G]), Ne.ENGINE = Ne.OS = ee([x, k]), t.exports && (e = t.exports = Ne), e.UAParser = Ne;
    var Ue = typeof r !== R && (r.jQuery || r.Zepto);
    if (Ue && !Ue.ua) {
      var ge = new Ne();
      Ue.ua = ge.getResult(), Ue.ua.get = function() {
        return ge.getUA();
      }, Ue.ua.set = function(oe) {
        ge.setUA(oe);
        var le = ge.getResult();
        for (var ne in le)
          Ue.ua[ne] = le[ne];
      };
    }
  })(typeof window == "object" ? window : rn);
})(sn, sn.exports);
var Cd = sn.exports;
const Dd = /* @__PURE__ */ ns(Cd), Yt = Dd(), ar = Yt.os.name, Od = ar && ar.toLowerCase().indexOf("android") >= 0, Md = ar && ar.toLowerCase().indexOf("ios") >= 0, $t = Yt.device.type === "mobile" || Od || Md, Nd = "kwai-p";
let Ko = rs.ERROR;
typeof location < "u" && (Ko = jc.loadLogLevel("kwai-player-log") || rs.ERROR, Wc.setLevel(Ko).setName(Nd));
const Rs = Qc.EventEmitter;
var Pd = Object.defineProperty, Ud = (t, e, r) => e in t ? Pd(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Me = (t, e, r) => (Ud(t, typeof e != "symbol" ? e + "" : e, r), r);
const zo = {
  development: "./misc2",
  production: "https://log-sdk.ksapisrv.com/rest/wd/common/log/collect/misc2",
  oversea: "https://logsdk.kwai-pro.com/rest/wd/common/log/collect/misc2",
  "logger-oversea": "https://data-track-sgp.corp.kuaishou.com/rest/wd/common/log/collect/misc2"
}, Fd = 5e3;
var Ai = /* @__PURE__ */ ((t) => (t.SUMMARY = "KP_WEB_SUMMARY", t.REALTIME = "KP_WEB_REALTIME", t.DOWNLOAD = "KP_WEB_DOWNLOAD", t.EVENT = "KP_WEB_EVENT", t))(Ai || {});
const Bd = {
  summary: "KP_WEB_SUMMARY",
  realtimeBeacon: "KP_WEB_REALTIME",
  download: "KP_WEB_DOWNLOAD",
  event: "KP_WEB_EVENT"
  /* EVENT */
}, Ss = "production", Hd = "streamlake", Jo = [
  "summary",
  "realtimeBeacon",
  "download",
  "event"
  /* EVENT */
];
(function() {
  try {
    if (typeof document < "u") {
      var t = document.createElement("style");
      t.appendChild(document.createTextNode("")), document.head.appendChild(t);
    }
  } catch (e) {
    console.error("vite-plugin-css-injected-by-js", e);
  }
})();
var Vd = Object.defineProperty, Gd = (t, e, r) => e in t ? Vd(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, At = (t, e, r) => (Gd(t, typeof e != "symbol" ? e + "" : e, r), r);
const Wd = "ControlsPlugin", jd = "I18nPlugin", Kd = "LoggerPlugin", zd = "HotkeyPlugin", Jd = "PlayInfoPlugin", $d = "RotatePlugin", qd = "PreviewPlugin", Yd = "MaskPlugin", Qd = "VRPlugin", Zd = "DanmakuPlugin";
let pt = class extends Rs {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  static isInstanceOfPlugin(e) {
    return typeof e.beforeInstall == "function" && typeof e.afterInstall == "function" && typeof e.beforeUninstall == "function" && typeof e.afterUninstall == "function" && typeof e.getLabel == "function";
  }
  /**
   * 控制条插槽按钮
   */
  get controlsSoltBtns() {
  }
  /**
   * 播放器实例化前钩子
   * @param player 播放器实例
   * @param options 实例化播放器时指定的当前插件的参数
   */
  beforeInstall(e, r) {
  }
  /**
   * 播放器实例化后钩子
   * @param player 播放器实例
   * @param options 实例化播放器时指定的当前插件的参数
   */
  afterInstall(e, r) {
  }
  /**
   * 播放器销毁前钩子
   * @param player 播放器实例
   */
  beforeUninstall(e) {
  }
  /**
   * 播放器销毁后钩子
   * @param player 播放器实例
   */
  afterUninstall(e) {
  }
};
At(pt, "label"), /**
* 版本
*/
At(pt, "version"), /**
* 当前环境是否支持
*/
At(pt, "isSupported");
const Xd = class Ls extends pt {
  /**
   * @override
   */
  getLabel() {
    return Ls.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
};
At(Xd, "label", Wd);
const eh = class ks extends pt {
  /**
   * @override
   */
  getLabel() {
    return ks.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
};
At(eh, "label", jd);
const Is = class xs extends pt {
  /**
   * @override
   */
  getLabel() {
    return xs.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
  /**
   * 增加业务相关数据
   * @param key 上报数据key
   * @param value 上报数据
   */
  addBizLog(e, r) {
  }
  appendSummaryField(e, r) {
  }
};
At(Is, "label", Kd);
let th = Is;
const ih = class Cs extends pt {
  /**
   * @override
   */
  getLabel() {
    return Cs.label;
  }
};
At(ih, "label", zd);
const rh = class Ds extends pt {
  /**
   * @override
   */
  getLabel() {
    return Ds.label;
  }
};
At(rh, "label", Jd);
const nh = class Os extends pt {
  /**
   * @override
   */
  getLabel() {
    return Os.label;
  }
};
At(nh, "label", $d);
const oh = class Ms extends pt {
  /**
   * @override
   */
  getLabel() {
    return Ms.label;
  }
};
At(oh, "label", qd);
const ah = class Ns extends pt {
  /**
   * @override
   */
  getLabel() {
    return Ns.label;
  }
};
At(ah, "label", Yd);
const sh = class Ps extends pt {
  /**
   * @override
   */
  getLabel() {
    return Ps.label;
  }
};
At(sh, "label", Qd);
const lh = class Us extends pt {
  /**
   * @override
   */
  getLabel() {
    return Us.label;
  }
};
At(lh, "label", Zd);
var ni = /* @__PURE__ */ ((t) => (t.ERROR = "error", t.MANIFEST_PARSED = "manifestparsed", t.LEVEL_SWITCHING = "levelswitching", t.LEVEL_SWITCHED = "levelswitched", t.LEVEL_SWITCH_PLAYING = "levelswitchplaying", t.LEVEL_SWITCH_FAILED = "levelswitchfailed", t.LEVEL_UPDATED = "levelupdated", t.AUDIO_TRACKS_SWITCHING = "audiotrackswitching", t.AUDIO_TRACKS_SWITCHED = "audiotrackswitched", t.LOADSTART = "loadstart", t.PROGRESS = "progress", t.SUSPEND = "suspend", t.ABORT = "abort", t.EMPTIED = "emptied", t.STALLED = "stalled", t.LOADEDMETADATA = "loadedmetadata", t.LOADEDDATA = "loadeddata", t.CANPLAY = "canplay", t.CANPLAYTHROUGH = "canplaythrough", t.PLAYING = "playing", t.WAITING = "waiting", t.SEEKING = "seeking", t.SEEKED = "seeked", t.ENDED = "ended", t.DURATIONCHANGE = "durationchange", t.TIMEUPDATE = "timeupdate", t.PLAY = "play", t.PAUSE = "pause", t.RATECHANGE = "ratechange", t.RESIZE = "resize", t.VOLUMECHANGE = "volumechange", t.ENTER_PICTURE_IN_PICTURE = "enterpictureinpicture", t.LEAVE_PICTURE_IN_PICTURE = "leavepictureinpicture", t.REPORT = "report", t.VIDEO_RENDERER_CHANGE = "videorendererchange", t.FULLSCREEN_CHANGE = "fullscreenchange", t.ATTRIBUTE_CHANGE = "attribute:change", t.INTERACTION = "interaction", t.LIVE_SHIFT_CHANGE = "liveshiftchange", t.LIVE_SHIFT_TYPE_CHANGE = "liveshifttypechange", t.OBJECT_FIT_CHANGE = "objectfitchange", t.ATTRIBUTE_CHANGE_CONFIG = "attribute:change:config", t.ATTRIBUTE_CHANGE_SRC = "attribute:change:src", t.ATTRIBUTE_CHANGE_VIDEO_ID = "attribute:change:videoid", t.ATTRIBUTE_CHANGE_PREVIEW_URL = "attribute:change:previewurl", t.ATTRIBUTE_CHANGE_MASK_URL = "attribute:change:maskurl", t.ATTRIBUTE_CHANGE_CROSS_ORIGIN = "attribute:change:crossorigin", t.ATTRIBUTE_CHANGE_PRELOAD = "attribute:change:preload", t.ATTRIBUTE_CHANGE_CURRENT_TIME = "attribute:change:currenttime", t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE = "attribute:change:defaultplaybackrate", t.ATTRIBUTE_CHANGE_PLAYBACK_RATE = "attribute:change:playbackrate", t.ATTRIBUTE_CHANGE_AUTOPLAY = "attribute:change:autoplay", t.ATTRIBUTE_CHANGE_LOOP = "attribute:change:loop", t.ATTRIBUTE_CHANGE_CONTROLS = "attribute:change:controls", t.ATTRIBUTE_CHANGE_VOLUME = "attribute:change:volume", t.ATTRIBUTE_CHANGE_MUTED = "attribute:change:muted", t.ATTRIBUTE_CHANGE_DEFAULT_MUTED = "attribute:change:defaultmuted", t.ATTRIBUTE_CHANGE_POSTER = "attribute:change:poster", t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE = "attribute:change:disablepictureinpicture", t.ATTRIBUTE_CHANGE_PLAYSINLINE = "attribute:change:playsinline", t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE = "attribute:change:disableadaptive", t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD = "attribute:change:disabledownload", t.ATTRIBUTE_CHANGE_DISABLE_MASK = "attribute:change:disablemask", t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY = "attribute:change:disablehotkey", t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU = "attribute:change:disabledanmaku", t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING = "attribute:change:danmakurendering", t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS = "attribute:change:danmakucontrolspos", t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN = "attribute:change:danmakucontrolsposfullscreen", t.ATTRIBUTE_CHANGE_CURRENT_LEVEL = "attribute:change:currentlevel", t.ATTRIBUTE_CHANGE_NEXT_LEVEL = "attribute:change:nextlevel", t.ATTRIBUTE_CHANGE_CURRENT_FRAME = "attribute:change:currentframe", t.ATTRIBUTE_CHANGE_AUDIO_TRACK = "attribute:change:audiotrack", t.ATTRIBUTE_CHANGE_PREFETCH = "attribute:change:prefetch", t.ATTRIBUTE_CHANGE_SHOW_PROGRESS = "attribute:change:showprogress", t.ATTRIBUTE_CHANGE_SHOW_TIME = "attribute:change:showtime", t.ATTRIBUTE_CHANGE_SHOW_NEXT = "attribute:change:shownext", t.ATTRIBUTE_CHANGE_SHOW_PREV = "attribute:change:showprev", t.ATTRIBUTE_CHANGE_BIZ_DATA = "attribute:change:bizdata", t.ATTRIBUTE_CHANGE_LIVE_TIME = "attribute:change:livetime", t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL = "attribute:change:showinfopanel", t.CLICK_NEXT = "clicknext", t.CLICK_LOGIN = "clicklogin", t.CLICK_REGISTER = "clickregister", t.CLICK_VIP = "clickvip", t))(ni || {}), ji, uh = new Uint8Array(16);
function ch() {
  if (!ji && (ji = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !ji))
    throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
  return ji(uh);
}
const dh = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
function hh(t) {
  return typeof t == "string" && dh.test(t);
}
var st = [];
for (var Gr = 0; Gr < 256; ++Gr)
  st.push((Gr + 256).toString(16).substr(1));
function fh(t) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = (st[t[e + 0]] + st[t[e + 1]] + st[t[e + 2]] + st[t[e + 3]] + "-" + st[t[e + 4]] + st[t[e + 5]] + "-" + st[t[e + 6]] + st[t[e + 7]] + "-" + st[t[e + 8]] + st[t[e + 9]] + "-" + st[t[e + 10]] + st[t[e + 11]] + st[t[e + 12]] + st[t[e + 13]] + st[t[e + 14]] + st[t[e + 15]]).toLowerCase();
  if (!hh(r))
    throw TypeError("Stringified UUID is invalid");
  return r;
}
function Fs(t, e, r) {
  t = t || {};
  var s = t.random || (t.rng || ch)();
  if (s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, e) {
    r = r || 0;
    for (var l = 0; l < 16; ++l)
      e[r + l] = s[l];
    return e;
  }
  return fh(s);
}
const Wr = "log-ctx";
class Ah {
  constructor() {
    Me(this, "_env", Ss), Me(this, "_reportTypes", []), Me(this, "_player"), Me(this, "_logger"), Me(this, "_logBaseInfo", this._getDefaultLogBaseInfo()), Me(this, "_biz", {}), Me(this, "_extraSummaryFields", {}), Me(this, "_forceSendBeacon", !1);
  }
  setBaseInfo(e, r, s) {
    this._player = e, this._logger = e.logger, this._logBaseInfo.env = this._env = r, this._reportTypes = s;
  }
  setBizData(e) {
    var r, s;
    if ((r = this._logger) == null || r.i(Wr, "set biz", e), !e) {
      this._logBaseInfo = this._getDefaultLogBaseInfo();
      return;
    }
    const l = {};
    Object.keys(e).forEach((d) => {
      var f;
      const c = this._underscoreToCamelCase(d), R = e[d];
      if (["sessionId", "deviceId", "userId", "globalId", "networkType", "packageName", "versionName", "channel"].indexOf(c) >= 0 && (typeof R == "string" || typeof R == "number")) {
        const A = this._val2String(e[d]).trim();
        A && ((f = this._logger) == null || f.i(Wr, "biz to log:", c, A), l[c] = A);
      }
      d !== "secretId" && d !== "secretKey" && (this._biz[d] = R);
    }), Object.assign(this._logBaseInfo, l), l.deviceId && ((s = this._logger) == null || s.i(Wr, `update did by bizData. ${l.deviceId}`), xd(this._logBaseInfo.deviceId));
  }
  preprocessingLog(e, r, s) {
    var l, d;
    if (r)
      return r = Object.assign(r, {
        player_version: ((l = this._player) == null ? void 0 : l.version) || "",
        pack_version: ((d = this._player) == null ? void 0 : d.packVersion) || "",
        biz: this._biz
      }), e === Ai.SUMMARY && typeof r == "object" && (s ? r.extra = Object.assign({}, this._extraSummaryFields, s) : r.extra = this._extraSummaryFields), r;
  }
  clearExtraSummary() {
    this._extraSummaryFields = {};
  }
  appendSummaryField(e, r) {
    this._extraSummaryFields[e] = r;
  }
  get reportTypes() {
    return this._reportTypes;
  }
  get logBaseInfo() {
    var e;
    return (e = this._player) != null && e.productName && (this._logBaseInfo.productName = this._player.productName), this._logBaseInfo.deviceId || (this._logBaseInfo.deviceId = or), this._logBaseInfo;
  }
  get player() {
    return this._player;
  }
  set forceSendBeacon(e) {
    this._forceSendBeacon = e;
  }
  get forceSendBeacon() {
    return this._forceSendBeacon;
  }
  _getDefaultLogBaseInfo() {
    let e = 10;
    return Yt.os.name === "iOS" ? e = 9 : Yt.os.name === "Android" && (e = 8), {
      env: this._env,
      productName: Hd,
      sessionId: Fs(),
      platform: e,
      deviceId: or,
      userId: "",
      globalId: "",
      networkType: "",
      packageName: "",
      versionName: "",
      channel: ""
    };
  }
  _underscoreToCamelCase(e) {
    return e.replace(/_([a-z])/g, (r, s) => s.toUpperCase());
  }
  _val2String(e) {
    return typeof e == "number" ? e.toString() : e || "";
  }
}
const jr = "kwai-player-web-log-temp", ph = 3 * 24 * 3600 * 1e3, vh = 5 * 1e3, $o = 1, ti = "log-reissue";
class _h {
  constructor(e, r, s) {
    Me(this, "_ctx"), Me(this, "_logger"), Me(this, "_webLogger"), Me(this, "_active", !1), Me(this, "_processingTs", 0), Me(this, "_lc", new Ts()), Me(this, "_timer", 0), Me(this, "_checkMissing", !1), Me(this, "_tick", () => {
      if (!this._active || !this._ctx.player)
        return;
      this._checkMissing && (this._checkMissing = !1, this._checkMissingLog());
      const l = performance.now();
      if (l - this._processingTs >= vh) {
        this._processingTs = l;
        const d = this._ctx.preprocessingLog(Ai.SUMMARY, this._ctx.player.audienceStat, { reissue_log: 1 });
        d && (this._logger.v(ti, "write temp"), this._writeTemp(this._webLogger.generateFormData(this._ctx.logBaseInfo, [{ key: Ai.SUMMARY, value: d }])));
      }
    }), Me(this, "_startTimer", () => {
      this._timer || (this._timer = +setInterval(this._tick, 1e3));
    }), Me(this, "_stopTimer", () => {
      clearInterval(this._timer), this._timer = 0;
    }), this._ctx = e, this._logger = r, this._webLogger = s, this._lc.timeout = ph;
  }
  start() {
    this._logger.i(ti, "start"), this._active || (this._active = !0, this._processingTs = performance.now(), this._checkMissing = !0, this._startTimer());
  }
  stop() {
    this._logger.i(ti, "stop"), this._active = !1, this._clear(), this._stopTimer();
  }
  _checkMissingLog() {
    const e = this._readTemp();
    this._clear(), e ? (this._logger.i(ti, "send missing log"), this._webLogger.send(this._ctx.logBaseInfo.env, Ai.SUMMARY, e.value)) : this._logger.i(ti, "no missing log");
  }
  _clear() {
    try {
      localStorage == null || localStorage.removeItem(jr);
    } catch (e) {
    }
  }
  _writeTemp(e) {
    if (!e)
      return;
    const r = {
      version: $o,
      value: e,
      checkSum: this._fletcher16(e)
    };
    try {
      this._lc.write(jr, btoa(JSON.stringify(r)));
    } catch (s) {
    }
  }
  _readTemp() {
    const e = this._lc.read(jr, !0);
    if (typeof e == "string")
      try {
        const r = JSON.parse(atob(e));
        if (r.version === $o && typeof r.value == "string" && r.checkSum === this._fletcher16(r.value))
          return this._logger.i(ti, "read success"), r;
        this._logger.i(ti, "read failed", r);
      } catch (r) {
      }
  }
  _fletcher16(e) {
    let r = 0, s = 0;
    for (let l = 0; l < e.length; l++)
      r = (r + e.charCodeAt(l)) % 255, s = (s + r) % 255;
    return s << 8 | r;
  }
}
const qo = {
  unknown: 0,
  none: 1,
  wifi: 2,
  "4g": 3,
  "3g": 4,
  "2g": 5,
  "5g": 7,
  "slow-2g": 5
}, Kr = (/* @__PURE__ */ new Date()).toString().match(/GMT\+\d+/);
let zr = "";
function mh() {
  try {
    return parseInt((localStorage == null ? void 0 : localStorage.getItem("kwai_player_client_increment_id")) || "") || 0;
  } catch (t) {
  }
  return 0;
}
const li = "web-logger", ln = class oi {
  constructor(e) {
    Me(this, "_waitingQueue", []), Me(this, "_nextTickTimer"), Me(this, "_logger"), this._logger = e;
  }
  sendLog(e, r, s, l = !1, d) {
    this._logger.i(li, "sendLog", e, r, s, `forceSendBeacon: ${l} immediately: ${d}`), s && (this._waitingQueue.push({ key: r, value: s }), d ? (this.send(e.env, e.productName, this.generateFormData(e, this._waitingQueue), l), this._waitingQueue.splice(0)) : this._nextTickTimer || (this._nextTickTimer = setTimeout(() => {
      this._nextTickTimer = void 0, this.send(e.env, e.productName, this.generateFormData(e, this._waitingQueue), l), this._waitingQueue.splice(0);
    }, 0)));
  }
  send(e, r, s, l = !1) {
    if (this._logger.i(li, "send", e, r, !!s, `forceSendBeacon: ${l}`), !s)
      return;
    let d = zo[e] || zo.production;
    oi._clientIncrementId++;
    try {
      localStorage && (localStorage.kwai_player_client_increment_id = oi._clientIncrementId);
    } catch (c) {
    }
    const f = new Wo(d, !0);
    if (f.query.v = "3.10.24", f.query.kpn = r, d = f.toString(), this._logger.i(li, "send", e, r, !!s, d), l && navigator.sendBeacon) {
      const c = navigator.sendBeacon(d, s);
      this._logger.i(li, "send data use sendBeacon.", c), c || this._sendByXhr(d, s);
    } else
      this._sendByXhr(d, s);
  }
  _sendByXhr(e, r) {
    this._logger.i(li, "send data use xhr.");
    const s = new XMLHttpRequest();
    s.open("POST", e), s.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"), s.onerror = s.ontimeout = () => {
      this._logger.i("sendLog error"), s.onerror = s.ontimeout = s.onload = null;
    }, s.onload = () => {
      s.onerror = s.ontimeout = s.onload = null;
    }, s.timeout = Fd, s.send(r);
  }
  generateFormData(e, r) {
    this._logger.i(li, `device_id: ${e.deviceId}`);
    const s = {
      common: oi._buildCommon(
        e,
        {
          service_name: "KwaiPlayerWeb"
        }
      ),
      logs: r.map((l) => oi._buildEvent(e, l.key, l.value))
    };
    return s.logs.length ? JSON.stringify(s) : "";
  }
  static _buildEvent(e, r, s) {
    zr || (zr = Fs());
    const l = {
      identity: zr,
      page: location.href,
      hostname: location.hostname,
      page_type: 2,
      params: new Wo(location.href, !0).query
    };
    return {
      client_timestamp: Date.now(),
      client_increment_id: oi._clientIncrementId,
      session_id: e.sessionId,
      time_zone: oi._timeZone,
      stat_package: {
        custom_stat_event: {
          key: r,
          value: JSON.stringify(Object.assign({}, s, { url_package: l }))
        }
      }
    };
  }
  static _buildCommon(e, r) {
    return So({
      identity_package: {
        device_id: e.deviceId,
        global_id: e.globalId,
        user_id: e.userId
      },
      app_package: {
        language: navigator.language,
        platform: e.platform,
        container: e.platform === 10 ? "WEB" : "H5",
        package_name: e.packageName,
        product_name: e.productName,
        version_name: e.versionName,
        channel: e.channel
      },
      device_package: {
        os_version: Yt.os.version,
        model: Yt.os.name,
        ua: navigator.userAgent
      },
      need_encrypt: !1,
      sdk_version: "",
      h5_extra_attr: this._getH5ExtraAttr(e),
      global_attr: "{}",
      network_package: {
        type: this._getNetworkType(e.networkType)
      }
    }, r);
  }
  static _getNetworkType(e) {
    var r;
    const s = e || ((r = (navigator == null ? void 0 : navigator.connection) || (navigator == null ? void 0 : navigator.mozConnection) || (navigator == null ? void 0 : navigator.webkitConnection)) == null ? void 0 : r.effectiveType);
    return s && qo[s] || qo.unknown;
  }
  static _getH5ExtraAttr(e) {
    const r = parseFloat(devicePixelRatio.toFixed(3)) || 1;
    return JSON.stringify({
      sdk_name: "",
      sdk_version: "",
      sdk_bundle: "",
      app_version_name: e.versionName,
      resolution: `${Math.floor(screen.width * r)}x${Math.floor(screen.height * r)}`,
      screen_width: Math.floor(screen.width),
      screen_height: Math.floor(screen.height),
      device_pixel_ratio: r,
      domain: location.origin,
      fromIframe: self !== top
    });
  }
};
Me(ln, "_clientIncrementId", mh()), Me(ln, "_timeZone", Kr && Kr[0] ? Kr[0] : "");
let gh = ln;
const Ti = "logger-plugin";
class Bs extends th {
  constructor() {
    super(...arguments), Me(this, "_summaryAlreadySend", !1), Me(this, "_webLogger"), Me(this, "_logger"), Me(this, "_ctx", new Ah()), Me(this, "_logReissue"), Me(this, "_parseBizData", () => {
      var e, r, s;
      (r = this._logger) == null || r.i(Ti, "parse biz data", (e = this._ctx.player) == null ? void 0 : e.bizData), this._ctx.setBizData((s = this._ctx.player) == null ? void 0 : s.bizData);
    }), Me(this, "_onReport", (e) => {
      var r, s;
      if (this._ctx.reportTypes.indexOf(e.type) !== -1) {
        const l = Bd[e.type];
        l ? ((r = this._logger) == null || r.i(Ti, "sendLog", this._ctx.logBaseInfo.productName, l), this._send(l, e.value)) : (s = this._logger) == null || s.i(Ti, "unknown weblogger key.");
      }
    }), Me(this, "_onSrcChange", () => {
      var e;
      this._sendSummary(), this._summaryAlreadySend = !1, (e = this._logReissue) == null || e.start();
    }), Me(this, "_sendSummary", () => {
      var e, r;
      !this._ctx.player || this._summaryAlreadySend || !this._ctx.player.audienceStat || ((e = this._logReissue) == null || e.stop(), this._summaryAlreadySend = !0, (r = this._logger) == null || r.i(Ti, "send summary"), this._send(Ai.SUMMARY, this._ctx.player.audienceStat, !0));
    }), Me(this, "_onBeforeunload", () => {
      this._sendSummary();
    });
  }
  beforeInstall(e, r) {
    let s;
    r && r.reportTypes && Array.isArray(r.reportTypes) && (s = r.reportTypes.filter((l) => Jo.indexOf(l) >= 0)), r != null && r.productName && (e.productName = r.productName), typeof (r == null ? void 0 : r.forceSendBeacon) < "u" && (this._ctx.forceSendBeacon = r.forceSendBeacon), this._logger = e.logger, this._ctx.setBaseInfo(e, (r == null ? void 0 : r.env) || Ss, s || Jo), this._webLogger || (this._webLogger = new gh(e.logger)), this._logReissue = new _h(this._ctx, e.logger, this._webLogger), e.on(ni.REPORT, this._onReport), e.on(ni.ATTRIBUTE_CHANGE_SRC, this._onSrcChange), e.on(ni.ATTRIBUTE_CHANGE_BIZ_DATA, this._parseBizData), window.addEventListener("beforeunload", this._onBeforeunload), Yt && Yt.device.type === "mobile" && window.addEventListener("unload", this._onBeforeunload), this._parseBizData();
  }
  beforeUninstall() {
    this._sendSummary();
  }
  afterUninstall() {
    var e, r, s;
    (e = this._ctx.player) == null || e.off(ni.REPORT, this._onReport), (r = this._ctx.player) == null || r.off(ni.ATTRIBUTE_CHANGE_SRC, this._onSrcChange), (s = this._ctx.player) == null || s.off(ni.ATTRIBUTE_CHANGE_BIZ_DATA, this._parseBizData), window.removeEventListener("beforeunload", this._onBeforeunload), window.removeEventListener("unload", this._onBeforeunload);
  }
  appendSummaryField(e, r) {
    var s;
    (s = this._logger) == null || s.i(Ti, "add summary field", e, r), this._ctx.appendSummaryField(e, r);
  }
  _send(e, r, s) {
    var l;
    r && ((l = this._webLogger) == null || l.sendLog(this._ctx.logBaseInfo, e, this._ctx.preprocessingLog(e, r), this._ctx.forceSendBeacon, s));
  }
}
Me(Bs, "version", "1.1.0-alpha.0");
var pr, Ee, Hs, ai, Yo, Vs, un, Gs, sr = {}, Ws = [], yh = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
function qt(t, e) {
  for (var r in e)
    t[r] = e[r];
  return t;
}
function js(t) {
  var e = t.parentNode;
  e && e.removeChild(t);
}
function bh(t, e, r) {
  var s, l, d, f = {};
  for (d in e)
    d == "key" ? s = e[d] : d == "ref" ? l = e[d] : f[d] = e[d];
  if (arguments.length > 2 && (f.children = arguments.length > 3 ? pr.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null)
    for (d in t.defaultProps)
      f[d] === void 0 && (f[d] = t.defaultProps[d]);
  return Yi(t, f, s, l, null);
}
function Yi(t, e, r, s, l) {
  var d = { type: t, props: e, key: r, ref: s, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: l == null ? ++Hs : l };
  return l == null && Ee.vnode != null && Ee.vnode(d), d;
}
function Di(t) {
  return t.children;
}
function Qi(t, e) {
  this.props = t, this.context = e;
}
function xi(t, e) {
  if (e == null)
    return t.__ ? xi(t.__, t.__.__k.indexOf(t) + 1) : null;
  for (var r; e < t.__k.length; e++)
    if ((r = t.__k[e]) != null && r.__e != null)
      return r.__e;
  return typeof t.type == "function" ? xi(t) : null;
}
function Ks(t) {
  var e, r;
  if ((t = t.__) != null && t.__c != null) {
    for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++)
      if ((r = t.__k[e]) != null && r.__e != null) {
        t.__e = t.__c.base = r.__e;
        break;
      }
    return Ks(t);
  }
}
function cn(t) {
  (!t.__d && (t.__d = !0) && ai.push(t) && !lr.__r++ || Yo !== Ee.debounceRendering) && ((Yo = Ee.debounceRendering) || Vs)(lr);
}
function lr() {
  var t, e, r, s, l, d, f, c;
  for (ai.sort(un); t = ai.shift(); )
    t.__d && (e = ai.length, s = void 0, l = void 0, f = (d = (r = t).__v).__e, (c = r.__P) && (s = [], (l = qt({}, d)).__v = d.__v + 1, gn(c, d, l, r.__n, c.ownerSVGElement !== void 0, d.__h != null ? [f] : null, s, f == null ? xi(d) : f, d.__h), Ys(s, d), d.__e != f && Ks(d)), ai.length > e && ai.sort(un));
  lr.__r = 0;
}
function zs(t, e, r, s, l, d, f, c, R, A) {
  var v, O, m, x, g, E, k, y = s && s.__k || Ws, w = y.length;
  for (r.__k = [], v = 0; v < e.length; v++)
    if ((x = r.__k[v] = (x = e[v]) == null || typeof x == "boolean" || typeof x == "function" ? null : typeof x == "string" || typeof x == "number" || typeof x == "bigint" ? Yi(null, x, null, null, x) : Array.isArray(x) ? Yi(Di, { children: x }, null, null, null) : x.__b > 0 ? Yi(x.type, x.props, x.key, x.ref ? x.ref : null, x.__v) : x) != null) {
      if (x.__ = r, x.__b = r.__b + 1, (m = y[v]) === null || m && x.key == m.key && x.type === m.type)
        y[v] = void 0;
      else
        for (O = 0; O < w; O++) {
          if ((m = y[O]) && x.key == m.key && x.type === m.type) {
            y[O] = void 0;
            break;
          }
          m = null;
        }
      gn(t, x, m = m || sr, l, d, f, c, R, A), g = x.__e, (O = x.ref) && m.ref != O && (k || (k = []), m.ref && k.push(m.ref, null, x), k.push(O, x.__c || g, x)), g != null ? (E == null && (E = g), typeof x.type == "function" && x.__k === m.__k ? x.__d = R = Js(x, R, t) : R = $s(t, x, m, y, g, R), typeof r.type == "function" && (r.__d = R)) : R && m.__e == R && R.parentNode != t && (R = xi(m));
    }
  for (r.__e = E, v = w; v--; )
    y[v] != null && (typeof r.type == "function" && y[v].__e != null && y[v].__e == r.__d && (r.__d = qs(s).nextSibling), Zs(y[v], y[v]));
  if (k)
    for (v = 0; v < k.length; v++)
      Qs(k[v], k[++v], k[++v]);
}
function Js(t, e, r) {
  for (var s, l = t.__k, d = 0; l && d < l.length; d++)
    (s = l[d]) && (s.__ = t, e = typeof s.type == "function" ? Js(s, e, r) : $s(r, s, s, l, s.__e, e));
  return e;
}
function $s(t, e, r, s, l, d) {
  var f, c, R;
  if (e.__d !== void 0)
    f = e.__d, e.__d = void 0;
  else if (r == null || l != d || l.parentNode == null)
    e:
      if (d == null || d.parentNode !== t)
        t.appendChild(l), f = null;
      else {
        for (c = d, R = 0; (c = c.nextSibling) && R < s.length; R += 1)
          if (c == l)
            break e;
        t.insertBefore(l, d), f = d;
      }
  return f !== void 0 ? f : l.nextSibling;
}
function qs(t) {
  var e, r, s;
  if (t.type == null || typeof t.type == "string")
    return t.__e;
  if (t.__k) {
    for (e = t.__k.length - 1; e >= 0; e--)
      if ((r = t.__k[e]) && (s = qs(r)))
        return s;
  }
  return null;
}
function Eh(t, e, r, s, l) {
  var d;
  for (d in r)
    d === "children" || d === "key" || d in e || ur(t, d, null, r[d], s);
  for (d in e)
    l && typeof e[d] != "function" || d === "children" || d === "key" || d === "value" || d === "checked" || r[d] === e[d] || ur(t, d, e[d], r[d], s);
}
function Qo(t, e, r) {
  e[0] === "-" ? t.setProperty(e, r == null ? "" : r) : t[e] = r == null ? "" : typeof r != "number" || yh.test(e) ? r : r + "px";
}
function ur(t, e, r, s, l) {
  var d;
  e:
    if (e === "style")
      if (typeof r == "string")
        t.style.cssText = r;
      else {
        if (typeof s == "string" && (t.style.cssText = s = ""), s)
          for (e in s)
            r && e in r || Qo(t.style, e, "");
        if (r)
          for (e in r)
            s && r[e] === s[e] || Qo(t.style, e, r[e]);
      }
    else if (e[0] === "o" && e[1] === "n")
      d = e !== (e = e.replace(/Capture$/, "")), e = e.toLowerCase() in t ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + d] = r, r ? s || t.addEventListener(e, d ? Xo : Zo, d) : t.removeEventListener(e, d ? Xo : Zo, d);
    else if (e !== "dangerouslySetInnerHTML") {
      if (l)
        e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
      else if (e !== "width" && e !== "height" && e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e in t)
        try {
          t[e] = r == null ? "" : r;
          break e;
        } catch (f) {
        }
      typeof r == "function" || (r == null || r === !1 && e[4] !== "-" ? t.removeAttribute(e) : t.setAttribute(e, r));
    }
}
function Zo(t) {
  return this.l[t.type + !1](Ee.event ? Ee.event(t) : t);
}
function Xo(t) {
  return this.l[t.type + !0](Ee.event ? Ee.event(t) : t);
}
function gn(t, e, r, s, l, d, f, c, R) {
  var A, v, O, m, x, g, E, k, y, w, _, b, I, P, G, H = e.type;
  if (e.constructor !== void 0)
    return null;
  r.__h != null && (R = r.__h, c = e.__e = r.__e, e.__h = null, d = [c]), (A = Ee.__b) && A(e);
  try {
    e:
      if (typeof H == "function") {
        if (k = e.props, y = (A = H.contextType) && s[A.__c], w = A ? y ? y.props.value : A.__ : s, r.__c ? E = (v = e.__c = r.__c).__ = v.__E : ("prototype" in H && H.prototype.render ? e.__c = v = new H(k, w) : (e.__c = v = new Qi(k, w), v.constructor = H, v.render = Th), y && y.sub(v), v.props = k, v.state || (v.state = {}), v.context = w, v.__n = s, O = v.__d = !0, v.__h = [], v._sb = []), v.__s == null && (v.__s = v.state), H.getDerivedStateFromProps != null && (v.__s == v.state && (v.__s = qt({}, v.__s)), qt(v.__s, H.getDerivedStateFromProps(k, v.__s))), m = v.props, x = v.state, v.__v = e, O)
          H.getDerivedStateFromProps == null && v.componentWillMount != null && v.componentWillMount(), v.componentDidMount != null && v.__h.push(v.componentDidMount);
        else {
          if (H.getDerivedStateFromProps == null && k !== m && v.componentWillReceiveProps != null && v.componentWillReceiveProps(k, w), !v.__e && v.shouldComponentUpdate != null && v.shouldComponentUpdate(k, v.__s, w) === !1 || e.__v === r.__v) {
            for (e.__v !== r.__v && (v.props = k, v.state = v.__s, v.__d = !1), v.__e = !1, e.__e = r.__e, e.__k = r.__k, e.__k.forEach(function(Q) {
              Q && (Q.__ = e);
            }), _ = 0; _ < v._sb.length; _++)
              v.__h.push(v._sb[_]);
            v._sb = [], v.__h.length && f.push(v);
            break e;
          }
          v.componentWillUpdate != null && v.componentWillUpdate(k, v.__s, w), v.componentDidUpdate != null && v.__h.push(function() {
            v.componentDidUpdate(m, x, g);
          });
        }
        if (v.context = w, v.props = k, v.__P = t, b = Ee.__r, I = 0, "prototype" in H && H.prototype.render) {
          for (v.state = v.__s, v.__d = !1, b && b(e), A = v.render(v.props, v.state, v.context), P = 0; P < v._sb.length; P++)
            v.__h.push(v._sb[P]);
          v._sb = [];
        } else
          do
            v.__d = !1, b && b(e), A = v.render(v.props, v.state, v.context), v.state = v.__s;
          while (v.__d && ++I < 25);
        v.state = v.__s, v.getChildContext != null && (s = qt(qt({}, s), v.getChildContext())), O || v.getSnapshotBeforeUpdate == null || (g = v.getSnapshotBeforeUpdate(m, x)), G = A != null && A.type === Di && A.key == null ? A.props.children : A, zs(t, Array.isArray(G) ? G : [G], e, r, s, l, d, f, c, R), v.base = e.__e, e.__h = null, v.__h.length && f.push(v), E && (v.__E = v.__ = null), v.__e = !1;
      } else
        d == null && e.__v === r.__v ? (e.__k = r.__k, e.__e = r.__e) : e.__e = wh(r.__e, e, r, s, l, d, f, R);
    (A = Ee.diffed) && A(e);
  } catch (Q) {
    e.__v = null, (R || d != null) && (e.__e = c, e.__h = !!R, d[d.indexOf(c)] = null), Ee.__e(Q, e, r);
  }
}
function Ys(t, e) {
  Ee.__c && Ee.__c(e, t), t.some(function(r) {
    try {
      t = r.__h, r.__h = [], t.some(function(s) {
        s.call(r);
      });
    } catch (s) {
      Ee.__e(s, r.__v);
    }
  });
}
function wh(t, e, r, s, l, d, f, c) {
  var R, A, v, O = r.props, m = e.props, x = e.type, g = 0;
  if (x === "svg" && (l = !0), d != null) {
    for (; g < d.length; g++)
      if ((R = d[g]) && "setAttribute" in R == !!x && (x ? R.localName === x : R.nodeType === 3)) {
        t = R, d[g] = null;
        break;
      }
  }
  if (t == null) {
    if (x === null)
      return document.createTextNode(m);
    t = l ? document.createElementNS("http://www.w3.org/2000/svg", x) : document.createElement(x, m.is && m), d = null, c = !1;
  }
  if (x === null)
    O === m || c && t.data === m || (t.data = m);
  else {
    if (d = d && pr.call(t.childNodes), A = (O = r.props || sr).dangerouslySetInnerHTML, v = m.dangerouslySetInnerHTML, !c) {
      if (d != null)
        for (O = {}, g = 0; g < t.attributes.length; g++)
          O[t.attributes[g].name] = t.attributes[g].value;
      (v || A) && (v && (A && v.__html == A.__html || v.__html === t.innerHTML) || (t.innerHTML = v && v.__html || ""));
    }
    if (Eh(t, m, O, l, c), v)
      e.__k = [];
    else if (g = e.props.children, zs(t, Array.isArray(g) ? g : [g], e, r, s, l && x !== "foreignObject", d, f, d ? d[0] : r.__k && xi(r, 0), c), d != null)
      for (g = d.length; g--; )
        d[g] != null && js(d[g]);
    c || ("value" in m && (g = m.value) !== void 0 && (g !== t.value || x === "progress" && !g || x === "option" && g !== O.value) && ur(t, "value", g, O.value, !1), "checked" in m && (g = m.checked) !== void 0 && g !== t.checked && ur(t, "checked", g, O.checked, !1));
  }
  return t;
}
function Qs(t, e, r) {
  try {
    typeof t == "function" ? t(e) : t.current = e;
  } catch (s) {
    Ee.__e(s, r);
  }
}
function Zs(t, e, r) {
  var s, l;
  if (Ee.unmount && Ee.unmount(t), (s = t.ref) && (s.current && s.current !== t.__e || Qs(s, null, e)), (s = t.__c) != null) {
    if (s.componentWillUnmount)
      try {
        s.componentWillUnmount();
      } catch (d) {
        Ee.__e(d, e);
      }
    s.base = s.__P = null, t.__c = void 0;
  }
  if (s = t.__k)
    for (l = 0; l < s.length; l++)
      s[l] && Zs(s[l], e, r || typeof t.type != "function");
  r || t.__e == null || js(t.__e), t.__ = t.__e = t.__d = void 0;
}
function Th(t, e, r) {
  return this.constructor(t, r);
}
function ea(t, e, r) {
  var s, l, d;
  Ee.__ && Ee.__(t, e), l = (s = typeof r == "function") ? null : r && r.__k || e.__k, d = [], gn(e, t = (!s && r || e).__k = bh(Di, null, [t]), l || sr, sr, e.ownerSVGElement !== void 0, !s && r ? [r] : l ? null : e.firstChild ? pr.call(e.childNodes) : null, d, !s && r ? r : l ? l.__e : e.firstChild, s), Ys(d, t);
}
function Rh(t, e) {
  var r = { __c: e = "__cC" + Gs++, __: t, Consumer: function(s, l) {
    return s.children(l);
  }, Provider: function(s) {
    var l, d;
    return this.getChildContext || (l = [], (d = {})[e] = this, this.getChildContext = function() {
      return d;
    }, this.shouldComponentUpdate = function(f) {
      this.props.value !== f.value && l.some(function(c) {
        c.__e = !0, cn(c);
      });
    }, this.sub = function(f) {
      l.push(f);
      var c = f.componentWillUnmount;
      f.componentWillUnmount = function() {
        l.splice(l.indexOf(f), 1), c && c.call(f);
      };
    }), s.children;
  } };
  return r.Provider.__ = r.Consumer.contextType = r;
}
pr = Ws.slice, Ee = { __e: function(t, e, r, s) {
  for (var l, d, f; e = e.__; )
    if ((l = e.__c) && !l.__)
      try {
        if ((d = l.constructor) && d.getDerivedStateFromError != null && (l.setState(d.getDerivedStateFromError(t)), f = l.__d), l.componentDidCatch != null && (l.componentDidCatch(t, s || {}), f = l.__d), f)
          return l.__E = l;
      } catch (c) {
        t = c;
      }
  throw t;
} }, Hs = 0, Qi.prototype.setState = function(t, e) {
  var r;
  r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = qt({}, this.state), typeof t == "function" && (t = t(qt({}, r), this.props)), t && qt(r, t), t != null && this.__v && (e && this._sb.push(e), cn(this));
}, Qi.prototype.forceUpdate = function(t) {
  this.__v && (this.__e = !0, t && this.__h.push(t), cn(this));
}, Qi.prototype.render = Di, ai = [], Vs = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, un = function(t, e) {
  return t.__v.__b - e.__v.__b;
}, lr.__r = 0, Gs = 0;
var Sh = 0;
function Se(t, e, r, s, l, d) {
  var f, c, R = {};
  for (c in e)
    c == "ref" ? f = e[c] : R[c] = e[c];
  var A = { type: t, props: R, key: r, ref: f, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Sh, __source: l, __self: d };
  if (typeof t == "function" && (f = t.defaultProps))
    for (c in f)
      R[c] === void 0 && (R[c] = f[c]);
  return Ee.vnode && Ee.vnode(A), A;
}
var gi, We, Jr, ta, Ci = 0, Xs = [], Zi = [], ia = Ee.__b, ra = Ee.__r, na = Ee.diffed, oa = Ee.__c, aa = Ee.unmount;
function Oi(t, e) {
  Ee.__h && Ee.__h(We, t, Ci || e), Ci = 0;
  var r = We.__H || (We.__H = { __: [], __h: [] });
  return t >= r.__.length && r.__.push({ __V: Zi }), r.__[t];
}
function tt(t) {
  return Ci = 1, Lh(tl, t);
}
function Lh(t, e, r) {
  var s = Oi(gi++, 2);
  if (s.t = t, !s.__c && (s.__ = [r ? r(e) : tl(void 0, e), function(c) {
    var R = s.__N ? s.__N[0] : s.__[0], A = s.t(R, c);
    R !== A && (s.__N = [A, s.__[1]], s.__c.setState({}));
  }], s.__c = We, !We.u)) {
    var l = function(c, R, A) {
      if (!s.__c.__H)
        return !0;
      var v = s.__c.__H.__.filter(function(m) {
        return m.__c;
      });
      if (v.every(function(m) {
        return !m.__N;
      }))
        return !d || d.call(this, c, R, A);
      var O = !1;
      return v.forEach(function(m) {
        if (m.__N) {
          var x = m.__[0];
          m.__ = m.__N, m.__N = void 0, x !== m.__[0] && (O = !0);
        }
      }), !(!O && s.__c.props === c) && (!d || d.call(this, c, R, A));
    };
    We.u = !0;
    var d = We.shouldComponentUpdate, f = We.componentWillUpdate;
    We.componentWillUpdate = function(c, R, A) {
      if (this.__e) {
        var v = d;
        d = void 0, l(c, R, A), d = v;
      }
      f && f.call(this, c, R, A);
    }, We.shouldComponentUpdate = l;
  }
  return s.__N || s.__;
}
function yn(t, e) {
  var r = Oi(gi++, 3);
  !Ee.__s && bn(r.__H, e) && (r.__ = t, r.i = e, We.__H.__h.push(r));
}
function kh(t, e) {
  var r = Oi(gi++, 4);
  !Ee.__s && bn(r.__H, e) && (r.__ = t, r.i = e, We.__h.push(r));
}
function dn(t) {
  return Ci = 5, el(function() {
    return { current: t };
  }, []);
}
function el(t, e) {
  var r = Oi(gi++, 7);
  return bn(r.__H, e) ? (r.__V = t(), r.i = e, r.__h = t, r.__V) : r.__;
}
function ui(t, e) {
  return Ci = 8, el(function() {
    return t;
  }, e);
}
function Ih(t) {
  var e = We.context[t.__c], r = Oi(gi++, 9);
  return r.c = t, e ? (r.__ == null && (r.__ = !0, e.sub(We)), e.props.value) : t.__;
}
function xh() {
  for (var t; t = Xs.shift(); )
    if (t.__P && t.__H)
      try {
        t.__H.__h.forEach(Xi), t.__H.__h.forEach(hn), t.__H.__h = [];
      } catch (e) {
        t.__H.__h = [], Ee.__e(e, t.__v);
      }
}
Ee.__b = function(t) {
  We = null, ia && ia(t);
}, Ee.__r = function(t) {
  ra && ra(t), gi = 0;
  var e = (We = t.__c).__H;
  e && (Jr === We ? (e.__h = [], We.__h = [], e.__.forEach(function(r) {
    r.__N && (r.__ = r.__N), r.__V = Zi, r.__N = r.i = void 0;
  })) : (e.__h.forEach(Xi), e.__h.forEach(hn), e.__h = [])), Jr = We;
}, Ee.diffed = function(t) {
  na && na(t);
  var e = t.__c;
  e && e.__H && (e.__H.__h.length && (Xs.push(e) !== 1 && ta === Ee.requestAnimationFrame || ((ta = Ee.requestAnimationFrame) || Ch)(xh)), e.__H.__.forEach(function(r) {
    r.i && (r.__H = r.i), r.__V !== Zi && (r.__ = r.__V), r.i = void 0, r.__V = Zi;
  })), Jr = We = null;
}, Ee.__c = function(t, e) {
  e.some(function(r) {
    try {
      r.__h.forEach(Xi), r.__h = r.__h.filter(function(s) {
        return !s.__ || hn(s);
      });
    } catch (s) {
      e.some(function(l) {
        l.__h && (l.__h = []);
      }), e = [], Ee.__e(s, r.__v);
    }
  }), oa && oa(t, e);
}, Ee.unmount = function(t) {
  aa && aa(t);
  var e, r = t.__c;
  r && r.__H && (r.__H.__.forEach(function(s) {
    try {
      Xi(s);
    } catch (l) {
      e = l;
    }
  }), r.__H = void 0, e && Ee.__e(e, r.__v));
};
var sa = typeof requestAnimationFrame == "function";
function Ch(t) {
  var e, r = function() {
    clearTimeout(s), sa && cancelAnimationFrame(e), setTimeout(t);
  }, s = setTimeout(r, 100);
  sa && (e = requestAnimationFrame(r));
}
function Xi(t) {
  var e = We, r = t.__c;
  typeof r == "function" && (t.__c = void 0, r()), We = e;
}
function hn(t) {
  var e = We;
  t.__c = t.__(), We = e;
}
function bn(t, e) {
  return !t || t.length !== e.length || e.some(function(r, s) {
    return r !== t[s];
  });
}
function tl(t, e) {
  return typeof e == "function" ? e(t) : e;
}
(function() {
  try {
    if (typeof document != "undefined") {
      var t = document.createElement("style");
      t.appendChild(document.createTextNode("._container_afsrn_1{background-color:rgba(0,0,0,.5);border-radius:.375em;position:relative;color:#fff;font-size:12px;font-family:Arial,Roboto,Noto,sans-serif;box-sizing:border-box;padding:2em .625em .625em;overflow:auto;word-break:break-all;white-space:normal;max-width:500px;max-height:calc(100% - 10px);line-height:1.5;margin:.3125em}._container-h5_afsrn_19{background-color:rgba(0,0,0,.5);border-radius:.375em;position:relative;color:#fff;font-size:12px;font-family:Arial,Roboto,Noto,sans-serif;box-sizing:border-box;padding:2em .625em .625em;overflow:auto;word-break:break-all;white-space:normal;font-size:14px;width:100%;height:100%}._close-btn_afsrn_36{position:absolute;right:0;top:0;cursor:pointer;word-break:keep-all;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:.625em}._btn-tip_afsrn_49{background-color:rgba(0,0,0,.5);border-radius:.375em;position:absolute;left:50%;transform:translate(-50%);bottom:2.1875em;white-space:nowrap;padding:.5em}._actions_afsrn_60{display:flex;justify-content:flex-end;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:0}._actions_afsrn_60 ._copy-btn_afsrn_69{word-break:keep-all;cursor:pointer;padding:.625em 0 0 .625em}._info-item_afsrn_75{display:flex}._info-item-name_afsrn_79{width:20%;min-width:7.5em;text-align:right;margin-right:.625em;flex-shrink:0}._info-item-value_afsrn_87{flex-grow:1;text-align:left}._item-svg_afsrn_92{display:inline-block;width:60%;height:1em;margin-right:.625em;background:rgba(255,255,255,.2)}._item-value_afsrn_100{display:inline-block}@media (hover: hover){._close-btn_afsrn_36:hover,._copy-btn_afsrn_69:hover{color:#ccc}}")), document.head.appendChild(t);
    }
  } catch (e) {
    console.error("vite-plugin-css-injected-by-js", e);
  }
})();
var Dh = Object.defineProperty, Oh = (t, e, r) => e in t ? Dh(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Jt = (t, e, r) => (Oh(t, typeof e != "symbol" ? e + "" : e, r), r);
(function() {
  try {
    if (typeof document < "u") {
      var t = document.createElement("style");
      t.appendChild(document.createTextNode("")), document.head.appendChild(t);
    }
  } catch (e) {
    console.error("vite-plugin-css-injected-by-js", e);
  }
})();
var Mh = Object.defineProperty, Nh = (t, e, r) => e in t ? Mh(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ct = (t, e, r) => (Nh(t, typeof e != "symbol" ? e + "" : e, r), r);
const Ph = "ControlsPlugin", il = "I18nPlugin", Uh = "LoggerPlugin", Fh = "HotkeyPlugin", Bh = "PlayInfoPlugin", Hh = "RotatePlugin", Vh = "PreviewPlugin", Gh = "MaskPlugin", Wh = "VRPlugin", jh = "DanmakuPlugin";
var fn = /* @__PURE__ */ ((t) => (t.PLAY_BAR_LEFT = "playBarLeft", t.PLAY_BAR_RIGHT = "playBarRight", t.CONTEXT_MENU = "contextMenu", t))(fn || {});
class Kh {
  constructor() {
    ct(this, "_callbacks", []);
  }
  add(e) {
    this._callbacks.push(e);
  }
  remove(e) {
    const r = this._callbacks.findIndex((s) => s === e);
    r >= 0 && this._callbacks.splice(r, 1);
  }
  call(e) {
    this._callbacks.forEach((r) => r(e));
  }
  destroy() {
    this._callbacks.splice(0, this._callbacks.length);
  }
}
class vt extends Rs {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  static isInstanceOfPlugin(e) {
    return typeof e.beforeInstall == "function" && typeof e.afterInstall == "function" && typeof e.beforeUninstall == "function" && typeof e.afterUninstall == "function" && typeof e.getLabel == "function";
  }
  /**
   * 控制条插槽按钮
   */
  get controlsSoltBtns() {
  }
  /**
   * 播放器实例化前钩子
   * @param player 播放器实例
   * @param options 实例化播放器时指定的当前插件的参数
   */
  beforeInstall(e, r) {
  }
  /**
   * 播放器实例化后钩子
   * @param player 播放器实例
   * @param options 实例化播放器时指定的当前插件的参数
   */
  afterInstall(e, r) {
  }
  /**
   * 播放器销毁前钩子
   * @param player 播放器实例
   */
  beforeUninstall(e) {
  }
  /**
   * 播放器销毁后钩子
   * @param player 播放器实例
   */
  afterUninstall(e) {
  }
}
ct(vt, "label"), /**
* 版本
*/
ct(vt, "version"), /**
* 当前环境是否支持
*/
ct(vt, "isSupported");
const zh = class rl extends vt {
  /**
   * @override
   */
  getLabel() {
    return rl.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
};
ct(zh, "label", Ph);
const Jh = class nl extends vt {
  /**
   * @override
   */
  getLabel() {
    return nl.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
};
ct(Jh, "label", il);
const $h = class ol extends vt {
  /**
   * @override
   */
  getLabel() {
    return ol.label;
  }
  beforeInstall(e, r) {
  }
  afterInstall(e, r) {
  }
  /**
   * 增加业务相关数据
   * @param key 上报数据key
   * @param value 上报数据
   */
  addBizLog(e, r) {
  }
  appendSummaryField(e, r) {
  }
};
ct($h, "label", Uh);
const qh = class al extends vt {
  /**
   * @override
   */
  getLabel() {
    return al.label;
  }
};
ct(qh, "label", Fh);
const sl = class ll extends vt {
  /**
   * @override
   */
  getLabel() {
    return ll.label;
  }
};
ct(sl, "label", Bh);
let Yh = sl;
const Qh = class ul extends vt {
  /**
   * @override
   */
  getLabel() {
    return ul.label;
  }
};
ct(Qh, "label", Hh);
const Zh = class cl extends vt {
  /**
   * @override
   */
  getLabel() {
    return cl.label;
  }
};
ct(Zh, "label", Vh);
const Xh = class dl extends vt {
  /**
   * @override
   */
  getLabel() {
    return dl.label;
  }
};
ct(Xh, "label", Gh);
const ef = class hl extends vt {
  /**
   * @override
   */
  getLabel() {
    return hl.label;
  }
};
ct(ef, "label", Wh);
const tf = class fl extends vt {
  /**
   * @override
   */
  getLabel() {
    return fl.label;
  }
};
ct(tf, "label", jh);
var Ut = /* @__PURE__ */ ((t) => (t.ERROR = "error", t.MANIFEST_PARSED = "manifestparsed", t.LEVEL_SWITCHING = "levelswitching", t.LEVEL_SWITCHED = "levelswitched", t.LEVEL_SWITCH_PLAYING = "levelswitchplaying", t.LEVEL_SWITCH_FAILED = "levelswitchfailed", t.LEVEL_UPDATED = "levelupdated", t.AUDIO_TRACKS_SWITCHING = "audiotrackswitching", t.AUDIO_TRACKS_SWITCHED = "audiotrackswitched", t.LOADSTART = "loadstart", t.PROGRESS = "progress", t.SUSPEND = "suspend", t.ABORT = "abort", t.EMPTIED = "emptied", t.STALLED = "stalled", t.LOADEDMETADATA = "loadedmetadata", t.LOADEDDATA = "loadeddata", t.CANPLAY = "canplay", t.CANPLAYTHROUGH = "canplaythrough", t.PLAYING = "playing", t.WAITING = "waiting", t.SEEKING = "seeking", t.SEEKED = "seeked", t.ENDED = "ended", t.DURATIONCHANGE = "durationchange", t.TIMEUPDATE = "timeupdate", t.PLAY = "play", t.PAUSE = "pause", t.RATECHANGE = "ratechange", t.RESIZE = "resize", t.VOLUMECHANGE = "volumechange", t.ENTER_PICTURE_IN_PICTURE = "enterpictureinpicture", t.LEAVE_PICTURE_IN_PICTURE = "leavepictureinpicture", t.REPORT = "report", t.VIDEO_RENDERER_CHANGE = "videorendererchange", t.FULLSCREEN_CHANGE = "fullscreenchange", t.ATTRIBUTE_CHANGE = "attribute:change", t.INTERACTION = "interaction", t.LIVE_SHIFT_CHANGE = "liveshiftchange", t.LIVE_SHIFT_TYPE_CHANGE = "liveshifttypechange", t.OBJECT_FIT_CHANGE = "objectfitchange", t.ATTRIBUTE_CHANGE_CONFIG = "attribute:change:config", t.ATTRIBUTE_CHANGE_SRC = "attribute:change:src", t.ATTRIBUTE_CHANGE_VIDEO_ID = "attribute:change:videoid", t.ATTRIBUTE_CHANGE_PREVIEW_URL = "attribute:change:previewurl", t.ATTRIBUTE_CHANGE_MASK_URL = "attribute:change:maskurl", t.ATTRIBUTE_CHANGE_CROSS_ORIGIN = "attribute:change:crossorigin", t.ATTRIBUTE_CHANGE_PRELOAD = "attribute:change:preload", t.ATTRIBUTE_CHANGE_CURRENT_TIME = "attribute:change:currenttime", t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE = "attribute:change:defaultplaybackrate", t.ATTRIBUTE_CHANGE_PLAYBACK_RATE = "attribute:change:playbackrate", t.ATTRIBUTE_CHANGE_AUTOPLAY = "attribute:change:autoplay", t.ATTRIBUTE_CHANGE_LOOP = "attribute:change:loop", t.ATTRIBUTE_CHANGE_CONTROLS = "attribute:change:controls", t.ATTRIBUTE_CHANGE_VOLUME = "attribute:change:volume", t.ATTRIBUTE_CHANGE_MUTED = "attribute:change:muted", t.ATTRIBUTE_CHANGE_DEFAULT_MUTED = "attribute:change:defaultmuted", t.ATTRIBUTE_CHANGE_POSTER = "attribute:change:poster", t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE = "attribute:change:disablepictureinpicture", t.ATTRIBUTE_CHANGE_PLAYSINLINE = "attribute:change:playsinline", t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE = "attribute:change:disableadaptive", t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD = "attribute:change:disabledownload", t.ATTRIBUTE_CHANGE_DISABLE_MASK = "attribute:change:disablemask", t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY = "attribute:change:disablehotkey", t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU = "attribute:change:disabledanmaku", t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING = "attribute:change:danmakurendering", t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS = "attribute:change:danmakucontrolspos", t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN = "attribute:change:danmakucontrolsposfullscreen", t.ATTRIBUTE_CHANGE_CURRENT_LEVEL = "attribute:change:currentlevel", t.ATTRIBUTE_CHANGE_NEXT_LEVEL = "attribute:change:nextlevel", t.ATTRIBUTE_CHANGE_CURRENT_FRAME = "attribute:change:currentframe", t.ATTRIBUTE_CHANGE_AUDIO_TRACK = "attribute:change:audiotrack", t.ATTRIBUTE_CHANGE_PREFETCH = "attribute:change:prefetch", t.ATTRIBUTE_CHANGE_SHOW_PROGRESS = "attribute:change:showprogress", t.ATTRIBUTE_CHANGE_SHOW_TIME = "attribute:change:showtime", t.ATTRIBUTE_CHANGE_SHOW_NEXT = "attribute:change:shownext", t.ATTRIBUTE_CHANGE_SHOW_PREV = "attribute:change:showprev", t.ATTRIBUTE_CHANGE_BIZ_DATA = "attribute:change:bizdata", t.ATTRIBUTE_CHANGE_LIVE_TIME = "attribute:change:livetime", t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL = "attribute:change:showinfopanel", t.CLICK_NEXT = "clicknext", t.CLICK_LOGIN = "clicklogin", t.CLICK_REGISTER = "clickregister", t.CLICK_VIP = "clickvip", t))(Ut || {});
const Al = Rh(void 0), la = "kwai_player_ll_enabled", rf = "play-info-context", nf = (t) => {
  const { children: e, player: r } = t, s = r.logger, l = new Po(), d = Po.isSupported() && !$t, f = `${r.packVersion}(${r.version})`, c = new Ts(), [R, A] = tt(!1), v = (g, E = !1) => {
    if (g = g && d, g ? (O(), r.outputLogger = l.getLoggerForAdd()) : r.outputLogger = void 0, A(g), E)
      try {
        c.write(la, g ? "1" : "0");
      } catch (k) {
      }
  }, O = () => {
    try {
      localStorage.setItem("kwai-kernel-log", JSON.stringify({ value: "i", time: Date.now() })), localStorage.setItem("kwai-player-log", JSON.stringify({ value: "i", time: Date.now() }));
    } catch (g) {
    }
  }, m = () => {
    v(!R, !0);
  }, x = () => {
    l.downloadLog();
  };
  try {
    const g = (c.read(la) == "1" || !1) && d;
    A(g), g && v(g);
  } catch (g) {
  }
  return yn(() => () => {
    s.i(rf, "destroy"), l.destroy();
  }, []), /* @__PURE__ */ Se(
    Al.Provider,
    {
      value: {
        player: r,
        playerVersion: f,
        localLogSwitch: R,
        localLogEnabled: d,
        toggleLocalLog: m,
        downloadLocalLog: x
      },
      children: e
    }
  );
}, of = "_container_afsrn_1", af = "_actions_afsrn_60", Xe = {
  container: of,
  "container-h5": "_container-h5_afsrn_19",
  "close-btn": "_close-btn_afsrn_36",
  "btn-tip": "_btn-tip_afsrn_49",
  actions: af,
  "copy-btn": "_copy-btn_afsrn_69",
  "info-item": "_info-item_afsrn_75",
  "info-item-name": "_info-item-name_afsrn_79",
  "info-item-value": "_info-item-value_afsrn_87",
  "item-svg": "_item-svg_afsrn_92",
  "item-value": "_item-value_afsrn_100"
};
function bt(t) {
  const { title: e, value: r } = t;
  return /* @__PURE__ */ Se("div", { className: Xe["info-item"], children: [
    /* @__PURE__ */ Se("div", { className: Xe["info-item-name"], children: [
      e,
      ":"
    ] }),
    /* @__PURE__ */ Se("div", { className: Xe["info-item-value"], children: r })
  ] });
}
function sf(t) {
  const { dataArray: e } = t, r = dn(null), [s, l] = tt("");
  return yn(() => {
    if (r != null && r.current) {
      const { width: d, height: f } = r.current.getBoundingClientRect(), c = Math.max(...e) || 1, R = f - 2, A = d / e.length;
      let v = `M0 ${R * (c - e[0]) / c + 1}`;
      for (let O = 1; O < e.length; O++)
        v += ` L${O * A} ${R * (c - e[O]) / c + 1}`;
      l(v);
    }
  }, [e]), /* @__PURE__ */ Se("svg", { ref: r, height: "100%", width: "100%", style: "display:block", children: /* @__PURE__ */ Se("path", { fill: "none", stroke: "#fff", strokeWidth: "1", d: s }) });
}
function Ki(t) {
  const { title: e, suffix: r, value: s } = t, [l, d] = tt(0);
  return yn(() => {
    d(s[s.length - 1] || 0);
  }, [s]), /* @__PURE__ */ Se("div", { className: Xe["info-item"], children: [
    /* @__PURE__ */ Se("div", { className: Xe["info-item-name"], children: [
      e,
      ":"
    ] }),
    /* @__PURE__ */ Se("div", { className: Xe["info-item-value"], children: [
      /* @__PURE__ */ Se("div", { className: Xe["item-svg"], children: /* @__PURE__ */ Se(sf, { dataArray: s }) }),
      /* @__PURE__ */ Se("div", { className: Xe["item-value"], children: r(l) })
    ] })
  ] });
}
function lf(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var uf = function() {
  var t = document.getSelection();
  if (!t.rangeCount)
    return function() {
    };
  for (var e = document.activeElement, r = [], s = 0; s < t.rangeCount; s++)
    r.push(t.getRangeAt(s));
  switch (e.tagName.toUpperCase()) {
    case "INPUT":
    case "TEXTAREA":
      e.blur();
      break;
    default:
      e = null;
      break;
  }
  return t.removeAllRanges(), function() {
    t.type === "Caret" && t.removeAllRanges(), t.rangeCount || r.forEach(function(l) {
      t.addRange(l);
    }), e && e.focus();
  };
}, cf = uf, ua = {
  "text/plain": "Text",
  "text/html": "Url",
  default: "Text"
}, df = "Copy to clipboard: #{key}, Enter";
function hf(t) {
  var e = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
  return t.replace(/#{\s*key\s*}/g, e);
}
function ff(t, e) {
  var r, s, l, d, f, c, R = !1;
  e || (e = {}), r = e.debug || !1;
  try {
    l = cf(), d = document.createRange(), f = document.getSelection(), c = document.createElement("span"), c.textContent = t, c.ariaHidden = "true", c.style.all = "unset", c.style.position = "fixed", c.style.top = 0, c.style.clip = "rect(0, 0, 0, 0)", c.style.whiteSpace = "pre", c.style.webkitUserSelect = "text", c.style.MozUserSelect = "text", c.style.msUserSelect = "text", c.style.userSelect = "text", c.addEventListener("copy", function(v) {
      if (v.stopPropagation(), e.format)
        if (v.preventDefault(), typeof v.clipboardData > "u") {
          r && console.warn("unable to use e.clipboardData"), r && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
          var O = ua[e.format] || ua.default;
          window.clipboardData.setData(O, t);
        } else
          v.clipboardData.clearData(), v.clipboardData.setData(e.format, t);
      e.onCopy && (v.preventDefault(), e.onCopy(v.clipboardData));
    }), document.body.appendChild(c), d.selectNodeContents(c), f.addRange(d);
    var A = document.execCommand("copy");
    if (!A)
      throw new Error("copy command was unsuccessful");
    R = !0;
  } catch (v) {
    r && console.error("unable to copy using execCommand: ", v), r && console.warn("trying IE specific stuff");
    try {
      window.clipboardData.setData(e.format || "text", t), e.onCopy && e.onCopy(window.clipboardData), R = !0;
    } catch (O) {
      r && console.error("unable to copy using clipboardData: ", O), r && console.error("falling back to prompt"), s = hf("message" in e ? e.message : df), window.prompt(s, t);
    }
  } finally {
    f && (typeof f.removeRange == "function" ? f.removeRange(d) : f.removeAllRanges()), c && document.body.removeChild(c), l();
  }
  return R;
}
var Af = ff;
const pf = /* @__PURE__ */ lf(Af), ca = 100, vf = "info-panel";
function _f(t) {
  const e = Ih(Al);
  if (!e)
    return /* @__PURE__ */ Se(Di, {});
  const { player: r, playerVersion: s, localLogEnabled: l, localLogSwitch: d, toggleLocalLog: f, downloadLocalLog: c } = e, { onChangeShowEventLog: R } = t, A = or, [v, O] = tt(""), [m, x] = tt(""), [g, E] = tt(""), [k, y] = tt(""), [w, _] = tt(""), [b, I] = tt(""), [P, G] = tt(0), [H, Q] = tt(""), [ue, de] = tt(""), [j, F] = tt([]), [S, D] = tt([]), [U, N] = tt([]), [z, Y] = tt([]), [C, M] = tt((/* @__PURE__ */ new Date()).toString()), B = dn(void 0);
  kh(() => {
    const fe = () => {
      x(""), E(""), y(""), _(""), I(""), G(0), Q(""), z.splice(0, S.length), S.splice(0, S.length), U.splice(0, U.length), j.splice(0, j.length);
    }, He = () => {
      O(r.kernelType || "");
    }, Lt = (ce) => {
      if (ce && ce.type === "mediaInfo") {
        B.current = ce.value, O(r.kernelType || ""), x(ce.value.streamHost || ""), E(ce.value.colorSpace || ""), Q(ce.value.sid || ""), de(ce.value.gpu || "");
        const Ve = [];
        ce.value.coreType && Ve.push(ce.value.coreType), ce.value.box && (ce.value.enhancedFlv ? Ve.push("enhanced-flv") : Ve.push(ce.value.box)), ce.value.videoCodecType && Ve.push(ce.value.videoCodecType), ce.value.videoDecoder && Ve.push(ce.value.videoDecoder), ce.value.width && ce.value.height && Ve.push(`${ce.value.width}x${ce.value.height}`), ce.value.sar && Ve.push(`[SAR ${ce.value.sar.width}:${ce.value.sar.height}]`), ce.value.fps && Ve.push(`@${ce.value.fps.toFixed(2)}`), y(Ve.join(" "));
        const Ne = [];
        ce.value.videoCodec && Ne.push(ce.value.videoCodec), ce.value.audioCodec && Ne.push(ce.value.audioCodec), _(Ne.join(","));
      }
      ce && ce.type === "heartbeat" && (ce.value.decodedFrames && I(`${ce.value.decodedFPS || 0}/${ce.value.droppedFPS || 0} ${ce.value.decodedFrames || 0}/${ce.value.droppedFrames || 0}`), typeof ce.value.totalReceive == "number" && G(ce.value.totalReceive), we(ce.value.videoBuffered || 0, S, D), we(ce.value.audioBuffered || 0, U, N), !S.length && !U.length && we(ce.value.buffered || 0, z, Y), we(ce.value.speed || 0, j, F), M((/* @__PURE__ */ new Date()).toString()));
    };
    return r.on(Ut.ATTRIBUTE_CHANGE_SRC, fe), r.on(Ut.REPORT, Lt), r.on(Ut.LOADEDMETADATA, He), () => {
      r.off(Ut.ATTRIBUTE_CHANGE_SRC, fe), r.off(Ut.REPORT, Lt), r.off(Ut.LOADEDMETADATA, He), he.current && clearTimeout(he.current);
    };
  }, []);
  const [Z, K] = tt(""), [se, pe] = tt(!1), he = dn(0), we = ui((fe, He, Lt) => {
    typeof fe == "number" && !isNaN(fe) && (He.push(fe), He.length > ca ? He.shift() : He.length === 1 && (He.unshift(...new Array(ca - 1)), He.forEach((ce, Ve) => {
      typeof ce != "number" && (He[Ve] = 0);
    })), Lt([...He]));
  }, []), ee = ui(() => {
    r.logger.i(vf, "click copy");
    const fe = { date: C };
    A && (fe.did = A), s && (fe.playerVersion = s), H && (fe.sessionId = H), m && (fe.streamHost = m), g && (fe.colorSpace = g), k && (fe.res = k), w && (fe.codec = w), ue && (fe.gpu = ue), S.length && (fe.vBuffer = S[S.length - 1]), U.length && (fe.aBuffer = U[U.length - 1]), z.length && (fe.buffer = z[z.length - 1]), j.length && (fe.speed = j[j.length - 1]), B.current && (fe.mediainfo = B.current), fe.userAgent = navigator.userAgent, fe.summary = r.audienceStat;
    const He = pf(JSON.stringify(fe));
    K(He ? "已复制" : "复制失败"), pe(!0), he.current && clearTimeout(he.current), he.current = +setTimeout(() => {
      pe(!1), he.current = 0;
    }, 1e3);
  }, []), je = ui((fe) => fe > 1e9 ? `${(fe / 1e9).toFixed(2)} GB` : fe > 1e6 ? `${(fe / 1e6).toFixed(2)} MB` : `${(fe / 1e3).toFixed(2)} KB`, []), Le = ui((fe) => fe > 1e7 ? `${(fe / 1e6).toFixed(2)} MB/s` : `${(fe / 1e3).toFixed(2)} KB/s`, []), Ht = ui((fe) => fe > 1e3 ? `${(fe / 1e3).toFixed(2)} s` : `${fe} ms`, []), it = ui((fe) => {
    fe.stopPropagation();
  }, []);
  return /* @__PURE__ */ Se("div", { className: $t ? Xe["container-h5"] : Xe.container, onContextMenu: it, children: [
    A && /* @__PURE__ */ Se(bt, { title: "DeviceId", value: A }),
    s && /* @__PURE__ */ Se(bt, { title: "PlayerVersion", value: s }),
    v && /* @__PURE__ */ Se(bt, { title: "kernel", value: v }),
    H && /* @__PURE__ */ Se(bt, { title: "SessionId", value: H }),
    m && /* @__PURE__ */ Se(bt, { title: "StreamHost", value: m }),
    k && /* @__PURE__ */ Se(bt, { title: "Res", value: k }),
    g && /* @__PURE__ */ Se(bt, { title: "Color", value: g }),
    w && /* @__PURE__ */ Se(bt, { title: "Codec", value: w }),
    b && /* @__PURE__ */ Se(bt, { title: "Frames", value: b }),
    !!z.length && /* @__PURE__ */ Se(Ki, { title: "Buffered", value: z, suffix: Ht }),
    !!S.length && /* @__PURE__ */ Se(Ki, { title: "VideoBuffered", value: S, suffix: Ht }),
    !!U.length && /* @__PURE__ */ Se(Ki, { title: "AudioBuffered", value: U, suffix: Ht }),
    !!j.length && /* @__PURE__ */ Se(
      Ki,
      {
        title: "Speed",
        value: j,
        suffix: Le
      }
    ),
    P > 0 && /* @__PURE__ */ Se(bt, { title: "TotalReceive", value: je(P) }),
    ue && /* @__PURE__ */ Se(bt, { title: "GPU", value: ue }),
    /* @__PURE__ */ Se(bt, { title: "Date", value: C }),
    /* @__PURE__ */ Se("div", { className: [$t ? Xe["h5-btn"] : "", Xe["close-btn"]].join(" "), onClick: R, children: "[X]" }),
    /* @__PURE__ */ Se("div", { className: Xe.actions, children: [
      d && /* @__PURE__ */ Se("div", { className: [$t ? Xe["h5-btn"] : "", Xe["copy-btn"]].join(" "), onClick: c, children: "[Download Log]" }),
      l && /* @__PURE__ */ Se("div", { className: [$t ? Xe["h5-btn"] : "", Xe["copy-btn"]].join(" "), onClick: f, children: [
        "[Log ",
        d ? "on" : "off",
        "]"
      ] }),
      /* @__PURE__ */ Se("div", { className: [$t ? Xe["h5-btn"] : "", Xe["copy-btn"]].join(" "), onClick: ee, children: [
        se && /* @__PURE__ */ Se("div", { className: Xe["btn-tip"], children: Z }),
        /* @__PURE__ */ Se("div", { children: "[Copy]" })
      ] })
    ] })
  ] });
}
const mf = "kwai-player-web-play-info", da = "play-info-plugin", pl = class An extends Yh {
  constructor() {
    super(...arguments), Jt(this, "_player"), Jt(this, "_i18n"), Jt(this, "_callback", new Kh()), Jt(this, "_option", {
      showInPlayBar: !1,
      showInContextMenu: !0,
      svgRaw: '<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>'
    }), Jt(this, "_container"), Jt(this, "_onChangeShowEventLog", () => {
      this._container && (this.isShow = !this.isShow);
    }), Jt(this, "_onShowInfoPanelChange", () => {
      var e;
      this.isShow = !!((e = this._player) != null && e.showInfoPanel);
    });
  }
  beforeInstall(e, r) {
    r && (r.showInPlayBar === !0 && (this._option.showInPlayBar = !0), r.showInContextMenu === !1 && (this._option.showInContextMenu = !1), r.svgRaw && (this._option.svgRaw = r.svgRaw)), this._i18n = e.getPluginInstance(il);
  }
  afterInstall(e, r) {
    if (this._player = e, !this._player)
      return;
    this._container || (this._container = this._player.createSubContainer(), this._container.style.display = "none", this._container.style.position = "absolute", this._container.style.maxHeight = "100%", this._container.style.overflowY = "auto", this._container.style.top = "0", this._container.style.left = "0", $t && (this._container.style.width = "100%"));
    const s = e.logger;
    if (ea(
      /* @__PURE__ */ Se(nf, { player: e, children: /* @__PURE__ */ Se(
        _f,
        {
          onChangeShowEventLog: this._onChangeShowEventLog
        }
      ) }),
      this._container
    ), typeof e.showInfoPanel == "boolean")
      this.isShow = e.showInfoPanel, s.i(da, `set show by player: ${e.showInfoPanel}`);
    else {
      let l = mf;
      typeof (r == null ? void 0 : r.keyInUrl) == "string" && (l = r == null ? void 0 : r.keyInUrl), location.href.indexOf(l) >= 0 && (this.isShow = !0, s.i(da, "set show by url: true"));
    }
    e.on(Ut.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL, this._onShowInfoPanelChange);
  }
  beforeUninstall(e) {
    this._callback.destroy();
  }
  afterUninstall(e) {
    this._container && (ea(
      null,
      this._container
    ), e.removeSubContainer(this._container)), this._player = void 0, e.off(Ut.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL, this._onShowInfoPanelChange), this.removeAllListeners();
  }
  set isShow(e) {
    this._container && (this._container.style.display = e ? "block" : "none", this.emit(Ut.ATTRIBUTE_CHANGE), this._callback.call(e));
  }
  get isShow() {
    var e;
    return ((e = this._container) == null ? void 0 : e.style.display) === "block";
  }
  get dom() {
    return this._container;
  }
  getLabel() {
    return An.label;
  }
  get controlsSoltBtns() {
    const e = [];
    if (this._option.showInContextMenu) {
      const r = {
        role: "play-info-context-menu",
        slotPos: fn.CONTEXT_MENU,
        getChecked: () => this.isShow,
        getText: () => this._text("playInfo"),
        svgRaw: this._option.svgRaw,
        onClick: () => this.isShow = !this.isShow,
        callback: this._callback
      };
      e.push(r);
    }
    if (this._option.showInPlayBar && !$t) {
      const r = {
        role: "play-info-btn",
        slotPos: fn.PLAY_BAR_RIGHT,
        getTips: () => this._text("playInfo"),
        svgRaw: this._option.svgRaw,
        onClick: () => this.isShow = !this.isShow,
        callback: this._callback
      };
      e.push(r);
    }
    return e;
  }
  _text(e) {
    var r;
    return ((r = this._i18n) == null ? void 0 : r.text(An.label, e)) || "视频信息";
  }
};
Jt(pl, "version", "1.1.0-alpha.0");
let gf = pl;
Ii.register(Bs);
Ii.register(gf);
Ii.packVersion = "1.1.19.vue3-mini";
export {
  Ef as CallbackProxy,
  Sc as ControlsPluginLabel,
  Tf as ControlsPluginModule,
  Fc as ControlsSlotPos,
  Uc as DanmakuControlsPos,
  Pc as DanmakuPluginDomStyle,
  Nc as DanmakuPluginLabel,
  Of as DanmakuPluginModule,
  Mt as FullscreenType,
  Ic as HotkeyPluginLabel,
  Lf as HotkeyPluginModule,
  Lc as I18nPluginLabel,
  Rf as I18nPluginModule,
  Ii as KwaiPlayer,
  J as KwaiPlayerEvent,
  Ji as KwaiPlayerLayer,
  No as KwaiPlayerVue3,
  hi as LiveShiftType,
  kc as LoggerPluginLabel,
  Sf as LoggerPluginModule,
  Oc as MaskPluginLabel,
  Cf as MaskPluginModule,
  xc as PlayInfoPluginLabel,
  kf as PlayInfoPluginModule,
  ut as PluginModule,
  Dc as PreviewPluginLabel,
  xf as PreviewPluginModule,
  Cc as RotatePluginLabel,
  If as RotatePluginModule,
  Mc as VRPluginLabel,
  Df as VRPluginModule,
  No as default
};