@volcengine/veplayer 1.6.4 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -45
- package/esm/index.d.ts +1405 -0
- package/esm/veplayer.biz.live.development.css +41 -0
- package/esm/veplayer.biz.live.development.js +3157 -0
- package/esm/veplayer.biz.live.production.css +1 -0
- package/esm/veplayer.biz.live.production.js +2 -0
- package/esm/veplayer.biz.vod.development.js +13 -0
- package/esm/veplayer.biz.vod.production.js +2 -0
- package/esm/veplayer.d.ts +3071 -0
- package/esm/veplayer.development.css +743 -0
- package/esm/veplayer.development.js +21023 -0
- package/esm/veplayer.live.d.ts +3074 -0
- package/esm/veplayer.live.development.css +743 -0
- package/esm/veplayer.live.development.js +21022 -0
- package/esm/veplayer.live.production.css +1 -0
- package/esm/veplayer.live.production.js +11 -0
- package/esm/veplayer.production.css +1 -0
- package/esm/veplayer.production.js +11 -0
- package/esm/veplayer.vod.d.ts +1405 -0
- package/esm/veplayer.vod.development.css +702 -0
- package/esm/veplayer.vod.development.js +13104 -0
- package/esm/veplayer.vod.production.css +1 -0
- package/esm/veplayer.vod.production.js +11 -0
- package/package.json +78 -6
- package/umd/index.d.ts +1405 -0
- package/umd/veplayer.biz.live.development.css +41 -0
- package/umd/veplayer.biz.live.development.js +3169 -0
- package/umd/veplayer.biz.live.production.css +1 -0
- package/umd/veplayer.biz.live.production.js +1 -0
- package/umd/veplayer.biz.vod.development.js +29 -0
- package/umd/veplayer.biz.vod.production.js +1 -0
- package/umd/veplayer.d.ts +3071 -0
- package/umd/veplayer.development.css +743 -0
- package/umd/veplayer.development.js +21026 -0
- package/umd/veplayer.live.d.ts +3074 -0
- package/umd/veplayer.live.development.css +743 -0
- package/umd/veplayer.live.development.js +21034 -0
- package/umd/veplayer.live.production.css +1 -0
- package/umd/veplayer.live.production.js +1 -0
- package/umd/veplayer.production.css +1 -0
- package/umd/veplayer.production.js +1 -0
- package/umd/veplayer.vod.d.ts +1405 -0
- package/umd/veplayer.vod.development.css +702 -0
- package/umd/veplayer.vod.development.js +13119 -0
- package/umd/veplayer.vod.production.css +1 -0
- package/umd/veplayer.vod.production.js +1 -0
- package/index.d.ts +0 -3256
- package/index.min.css +0 -1
- package/index.min.js +0 -2
package/index.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @volcengine/veplayer@1.6.4 Built @Thu, 19 Oct 2023 11:45:49 GMT
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VePlayer=t()}(this,(function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){c(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(O){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new E(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(O){return{type:"throw",arg:O}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&i.call(m,a)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(r,o,a,s){var l=h(e[r],e,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function T(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e||""===e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}throw new TypeError(typeof e+" is not iterable")}return p.prototype=g,r(_,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new k(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,l,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;C(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(i,r)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,T(i.key),i)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Hl){return!1}}();return function(){var n,i=h(e);if(t){var r=h(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return g(this,n)}}function y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=y(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},m.apply(this,arguments)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function T(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function S(e,t){return e===t||e!=e&&t!=t}function C(e,t){for(var n=e.length;n--;)if(S(e[n][0],t))return n;return-1}var E=Array.prototype.splice;function x(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}x.prototype.clear=function(){this.__data__=[],this.size=0},x.prototype.delete=function(e){var t=this.__data__,n=C(t,e);return!(n<0)&&(n==t.length-1?t.pop():E.call(t,n,1),--this.size,!0)},x.prototype.get=function(e){var t=this.__data__,n=C(t,e);return n<0?void 0:t[n][1]},x.prototype.has=function(e){return C(this.__data__,e)>-1},x.prototype.set=function(e,t){var n=this.__data__,i=C(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var O="object"==("undefined"==typeof global?"undefined":i(global))&&global&&global.Object===Object&&global,P="object"==("undefined"==typeof self?"undefined":i(self))&&self&&self.Object===Object&&self,L=O||P||Function("return this")(),I=L.Symbol,D=Object.prototype,A=D.hasOwnProperty,M=D.toString,R=I?I.toStringTag:void 0;var N=Object.prototype.toString;var j=I?I.toStringTag:void 0;function B(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=A.call(e,R),n=e[R];try{e[R]=void 0;var i=!0}catch(Hl){}var r=M.call(e);return i&&(t?e[R]=n:delete e[R]),r}(e):function(e){return N.call(e)}(e)}function U(e){var t=i(e);return null!=e&&("object"==t||"function"==t)}function H(e){if(!U(e))return!1;var t=B(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var F,V=L["__core-js_shared__"],z=(F=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"";var G=Function.prototype.toString;function W(e){if(null!=e){try{return G.call(e)}catch(Hl){}try{return e+""}catch(Hl){}}return""}var K=/^\[object .+?Constructor\]$/,$=Function.prototype,Y=Object.prototype,q=$.toString,X=Y.hasOwnProperty,J=RegExp("^"+q.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Z(e){return!(!U(e)||(t=e,z&&z in t))&&(H(e)?J:K).test(W(e));var t}function Q(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(n)?n:void 0}var ee=Q(L,"Map"),te=Q(Object,"create");var ne=Object.prototype.hasOwnProperty;var ie=Object.prototype.hasOwnProperty;function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function oe(e,t){var n,r,o=e.__data__;return("string"==(r=i(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}re.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(te){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ne.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:ie.call(t,e)},re.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=te&&void 0===t?"__lodash_hash_undefined__":t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(ee||x),string:new re}},ae.prototype.delete=function(e){var t=oe(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return oe(this,e).get(e)},ae.prototype.has=function(e){return oe(this,e).has(e)},ae.prototype.set=function(e,t){var n=oe(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function se(e){var t=this.__data__=new x(e);this.size=t.size}se.prototype.clear=function(){this.__data__=new x,this.size=0},se.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof x){var i=n.__data__;if(!ee||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(i)}return n.set(e,t),this.size=n.size,this};var le=function(){try{var e=Q(Object,"defineProperty");return e({},"",{}),e}catch(Hl){}}(),ce=le;function ue(e,t,n){"__proto__"==t&&ce?ce(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var he=Object.prototype.hasOwnProperty;function de(e,t,n){var i=e[t];he.call(e,t)&&S(i,n)&&(void 0!==n||t in e)||ue(e,t,n)}function fe(e,t,n,i){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=i?i(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),r?ue(n,s,l):de(n,s,l)}return n}function pe(e){return null!=e&&"object"==i(e)}function ge(e){return pe(e)&&"[object Arguments]"==B(e)}var ve=Object.prototype,ye=ve.hasOwnProperty,me=ve.propertyIsEnumerable,_e=ge(function(){return arguments}())?ge:function(e){return pe(e)&&ye.call(e,"callee")&&!me.call(e,"callee")},be=_e,ke=Array.isArray;var we="object"==("undefined"==typeof exports?"undefined":i(exports))&&exports&&!exports.nodeType&&exports,Te=we&&"object"==("undefined"==typeof module?"undefined":i(module))&&module&&!module.nodeType&&module,Se=Te&&Te.exports===we?L.Buffer:void 0,Ce=(Se?Se.isBuffer:void 0)||function(){return!1},Ee=/^(?:0|[1-9]\d*)$/;function xe(e,t){var n=i(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Ee.test(e))&&e>-1&&e%1==0&&e<t}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Pe={};function Le(e){return function(t){return e(t)}}Pe["[object Float32Array]"]=Pe["[object Float64Array]"]=Pe["[object Int8Array]"]=Pe["[object Int16Array]"]=Pe["[object Int32Array]"]=Pe["[object Uint8Array]"]=Pe["[object Uint8ClampedArray]"]=Pe["[object Uint16Array]"]=Pe["[object Uint32Array]"]=!0,Pe["[object Arguments]"]=Pe["[object Array]"]=Pe["[object ArrayBuffer]"]=Pe["[object Boolean]"]=Pe["[object DataView]"]=Pe["[object Date]"]=Pe["[object Error]"]=Pe["[object Function]"]=Pe["[object Map]"]=Pe["[object Number]"]=Pe["[object Object]"]=Pe["[object RegExp]"]=Pe["[object Set]"]=Pe["[object String]"]=Pe["[object WeakMap]"]=!1;var Ie="object"==("undefined"==typeof exports?"undefined":i(exports))&&exports&&!exports.nodeType&&exports,De=Ie&&"object"==("undefined"==typeof module?"undefined":i(module))&&module&&!module.nodeType&&module,Ae=De&&De.exports===Ie&&O.process,Me=function(){try{var e=De&&De.require&&De.require("util").types;return e||Ae&&Ae.binding&&Ae.binding("util")}catch(Hl){}}(),Re=Me&&Me.isTypedArray,Ne=Re?Le(Re):function(e){return pe(e)&&Oe(e.length)&&!!Pe[B(e)]},je=Object.prototype.hasOwnProperty;function Be(e,t){var n=ke(e),i=!n&&be(e),r=!n&&!i&&Ce(e),o=!n&&!i&&!r&&Ne(e),a=n||i||r||o,s=a?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],l=s.length;for(var c in e)!t&&!je.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xe(c,l))||s.push(c);return s}var Ue=Object.prototype;function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ue)}function Fe(e,t){return function(n){return e(t(n))}}var Ve=Fe(Object.keys,Object),ze=Object.prototype.hasOwnProperty;function Ge(e){return null!=e&&Oe(e.length)&&!H(e)}function We(e){return Ge(e)?Be(e):function(e){if(!He(e))return Ve(e);var t=[];for(var n in Object(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var Ke=Object.prototype.hasOwnProperty;function $e(e){if(!U(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=He(e),n=[];for(var i in e)("constructor"!=i||!t&&Ke.call(e,i))&&n.push(i);return n}function Ye(e){return Ge(e)?Be(e,!0):$e(e)}var qe="object"==("undefined"==typeof exports?"undefined":i(exports))&&exports&&!exports.nodeType&&exports,Xe=qe&&"object"==("undefined"==typeof module?"undefined":i(module))&&module&&!module.nodeType&&module,Je=Xe&&Xe.exports===qe?L.Buffer:void 0,Ze=Je?Je.allocUnsafe:void 0;function Qe(){return[]}var et=Object.prototype.propertyIsEnumerable,tt=Object.getOwnPropertySymbols,nt=tt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o}(tt(e),(function(t){return et.call(e,t)})))}:Qe,it=nt;function rt(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var ot=Fe(Object.getPrototypeOf,Object),at=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)rt(t,it(e)),e=ot(e);return t}:Qe,st=at;function lt(e,t,n){var i=t(e);return ke(e)?i:rt(i,n(e))}function ct(e){return lt(e,We,it)}function ut(e){return lt(e,Ye,st)}var ht=Q(L,"DataView"),dt=Q(L,"Promise"),ft=Q(L,"Set"),pt=Q(L,"WeakMap"),gt="[object Map]",vt="[object Promise]",yt="[object Set]",mt="[object WeakMap]",_t="[object DataView]",bt=W(ht),kt=W(ee),wt=W(dt),Tt=W(ft),St=W(pt),Ct=B;(ht&&Ct(new ht(new ArrayBuffer(1)))!=_t||ee&&Ct(new ee)!=gt||dt&&Ct(dt.resolve())!=vt||ft&&Ct(new ft)!=yt||pt&&Ct(new pt)!=mt)&&(Ct=function(e){var t=B(e),n="[object Object]"==t?e.constructor:void 0,i=n?W(n):"";if(i)switch(i){case bt:return _t;case kt:return gt;case wt:return vt;case Tt:return yt;case St:return mt}return t});var Et=Ct,xt=Object.prototype.hasOwnProperty;var Ot=L.Uint8Array;function Pt(e){var t=new e.constructor(e.byteLength);return new Ot(t).set(new Ot(e)),t}var Lt=/\w*$/;var It=I?I.prototype:void 0,Dt=It?It.valueOf:void 0;function At(e,t,n){var i,r,o,a=e.constructor;switch(t){case"[object ArrayBuffer]":return Pt(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return function(e,t){var n=t?Pt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?Pt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return(o=new(r=e).constructor(r.source,Lt.exec(r))).lastIndex=r.lastIndex,o;case"[object Symbol]":return i=e,Dt?Object(Dt.call(i)):{}}}var Mt=Object.create,Rt=function(){function e(){}return function(t){if(!U(t))return{};if(Mt)return Mt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Nt=Rt;var jt=Me&&Me.isMap,Bt=jt?Le(jt):function(e){return pe(e)&&"[object Map]"==Et(e)};var Ut=Me&&Me.isSet,Ht=Ut?Le(Ut):function(e){return pe(e)&&"[object Set]"==Et(e)},Ft="[object Arguments]",Vt="[object Function]",zt="[object Object]",Gt={};function Wt(e,t,n,i,r,o){var a,s=1&t,l=2&t,c=4&t;if(n&&(a=r?n(e,i,r,o):n(e)),void 0!==a)return a;if(!U(e))return e;var u=ke(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&xt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}(e,a)}else{var h=Et(e),d=h==Vt||"[object GeneratorFunction]"==h;if(Ce(e))return function(e,t){if(t)return e.slice();var n=e.length,i=Ze?Ze(n):new e.constructor(n);return e.copy(i),i}(e,s);if(h==zt||h==Ft||d&&!r){if(a=l||d?{}:function(e){return"function"!=typeof e.constructor||He(e)?{}:Nt(ot(e))}(e),!s)return l?function(e,t){return fe(e,st(e),t)}(e,function(e,t){return e&&fe(t,Ye(t),e)}(a,e)):function(e,t){return fe(e,it(e),t)}(e,function(e,t){return e&&fe(t,We(t),e)}(a,e))}else{if(!Gt[h])return r?e:{};a=At(e,h,s)}}o||(o=new se);var f=o.get(e);if(f)return f;o.set(e,a),Ht(e)?e.forEach((function(i){a.add(Wt(i,t,n,i,e,o))})):Bt(e)&&e.forEach((function(i,r){a.set(r,Wt(i,t,n,r,e,o))}));var p=u?void 0:(c?l?ut:ct:l?Ye:We)(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(p||e,(function(i,r){p&&(i=e[r=i]),de(a,r,Wt(i,t,n,r,e,o))})),a}Gt[Ft]=Gt["[object Array]"]=Gt["[object ArrayBuffer]"]=Gt["[object DataView]"]=Gt["[object Boolean]"]=Gt["[object Date]"]=Gt["[object Float32Array]"]=Gt["[object Float64Array]"]=Gt["[object Int8Array]"]=Gt["[object Int16Array]"]=Gt["[object Int32Array]"]=Gt["[object Map]"]=Gt["[object Number]"]=Gt[zt]=Gt["[object RegExp]"]=Gt["[object Set]"]=Gt["[object String]"]=Gt["[object Symbol]"]=Gt["[object Uint8Array]"]=Gt["[object Uint8ClampedArray]"]=Gt["[object Uint16Array]"]=Gt["[object Uint32Array]"]=!0,Gt["[object Error]"]=Gt[Vt]=Gt["[object WeakMap]"]=!1;function Kt(e){return Wt(e,5)}function $t(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ae;++t<n;)this.add(e[t])}function Yt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function qt(e,t){return e.has(t)}$t.prototype.add=$t.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},$t.prototype.has=function(e){return this.__data__.has(e)};function Xt(e,t,n,i,r,o){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=2&n?new $t:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(i)var v=a?i(g,p,h,t,e,o):i(p,g,h,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!Yt(t,(function(e,t){if(!qt(f,t)&&(p===e||r(p,e,n,i,o)))return f.push(t)}))){d=!1;break}}else if(p!==g&&!r(p,g,n,i,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Jt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function Zt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Qt=I?I.prototype:void 0,en=Qt?Qt.valueOf:void 0;var tn=Object.prototype.hasOwnProperty;var nn="[object Arguments]",rn="[object Array]",on="[object Object]",an=Object.prototype.hasOwnProperty;function sn(e,t,n,i,r,o){var a=ke(e),s=ke(t),l=a?rn:Et(e),c=s?rn:Et(t),u=(l=l==nn?on:l)==on,h=(c=c==nn?on:c)==on,d=l==c;if(d&&Ce(e)){if(!Ce(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new se),a||Ne(e)?Xt(e,t,n,i,r,o):function(e,t,n,i,r,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Ot(e),new Ot(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return S(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Jt;case"[object Set]":var l=1&i;if(s||(s=Zt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=2,a.set(e,t);var u=Xt(s(e),s(t),i,r,o,a);return a.delete(e),u;case"[object Symbol]":if(en)return en.call(e)==en.call(t)}return!1}(e,t,l,n,i,r,o);if(!(1&n)){var f=u&&an.call(e,"__wrapped__"),p=h&&an.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return o||(o=new se),r(g,v,n,i,o)}}return!!d&&(o||(o=new se),function(e,t,n,i,r,o){var a=1&n,s=ct(e),l=s.length;if(l!=ct(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:tn.call(t,u)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=a;++c<l;){var g=e[u=s[c]],v=t[u];if(i)var y=a?i(v,g,u,t,e,o):i(g,v,u,e,t,o);if(!(void 0===y?g===v||r(g,v,n,i,o):y)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,n,i,r,o))}function ln(e,t,n,i,r){return e===t||(null==e||null==t||!pe(e)&&!pe(t)?e!=e&&t!=t:sn(e,t,n,i,ln,r))}function cn(e){return e==e&&!U(e)}function un(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function hn(e){var t=function(e){for(var t=We(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,cn(r)]}return t}(e);return 1==t.length&&t[0][2]?un(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,i){var r=n.length,o=r,a=!i;if(null==e)return!o;for(e=Object(e);r--;){var s=n[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var l=(s=n[r])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var h=new se;if(i)var d=i(c,u,l,e,t,h);if(!(void 0===d?ln(u,c,3,i,h):d))return!1}}return!0}(n,e,t)}}function dn(e){return"symbol"==i(e)||pe(e)&&"[object Symbol]"==B(e)}var fn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pn=/^\w*$/;function gn(e,t){if(ke(e))return!1;var n=i(e);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!dn(e))||(pn.test(e)||!fn.test(e)||null!=t&&e in Object(t))}function vn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(vn.Cache||ae),n}vn.Cache=ae;var yn,mn,_n,bn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kn=/\\(\\)?/g,wn=(yn=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(bn,(function(e,n,i,r){t.push(i?r.replace(kn,"$1"):n||e)})),t},mn=vn(yn,(function(e){return 500===_n.size&&_n.clear(),e})),_n=mn.cache,mn),Tn=wn;var Sn=I?I.prototype:void 0,Cn=Sn?Sn.toString:void 0;function En(e){if("string"==typeof e)return e;if(ke(e))return function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}(e,En)+"";if(dn(e))return Cn?Cn.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function xn(e,t){return ke(e)?e:gn(e,t)?[e]:Tn(function(e){return null==e?"":En(e)}(e))}function On(e){if("string"==typeof e||dn(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function Pn(e,t){for(var n=0,i=(t=xn(t,e)).length;null!=e&&n<i;)e=e[On(t[n++])];return n&&n==i?e:void 0}function Ln(e,t,n){var i=null==e?void 0:Pn(e,t);return void 0===i?n:i}function In(e,t){return null!=e&&t in Object(e)}function Dn(e,t){return null!=e&&function(e,t,n){for(var i=-1,r=(t=xn(t,e)).length,o=!1;++i<r;){var a=On(t[i]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++i!=r?o:!!(r=null==e?0:e.length)&&Oe(r)&&xe(a,r)&&(ke(e)||be(e))}(e,t,In)}function An(e){return e}function Mn(e){return gn(e)?(t=On(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Pn(t,e)}}(e);var t}function Rn(e){return"function"==typeof e?e:null==e?An:"object"==i(e)?ke(e)?(t=e[0],n=e[1],gn(t)&&cn(n)?un(On(t),n):function(e){var i=Ln(e,t);return void 0===i&&i===n?Dn(e,t):ln(n,i,3)}):hn(e):Mn(e);var t,n}function Nn(e){return e!=e}function jn(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):function(e,t,n,i){for(var r=e.length,o=n+(i?1:-1);i?o--:++o<r;)if(t(e[o],o,e))return o;return-1}(e,Nn,n)}(e,t,0)>-1}function Bn(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}var Un=ft&&1/Zt(new ft([,-0]))[1]==1/0?function(e){return new ft(e)}:function(){};function Hn(e,t){return e&&e.length?function(e,t,n){var i=-1,r=jn,o=e.length,a=!0,s=[],l=s;if(n)a=!1,r=Bn;else if(o>=200){var c=t?null:Un(e);if(c)return Zt(c);a=!1,r=qt,l=new $t}else l=t?[]:s;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=n||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else r(l,h,n)||(l!==s&&l.push(h),s.push(u))}return s}(e,Rn(t)):[]}var Fn=function(e){return e.H265="h265",e.H264="h264",e}(Fn||{}),Vn=function(e){return e.H264="h264",e}(Vn||{}),zn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Gn=function(){var e,t=null;function n(e){return!!e&&("object"===i(e)||"function"==typeof e)}function r(e){if(null!==e&&!n(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}var o=Object,a=Boolean(o.create)||!({__proto__:null}instanceof o),s=o.create||(a?function(e){return r(e),{__proto__:e}}:function(e){if(r(e),null===e)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var t=function(){};return t.prototype=e,new t}),l=function(){return null},c=o.getPrototypeOf||([].__proto__===Array.prototype?function(e){var t=e.__proto__;return n(t)?t:null}:l);return e=function(i,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!n(i)||!n(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");var h=function(){};t=function(){i=null,h=function(e){throw new TypeError("Cannot perform '".concat(e,"' on a proxy that has been revoked"))}},setTimeout((function(){t=null}),0);var d=u;for(var f in u={get:null,set:null,apply:null,construct:null},d){if(!(f in u))throw new TypeError("Proxy polyfill does not support trap '".concat(f,"'"));u[f]=d[f]}"function"==typeof d&&(u.apply=d.apply.bind(d));var p,g=c(i),v=!1,y=!1;"function"==typeof i?(p=function(){var e=this&&this.constructor===p,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&u.construct)return u.construct.call(this,i,t);if(!e&&u.apply)return u.apply(i,this,t);if(e){t.unshift(i);var n=i.bind.apply(i,t);return new n}return i.apply(this,t)},v=!0):i instanceof Array?(p=[],y=!0):p=a||null!==g?s(g):{};var m=u.get?function(e){return h("get"),u.get(this,e,p)}:function(e){return h("get"),this[e]},_=u.set?function(e,t){h("set"),u.set(this,e,t,p)}:function(e,t){h("set"),this[e]=t},b=o.getOwnPropertyNames(i),k={};b.forEach((function(e){if(!v&&!y||!(e in p)){var t=o.getOwnPropertyDescriptor(i,e),n={enumerable:Boolean(t.enumerable),get:m.bind(i,e),set:_.bind(i,e)};o.defineProperty(p,e,n),k[e]=!0}}));var w=!0;if(v||y){var T=o.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return r(t),e.__proto__=t,e}:l);g&&T(p,g)||(w=!1)}if(u.get||!w)for(var S in i)k[S]||o.defineProperty(p,S,{get:m.bind(i,S)});return o.seal(i),o.seal(p),p},e.revocable=function(n,i){return{proxy:new e(n,i),revoke:t}},e}(),Wn=new(function(){function e(){a(this,e),this.subscribeId=0,this.watcherMap=new Map}return l(e,[{key:"observe",value:function(e){var t=this,n=new Gn(e,{set:function(e,i,r){var o=Reflect.get(e,i);Reflect.set(e,i,r);var a=t.watcherMap.get(n);return a&&(t.flushCallback(a),t.flushPropertyCallback(a,i,o,r)),!0}});return this.watcherMap.set(n,{pending:!1,queue:[],property:{}}),n}},{key:"subscribe",value:function(e,t){var n=this.watcherMap.get(e);if(n)return this.subscribeId++,n.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}},{key:"unsubscribe",value:function(e,t){var n=this.watcherMap.get(e);if(n){var i=n.queue,r=i.findIndex((function(e){return e.id===t}));void 0!==r&&r>-1&&i.splice(r,1)}}},{key:"subscribeProperty",value:function(e,t,n){var i=this.watcherMap.get(e);i&&(this.subscribeId++,i.property[t]||(i.property[t]={pending:!1,timer:0,pre:null,queue:[]}),i.property[t].queue.push({id:this.subscribeId,callback:n}))}},{key:"unsubscribeProperty",value:function(e,t,n){var i=this.watcherMap.get(e);if(i){var r=i.property[t];if(r){var o=r.queue,a=o.findIndex((function(e){return e.id===n}));void 0!==a&&a>-1&&o.splice(a,1)}}}},{key:"flushCallback",value:function(e){e.pending||(e.pending=!0,setTimeout((function(){e.queue.forEach((function(e){return e.callback()})),e.pending=!1}),0))}},{key:"flushPropertyCallback",value:function(e,t,n,i){var r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=n),r.timer=setTimeout((function(){r.queue.forEach((function(e){return e.callback(r.pre,i)})),r.pending=!1}),0))}}]),e}());function Kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(n),!0).forEach((function(t){Zn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yn(e){return(Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ci(i.key),i)}}function Jn(e,t,n){return t&&Xn(e.prototype,t),n&&Xn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zn(e,t,n){return(t=ci(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ti(e,t)}function ei(e){return(ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ti(e,t){return(ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ni(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ii(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ni(e)}function ri(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Hl){return!1}}();return function(){var n,i=ei(e);if(t){var r=ei(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ii(this,n)}}function oi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ei(e)););return e}function ai(){return ai="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=oi(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},ai.apply(this,arguments)}function si(e){return function(e){if(Array.isArray(e))return li(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return li(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return li(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function li(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function ci(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}var ui={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,i),!0;case 4:return u.fn.call(u.context,t,i,r),!0;case 5:return u.fn.call(u.context,t,i,r,o),!0;case 6:return u.fn.call(u.context,t,i,r,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,i);break;case 4:u[c].fn.call(u[c].context,t,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||r&&!s[l].once||i&&s[l].context!==i)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(ui);var hi=ui.exports,di="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,fi={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},pi="%c[xgplayer]",gi={config:{debug:di?3:0},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[pi,fi.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[pi,fi.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[pi,fi.error,e].concat(r))}}};var vi=function(){function e(t){qn(this,e),this.bufferedList=t}return Jn(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),yi={};function mi(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}function _i(e){var t=Yn(e);return null!==e&&("object"===t||"function"===t)}function bi(e,t,n){var i,r,o,a,s,l,c=0,u=!1,h=!1,d=!0,f=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,c=t,a=e.apply(o,n)}function g(e,t){return f?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){return c=e,s=g(m,t),u?p(e):a}function y(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function m(){var e=Date.now();if(y(e))return _(e);s=g(m,function(e){var n=e-c,i=t-(e-l);return h?Math.min(i,o-n):i}(e))}function _(e){return s=void 0,d&&i?p(e):(i=r=void 0,a)}function b(){for(var e=Date.now(),n=y(e),o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];if(i=c,r=this,l=e,n){if(void 0===s)return v(l);if(h)return s=g(m,t),p(l)}return void 0===s&&(s=g(m,t)),a}return t=+t||0,_i(n)&&(u=!!n.leading,o=(h="maxWait"in n)?Math.max(+n.maxWait||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,i=l=r=s=void 0},b.flush=function(){return void 0===s?a:_(Date.now())},b.pending=function(){return void 0!==s},b}yi.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},yi.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&yi.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return gi.logError("util.createDomFromHtml",o),null}},yi.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(Hl){var n=e.className&&"object"===Yn(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},yi.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(Hl){yi.hasClass(e,t)||(e.className&&"object"===Yn(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},yi.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(Hl){yi.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Yn(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},yi.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){yi.hasClass(e,t)?yi.removeClass(e,t):yi.addClass(e,t)}))},yi.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===yi.typeOf(e[n])?t.push(e[n]):"Object"===yi.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},yi.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(Hl){gi.logError("util.findDom",Hl),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},yi.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},yi.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),a=[],s=String(e);o--;)a.push(i);return a.join("").substring(0,r-s.length)+s},yi.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=yi.padStart(Math.floor(e/3600),2,0),n=yi.padStart(Math.floor((e-3600*t)/60),2,0),i=yi.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},yi.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},yi.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},yi.deepCopy=function(e,t){if("Object"===yi.typeOf(t)&&"Object"===yi.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==yi.typeOf(t[n])||t[n]instanceof Node?"Array"===yi.typeOf(t[n])?e[n]="Array"===yi.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:yi.deepCopy(e[n],t[n])})),e},yi.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===yi.typeOf(t[n])&&"Array"===yi.typeOf(e[n])?"Array"===yi.typeOf(e[n])&&(i=e[n]).push.apply(i,si(t[n])):yi.typeOf(e[n])!==yi.typeOf(t[n])||null===e[n]||"Object"!==yi.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):yi.deepMerge(e[n],t[n])})),e},yi.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},yi.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},yi.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},yi.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},yi.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),yi.clearTimeout(e,i)}),n);return e._timers.push(i),i},yi.clearTimeout=function(e,t){var n=e._timers;if("Array"===yi.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},yi.clearAllTimers=function(e){var t=e._timers;"Array"===yi.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},yi.createImgBtn=function(e,t,n,i){var r,o,a,s=yi.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),a=e,!1)})),s.style.width="".concat(r).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(r).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):"auto 5px auto 5px");return s},yi.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},yi.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},yi.checkIsFunction=function(e){return e&&"function"==typeof e},yi.checkIsObject=function(e){return null!==e&&"object"===Yn(e)},yi.hide=function(e){e.style.display="none"},yi.show=function(e,t){e.style.display=t||"block"},yi.isUndefined=function(e){if(null==e)return!0},yi.isNotNull=function(e){return!(null==e)},yi.setStyleFromCsstext=function(e,t){t&&("String"===yi.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},yi.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(mi(n[0],t)?r[n[0]]=n[1]:o[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},yi.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},yi.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},yi.stopPropagation=function(e){e&&e.stopPropagation()},yi.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},yi.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},yi.checkTouchSupport=function(){return"ontouchstart"in window},yi.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var a=r.length;if(a){var s=r[a-1].end;n[o].start-s<t?n[o].end>s&&(r[a-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new vi(r)},yi.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},yi.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},yi.getHostFromUrl=function(e){if("String"!==yi.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},yi.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},yi.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},yi.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(Hl){e=0}t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now()));var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}));return n},yi.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},yi.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},yi.createPositionBar=function(e,t){var n=yi.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(n),n},yi.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0};return"scale(".concat(e.scale||1,") translate(").concat(e.x||0,"%, ").concat(e.y||0,"%) rotate(").concat(e.rotate||0,"deg)")},yi.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360};var ki=/(Android)\s([\d.]+)/,wi=/(Version)\/([\d.]+)/,Ti=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Si={get device(){return Si.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o,s=!(a||i||n||o),l=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:a,isIpad:l,isIos:a||l,isAndroid:i,isPc:s,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?wi:ki)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&Ti.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(Hl){return Promise.resolve(t)}}},Ci="3.0.9-alpha.0",Ei={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},xi={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Oi=Jn((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};qn(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var r=n.mediaError?n.mediaError:t.media.error||{},o=t.duration,a=t.currentTime,s=t.ended,l=t.src,c=t.currentSrc,u=t.media,h=u.readyState,d=u.networkState,f=n.errorCode||r.code;xi[f]&&(f=xi[f]);var p={playerVersion:Ci,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:n.errorType,errorCode:f,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:yi.getHostFromUrl(l||c)};return n.ext&&Object.keys(n.ext).map((function(e){p[e]=n.ext[e]})),p}if(arguments.length>1){for(var g={playerVersion:Ci,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],y=0;y<arguments.length;y++)g[v[y]]=arguments[y];return g.ex=i?(i[arguments[0]]||{}).msg:"",g}})),Pi="play",Li="playing",Ii="ended",Di="pause",Ai="error",Mi="seeking",Ri="seeked",Ni="timeupdate",ji="waiting",Bi="canplay",Ui="durationchange",Hi="volumechange",Fi="loadeddata",Vi="ratechange",zi="progress",Gi="loadstart",Wi="emptied",Ki="focus",$i="blur",Yi="ready",qi="urlNull",Xi="autoplay_started",Ji="autoplay_was_prevented",Zi="complete",Qi="replay",er="destroy",tr="urlchange",nr="download_speed_change",ir="fullscreen_change",rr="cssFullscreen_change",or="mini_state_change",ar="definition_change",sr="after_definition_change",lr="SEI_PARSED",cr="video_resize",ur="pip_change",hr="rotate",dr="screenShot",fr="playnext",pr="shortcut",gr="xglog",vr="user_action",yr="reset",mr="source_error",_r="source_success",br=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],kr={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},wr="fps_stuck",Tr=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:sr,AUTOPLAY_PREVENTED:Ji,AUTOPLAY_STARTED:Xi,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:Bi,CANPLAY_THROUGH:"canplaythrough",COMPLETE:Zi,CSS_FULLSCREEN_CHANGE:rr,DEFINITION_CHANGE:ar,DESTROY:er,DOWNLOAD_SPEED_CHANGE:nr,DURATION_CHANGE:Ui,EMPTIED:Wi,ENDED:Ii,ERROR:Ai,FPS_STUCK:wr,FULLSCREEN_CHANGE:ir,LOADED_DATA:Fi,LOADED_METADATA:"loadedmetadata",LOAD_START:Gi,MINI_STATE_CHANGE:or,PAUSE:Di,PIP_CHANGE:ur,PLAY:Pi,PLAYER_BLUR:$i,PLAYER_FOCUS:Ki,PLAYING:Li,PLAYNEXT:fr,PROGRESS:zi,RATE_CHANGE:Vi,READY:Yi,REPLAY:Qi,RESET:yr,RETRY:"retry",ROTATE:hr,SCREEN_SHOT:dr,SEEKED:Ri,SEEKING:Mi,SEI_PARSED:lr,SHORTCUT:pr,SOURCE_ERROR:mr,SOURCE_SUCCESS:_r,STALLED:"stalled",STATS_EVENTS:kr,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:Ni,URL_CHANGE:tr,URL_NULL:qi,USER_ACTION:vr,VIDEO_EVENTS:br,VIDEO_RESIZE:cr,VOLUME_CHANGE:Hi,WAITING:ji,XGLOG:gr},Symbol.toStringTag,{value:"Module"}));function Sr(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}function Cr(e,t){return function(n,i){var r={player:t,eventName:e,originalEvent:n,detail:n.detail||{},timeStamp:n.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[n.type],muted:t.muted,volume:t.volume,host:yi.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(n.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(r.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(r.error=i||t.video.error),t.mediaEventMiddleware[e]){var a=Sr.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw Sr.call(t,e,r),s}}else Sr.call(t,e,r)}}var Er=function(e){Qn(n,e);var t=ri(n);function n(e){var i;qn(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype="MP4",i._rate=-1,i.mediaConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return Si.isWeixin&&Si.os.isAndroid&&r&&(i.mediaConfig["x5-video-player-type"]=r,delete i.mediaConfig.playsinline,delete i.mediaConfig["webkit-playsinline"],delete i.mediaConfig["x5-playsinline"]),e.loop&&(i.mediaConfig.loop="loop"),i.media=yi.createDom(i.mediaConfig.mediaType,"",i.mediaConfig,""),e.defaultPlaybackRate&&(i.media.defaultPlaybackRate=i.media.playbackRate=e.defaultPlaybackRate),"Number"===yi.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.media.muted=!0,i._lastMuted=!0),e.autoplay&&(i.media.autoplay=!0),i._interval={},i.mediaEventMiddleware={},i.attachVideoEvents(),i}return Jn(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.mediaEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=br.map((function(t){var n="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[n]&&e.on(t,e[n]),Zn({},t,Cr(t,e))}))),this._evHandlers.forEach((function(e){var n=Object.keys(e)[0];t.addEventListener(n,e[n],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var n=Object.keys(e)[0];t.removeEventListener(n,e[n],!1)})),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){n.media.appendChild(yi.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._videoSourceIndex=i.length,this._vLoadeddata=function(e){n.emit(_r,{src:e.target.currentSrc,host:yi.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){var t=parseInt(e.target.getAttribute("data-index"),10);if(n._videoSourceIndex--,0===n._videoSourceIndex||t>=n._videoSourceCount){var i={code:4,message:"sources_load_error"};r?r.error(e,i):n.errorHandler("error",i)}var o=Ei[4];n.emit(mr,new Oi(n,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<i.length;a++)i[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var n=this.media.error||t,i=n.code?Ei[n.code]:"other";n.message;this.media.currentSrc||(n={code:6,message:"empty_src"}),this.emit(e,new Oi(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var n=this.media.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?yi.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){if(!this.media.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(tr,e),this.emit(ji),this._currentTime=0,this._duration=0,/^blob/.test(this.media.currentSrc)||/^blob/.test(this.media.src)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===yi.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=ai(ei(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=ai(ei(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=ai(ei(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=ai(ei(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){ai(ei(n.prototype),"removeAllListeners",this).call(this)}}]),n}(hi),xr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};qn(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return Jn(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),Or=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Pr=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Lr=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Ir="data-xgplayerid";function Dr(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(a&&a.then?a.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function Ar(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(Hl){throw Hl.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(Hl.message),Hl}if(this.__hooks&&this.__hooks[e])try{var a,s=(a=this.__hooks[e]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then((function(e){!1!==e&&Dr.apply(void 0,[r,t,n.next].concat(si(i)))})).catch((function(e){throw e})):Dr.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&Dr.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(Hl){throw Hl.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(Hl.message),Hl}else Dr.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function Mr(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function Rr(e,t){var n=this.__hooks;n&&delete n[e]}function Nr(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function jr(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function Br(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function Ur(e){e.__hooks=null}function Hr(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var a,s=(a=e.__hooks[t]).call.apply(a,[e,e].concat(r));if(s&&s.then)s.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==s)return n.call.apply(n,[e,e].concat(r))}function Fr(e,t){gi.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var Vr=function(){function e(t){qn(this,e),yi.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),Br(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return Jn(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=yi.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):Fr(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):Fr(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):Fr(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=$n($n({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return Ar.call.apply(Ar,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return Mr.call.apply(Mr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return Rr.call.apply(Rr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),yi.clearAllTimers(this),yi.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),Ur(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var zr=Element.prototype;zr.matches=zr.matchesSelector||zr.mozMatchesSelector||zr.msMatchesSelector||zr.oMatchesSelector||zr.webkitMatchesSelector}var Gr=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function Wr(e,t,n,i,r){var o=Kr.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function Kr(e,t,n,i){return function(n){n.delegateTarget=Gr(n.target,t),n.delegateTarget&&i.call(e,n)}}var $r=function(e,t,n,i,r){return"function"==typeof e.addEventListener?Wr.apply(null,arguments):"function"==typeof n?Wr.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return Wr(e,t,n,i,r)})))},Yr={CONTROLS:"controls",ROOT:"root"},qr={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"};function Xr(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Jr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return yi.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(Xr(e)||Xr(e.url))return i.src=Xr(e)?e:e.url||"",o=yi.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(yi.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(gi.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(Hl){return gi.logError("Plugin named [".concat(r,"]:createIcon"),Hl),null}return"string"==typeof e?yi.createDomFromHtml(e,i,n):(gi.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Zr(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;n&&n[i]&&(o=function(e,t){return"object"===Yn(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),a=function(e,t){return"object"===Yn(e)&&e.attr&&"object"===Yn(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],a),s=Jr(n[i],i,o,a,t.pluginName)),!s&&r&&(s=Jr(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[i]=s}))}var Qr=function(e){Qn(n,e);var t=ri(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qn(this,n),(e=t.call(this,i)).__delegates=[],e}return Jn(n,[{key:"__init",value:function(e){if(ai(ei(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,Zr(this.registerIcons()||{},this),this.langText={};var r,o,a=this.registerLanguageTexts()||{};r=a,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(Hl){throw gi.logError("Plugin:".concat(this.pluginName,":render"),Hl),new Error("Plugin:".concat(this.pluginName,":render:").concat(Hl.message))}if(s)(i=n.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=yi.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var l=this.config.attr||{},c=this.config.style||{};this.setAttr(l),this.setStyle(c),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Yn(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,a=t[o],s={root:e.root};"function"==typeof a?(i=e.config[o]||{},r=a):"object"===Yn(a)&&"function"==typeof a.plugin&&(i=a.options?yi.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=i,void 0!==i.index&&(s.index=i.index),i.root&&(s.root=i.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=ai(ei(n.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===yi.typeOf(e)?this.root.style[e]=t:void("Object"===yi.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===yi.typeOf(e)?this.root.setAttribute(e,t):void("Object"===yi.typeOf(e)&&Object.keys(e).map((function(t){n.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"unbindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,n)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(n){return gi.logError("Plugin:appendChild",n),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),ai(ei(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var a=0,s=null,l="";a<i;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=r){l="beforebegin";break}c<r&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var a=$r(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}));else{var a=$r(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return Yr}},{key:"POSITIONS",get:function(){return qr}}]),n}(Vr),eo=function(){function e(){var t=this;if(qn(this,e),Zn(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return _i(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),bi(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(Hl){console.error(Hl)}}return Jn(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(Ir),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(Hl){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(i){console.error(i)}return!0}return!1}}]),e}(),to=null;var no={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.resize()},to||(to=new eo),to.addObserver(t,n)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[i]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),n=0;n<t.length;n++){var i=this.pluginGroup[t[n]]._player;if(i.root===e)return i}return null}return null},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===yi.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var a=n.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){n.config||(n.config={});for(var s=Object.keys(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var c=o[s[l]];"Object"===yi.typeOf(c)?n.config=Object.assign({},n.config,o[s[l]]):"Boolean"===yi.typeOf(c)&&(n.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(i,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(n);return r[a.toLowerCase()]=u,r[a.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(Hl){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),Hl)}},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(n(t))}catch(Hl){throw a.push(n(null)),Hl}})),Promise.all([].concat(a)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(n){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var n=Object.keys(this.pluginGroup),i=0;i<n.length;i++){var r=this.pluginGroup[n[i]];r&&r._player&&(this.pluginGroup[n[i]]._player.isUserActive=!1)}return this.pluginGroup[e]._player.isUserActive=t,e}},getCurrentUseActiveId:function(){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),t=0;t<e.length;t++){var n=this.pluginGroup[e[t]];if(n&&n._player&&n._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,to.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,a=Object.keys(r);o<a.length;o++){var s=a[o];this.unRegister(t,s)}var l=e.isUseActive;if(delete this.pluginGroup[t],delete e._pluginInfoId,l){var c=Object.keys(this.pluginGroup);c.length>0&&this.setCurrentUserActive(c[c.length-1],!0)}}}},io={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function ro(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}var oo=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=ni(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Zn(ni(e),"onMouseLeave",(function(t){ni(e).player.focus()})),e}return Jn(n,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Si.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode;if(!n){"flex"===r&&this.player.addClass(io.FLEX_CONTROLS);var o={height:"".concat(i,"px")};Object.keys(o).map((function(t){e.root.style[t]=o[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(or,(function(t){t?yi.addClass(e.root,"mini-controls"):yi.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Si.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&yi.addClass(this.root,io.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){yi.removeClass(this.root,io.CONTROLS_AUTOHIDE)}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){var o=t.position?t.position:t.config&&t.config.position?t.config.position:r.position;switch(o){case qr.CONTROLS_LEFT:t.root=this.left;break;case qr.CONTROLS_RIGHT:t.root=this.right;break;case qr.CONTROLS_CENTER:t.root=this.center;break;case qr.CONTROLS:t.root=this.root;break;default:t.root=this.left}return ai(ei(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==Si.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=yi.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},Zn({},io.CONTROLS_AUTOHIDE,n),{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(Qr),ao={lang:{},langKeys:[],textKeys:[]};function so(e,t){return Object.keys(t).forEach((function(n){var i,r=yi.typeOf(t[n]),o=yi.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,si(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),so(e[n],t[n])):e[n]=t[n]})),e}function lo(){Object.keys(ao.lang.en).map((function(e){ao.textKeys[e]=e}))}function co(e,t){var n=e.LANG;if(t||(t=ao),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?so(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),lo()}}co({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var uo={get textKeys(){return ao.textKeys},get langKeys(){return ao.langKeys},get lang(){var e={};return ao.langKeys.map((function(t){e[t]=ao.lang[t]})),ao.lang["zh-cn"]&&(e.zh=ao.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=ao),t.lang){n="Array"!==yi.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?so(i[e.LANG]||{},e.TEXT||{}):co(e,t)})),lo()}},use:co,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return so(n.lang,ao.lang),(t=n.langKeys).push.apply(t,si(ao.langKeys)),so(n.textKeys,ao.textKeys),n}},ho={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},fo=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],po=["play","pause","replay","retry"],go=0,vo=0,yo=function(e){Qn(n,e);var t=ri(n);function n(e){var i;qn(this,n);var r,o=yi.deepMerge(ro(),e);Zn(ni(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;gi.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,(t||i._useAutoplay)&&i.mediaPlay(),i.off(Bi,i.canPlayFunc),i.removeClass(io.ENTER)}})),Zn(ni(i),"onFullscreenChange",(function(e,t){var n=function(){yi.setTimeout(ni(i),(function(){i.resize()}),100)},r=yi.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(vr,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,Ir);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.media.focus(),i.fullscreen=!0,i.changeFullStyle(i.root,r,io.FULLSCREEN),i.emit(ir,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var a=ni(i),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),yi.setTimeout(ni(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.media.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(io.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,io.FULLSCREEN),i._fullscreenEl=null,i.emit(ir,!1)}})),Zn(ni(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.media,i.onFullscreenChange(e,!0)})),Zn(ni(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),Br(ni(i),po),i.config=o,i._pluginInfoId=yi.generateSessionId(),(r=ni(i)).logInfo=gi.logInfo.bind(r),r.logWarn=gi.logWarn.bind(r),r.logError=gi.logError.bind(r);var a=i.constructor.defaultPreset;if(i.config.presets.length){var s=i.config.presets.indexOf("default");s>=0&&a&&(i.config.presets[s]=a)}else a&&i.config.presets.push(a);if(i.userTimer=null,i.waitTimer=null,i._state=ho.INITIAL,i.isError=!1,i._hasStart=!1,i.isSeeking=!1,i.isCanplay=!1,i._useAutoplay=!1,i.rotateDeg=0,i.isActive=!1,i.fullscreen=!1,i.cssfullscreen=!1,i.isRotateFullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i.videoPos={pi:1,scale:0,rotate:0,x:0,y:0,h:-1,w:-1,vy:0,vx:0},i.sizeInfo={width:0,height:0,left:0,top:0},i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.root=null,i.__i18n=uo.init(i._pluginInfoId),Si.os.isAndroid&&Si.osVersion>0&&Si.osVersion<6&&(i.config.autoplay=!1),i.database=new xr,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,!i._initDOM())return console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),ii(i);var l=i.config,c=l.definition,u=void 0===c?{}:c;if(!l.url&&u.list&&u.list.length>0){var h=u.list.find((function(e){return e.definition&&e.definition===u.defaultDefinition}));h||(u.defaultDefinition=u.list[0].definition,h=u.list[0]),i.config.url=h.url,i.curDefinition=h}return i._bindEvents(),i._registerPresets(),i._registerPlugins(),no.onPluginsReady(ni(i)),i.getInitDefinition(),i.setState(ho.READY),yi.setTimeout(ni(i),(function(){i.emit(Yi)}),0),i.onReady&&i.onReady(),(i.config.videoInit||i.config.autoplay)&&(!i.hasStart||i.state<ho.ATTACHED)&&i.start(),i}return Jn(n,[{key:"_initDOM",value:function(){var e=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var t=this.config.el;if(!t||1!==t.nodeType)return this.emit(Ai,new Oi("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=t}var n=no.checkPlayerRoot(this.root);n&&(gi.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Ir,this.playerId),no.init(this),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.mediaConfig.mediaType===i.mediaType){var r=this.innerContainer||this.root;this.detachVideoEvents(this.media);var o=new i(r,this.config,this.mediaConfig);this.attachVideoEvents(o),this.media=o}if(this.media.setAttribute(Ir,this.playerId),this.config.controls){var a=this.config.controls.root||null,s=no.register(this,oo,{root:a});this.controls=s}var l="mobile"===this.config.isMobileSimulateMode?"mobile":Si.device;if(this.addClass("".concat(io.DEFAULT," ").concat(io.INACTIVE," xgplayer-").concat(l," ").concat(this.config.controls?"":io.NO_CONTROLS)),this.config.autoplay?this.addClass(io.ENTER):this.addClass(io.NO_START),this.config.fluid){var c=this.config,u=c.width,h=c.height;"number"==typeof u&&"number"==typeof h||(u=600,h=337.5);var d={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*h/u,"%")};Object.keys(d).forEach((function(t){e.root.style[t]=d[t]}))}else["width","height"].forEach((function(t){e.config[t]&&("number"!=typeof e.config[t]?e.root.style[t]=e.config[t]:e.root.style[t]="".concat(e.config[t],"px"))}));var f=this.root.getBoundingClientRect(),p=f.width,g=f.height,v=f.left,y=f.top;return this.sizeInfo.width=p,this.sizeInfo.height=g,this.sizeInfo.left=v,this.sizeInfo.top=y,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=yi.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),Or.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Si.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(Fi,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(Pi,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Or.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(Pi,this.playFunc),this.off(Bi,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.media&&(e&&""!==e&&("Array"!==yi.typeOf(e)||0!==e.length)||(e="",this.emit(qi),gi.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.media),"Array"===yi.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e,"Number"===yi.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var i=this.media.readyState;gi.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.media.currentSrc)&&!/^blob/.test(this.media.src)&&this.load(),(Si.os.isIpad||Si.os.isPhone)&&this.mediaPlay()),i>=2?this.canPlayFunc():this.once(Bi,this.canPlayFunc),(!this.hasStart||this.state<ho.ATTACHED)&&no.afterInit(this),this.hasStart=!0,this.setState(ho.ATTACHED),yi.setTimeout(this,(function(){t.emit(Zi)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&uo.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(i&&o.indexOf(i.toLowerCase())>-1)return null;if(!t&&a[i.toLowerCase()])return;if(n.lazy&&n.loader){var r=no.lazyRegister(e,n);return void(n.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){gi.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(n)}catch(s){gi.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,a=void 0===o?[]:o,s=r.ignores,l=void 0===s?[]:s,c=r.icons,u=void 0===c?{}:c,h=r.i18n,d=void 0===h?[]:h;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,si(a)),(i=e.config.ignores).push.apply(i,si(l)),Object.keys(u).map((function(t){e.config.icons[t]||(e.config.icons[t]=u[t])}));var f=e.config.i18n||[];d.push.apply(d,si(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case qr.ROOT_RIGHT:this.rightBar||(this.rightBar=yi.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case qr.ROOT_LEFT:this.leftBar||(this.leftBar=yi.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case qr.ROOT_TOP:this.topBar||(this.topBar=yi.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&yi.addClass(this.topBar,io.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=no.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!no.checkPluginIfExits(i.pluginName,o)&&o.push(i);var a=no.getRootByConfig(i.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(s)),no.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?no.unRegister(this,e):e instanceof Vr&&no.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof Vr&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return no.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=no.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(yi.hasClass(this.root,e)||yi.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&yi.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return yi.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>ho.ATTACHING))return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(ho.ATTACHING),this._registerPlugins(!1),no.beforeInit(this).then((function(){if(t.config)return e||(e=t.url||t.config.url),t._startInit(e)})).catch((function(e){throw e.fileName="player",e.lineNumber="236",gi.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var n=this,i=e;"Object"===yi.typeOf(e)&&(i=e.url);var r=this.currentTime,o=this.paused&&!this.isError;return this.src=i,new Promise((function(e,t){var a=function(e){n.off("timeupdate",s),n.off("canplay",s),t(e)},s=function(){n.currentTime=r,o&&n.pause(),n.off("error",a),e(!0)};n.once("error",a),i?(Si.os.isAndroid?n.once("timeupdate",s):n.once("canplay",s),n.play()):n.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<ho.ATTACHED)return this.removeClass(io.NO_START),this.addClass(io.ENTER),this.start(),void(this._useAutoplay=!0);this.state<ho.RUNNING&&(this.removeClass(io.NO_START),!this.isCanplay&&this.addClass(io.ENTER));var t=ai(ei(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(io.NOT_ALLOW_AUTOPLAY),e.addClass(io.PLAYING),e.state<ho.RUNNING&&(gi.logInfo(">>>>playPromise.then"),e.setState(ho.RUNNING),e.emit(Xi))})).catch((function(t){if(gi.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(io.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=yi.setTimeout(e,(function(){e._errorTimer=null,e.emit(Ji),e.addClass(io.NOT_ALLOW_AUTOPLAY),e.removeClass(io.ENTER),e.pause(),e.setState(ho.NOTALLOW)}),0))})):(gi.logWarn("video.play not return promise"),this.state<ho.RUNNING&&(this.setState(ho.RUNNING),this.removeClass(io.NOT_ALLOW_AUTOPLAY),this.removeClass(io.NO_START),this.removeClass(io.ENTER),this.addClass(io.PLAYING),this.emit(Xi))),t}},{key:"mediaPause",value:function(){ai(ei(n.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){ai(ei(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(io.PAUSED),Hr(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;Hr(this,"pause",(function(){ai(ei(n.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,a=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(Ri,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(io.ENTER),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(Ri,this._onceSeekCanplay),this.state<ho.RUNNING?(this.removeClass(io.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(n.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(ar,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,$n({seamless:!1!==i.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){n.emit(sr,{from:t,to:e})})):this.emit(sr,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(Fi,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[io.NOT_ALLOW_AUTOPLAY,io.PLAYING,io.NO_START,io.PAUSED,io.REPLAY,io.ENTER,io.ENDED,io.ERROR,io.LOADING];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(io.ENTER),this.emit(yr)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;this.resetState();var i=this.plugins;if(i&&(t.map((function(t){e.deregister(t)})),n)){var r=ro();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=r[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,r=this.media;if(i&&r){if(this.hasStart=!1,this._useAutoplay=!1,i.removeAttribute(Ir),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),yi.clearAllTimers(this),this.emit(er),no.destroy(this),Ur(this),ai(ei(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),t)for(var o=t.children,a=0;a<o.length;a++)t.removeChild(o[a]);!t&&r instanceof window.Node&&i.contains(r)&&i.removeChild(r),["topBar","leftBar","rightBar","innerContainer"].map((function(t){e[t]&&i.removeChild(e[t]),e[t]=null}));var s=i.className.split(" ");s.length>0?i.className=s.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):i.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(io.ENDED),this.currentTime=0,this.isSeeking=!1,Hr(this,"replay",(function(){e.once(Ri,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(Qi),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(io.ERROR),this.addClass(io.LOADING),Hr(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(Bi,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=io.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=yi.filterStyleFromText(e)),yi.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=yi.filterStyleFromText(t),yi.addClass(t,i),t.setAttribute(Ir,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=io.PARENT_FULLSCREEN),this._orgCss&&(yi.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),yi.removeClass(e,n),t&&t!==e&&this._orgPCss&&(yi.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",yi.removeClass(t,i),t.removeAttribute(Ir))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.media;e||(e=t),this._fullScreenOffset={top:yi.scrollTop(),left:yi.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var i=yi.getFullScreenEl();if(i===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=0;r<Pr.length;r++){var o=Pr[r];if(e[o]){var a="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return a&&a.then?a:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(s){return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||yi.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var n=0;n<Lr.length;n++){var i=Lr[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(o){return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var t=e?"".concat(io.INNER_FULLSCREEN," ").concat(io.CSS_FULLSCREEN):io.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var n=this.config.fullscreen,i=void 0===n?{}:n,r=!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen();r&&(this.fullscreen=!0,this.emit(ir,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(rr,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(io.INNER_FULLSCREEN," ").concat(io.CSS_FULLSCREEN):io.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,n=void 0===t?{}:t;!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(ir,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(rr,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(io.INNER_FULLSCREEN," ").concat(io.ROTATE_FULLSCREEN):io.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,io.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(ir,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(io.INNER_FULLSCREEN," ").concat(io.ROTATE_FULLSCREEN):io.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,io.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(ir,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(Ki,$n({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit($i,$n({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3};if(this.isActive=!0,this.removeClass(io.INACTIVE),this.userTimer&&(yi.clearTimeout(this,this.userTimer),this.userTimer=null),!1!==t.autoHide&&!0!==t.isLock){var n=t.delay||this.config.inactive;this.userTimer=yi.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}else this.userTimer&&(yi.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignorePaused,n=void 0!==t&&t;if(this.isActive){var i=this.config.closePauseVideoFocus;this.isActive=!1,(n||i||!this.paused&&!this.ended)&&this.addClass(io.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(io.ENTER),this.removeClass(io.ERROR),this.removeClass(io.LOADING),this.isCanplay=!0,this.waitTimer&&yi.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1}},{key:"onLoadstart",value:function(){this.removeClass(io.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===ho.ENDED&&this.setState(ho.RUNNING),this.removeClass(io.PAUSED),this.ended&&this.removeClass(io.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(io.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(yi.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(io.ENDED),this.setState(ho.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(io.NOT_ALLOW_AUTOPLAY),this.removeClass(io.NO_START),this.removeClass(io.ENTER),this.removeClass(io.LOADING),this.addClass(io.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(io.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&yi.clearTimeout(this,this.waitTimer),this.removeClass(io.LOADING),this.removeClass(io.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&yi.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=yi.setTimeout(this,(function(){e.addClass(io.LOADING),yi.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[io.NO_START,io.PAUSED,io.ENDED,io.ERROR,io.REPLAY,io.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(io.LOADING))&&this.media.readyState>2&&(this.removeClass(io.LOADING),yi.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state<ho.RUNNING&&this.duration&&(this.setState(ho.RUNNING),this.emit(Xi)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===yi.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,n){if(this.media&&t&&e){var i="String"===yi.typeOf(e)?e:e.type||"";n.props&&"Array"!==yi.typeOf(n.props)&&(n.props=[n.props]),this.emit(vr,$n({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.media.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=e||this.media.currentTime||.2,i=t.length,r=0;r<i;r++)if(t.start(r)<=n&&t.end(r)>n)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,n=e.vy,i=e.vx,r=e.h,o=e.w;if(t||n||i){var a=this.videoPos._pi;if(!a&&this.media.videoHeight&&(a=this.media.videoWidth/this.media.videoHeight*100),a){this.videoPos.pi=a;var s={rotate:t},l=0,c=0,u=1,h=Math.abs(t/90),d=this.root,f=this.innerContainer,p=d.offsetWidth,g=f?f.offsetHeight:d.offsetHeight,v=g,y=p;if(h%2==0)u=r>0?100/r:o>0?100/o:1,s.scale=u,l=n>0?(100-r)/2-n:0,s.y=2===h?0-l:l,c=i>0?(100-o)/2-i:0,s.x=2===h?0-c:c,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(v,"px");else if(h%2==1){v=p;var m=g-p;c=-m/2/(y=g)*100,s.x=3===h?c+n/2:c-n/2,l=m/2/v*100,s.y=3===h?l+i/2:l-i/2,s.scale=u,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(v,"px")}var _=yi.getTransformStyle(s);this.media.style.transform=_,this.media.style.webkitTransform=_}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===yi.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,Hr(this,"playnext",(function(){t.start(),t.emit(fr,e)}))}},{key:"resize",value:function(){var e=this;if(this.media){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.media,i=n.videoWidth,r=n.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&i){this._videoHeight=r,this._videoWidth=i;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=t.width,u=t.height-l,h=parseInt(i/r*1e3,10),d=parseInt(c/u*1e3,10),f=c,p=u,g={};"auto"===a&&d>h||"fixWidth"===a?(p=c/h*1e3,this.config.fluid?g.paddingTop="".concat(100*p/f,"%"):g.height="".concat(p+l,"px")):("auto"===a&&d<h||"fixHeight"===a)&&(f=h*u/1e3,g.width="".concat(f,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&d<h||"fillWidth"===s&&d>h)&&this.setAttribute("data-xgfill","cover");var v={videoScale:h,vWidth:f,vHeight:p,cWidth:f,cHeight:p+l};this.resizePosition(),this.emit(cr,v)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(e,t):this.media.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){gi.logInfo("setState","state from:".concat(fo[this.state]," to:").concat(fo[e])),this._state=e}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(ho.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===ho.RUNNING||this._state===ho.ENDED},set:function(e){e?this.setState(ho.RUNNING):this._state>=ho.RUNNING&&this.setState(ho.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition,i=null,r=null;n.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==uo.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,no.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(uo.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Ci}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return ai(ei(n.prototype),"readyState",this)}},{key:"error",get:function(){var e=ai(ei(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return ai(ei(n.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=yi.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return vo},set:function(e){vo=e}},{key:"realTimeSpeed",get:function(){return go},set:function(e){go=e}},{key:"hook",value:function(e,t){return Ar.call.apply(Ar,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return Mr.call.apply(Mr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return Rr.call.apply(Rr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return Nr.call.apply(Nr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return jr.call.apply(jr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),no.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return gi.config.debug},set:function(e){gi.config.debug=e}},{key:"getCurrentUserActivePlayerId",value:function(){return no.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){no.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return Si.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Si.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(Er);function mo(){return(new Date).getTime()}Zn(yo,"defaultPreset",null),Zn(yo,"XgVideoProxy",null);var _o="loadstart",bo="loadeddata",ko="firstFrame",wo="waitingStart",To="waitingEnd",So="seekStart",Co="seekEnd",Eo=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(gi.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),Zn(ni(e),"_onAutoplayStart",(function(){gi.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Zn(ni(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=mo(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&yi.clearTimeout(ni(e),e._waitTimer),e._waittTimer&&yi.clearTimeout(ni(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Zn(ni(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=mo(),e.emitLog(So,{start:mo()}))})),Zn(ni(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),Zn(ni(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=mo(),e.fixedWaitingStart=mo(),e._waitType=1,e.emitLog(wo,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Zn(ni(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=mo(),e._waitTimer=yi.setTimeout(ni(e),(function(){e._isWaiting&&(e.waitingStart=mo(),yi.clearTimeout(ni(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(wo,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),Zn(ni(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Zn(ni(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=mo(),this.loadedCostTime=0,this.startCostTime=0,this.on(Gi,(function(){var t=e._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=mo()-e.newPointTime,gi.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(_o,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=mo(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(Fi,(function(){e.vt=mo(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;gi.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(bo,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Mi,this._onSeeking),this.on(Ri,this._onSeeked),this.on(er,(function(){e.endState("destroy")})),this.on(tr,(function(){e.endState("urlChange"),gi.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Li,Bi],this._onPlaying),this.on(ji,this._onWaiting),this.on(Ai,this._onError),this.on(yr,(function(){gi.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(Xi,this._onAutoplayStart),this.off(Ni,this._onTimeupdate),this.once(Xi,this._onAutoplayStart),this.once(Ni,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=mo();var t=this._state,n=t.isFFLoading,i=t.isFFSend;gi.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i&&(gi.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(ko,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&yi.clearTimeout(this,this._waittTimer),this._waittTimer=yi.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),yi.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=mo(),n=t-this.seekingStart;this.seekingStart=0,this.emitLog(Co,{end:t,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(yi.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(yi.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=mo(),n=t-this.waitingStart,i=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(To,{fixedCostTime:i>r?r:i,costTime:n>r?r:n,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(gr,$n({t:mo(),host:yi.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(Qr);function xo(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Oo=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"registerIcons",value:function(){return{replay:xo}}},{key:"afterCreate",value:function(){var e=this;Qr.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Ii,(function(){if(e.playerConfig.loop||yi.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(Pi,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),yi.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n}(Qr),Po=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){yi.addClass(this.root,"hide")}},{key:"show",value:function(){yi.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(Ii,(function(){e.isEndedShow&&yi.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(Ni,(function(){e.onTimeUpdate()})),this.on(tr,(function(){yi.removeClass(e.root,"hide"),yi.addClass(e.root,"xg-showplay"),e.once(Ni,(function(){e.onTimeUpdate()}))}))):this.on(Pi,(function(){yi.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?yi.removeClass(this.root,"xg-showplay"):this.once(Ni,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(Qr);function Lo(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Io(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Do={};function Ao(e){e?window.clearTimeout(e):Object.keys(Do).map((function(e){window.clearTimeout(Do[e].id),delete Do[e]}))}var Mo=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),yi.removeClass(i.root,e),i.show()})),Zn(ni(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";yi.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i}return Jn(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(Yi,(function(){n&&(n.lang&&"en"===n.lang?yi.addClass(t.root,"lang-is-en"):"jp"===n.lang&&yi.addClass(t.root,"lang-is-jp"))})),this.on(Xi,this.onAutoplayStart),n.autoplay||this.show(),this.on(Ji,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),yi.removeClass(e.root,t),e.show()})),this.on(Pi,(function(){e.onPlayPause("play")})),this.on(Di,(function(){e.onPlayPause("pause")})),this.on(yr,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var n=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:n,to:!n})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Lo,class:"xg-icon-play"},startPause:{icon:Io,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){yi.addClass(this.root,"hide")}},{key:"show",value:function(){yi.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){yi.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){yi.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return Do[e]&&window.clearTimeout(Do[e].id),Do[e]={},n.start&&n.start(),Do[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Do[e].id),delete Do[e]}),t),Do[e].id}("pauseplay",400,{start:function(){yi.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){yi.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){yi.removeClass(this.root,"interact"),Ao(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<ho.READY)||(this.player.paused||t.state!==ho.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n&&!(n.state<ho.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Ao(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(Qr),Ro=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=yi.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(Qr);function No(e,t,n){try{return' <div class="xg-tips '.concat(n?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(Hl){return'<div class="xg-tips hide"></div>'}}var jo=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:10}}}]),n}(Qr);function Bo(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var Uo=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Ho=Uo.length;function Fo(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Yn(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<Ho;t++)e[Uo[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<Ho;r++){var o=Uo[r],a=t[o],s=parseFloat(a);n[o]=Number.isNaN(s)?0:s}var l=n.paddingLeft+n.paddingRight,c=n.paddingTop+n.paddingBottom,u=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,d=n.borderLeftWidth+n.borderRightWidth,f=n.borderTopWidth+n.borderBottomWidth,p=i,g=Bo(t.width);!1!==g&&(n.width=g+(p?0:l+d));var v=Bo(t.height);return!1!==v&&(n.height=v+(p?0:c+f)),n.innerWidth=n.width-(l+d),n.innerHeight=n.height-(c+f),n.outerWidth=n.width+u,n.outerHeight=n.height+h,n}}function Vo(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var zo="dragStart",Go="dragMove",Wo="dragEnded",Ko={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},$o=function(e){Qn(n,e);var t=ri(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qn(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):ii(i)}return Jn(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),Ko[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=Ko[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=Vo(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Vo(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Vo(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=Fo(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(zo,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(Wo)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,r),this.position.x=i+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(Go,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=Fo(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(hi),Yo=function(e){Qn(n,e);var t=ri(n);function n(e){var i;qn(this,n),Zn(ni(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Zn(ni(i),"onCenterClick",(function(e){var t=ni(i).player;t.paused?t.play():t.pause()})),Zn(ni(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(yi.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=ni(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return Jn(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Di,(function(){e.setAttr("data-state","pause")})),this.on(Pi,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(jo,n,jo.pluginName)}var i=yi.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new $o(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Lo,class:"xg-icon-play"},pause:{icon:Io,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},yi.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(or,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;yi.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(or,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=yi.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(No(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(Qr),qo={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Xo=["videoClick","videoDbClick"],Jo=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=ni(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.media.focus())})),Zn(ni(e),"onMouseEnter",(function(t){var n=ni(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.media.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Zn(ni(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Zn(ni(e),"onVideoClick",(function(t){var n=ni(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.root&&t.target!==i.media&&t.target!==i.innerContainer&&t.target!==i.media.__canvas||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,Hr(ni(e),Xo[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Zn(ni(e),"onVideoDblClick",(function(t){var n=ni(e),i=n.player,r=n.playerConfig;r.closeVideoDblclick||!t.target||t.target!==i.media&&t.target!==i.media.__canvas||(!r.closeVideoClick&&e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),Hr(ni(e),Xo[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{props:"fullscreen",from:i.fullscreen,to:!i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Xo.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Si.device&&!Si.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;i&&i.addEventListener("click",this.onVideoClick,!1),i&&i.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(qo).map((function(t){i.addEventListener(t,e[qo[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),i.removeEventListener("click",this.onVideoClick,!1),i.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(qo).map((function(t){i.removeEventListener(t,e[qo[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Vr),Zo="press",Qo="pressend",ea="doubleclick",ta="click",na="touchmove",ia="touchstart",ra="touchend",oa={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},aa={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function sa(e){return e&&e.length>0?e[e.length-1]:null}var la=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};qn(this,e),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?aa:oa,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Jn(e,[{key:"_initEvent",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(Zo,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(ea,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(ta,e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(i){console.error("trigger>>:".concat(e),i)}}))}},{key:"onTouchStart",value:function(e){var t=this._pos,n=this.root,i=sa(e.touches);t.x=i?parseInt(i.pageX,10):e.pageX,t.y=i?parseInt(i.pageX,10):e.pageX,t.start=!0,this.__setPress(e),n.addEventListener(this.events.end,this.onTouchEnd),n.addEventListener(this.events.cancel,this.onTouchCancel),n.addEventListener(this.events.move,this.onTouchMove),this.trigger(ia,e)}},{key:"onTouchCancel",value:function(e){this.onTouchEnd(e)}},{key:"onTouchEnd",value:function(e){var t=this._pos,n=this.root;this.__clearPress(),n.removeEventListener(this.events.cancel,this.onTouchCancel),n.removeEventListener(this.events.end,this.onTouchEnd),n.removeEventListener(this.events.move,this.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&this.trigger(Qo,e),this.trigger(ra,e),!t.press&&!t.moving&&this.__setDb(e),t.press=!1,t.start=!1,t.moving=!1}},{key:"onTouchMove",value:function(e){var t=this._pos,n=this.config,i=sa(e.touches),r=i?parseInt(i.pageX,10):e.pageX,o=i?parseInt(i.pageY,10):e.pageX,a=r-t.x,s=o-t.y;Math.abs(s)<n.miniStep&&Math.abs(a)<n.miniStep||(this.__clearPress(),t.press&&this.trigger(Qo,e),t.press=!1,t.moving=!0,this.trigger(na,e))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).map((function(n){e.root.removeEventListener("touchend",e[t[n]])}))}}]),e}();function ca(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var ua="auto",ha="seeking",da="playbackrate",fa=["videoClick","videoDbClick"],pa=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"onTouchStart",(function(e){var t=ni(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=i.getTouche(e);if(s&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,yi.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),i.find(".xg-dur").innerHTML=yi.format(i.duration);var l=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var c=parseInt(s.pageX-o.left,10),u=parseInt(s.pageY-o.top,10);o.x=90===n.rotateDeg?u:c,o.y=90===n.rotateDeg?c:u,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),Zn(ni(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=ni(i),r=n.pos,o=n.config,a=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,c=parseInt(t.pageX-r.left,10),u=parseInt(t.pageY-r.top,10),h=90===a.rotateDeg?u:c,d=90===a.rotateDeg?c:u;if(Math.abs(h-r.x)>s||Math.abs(d-r.y)>s){var f=h-r.x,p=d-r.y,g=r.scope;if(-1===g&&(0===(g=i.checkScope(h,d,f,p,r))&&(l?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*i.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),Zn(ni(i),"onTouchEnd",(function(e){var t=ni(i),n=t.player,r=t.pos,o=t.playerConfig;if(r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var a=i.config,s=a.disableGesture,l=a.gestureX;!s&&l?(i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10)):r.time=0,r.scope=-1,i.resetPos(),yi.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(ua)}})),Zn(ni(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Zn(ni(i),"onRootTouchEnd",(function(e){i.pos.isStart&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.onTouchEnd(e))})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return Jn(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:ca,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;fa.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),yi.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=yi.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new la(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(Ui,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([Bi,Ii],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).map((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var a=i.plugins.progress;a&&(a.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),a.addCallBack("dragend",(function(){e.changeAction(ua)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&yi.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:Si.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(ua)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.state<ho.RUNNING?i.closeVideoClick||(this.sendUseAction(yi.createEvent("click")),t.play()):!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.sendUseAction(yi.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.state>=ho.RUNNING&&(this.sendUseAction(yi.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;Hr(this,fa[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;Hr(this,fa[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(da))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(ua))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),n.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(ha);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=yi.format(this.duration),this.find(".xg-cur").innerHTML=yi.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?yi.removeClass(this.find(".xg-seek-show"),"xg-back"):yi.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<ho.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(Qr);function ga(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var va=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n=t||window.event,i=n.keyCode,r=ni(e)._keyState;if(!t.repeat){if(r.isKeyDown||e.config.disable||e.config.disableBodyTrigger||!e.player.isUserActive&&!e.config.isIgnoreUserActive||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey)return;(n.target===document.body||e.config.isGlobalTrigger&&!ga(n.target))&&e.checkCode(i,!0)&&(r.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)}r.isBodyKeyDown&&e.handleKeyDown(n)}})),Zn(ni(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Zn(ni(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=ni(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Zn(ni(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return Jn(n,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,a={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.fullscreen,i=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]],a=o.action,s=o.keyCode,l=o.disable,c=o.pressAction,u=o.disablePress;if(s===e){if(!(l||n&&u)){var h=n&&c||a;"function"==typeof h?a(t,this.player,n):"string"==typeof h&&"function"==typeof this[h]&&this[h](t,this.player,n),this.emit(pr,$n({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(Vr);function ya(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var ma=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"registerIcons",value:function(){return{loadingIcon:ya}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:qr.ROOT}}}]),n}(Qr),_a=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],ba=function(){function e(t){qn(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return Jn(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var s=i[r],l=0===a?0:(a-s.start)/s.duration;n[r][e].style.width=l<0?0:"".concat(100*l,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==yi.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==yi.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(yi.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)yi.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return yi.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=yi.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=yi.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),_a.forEach((function(t){o.appendChild(yi.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}(),ka={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},wa=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=ni(i),r=n.pos,o=n.config,a=n.player,s=t;if(e){yi.event(e);var l=yi.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(r.moving&&Math.abs(r.x-c)<o.miniMoveStep)return;r.moving=!0,r.x=c,s=i.computeTime(e,c)}i.triggerCallbacks("dragmove",s,e),i._updateInnerFocus(s)})),Zn(ni(i),"onBodyClick",(function(e){i.pos.isLocked&&(i.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),Zn(ni(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Zn(ni(i),"_mouseUpHandler",(function(e,t){ni(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Zn(ni(i),"_mouseMoveHandler",(function(e,t){var n=ni(i),r=n._state,o=n.pos,a=n.config,s=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Zn(ni(i),"onMouseDown",(function(e){var t=ni(i),n=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=yi.getEventPos(e,r.zoom),c=90===r.rotateDeg?l.clientY:l.clientX;if(!(r.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&r.ended)){if(r.duration||r.isPlaying){e.stopPropagation(),i.focus(),yi.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),yi.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),yi.event(e),o.x=c,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,yi.addClass(i.progressBtn,"active");var u=i.computeTime(e,c);return u.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,u),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1)),!0}r.play()}})),Zn(ni(i),"onMouseUp",(function(e){var t=ni(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;e.stopPropagation(),e.preventDefault(),yi.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),yi.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),yi.event(e),yi.removeClass(i.progressBtn,"active");var l=i.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(i.triggerCallbacks("dragend",l,e),i.emitUserAction("drag","dragend",l)):(i.triggerCallbacks("click",l,e),i.emitUserAction("click","click",l)),i._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0,"touchend"===e.type?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),yi.setTimeout(ni(i),(function(){i.resetSeekState()}),10),n.focus()})),Zn(ni(i),"onMouseMove",(function(e){var t=ni(i),n=t._state,r=t.pos,o=t.player,a=t.config;yi.checkTouchSupport()&&e.preventDefault(),yi.event(e);var s=yi.getEventPos(e,o.zoom),l=90===o.rotateDeg?s.clientY:s.clientX,c=Math.abs(r.x-l);if(!(r.moving&&c<a.miniMoveStep||!r.moving&&c<a.miniStartStep)){r.x=l;var u=i.computeTime(e,l);u.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,u)}})),Zn(ni(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Zn(ni(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Zn(ni(i),"onMouseEnter",(function(e){var t=ni(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),yi.event(e);var o=yi.getEventPos(e,n.zoom),a=90===n.rotateDeg?o.clientY:o.clientX,s=i.computeTime(e,a);i.triggerCallbacks("mouseenter",s,e),i.focus()}})),Zn(ni(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),Zn(ni(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return Jn(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=$n($n({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new ba(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===Si.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(Ui,(function(){e.onMouseLeave()})),this.on(Ni,(function(){e.onTimeupdate()})),this.on(Ri,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(zi,(function(){e.onCacheUpdate()})),this.on(Ii,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(Wi,(function(){e.onReset()})),this.on(cr,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Yn(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(r){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),r)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",yi.stopPropagation),t.center&&t.center.addEventListener("touchend",yi.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),yi.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),yi.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.config.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===r.rotateDeg?(n=s,i=l):(n=a,i=c);var h=u-i,d=(h=h>n?n:h<0?0:h)/n;return{percent:d=d<0?0:d>1?1:d,currentTime:parseInt(d*this.duration*1e3,10)/1e3,offset:h,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!t.isSeeking&&!this.isProgressMoving){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=yi.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=yi.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",yi.stopPropagation),t.center&&t.center.removeEventListener("touchend",yi.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:ka.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return ka}}]),n}(Qr),Ta=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Zn(ni(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return Jn(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave)}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(Qr),Sa=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){var e=this;ai(ei(n.prototype),"afterCreate",this).call(this);var t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on([Di,Ai,Wi],(function(){e.animate(t.paused)})),this.on(Pi,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:Lo,class:"xg-icon-play"},pause:{icon:Io,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,n=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),n&&this.changeLangTextKey(n,t.PLAY_TIPS)):(this.setAttr("data-state","play"),n&&this.changeLangTextKey(n,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(No(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(Ta);function Ca(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var Ea=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:Ca,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){yi.addClass(this.root,"show")}},{key:"hide",value:function(){yi.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:qr.ROOT_TOP,index:0}}}]),n}(Qr);function xa(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Oa(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Pa=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.player.setRotateDeg(0):e.player.setRotateDeg(90))})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this;ai(ei(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=yi.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var n=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:n,to:!n})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(ir,(function(t){var n=e.find(".xg-tips");n&&e.changeLangTextKey(n,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:Ea,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Si.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:xa,class:"xg-get-fullscreen"},exitFullscreen:{icon:Oa,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Si.device?"touchend":"click",this.handleFullscreen),"mobile"===Si.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,n=this.config;!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):n.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):n.switchCallback&&"function"==typeof n.switchCallback?n.switchCallback(t.fullscreen):t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(e){}))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){ai(ei(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){ai(ei(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(No(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(Ta),La=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),(i=t.call(this,e)).isActiving=!1,i}return Jn(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"currentTime",get:function(){return this.player.currentTime||0}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on(Ui,(function(){e.onTimeUpdate()})),this.on(Ni,(function(){e.onTimeUpdate()})),this.on(Ii,(function(){e.onTimeUpdate(!0)})),this.on(Wi,(function(){e.onReset()})))}},{key:"show",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="block"),void(this.centerDurDom&&(this.centerDurDom.style.display="block"));this.root.style.display="block"}},{key:"hide",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="none"),void(this.centerDurDom&&(this.centerDurDom.style.display="none"));this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(!n.disable&&!this.isActiving&&t.hasStart){var r=t.currentTime+this.timeOffset;r=yi.adjustTimeByDuration(r,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(yi.format(r)),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=yi.format(i))):(this.timeDom.innerHTML=this.minWidthTime(yi.format(r)),i!==1/0&&i>0&&(this.durationDom.innerHTML=yi.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(yi.format(0)),this.centerDurDom.innerHTML=yi.format(0)):(this.timeDom.innerHTML=this.minWidthTime(yi.format(0)),this.durationDom.innerHTML=yi.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=yi.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=yi.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(yi.hide(this.durationDom),yi.hide(this.timeDom),yi.hide(this.find(".time-separator")),yi.show(this.find(".time-live-tag"))):yi.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(yi.hide(this.durationDom),yi.hide(this.timeDom),yi.hide(this.find(".time-separator")),yi.show(this.find(".time-live-tag"))):(yi.hide(this.find(".time-live-tag")),yi.show(this.find(".time-separator")),yi.show(this.durationDom),yi.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=this.minWidthTime(yi.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(yi.format(e)))}},{key:"minWidthTime",value:function(e){return e.split(":").map((function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(Ri,n),t.isSeeking?this.once(Ri,n):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(Qr);function Ia(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Da(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Aa(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Ma=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=ni(e).player,i=e.find(".xgplayer-bar");yi.event(t);var r=i.getBoundingClientRect(),o=yi.getEventPos(t,n.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Zn(ni(e),"onBarMouseMove",(function(t){var n=ni(e)._d;if(n.isStart){var i=ni(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),yi.event(t);var a=yi.getEventPos(t,o.zoom);n.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),Zn(ni(e),"onBarMouseUp",(function(t){yi.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=ni(e)._d;n.isStart=!1,n.isMoving=!1})),Zn(ni(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Zn(ni(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Zn(ni(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return Jn(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:Da,class:"xg-volume-small"},volumeLarge:{icon:Ia,class:"xg-volume"},volumeMuted:{icon:Aa,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==Si.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(Hi,this.onVolumeChange),this.once(Fi,this.onVolumeChange),"Number"!==yi.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);i.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:n.volume,to:a}};n.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:s}),n.volume=Math.max(Math.min(o/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.ceil(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(yi.clearTimeout(this,this._timerId),this._timerId=null),yi.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(yi.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=yi.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),yi.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(yi.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===Si.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(Qr);function Ra(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var Na=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),(i=t.call(this,e)).rotateDeg=i.config.rotateDeg||0,i}return Jn(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){ai(ei(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(cr,(function(){e.rotateDeg&&e.config.innerRotate&&yi.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){if(e||(e=0),t)this.player.videoRotateDeg=e;else{var n=this.player,i=this.rootWidth,r=this.rootHeight,o=n.root,a=n.innerContainer,s=n.media,l=o.offsetWidth,c=a&&t?a.offsetHeight:o.offsetHeight,u=i,h=r,d=0,f=0;.75!==e&&.25!==e||(u="".concat(c,"px"),h="".concat(l,"px"),d=-(c-l)/2,f=-(l-c)/2);var p="translate(".concat(d,"px,").concat(f,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:p,webKitTransform:p,height:h,width:u},v=t?s:o,y=t?n.getPlugin("poster"):null;Object.keys(g).map((function(e){v.style[e]=g[e],y&&y.root&&(y.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(hr,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:Ra}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(No(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(Ta);function ja(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function Ba(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var Ua="picture-in-picture",Ha="inline",Fa="fullscreen",Va=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!0,to:!1}),e.setAttr("data-state","normal")):4===e.player.media.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return Jn(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(ai(ei(n.prototype),"afterCreate",this).call(this),this.pMode=Ha,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Zi,(function(){e.config.showIcon&&(yi.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:ja,class:"xg-get-pip"},pipIconExit:{icon:Ba,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var n=t.paused;yi.setTimeout(e,(function(){!n&&t.mediaPlay()}),0),!n&&t.mediaPlay(),e.setAttr("data-state","normal"),t.emit(ur,!1)},this.enterPIPCallback=function(n){t.emit(ur,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.media.webkitPresentationMode;e.pMode===Fa&&i!==Fa&&t.onFullscreenChange(null,!1),e.pMode=i,i===Ua?e.enterPIPCallback(n):i===Ha&&e.leavePIPCallback(n)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(){var e=this.player,t=this.playerConfig;if(this.isPIPAvailable()&&!this.isPip)try{var i=t.poster;return i&&(e.media.poster="String"===yi.typeOf(i)?i:i.poster),n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("picture-in-picture"):e.media.requestPictureInPicture(),!0}catch(r){return console.error("requestPiP",r),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(t){return console.error("exitPIP",t),!1}}},{key:"isPip",get:function(){var e=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===e.media||e.media.webkitPresentationMode===Ua}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return("Boolean"!==yi.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===yi.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===yi.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(No(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(Ta);function za(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Ga=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"playNext",(function(e){var t=ni(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,i.nextHandler(i.config.urlList[i.idx],i.idx),t.emit(fr,i.idx+1)):(i.nextHandler(),t.emit(fr))})),i.idx=-1,i}return Jn(n,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:za}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Si.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(e):t.src=e,t.config.url=e,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n '.concat(No(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(Qr),Wa={exports:{}};Wa.exports=function e(t,n,i){var r,o,a=window,s="application/octet-stream",l=i||s,c=t,u=!n&&!i&&c,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=n||"download";if(f=f.call?f.bind(a):Blob,"true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),u&&u.length<2048&&(p=u.split("/").pop().split("?")[0],h.href=u,-1!==h.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(c),p):b(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var v=0,y=new Uint8Array(c.length),m=y.length;v<m;++v)y[v]=c.charCodeAt(v);c=new f([y],{type:l})}function _(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=i.charCodeAt(o);return new f([a],{type:n})}function b(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=c instanceof f?c:new f([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)b(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return b("data:"+l+";base64,"+a.btoa(r))}catch(k){return b("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0};var Ka=Wa.exports;function $a(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}var Ya=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"download",(function(e){if(!i.isLock){i.emitUserAction(e,"download");var t=i.playerConfig.url,n="";"String"===yi.typeOf(t)?n=t:"Array"===yi.typeOf(t)&&t.length>0&&(n=t[0].src);var r=i.getAbsoluteURL(n);Ka(r),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return Jn(n,[{key:"afterCreate",value:function(){ai(ei(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:$a}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(No(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(Ta),qa=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){ai(ei(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(cr,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var n=document.createElement("canvas"),i=n.getContext("2d");this.canvasCtx=i,this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height,i.imageSmoothingEnabled=!0,i.imageSmoothingEnabled&&(i.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(dr,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=i.quality||r.quality,s=i.type||r.type;return new Promise((function(i,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvas(e,t),u=n.canvas,c=n.canvasCtx;var h,d,f,p,g=o.media.videoWidth/o.media.videoHeight,v=u.width/u.height,y=o.media.videoWidth,m=o.media.videoHeight;g>v?(f=u.width,p=u.width/g,h=0,d=Math.round((u.height-p)/2)):g===v?(f=u.width,p=u.height,h=0,d=0):g<v&&(f=u.height*g,p=u.height,h=Math.round((u.width-f)/2),d=0),c.drawImage(o.media,0,0,y,m,h,d,f,p)}var _=u.toDataURL(s,a).replace(s,"image/octet-stream");i(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(cr,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>"),"\n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(Ta),Xa=function(){function e(t){qn(this,e),this.config=t.config,this.parent=t.root,this.root=yi.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var i="mobile"===Si.device?"touchend":"click";this._delegates=Qr.delegate.call(this,this.root,"li",i,this.onItemClick)}return Jn(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(yi.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&yi.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");yi.addClass(t,"selected"),i&&yi.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){yi.removeClass(this.root,"hide"),yi.addClass(this.root,"active")}},{key:"hide",value:function(){yi.removeClass(this.root,"active"),yi.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),Ja="side",Za="middle",Qa="click",es="hover";var ts="mobile"===Si.device,ns=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.switchActiveState(e)})),Zn(ni(i),"switchActiveState",(function(e){e.stopPropagation(),i.config.toggleMode===Qa?i.toggle(!i.isActive):i.toggle(!0)})),Zn(ni(i),"onLeave",(function(e){e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.config.listType!==Ja&&i.isActive&&i.toggle(!1)})),Zn(ni(i),"onListEnter",(function(e){i.enterType=2})),Zn(ni(i),"onListLeave",(function(e){i.enterType=0,i.isActive&&i.toggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return Jn(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),ts&&t.listType!==Za&&(t.listType=Ja),t.hidePortrait&&yi.addClass(this.root,"portrait"),this.on([cr,ir],(function(){e._resizeList()})),this.once(Bi,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),ts&&this.on(Ki,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),ts?(t.toggleMode=Qa,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===Qa?"click":"mouseenter",t.toggleMode===Qa?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",yi.createDom("span","",{},"icon-text")),yi.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||yi.addClass(this.root,"show")}},{key:"hide",value:function(){yi.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||yi.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Yn(e[t])?e[t][n]||e[t].en:e[t]}catch(r){return console.warn(r),""}}},{key:"toggle",value:function(e){if(e!==this.isActive){var t=this.player.controls,n=this.config.listType;e?(n===Ja?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(n===Ja?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var n=this.config,i=n.listType,r=n.list;this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||ts||i===Ja)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a,s,l={config:{data:e||[],className:(a=i.listType,s=i.position,a===Ja?s===qr.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){n.onItemClick(e,t)}},root:i.listType===Ja?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=i.listType===Za?c-50:c;u&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new Xa(l),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===Za?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}},{key:"destroy",value:function(){this.config.toggleMode===Qa?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:es}}}]),n}(Qr),is=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return Jn(n,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;ai(ei(n.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(ar,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||yi.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition;if(t.length>0){var i=null;t.map((function(e){e.definition===n&&(i=e)})),i||(i=t[0]),this.changeDefinition(i)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],i=arguments.length>1?arguments[1]:void 0,r=i&&i.definition?i.definition:this.config.defaultDefinition;i&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,n){var i=$n($n({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(i.selected=!0,o=n),i}));ai(ei(n.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,t){this.player.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;ai(ei(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return $n($n({},ns.defaultConfig),{},{position:qr.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),n}(ns),rs=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),(i=t.call(this,e)).curRate=1,i}return Jn(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;ai(ei(n.prototype),"afterCreate",this).call(this),this.on(Vi,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&ai(ei(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){ai(ei(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=-1,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));ai(ei(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],n="";n=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=n}}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return $n($n({},ns.defaultConfig),{},{position:qr.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),n}(ns);function os(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function as(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var ss=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;ai(ei(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(rr,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,n=this.find(".xg-tips");n&&this.changeLangTextKey(n,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:os,class:"xg-get-cssfull"},exitCssFullscreen:{icon:as,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){ai(ei(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(No(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:qr.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(Ta),ls=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(Ai,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.errorNote?this.i18n[t.errorNote]:"";if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),n}(Qr),cs=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),yi.addClass(this.root,"show"),"arrow"===n.mode&&yi.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),n.style&&this.setStyle(n.style);var o="boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide;if(o){var a=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),a)}}}},{key:"hide",value:function(){yi.removeClass(this.root,"show"),yi.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(io.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),n}(Qr),us={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function hs(e){Object.keys(us).map((function(t){void 0===e[t]&&(e[t]=us[t])}))}var ds={_updateDotDom:function(e,t){if(t){var n=this.calcuPosition(e.time,e.duration),i=e.style||{};i.left="".concat(n.left,"%"),i.width="".concat(n.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),n.isMini?yi.addClass(t,"mini"):yi.removeClass(t,"mini"),Object.keys(i).map((function(e){t.style[e]=i[e]}))}},initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this.ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player.plugins.progress;if(n&&(t&&(hs(e),this._ispots.push(e)),this.ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(i.left,"%"),r.width="".concat(i.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(o+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",s=yi.createDom("xg-spot",a,{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){s.style[e]=r[e]})),n.outer&&n.outer.appendChild(s),this.positionDot(s,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this.ispotsInit){var r=n.find('xg-spot[data-id="'.concat(e.id,'"]'));r&&(this._updateDotDom(e,r),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this.ispotsInit){var a=n.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this.ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this.ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.forEach((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},positionDots:function(){var e=this,t=this._ispots,n=this.playerSize,i=this.player.sizeInfo,r=this.player.plugins.progress;r&&i.width!==n.width&&(n.width=i.width,n.left=i.left,t.forEach((function(t){var n=r.find('xg-spot[data-id="'.concat(t.id,'"]'));n&&e.positionDot(n,t.id)})))},positionDot:function(e,t){var n=yi.findDom(e,".xgplayer-spot-pop");if(n){var i=this.playerSize,r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),a=r.left-i.left,s=i.width-a-r.width/2;if(a<o.width/2||i.width<o.width){var l=o.width/2-a;n.style.left="".concat(l,"px")}else if(s<o.width/2){var c=s-o.width/2+r.width/2;n.style.left="".concat(c,"px")}else n.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(n){var i=t.find('xg-spot[data-id="'.concat(n.id,'"]'));e._updateDotDom(n,i)}))},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};var fs={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMove"},ps=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),Zn(ni(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(yi.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||yi.hasClass(e.target,"xg-spot-content"))&&(yi.event(e),e.stopPropagation()))})),Zn(ni(i),"onMousedown",(function(e){i.config.disable||(i._state.f||yi.hasClass(e.target,"xg-spot-content"))&&(yi.event(e),e.stopPropagation())})),Zn(ni(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Zn(ni(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Zn(ni(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&yi.hasClass(t.target,"xgplayer-spot")&&!i._curDot){i._curDot=t.target,i.focusDot(t.target),i._curDot.children.length>0&&i.hide();var n=i.player.plugins.progress;n&&n.disableBlur(),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave)}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i.timeStr="",i._state={now:0,f:!1},i}return Jn(n,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.currentTime&&e.player.seek(n.currentTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(yi.format(t))})),function(e){var t=e.config,n=e.player;Object.keys(ds).map((function(t){e[t]=ds[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return hs(e),e})),e.ispotsInit=!1,e.playerSize={left:n.sizeInfo.left,width:n.sizeInfo.width},e.on(Ui,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(cr,(function(){e.positionDots()}))}(this),this.on(Ui,(function(){e.show()})),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(fs).map((function(n){e[fs[n]]=e[fs[n]].bind(e),t.addCallBack(n,e[fs[n]])})),"mobile"!==Si.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&yi.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&yi.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||yi.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(n){e[n]=t.target.getAttribute("data-".concat(n))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var n=this.root,i=this.previewLine,r=this.player,o=this.config,a="flex"===r.controls.mode,s=n.getBoundingClientRect().width;if(s){var l,c=e-(s=this._hasThumnail&&s<o.width?o.width:s)/2;c<0&&!a?(c=0,l=e-s/2):c>t-s&&!a?(l=c-(t-s),c=t-s):l=0,void 0!==l&&(i.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.innerHTML=e,!this.thumbnail&&(n.innerHTML=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,a=this._state;if(r){a.now=n,this.transformTimeHook(n);var s=this.timeStr;i&&i.target&&yi.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now),this.updateLinePos(e,t)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==Si.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){yi.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&yi.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=yi.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else yi.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player,r=n.root.getBoundingClientRect().width,o=i.duration/r*6;return e+t>i.duration&&(t=i.duration-e),i.duration,i.duration,{left:e/i.duration*100,width:t/i.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),yi.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(yi.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";yi.addClass(this.root,"no-timepoint"),e&&(yi.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(yi.addClass(this.root,"product"),this.tipText.textContent=e):(yi.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){yi.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",yi.removeClass(this.find(".xg-spot-content"),"show-text"),yi.removeClass(this.root,"product")}},{key:"hide",value:function(){yi.addClass(this.root,"hide")}},{key:"show",value:function(){yi.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(fs).map((function(n){t.removeCallBack(n,e[fs[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===Si.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info hide '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n}(Qr),gs=function(e){Qn(n,e);var t=ri(n);function n(e){var i;return qn(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return Jn(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([Ui],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,yi.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,a=i.col,s=i.width,l=i.height;this.interval=Math.round(this.player.duration/r);var c=Math.ceil(e/this.interval),u=(c=c>r?r:c)<o*a?0:Math.ceil(c/(o*a))-1,h=c-u*(a*o),d=h>0?Math.ceil(h/a)-1:0,f=h>0?h-d*a-1:0,p=0,g=0;if(t&&n){var v=t/n;v<s/l?p=(g=n)*(s/l):g=(p=t)/(s/l)}else n?t||(p=(g=n||l)*(s/l)):g=(p=t||s)/(s/l);var y=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:d,colIndex:f,url:y,height:g,width:p,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(p*a,"px auto"),backgroundPosition:"-".concat(f*p,"px -").concat(d*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var l=this.getPosition(t,n,i);this.preload(l.urlIndex),Object.keys(l.style).map((function(t){e.style[t]=l.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=yi.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(Qr),vs=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Qr),ys="realtime",ms="firstframe",_s="poster";function bs(){try{return parseInt(window.performance.now(),10)}catch(Hl){return(new Date).getTime()}}var ks=null,ws=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.renderOnTimeupdate(t),e.off(Ni,e.renderOnTimeupdate),e.on(Ni,e.renderOnTimeupdate))})),Zn(ni(e),"renderOnTimeupdate",(function(t){e._frameCount>0?(e.renderOnce(),e._frameCount--):(e._isLoaded=!0,e.off(Ni,e.renderOnTimeupdate),!e.player.paused&&e._checkIfCanStart()&&e.start())})),Zn(ni(e),"start",(function(){var t=e.player.media,n=bs(),i=e.checkVideoIsSupport(t);i&&e.canvasCtx&&(e.stop(),t.videoWidth&&t.videoHeight&&(e.videoPI=t.videoHeight>0?parseInt(t.videoWidth/t.videoHeight*100,10):0,(e.config.mode===ys||n-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(i,e.videoPI),e.preTime=n)),e.frameId=yi.requestAnimationFrame(e.start))})),Zn(ni(e),"stop",(function(){e.frameId&&(yi.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this.once(Zi,(function(){e.player&&(e.init(),e.player.paused||e.start())})),r!==_s&&(r!==ms&&(this.on(Wi,(function(){e.stop()})),this.on(Pi,(function(){e._checkIfCanStart()&&e.start()})),this.on(Di,(function(){e.stop()}))),this.on(Fi,this.onLoadedData),this.on(Gi,(function(){e._isLoaded=!1,e.stop()}))))}},{key:"init",value:function(){var e=this.player,t=this.config;this.canvasFilter=n.supportCanvasFilter();try{var i=this.config.isInnerRender&&e.innerContainer||e.root;i.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(t.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=i.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(Hl){gi.logError("plugin:DynamicBg",Hl)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==Si.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===yi.typeOf(e)?e:"String"===yi.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&e!==ms&&e!==_s}},{key:"renderOnce",value:function(){var e=this.player.media;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==n.width||a!==n.height||n.pi!==t){var s=parseInt(o/a*100,10);n.pi=t,n.width=this.canvas.width=o,n.height=this.canvas.height=a;var l=a,c=o;s<t?c=parseInt(a*t/100,10):s>t&&(l=parseInt(100*o/t,10)),n.rwidth=c*i.multiple,n.rheight=l*i.multiple,n.x=(o-n.rwidth)/2,n.y=(a-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(Hl){gi.logError("plugin:DynamicBg",Hl)}}},{key:"destroy",value:function(){this.stop(),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof ks?ks:ks=function(){try{return!!document.createElement("canvas").getContext}catch(Hl){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Si.browser||"firefox"===Si.browser)}}]),n}(Qr),Ts="info",Ss=kr,Cs=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats.info.push($n($n({type:"userAction"},n),{},{payload:i}))})),Zn(ni(e),"_onReset",(function(){e.reset()})),Zn(ni(e),"_recordInfo",(function(t){e.info(t)})),Zn(ni(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return Jn(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(vr,this._recordUserActions),this.on(Ss.STATS_INFO,this._recordInfo),this.on(Ss.STATS_DOWNLOAD,this._downloadStats),this.on(Ss.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats.info.push($n($n({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=$n({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(Zn(e={},Ts,[]),Zn(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats.info.map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(i){console.log("err",i)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats.info.forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Vr),Es=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=ni(e),i=t.player,r=t.config;if(i.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.media.paused||0===i.media.currentTime||!e.hasPlayed){var o=i.media.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,l=i.media.currentTime,c=e._getIndex(o,l,s);if(null!==c&&0!==c){console.log("GapJump bufferRange ",o.start(c),o.end(c));var u=o.start(c)+.1;if(!(u>i.media.duration)){var h=u-l,d=h<=a;h<n.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(i.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",d," currentTime:",i.media.currentTime," jumpSize:",l-i.media.currentTime),.08!==u&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(ji,this.onGapJump),this.on(Pi,(function(){e.hasPlayed=!0})),this.on(Mi,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(Qr);Es.BROWSER_GAP_TOLERANCE=.001;var xs=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=ni(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Zn(ni(e),"onJump",(function(){var t=ni(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.media.paused&&0!==n.media.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.media.duration||(console.log("waitintTimeout, currentTime:",n.currentTime,", jumpTo:",r),e.jumpCnt++,n.currentTime=r)}})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(ji,this.onWaiting),this.on([Li,Bi],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(Pi,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(Qr),Os="cdn",Ps=["cdn"],Ls=function(e){Qn(n,e);var t=ri(n);function n(){var e;qn(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Zn(ni(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Os;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var n=0;return e.speedListCache[t].map((function(e){n+=e})),Math.floor(n/e.speedListCache[t].length)})),Zn(ni(e),"startTimer",(function(){yi.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Zn(ni(e),"initSpeedList",(function(){e.speedListCache={},Ps.forEach((function(t){e.speedListCache[t]=[]}))})),Zn(ni(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||Os)})),Zn(ni(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var s=(new Date).getTime(),l=null,c=new XMLHttpRequest;e.xhr=c,c.open("GET",a);var u={},h=Math.floor(10*Math.random());u.Range="bytes="+h+"-"+(i+h),u&&Object.keys(u).forEach((function(e){c.setRequestHeader(e,u[e])})),c.onreadystatechange=function(){if(4===c.readyState){e.xhr=null,l=(new Date).getTime();var t=c.getResponseHeader("Content-Length")/1024*8,n=Math.round(1e3*t/(l-s));e.appendList(n),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(Hl){console.error(Hl)}}}})),Zn(ni(e),"appendList",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Os;if(e.speedListCache&&e.speedListCache[n]){var i=e.config.saveSpeedMax;e.speedListCache[n].length>=i&&e.speedListCache[n].shift(),e.speedListCache[n].push(t);var r=ni(e),o=r.player;o&&(n===Os?o.realTimeSpeed=t:o[e.getSpeedName("realTime",n)]=t),e.updateSpeed(n)}})),Zn(ni(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Os,n=e.getSpeed(t),i=ni(e),r=i.player;if(r)if(t===Os)r.avgSpeed&&n===r.avgSpeed||(r.avgSpeed=n,r.emit(nr,{speed:n,realTimeSpeed:r.realTimeSpeed}));else{var o=e.getSpeedName("avg",t);r[o]&&n===r[o]||(r[o]=n,r.emit(nr,{speed:n,realTimeSpeed:r.realTimeSpeed}))}})),e}return Jn(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList;(null==n?void 0:n.length)>0&&Ps.push.apply(Ps,si(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([Fi,Qi],this.startTimer)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([Fi,Qi],this.startTimer),Ps.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),n}(Qr),Is=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],n.disabled)||t.media.getVideoPlaybackQuality&&(this.on(Pi,(function(){e._startTick()})),this.on(Di,(function(){e._stopTick()})),this.on(Ii,(function(){e._stopTick()})),this.on(Wi,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.media,o=document.hidden,a=r.paused;if("boolean"==typeof o&&!o&&!a){for(var s=r.currentTime,l=r.buffered,c=!1,u=[],h=0;h<l.length;h++){var d=l.start(h),f=l.end(h);if(u.push({start:d,end:f}),d<=s&&s<=f-1){c=!0;break}}4===r.readyState&&c&&(this._currentStuckCount>this.config.stuckCount?(this.emit(wr,this._payload),this._reset()):e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({bufs:u,currentTime:r.currentTime,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i})):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){if(this.player.media){var e=this.player.media.getVideoPlaybackQuality(),t=e.totalVideoFrames,n=e.droppedVideoFrames,i=performance.now();if(t&&this._lastCheckPoint){var r=t-this._lastDecodedFrames,o=i-this._lastCheckPoint;this._checkStuck(r,t,n,o)}this._lastDecodedFrames=t,this._lastCheckPoint=i}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(Qr);uo.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var Ds=Jn((function e(t,n){var i,r,o;qn(this,e);var a=n&&"mobile"===n.isMobileSimulateMode,s=n.isLive,l=[].concat(s?[]:[wa,vs,ps,La],[Sa,Pa,Na,Ga,is,rs,Ya,qa,Ma,Va]),c=[Oo,Po,Mo,ma,Ro,ls,cs,gs,Yo];this.plugins=[Cs,Eo].concat(si(l),c,[Es,xs]);var u=a?"mobile":Si.device;switch(u){case"pc":(i=this.plugins).push.apply(i,[va,Jo,ss,Ls,Is]);break;case"mobile":(r=this.plugins).push.apply(r,[pa]);break;default:(o=this.plugins).push.apply(o,[va,Jo,ss])}(Si.os.isIpad||"pc"===u)&&this.plugins.push(ws),Si.os.isIpad&&this.plugins.push(Jo),this.ignores=[],this.i18n=[]})),As=function(e){Qn(n,e);var t=ri(n);function n(){return qn(this,n),t.apply(this,arguments)}return Jn(n)}(yo);Zn(As,"defaultPreset",Ds),Zn(As,"Util",yi),Zn(As,"Sniffer",Si),Zn(As,"Errors",Oi),Zn(As,"Events",Tr),Zn(As,"Plugin",Qr),Zn(As,"BasePlugin",Vr),Zn(As,"I18N",uo),Zn(As,"STATE_CLASS",io);var Ms={LANG:"zh-hk",TEXT:{ERROR_TYPES:{network:{code:1,msg:"視頻下載錯誤"},mse:{code:2,msg:"劉追加錯誤"},parse:{code:3,msg:"解析錯誤"},format:{code:4,msg:"格式錯誤"},decoder:{code:5,msg:"解碼錯誤"},runtime:{code:6,msg:"語法錯誤"},timeout:{code:7,msg:"播放超時"},other:{code:8,msg:"其他錯誤"}},HAVE_NOTHING:"沒有關於音頻/視頻是否就緒的信息",HAVE_METADATA:"音頻/視頻的元數據已就緒",HAVE_CURRENT_DATA:"關於當前播放位置的數據是可用的,但沒有足夠的數據來播放下壹幀/毫秒",HAVE_FUTURE_DATA:"當前及至少下壹幀的數據是可用的",HAVE_ENOUGH_DATA:"可用數據足以開始播放",NETWORK_EMPTY:"音頻/視頻尚未初始化",NETWORK_IDLE:"音頻/視頻是活動的且已選取資源,但並未使用網絡",NETWORK_LOADING:"瀏覽器正在下載數據",NETWORK_NO_SOURCE:"未找到音頻/視頻來源",MEDIA_ERR_ABORTED:"取回過程被用戶中止",MEDIA_ERR_NETWORK:"下載錯誤",MEDIA_ERR_DECODE:"解碼錯誤",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音頻/視頻格式",REPLAY:"重播",ERROR:"網絡連接似乎出現了問題",PLAY_TIPS:"播放",PAUSE_TIPS:"暫停",PLAYNEXT_TIPS:"下壹集",DOWNLOAD_TIPS:"下載",ROTATE_TIPS:"旋轉",RELOAD_TIPS:"重新載入",FULLSCREEN_TIPS:"進入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"進入樣式全屏",EXITCSSFULLSCREEN_TIPS:"退出樣式全屏",TEXTTRACK:"字幕",PIP:"畫中畫",SCREENSHOT:"截圖",LIVE:"正在直播",OFF:"關閉",OPEN:"開啟",MINI_DRAG:"點擊按住可拖動視頻",MINISCREEN:"小屏幕",REFRESH_TIPS:"請試試",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},Rs={LANG:"jp",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ビデオダウンロードエラー"},mse:{code:2,msg:"ストリーム追加エラー"},parse:{code:3,msg:"解析エラー"},format:{code:4,msg:"間違ったフォーマット"},decoder:{code:5,msg:"デコードエラー"},runtime:{code:6,msg:"文法エラー"},timeout:{code:7,msg:"再生タイムアウト"},other:{code:8,msg:"その他のエラー"}},HAVE_NOTHING:"オーディオ/ビデオが準備できているか情報がありません",HAVE_METADATA:"オーディオ/ビデオのメタデータは準備できています",HAVE_CURRENT_DATA:"現在の再生位置に関するデータは利用可能ですが、次のフレーム/ミリ秒を再生するのに十分なデータがありません",HAVE_FUTURE_DATA:"現在、少なくとも次のフレームのデータが利用可能です",HAVE_ENOUGH_DATA:"利用可能なデータは再生を開始するのに十分です",NETWORK_EMPTY:"オーディオ/ビデオが初期化されていません",NETWORK_IDLE:"オーディオ/ビデオはアクティブでリソースが選択されていますが、ネットワークが使用されていません",NETWORK_LOADING:"ブラウザーはデータをダウンロードしています",NETWORK_NO_SOURCE:"オーディオ/ビデオ のソースが見つかりません",MEDIA_ERR_ABORTED:"ユーザーによってフェッチプロセスが中止されました",MEDIA_ERR_NETWORK:"ダウンロード中にエラーが発生しました",MEDIA_ERR_DECODE:"デコード中にエラーが発生しました",MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ の形式がサポートされていません",REPLAY:"リプレイ",ERROR:"ネットワークの接続に問題が発生しました",PLAY_TIPS:"プレイ",PAUSE_TIPS:"一時停止",PLAYNEXT_TIPS:"次をプレイ",DOWNLOAD_TIPS:"ダウンロード",ROTATE_TIPS:"回転",RELOAD_TIPS:"再読み込み",FULLSCREEN_TIPS:"フルスクリーン",EXITFULLSCREEN_TIPS:"フルスクリーンを終了",CSSFULLSCREEN_TIPS:"シアターモード",EXITCSSFULLSCREEN_TIPS:"シアターモードを終了",TEXTTRACK:"字幕",PIP:"ミニプレーヤー",SCREENSHOT:"スクリーンショット",LIVE:"生放送",OFF:"オフ",OPEN:"開いた",MINI_DRAG:"ボタンを押して働画をドラッグする",MINISCREEN:"小さな画面",REFRESH:"リフレッシュ",REFRESH_TIPS:"してみてください",FORWARD:"早送り",LIVE_TIP:"生放送"}},Ns={origin:{index:1,next:"uhd",prev:null},uhd:{index:2,next:"hd",prev:"origin"},hd:{index:3,next:"sd",prev:"uhd"},sd:{index:4,next:"ld",prev:"hd"},ld:{index:5,next:"ao",prev:"sd"},ao:{index:6,next:null,prev:"ld"}},js=["zh","en","jp","zh-hk"],Bs=0,Us=1,Hs=2,Fs=function(e){return e[e.VALID=10]="VALID",e[e.TRANSCODING=30]="TRANSCODING",e[e.NO_SET_AUDIT=1e3]="NO_SET_AUDIT",e[e.OFFLINE=1002]="OFFLINE",e[e.NO_AUTH=2001]="NO_AUTH",e[e.UN_AUTH=2002]="UN_AUTH",e}(Fs||{}),Vs={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"},zs={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",a="minute",s="hour",l="day",c="week",u="month",h="quarter",d="year",f="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},m=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},_={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+m(i,2,"0")+":"+m(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var i=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(i,u),o=n-r<0,a=t.clone().add(i+(o?-1:1),u);return+(-(i+(n-r)/(o?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:c,d:l,D:f,h:s,m:a,s:o,ms:r,Q:h}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",k={};k[b]=y;var w=function(e){return e instanceof E},T=function e(t,n,i){var r;if(!t)return b;if("string"==typeof t){var o=t.toLowerCase();k[o]&&(r=o),n&&(k[o]=n,r=o);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;k[s]=t,r=s}return!i&&r&&(b=r),r||!i&&b},S=function(e,t){if(w(e))return e.clone();var n="object"==i(t)?t:{};return n.date=e,n.args=arguments,new E(n)},C=_;C.l=T,C.i=w,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function i(e){this.$L=T(e.locale,null,!0),this.parse(e)}var y=i.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(g);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return C},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return S(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<S(e)},y.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,i=!!C.u(t)||t,r=C.p(e),h=function(e,t){var r=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return i?r:r.endOf(l)},p=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(r){case d:return i?h(1,0):h(31,11);case u:return i?h(1,v):h(0,v+1);case c:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return h(i?y-b:y+(6-b),v);case l:case f:return p(m+"Hours",0);case s:return p(m+"Minutes",1);case a:return p(m+"Seconds",2);case o:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var n,i=C.p(e),c="set"+(this.$u?"UTC":""),h=(n={},n[l]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[s]=c+"Hours",n[a]=c+"Minutes",n[o]=c+"Seconds",n[r]=c+"Milliseconds",n)[i],p=i===l?this.$D+(t-this.$W):t;if(i===u||i===d){var g=this.clone().set(f,1);g.$d[h](p),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[C.p(e)]()},y.add=function(i,r){var h,f=this;i=Number(i);var p=C.p(r),g=function(e){var t=S(f);return C.w(t.date(t.date()+Math.round(e*i)),f)};if(p===u)return this.set(u,this.$M+i);if(p===d)return this.set(d,this.$y+i);if(p===l)return g(1);if(p===c)return g(7);var v=(h={},h[a]=t,h[s]=n,h[o]=e,h)[p]||1,y=this.$d.getTime()+i*v;return C.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var i=e||"YYYY-MM-DDTHH:mm:ssZ",r=C.z(this),o=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=function(e,n,r,o){return e&&(e[n]||e(t,i))||r[n].slice(0,o)},h=function(e){return C.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var i=e<12?"AM":"PM";return n?i.toLowerCase():i},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:C.s(s+1,2,"0"),MMM:u(n.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:u(n.weekdaysMin,this.$W,l,2),ddd:u(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:C.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:C.s(a,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:r};return i.replace(v,(function(e,t){return t||f[e]||r.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(i,r,f){var p,g=C.p(r),v=S(i),y=(v.utcOffset()-this.utcOffset())*t,m=this-v,_=C.m(this,v);return _=(p={},p[d]=_/12,p[u]=_,p[h]=_/3,p[c]=(m-y)/6048e5,p[l]=(m-y)/864e5,p[s]=m/n,p[a]=m/t,p[o]=m/e,p)[g]||m,f?_:C.a(_)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return k[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),i=T(e,t,!0);return i&&(n.$L=i),n},y.clone=function(){return C.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},i}(),x=E.prototype;return S.prototype=x,[["$ms",r],["$s",o],["$m",a],["$H",s],["$W",l],["$M",u],["$y",d],["$D",f]].forEach((function(e){x[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=T,S.isDayjs=w,S.unix=function(e){return S(1e3*e)},S.en=k[b],S.Ls=k,S.p={},S}()}(zs);var Gs=zs.exports,Ws={exports:{}};!function(e,t){var n,i,r;e.exports=(n="minute",i=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(e,t,o){var a=t.prototype;o.utc=function(e){return new t({date:e,utc:!0,args:arguments})},a.utc=function(e){var t=o(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),n):t},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(e,t){var o=this.$utils().u;if(o(e))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(i);if(!t)return null;var n=(""+t[0]).match(r)||["-",0,0],o=n[0],a=60*+n[1]+ +n[2];return 0===a?0:"+"===o?a:-a}(e)))return this;var a=Math.abs(e)<=16?60*e:e,s=this;if(t)return s.$offset=a,s.$u=0===e,s;if(0!==e){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,n)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var i=this.local(),r=o(e).local();return d.call(i,r,t,n)}})}(Ws);var Ks=Ws.exports,$s=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t,n){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(e,t,n){var i=n(12)("wks"),r=n(13),o=n(0).Symbol,a="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=i},function(e,t,n){var i=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=i)},function(e,t,n){var i=n(4);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,n){var i=n(6);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t,n){var i=n(3),r=n(26),o=n(27),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return a(e,t,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!1},function(e,t,n){var i=n(8),r=n(1)("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Object(e),r))?n:o?i(t):"Object"==(a=i(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var i=n(2),r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:n(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var i=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+r).toString(36))}},function(e,t,n){var i=n(9),r=n(28);e.exports=n(7)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,n){var i=n(4),r=n(0).document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,n){var i=n(0),r=n(14),o=n(18),a=n(13)("src"),s=n(29),l=(""+s).split("toString");n(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||r(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||r(n,a,e[t]?""+e[t]:l.join(String(t)))),e===i?e[t]=n:s?e[t]?e[t]=n:r(e,t,n):(delete e[t],r(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,n){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},function(e,t,n){e.exports={}},function(e,t,n){var i,r,o,a=n(5),s=n(38),l=n(39),c=n(16),u=n(0),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=u.Dispatch,v=0,y={},m=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},_=function(e){m.call(e.data)};d&&f||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++v]=function(){s("function"==typeof e?e:Function(e),t)},i(v),v},f=function(e){delete y[e]},"process"==n(8)(h)?i=function(e){h.nextTick(a(m,e,1))}:g&&g.now?i=function(e){g.now(a(m,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,i=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(i=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):i="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),m.call(e)}}:function(e){setTimeout(a(m,e,1),0)}),e.exports={set:d,clear:f}},function(e,t,n){var i=n(6);function r(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=i(t),this.reject=i(n)}e.exports.f=function(e){return new r(e)}},function(e,t,n){e.exports=n(23)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),n(24);var i,r=(i=n(48))&&i.__esModule?i:{default:i};t.default={url:r.default},e.exports=t.default},function(e,t,n){var i,r,o,a,s=n(10),l=n(0),c=n(5),u=n(11),h=n(25),d=n(4),f=n(6),p=n(30),g=n(31),v=n(37),y=n(20).set,m=n(40)(),_=n(21),b=n(41),k=n(42),w=n(43),T=l.TypeError,S=l.process,C=S&&S.versions,E=C&&C.v8||"",x=l.Promise,O="process"==u(S),P=function(){},L=r=_.f,I=!!function(){try{var e=x.resolve(1),t=(e.constructor={})[n(1)("species")]=function(e){e(P,P)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(P)instanceof t&&0!==E.indexOf("6.6")&&-1===k.indexOf("Chrome/66")}catch(i){}}(),D=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},A=function(e,t){if(!e._n){e._n=!0;var n=e._c;m((function(){for(var i=e._v,r=1==e._s,o=0,a=function(t){var n,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&N(e),e._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),a=!0)),n===t.promise?c(T("Promise-chain cycle")):(o=D(n))?o.call(n,l,c):l(n)):c(i)}catch(h){u&&!a&&u.exit(),c(h)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&M(e)}))}},M=function(e){y.call(l,(function(){var t,n,i,r=e._v,o=R(e);if(o&&(t=b((function(){O?S.emit("unhandledRejection",r,e):(n=l.onunhandledrejection)?n({promise:e,reason:r}):(i=l.console)&&i.error&&i.error("Unhandled promise rejection",r)})),e._h=O||R(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},N=function(e){y.call(l,(function(){var t;O?S.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},j=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),A(t,!0))},B=function e(t){var n,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw T("Promise can't be resolved itself");(n=D(t))?m((function(){var r={_w:i,_d:!1};try{n.call(t,c(e,r,1),c(j,r,1))}catch(o){j.call(r,o)}})):(i._v=t,i._s=1,A(i,!1))}catch(r){j.call({_w:i,_d:!1},r)}}};I||(x=function(e){p(this,x,"Promise","_h"),f(e),i.call(this);try{e(c(B,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(i=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(44)(x.prototype,{then:function(e,t){var n=L(v(this,x));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new i;this.promise=e,this.resolve=c(B,e,1),this.reject=c(j,e,1)},_.f=L=function(e){return e===x||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!I,{Promise:x}),n(45)(x,"Promise"),n(46)("Promise"),a=n(2).Promise,h(h.S+h.F*!I,"Promise",{reject:function(e){var t=L(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!I),"Promise",{resolve:function(e){return w(s&&this===a?x:this,e)}}),h(h.S+h.F*!(I&&n(47)((function(e){x.all(e).catch(P)}))),"Promise",{all:function(e){var t=this,n=L(t),i=n.resolve,r=n.reject,o=b((function(){var n=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;n.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,n[s]=e,--a||i(n))}),r)})),--a||i(n)}));return o.e&&r(o.v),n.promise},race:function(e){var t=this,n=L(t),i=n.reject,r=b((function(){g(e,!1,(function(e){t.resolve(e).then(n.resolve,i)}))}));return r.e&&i(r.v),n.promise}})},function(e,t,n){var i=n(0),r=n(2),o=n(14),a=n(17),s=n(5),l=function e(t,n,l){var c,u,h,d,f=t&e.F,p=t&e.G,g=t&e.P,v=t&e.B,y=p?i:t&e.S?i[n]||(i[n]={}):(i[n]||{}).prototype,m=p?r:r[n]||(r[n]={}),_=m.prototype||(m.prototype={});for(c in p&&(l=n),l)h=((u=!f&&y&&void 0!==y[c])?y:l)[c],d=v&&u?s(h,i):g&&"function"==typeof h?s(Function.call,h):h,y&&a(y,c,h,t&e.U),m[c]!=h&&o(m,c,d),g&&_[c]!=h&&(_[c]=h)};i.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){e.exports=!n(7)&&!n(15)((function(){return 7!=Object.defineProperty(n(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var i=n(4);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){e.exports=n(12)("native-function-to-string",Function.toString)},function(e,t,n){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(5),r=n(32),o=n(33),a=n(3),s=n(34),l=n(36),c={},u={},h=e.exports=function(e,t,n,h,d){var f,p,g,v,y=d?function(){return e}:l(e),m=i(n,h,t?2:1),_=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(f=s(e.length);f>_;_++)if((v=t?m(a(p=e[_])[0],p[1]):m(e[_]))===c||v===u)return v}else for(g=y.call(e);!(p=g.next()).done;)if((v=r(g,m,p.value,t))===c||v===u)return v};h.BREAK=c,h.RETURN=u},function(e,t,n){var i=n(3);e.exports=function(e,t,n,r){try{return r?t(i(n)[0],n[1]):t(n)}catch(a){var o=e.return;throw void 0!==o&&i(o.call(e)),a}}},function(e,t,n){var i=n(19),r=n(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[r]===e)}},function(e,t,n){var i=n(35),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},function(e,t,n){var i=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:i)(e)}},function(e,t,n){var i=n(11),r=n(1)("iterator"),o=n(19);e.exports=n(2).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[i(e)]}},function(e,t,n){var i=n(3),r=n(6),o=n(1)("species");e.exports=function(e,t){var n,a=i(e).constructor;return void 0===a||null==(n=i(a)[o])?t:r(n)}},function(e,t,n){e.exports=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var i=n(0).document;e.exports=i&&i.documentElement},function(e,t,n){var i=n(0),r=n(20).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,l="process"==n(8)(a);e.exports=function(){var e,t,n,c=function(){var i,r;for(l&&(i=a.domain)&&i.exit();e;){r=e.fn,e=e.next;try{r()}catch(o){throw e?n():t=void 0,o}}t=void 0,i&&i.enter()};if(l)n=function(){a.nextTick(c)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){r.call(i,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(i){var r={fn:i,next:void 0};t&&(t.next=r),e||(e=r,n()),t=r}}},function(e,t,n){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,n){var i=n(0).navigator;e.exports=i&&i.userAgent||""},function(e,t,n){var i=n(3),r=n(4),o=n(21);e.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var i=n(17);e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},function(e,t,n){var i=n(9).f,r=n(18),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&i(e,o,{configurable:!0,value:t})}},function(e,t,n){var i=n(0),r=n(9),o=n(7),a=n(1)("species");e.exports=function(e){var t=i[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var i=n(1)("iterator"),r=!1;try{var o=[7][i]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var o=[7],a=o[i]();a.next=function(){return{done:n=!0}},o[i]=function(){return a},e(o)}catch(s){}return n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e){try{e=JSON.parse(o.default.base64decode(e))}catch(c){return Promise.reject("base64 decode error")}var i=[];for(var s in n)i.push(s+"="+n[s]);var l="//"+t+"?"+e.GetPlayInfoToken+"&ssl=true";return i.length>0&&(l+="&"+i.join("&")),new a.default({type:"json",method:"GET",url:l}).then((function(e){return e&&e.response?"string"==typeof e.response?JSON.parse(e.response).Result:"object"===r(e.response)?e.response.Result:e.response:e}))}return Promise.reject("vid, host and token can't be empty")};var o=s(n(49)),a=s(n(50));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var i={base64decode:function(e){var t,n,i,r,o,a,s,l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];for(a=e.length,o=0,s="";o<a;){do{t=l[255&e.charCodeAt(o++)]}while(o<a&&-1===t);if(-1===t)break;do{n=l[255&e.charCodeAt(o++)]}while(o<a&&-1===n);if(-1===n)break;s+=String.fromCharCode(t<<2|(48&n)>>4);do{if(61==(i=255&e.charCodeAt(o++)))return s;i=l[i]}while(o<a&&-1===i);if(-1===i)break;s+=String.fromCharCode((15&n)<<4|(60&i)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return s;r=l[r]}while(o<a&&-1===r);if(-1===r)break;s+=String.fromCharCode((3&i)<<6|r)}return s}};t.default=i,e.exports=t.default},function(e,t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.url,r=t.method,o=void 0===r?"GET":r,a=(t.type,t.data),s=void 0===a?{}:a,l=t.headers,c=void 0===l?{}:l;return i(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,r=o.toUpperCase(),a=[];for(var l in s)a.push(l+"="+s[l]);if("GET"!==r)throw new Error("xhr "+r+" is not supported");for(var u in i.open(r,""+n,!0),i.responseType="",c)i.setRequestHeader(u,""+c[u]);i.send(),i.onload=function(){200===i.status||206===i.status?e(i):t(i)},i.onerror=function(){t(i)}}))},e.exports=t.default}]);Gs.extend(Ks);var Ys=function(e){return e.VIDEO="video",e.EVIDEO="evideo",e}(Ys||{}),qs=function(e){if(e){var t={},n=function(e){try{return JSON.parse(e)}catch(Hl){return console.warn("[utils/json] decode fail: ".concat(e),Hl),null}}(cl(e)?window.atob(e):e);if(n&&"string"==typeof n.GetPlayInfoToken)n.GetPlayInfoToken.split("&").map((function(e){var n=e.split("=");n[0]&&n[1]&&(t[n[0]]=n[1])}));return t}},Xs=function(e){var t={};return e.split("&").map((function(e){var n=e.split("=");n[0]&&n[1]&&(t[n[0]]=n[1])})),t},Js=function(e){var t,n;if(null==e||!e.playAuthToken)return!1;var i=qs(null==e?void 0:e.playAuthToken),r=null!==(t=null==i||null===(n=i.FileType)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:"video";return!!i&&("evideo"===r||"eaudio"===r)},Zs=function(e){var t,n,i;if(null==e||!e.playAuthToken)return"";var r=qs(null==e?void 0:e.playAuthToken),o=null!==(t=null==r||null===(n=r.FileType)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:"video",a=null==r||null===(i=r.Format)||void 0===i?void 0:i.toLowerCase();return a||(Object.values(Ys).includes(o)?"mp4":"m4a")},Qs=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;var t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;var n=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),i=Gs.utc(n,"YYYYMMDD hhmmss");return!!i.isValid()&&i.add(t,"seconds").isBefore(Gs())};function el(e){var n=e.playAuthToken,i=e.playDomain,r=e.reqParams,o=void 0===r?{}:r,a=e.definitionMap,s=e.needThumbs,l=void 0!==s&&s,c=e.needBarrageMask,u=void 0!==c&&c;if(n){var h=t(t({},o),{},{NeedThumbs:l?1:0,NeedBarrageMask:u?1:0});return new Promise((function(e,r){$s.url(n,i,h).then((function(n){var i=n.Data||n,r=i.Status,o=i.PlayInfoList,s=void 0===o?[]:o,l=i.PosterUrl,c=i.Vid,u=i.Duration,h=i.BarrageMaskUrl,d=i.ThumbInfoList,f=void 0===d?[]:d;if(r===Fs.VALID&&s.length){var p,g=s.map((function(e){return t(t({vid:c,lineId:1,lineName:"1",url:e.MainPlayUrl,streamType:e.Format,backupUrl:e.BackupPlayUrl,backUrlList:[e.BackupPlayUrl],bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,vwidth:e.Width,vheight:e.Height,codec:e.Codec},e),rl(e,a))})).sort((function(e,t){return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}));e({playList:g,type:null===(p=g[0])||void 0===p?void 0:p.Format,poster:l,vid:c,duration:u,dashOpts:n.Data?n:{Data:n},thumbs:f,barrageMaskUrl:h})}else e({playList:[],poster:l,vid:c,duration:u,dashOpts:n.Data?n:{Data:n},thumbs:f,barrageMaskUrl:h}),console.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((function(e){console.log("err",e),r(e)}))}))}return Promise.resolve()}function tl(e,t,n,i){return nl.apply(this,arguments)}function nl(){return(nl=o(n().mark((function e(t,i,r,o){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:case 15:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!--i||!r(e.t0)){e.next=12;break}return e.abrupt("return",tl(t,i,r,o));case 12:if(!o||"function"!=typeof o){e.next=16;break}return e.next=15,o(e.t0);case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var il=function(e){return(null==e?void 0:e.length)&&e.reduce((function(t,n,i){return t[n]={next:i+1>=e.length?null:e[i+1],pre:0===i?null:e[i-1]},t}),{})},rl=function(e,n){if(!e||!e.Definition&&!e.Quality)return{definition:"240P"};var i=e.Definition||e.Quality;if(n){var r=n[i];return r?"string"==typeof r?{definition:r}:t({},r||{}):{definition:i}}return{definition:i}},ol=function(){function e(){a(this,e),this.timeID=null,this.func=null}return l(e,[{key:"repeat",value:function(e,t){this.timeID=1,this.repeatInterval(e,t)}},{key:"repeatInterval",value:function(e,t){var n=this;this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((function(){e(),n.repeatInterval(e,t)}),t)))}},{key:"clear",value:function(){clearTimeout(this.timeID),this.timeID=null}}]),e}(),al=l((function e(t){var n=t.url,i=t.method,r=void 0===i?"GET":i,o=t.type,s=t.timeout,l=void 0===s?1e4:s,c=t.body,u=t.xhrSetup,h=t.cache,d=void 0===h||h;return a(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,a=r.toUpperCase();if("GET"!==a&&"POST"!==a&&"HEAD"!==a)throw new Error("XHR ".concat(a," is not allowed"));if(o&&(i.responseType=o),l&&(i.timeout=l),i.onload=function(){200===i.status||206===i.status?e(i):t(i)},i.onerror=function(){t(i)},i.ontimeout=function(){t(i)},i.onabort=function(){t(i)},"GET"===a&&!d){var s=/\?/gi.test(n)?"&":"?";n+="".concat(s,"_=").concat((new Date).getTime())}if(i.open(a,"".concat(n),!0),u)try{u(i,n)}catch(Hl){console.error("xhr setup failure: ".concat(Hl.stack||Hl.message))}switch(a){case"POST":"text"===o&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(c);break;case"GET":case"HEAD":i.send()}}))})),sl=function(e){return e&&e.then?e:new Promise((function(e){e(null)}))},ll=function(e,t){var n;if(t&&e)return Object.keys(e).map((function(i){i.toLowerCase()===t.toLowerCase()&&(n=e[i])})),n};function cl(e){return/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(e)}function ul(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e}function hl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=setTimeout((function(){n&&console.warn(n),i=null}),t);return e.then?e.then((function(){return clearTimeout(i)})):(clearTimeout(i),i=null),e}function dl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(i,r){e().then(i).catch((function(o){setTimeout((function(){1!==t?dl(e,t-1,n).then(i,r):r(o)}),n)}))}))}function fl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return console.error("mse error",t),!1}}var pl="undefined"!=typeof window,gl=pl&&navigator.userAgent.toLocaleLowerCase(),vl=pl&&/^((?!chrome|android).)*safari/.test(gl),yl=/["'&<>]/;var ml={playDomain:"//vod.volcengineapi.com",backupPlayDomain:"//open.volcengineapi.com"},_l=["options","type","isLive","id","root","plugins","defaultConfig","languages","url","codec","playList","streamType","isMobile","useSoftDecoding","enableH265Degrade","checkExpireInterval","expireDetectType","onMediaExpired","onTokenExpired","platform","unionId","isMusic","sdkPlugins","useHlsPluginForSafari"],bl=function(){function e(t){a(this,e),this.id="",this.type="",this.isLive=!1,this.options=null,this.isMobile=!1,this.playList=[],this.plugins=[],this.openSoftDecoding=!1,this.current={lineId:0,language:"",definition:"",streamType:"",codec:void 0};var n=t.options,i=t.type,r=t.isLive,o=t.id,s=t.root,l=t.plugins,c=void 0===l?[]:l,u=t.defaultConfig,h=t.languages;t.url;var d=t.codec;t.playList,t.streamType;var p,g,v=t.isMobile,y=void 0!==v&&v,m=t.useSoftDecoding,k=void 0!==m&&m,w=t.enableH265Degrade,T=void 0!==w&&w,S=t.checkExpireInterval,C=void 0===S?400:S,E=t.expireDetectType,x=void 0===E?[]:E,O=t.onMediaExpired,P=t.onTokenExpired,L=t.platform,I=t.unionId,D=t.isMusic,A=void 0!==D&&D,M=t.sdkPlugins,R=void 0===M?[]:M,N=t.useHlsPluginForSafari,j=void 0===N||N,B=f(t,_l);this.configs=t,this.options=Object.assign({},n,B),this.options.poster="string"==typeof this.options.poster?function(e){var t,n=""+e,i=yl.exec(n);if(!i)return n;var r,o="",a=0;for(r=i.index;r<n.length;r++){switch(n.charCodeAt(r)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==r&&(o+=n.substring(a,r)),a=r+1,o+=t}return a!==r?o+n.substring(a,r):o}(this.options.poster):void 0,this.options.icons=(p=this.options.icons,g={},p&&Object.entries(p).forEach((function(e){var t=_(e,2),n=t[0],i=t[1];i&&"string"!=typeof i&&(g[n]=i)})),g),this.id=o,this.root=s,this.type=i,this.isLive=!!(null!=r?r:"live"===i),this.defaultConfig=u,this.languageData=this.initI18nData(h),this.isMobile=y||"mobile"===Si.device,this.openSoftDecoding=k,this.enableH265Degrade=T,this.codec=d,this.checkExpireInterval=C,this.expireDetectType=x,this.onMediaExpired=O,this.onTokenExpired=P,this.initPlayData(t),this.current=Wn.observe(this.current),this.playList=Wn.observe(this.playList),this.plugins=b(c),this.isMusic=A,this.platform=L,this.unionId=I,this.apiMap=ml,this.sdkPlugins=R,this.useHlsPluginForSafari=j}return l(e,[{key:"initPlayData",value:function(e){var t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}},{key:"initPlaylistAndGetCurrent",value:function(e){var n,i=e.url,r=e.playList,o=e.streamType,a=void 0===o?"":o,s=null;if(r&&(this.playList=b(r)),i)if(0===this.playList.length)this.playList=[t(t({},this.current),{},{url:i,streamType:a})];else{var l=this.getUrlList({url:i});l.length>0?s=l[0]:console.log("默认url不在Playlist中")}var c=this.getCurrentByDefaultConfig();return c&&(s=c),null!==(n=s)&&void 0!==n?n:this.playList[0]}},{key:"isCurrentH265",value:function(){return!!this.codec&&this.codec.replace(".","").toLowerCase()===Fn.H265}},{key:"getCurrentByDefaultConfig",value:function(){if(this.defaultConfig){var e=this.defaultConfig,t=e.type,n=e.isLive,i=e.lineId,r=void 0===i?"":i,o=e.definition,a=void 0===o?"":o;if((null!=n?n:"live"===t)===this.isLive){if(!r&&!a)return console.log("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);var s=this.getUrlList({lineId:r,definition:a});return s.length>0?(this.isHitDefault=!0,s[0]):(console.log("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}}}},{key:"initCurrent",value:function(e){var t=this;Object.keys(this.current).forEach((function(n){t.current[n]=null==e?void 0:e[n]}));var n=(null==e?void 0:e.codec)||(null==e?void 0:e.Codec);n&&1===this.playList.length&&(this.codec=n)}},{key:"initI18nData",value:function(e){var t=[Rs,Ms],n=e&&Object.entries(e).reduce((function(e,n){var i=_(n,2),r=i[0],o=i[1];return js.includes(r)?e.push({LANG:"zh"===r?"zh-cn":r,TEXT:o}):t.push({LANG:r,TEXT:o}),e}),[]);return{extraLangList:t,extendLangList:n}}},{key:"getCurrentUrl",value:function(){var e;return null===(e=this.getCurrentStreams()[0])||void 0===e?void 0:e.url}},{key:"getCurrentStreamType",value:function(){var e=this.getCurrentStreams();if(e.length){var t=e[0],n=t.url;return t.streamType||function(e){return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(e)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(e)?"flv":function(e){return e&&0<e.toLowerCase().indexOf(".sdp")}(e)?"rtm":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(e)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(e)?"dash":"mp4"}(n)}return this.configs.streamType}},{key:"getCurrentStreams",value:function(){var e=this.current;return this.getUrlList(e)}},{key:"getLineList",value:function(){return Kt(Hn(this.playList,"lineId"))}},{key:"getLineListByLineId",value:function(e){return this.playList.filter((function(t){var n;return(null==e?void 0:e.toString())===(null===(n=t.lineId)||void 0===n?void 0:n.toString())}))}},{key:"getDefinitionListByLineId",value:function(e){return Kt(Hn(this.getLineListByLineId(e),"definition"))}},{key:"getUrlList",value:function(e){return this.playList.filter((function(t){return Object.keys(e).every((function(n){var i,r,o=(null===(i=e[n])||void 0===i?void 0:i.toString())===(null===(r=t[n])||void 0===r?void 0:r.toString()),a=!e[n];return o||a}))}))}},{key:"getNextDefinition",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=arguments.length>1?arguments[1]:void 0,r=n?"next":"prev",o=this.current,a=o.definition,s=o.lineId;if(a){var l=null===(e=this.getCurrentStreams())||void 0===e?void 0:e[0],c="auto"===a?l.mapDefinition:a,u=il(i)||Ns,h=Object.keys(u);if(h.includes(c)){for(var d=null===(t=u[c])||void 0===t?void 0:t[r],f=this.getDefinitionListByLineId(s);0===f.filter((function(e){return e.definition===d})).length&&d;){var p;d=null===(p=u[d])||void 0===p?void 0:p[r]}if(d)return"auto"===a&&d&&(l.mapDefinition=d),this.getUrlList({lineId:s,definition:d});console.log("已经降至最低级")}}}}]),e}(),kl=function(){return(kl=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function wl(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function Tl(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function Sl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Tl(arguments[t]));return e}var Cl,El=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;e&&t&&"function"==typeof t&&this.on(e,(function i(r){t(r),n.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&Sl(this._hooks[e]).forEach((function(e){try{e(t)}catch(n){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),xl=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},Ol=function(e){return Array.isArray(e)},Pl=(Cl=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return Cl+=1}),Ll=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)},Il=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},Dl=function(e,t,n){var i=document.createElement("script");i.src=e,i.onerror=function(){n(e)},i.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(i)},Al=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach((function(t){void 0!==document[t]&&(e=1)})),e},Ml=function(e){var t=document.createElement("a");return t.href=e,t},Rl=function(e){var t={};try{var n=Ml(e).search;if(!n)return t;(n=n.slice(1)).split("&").forEach((function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(o){t[n]=i}}))}catch(i){}return t},Nl=function(e){for(var t=0,n=0,i=(e+="").length,r=0;r<i;r++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t};function jl(e,t){return e(t={exports:{}},t.exports),t.exports}var Bl,Ul,Hl,Fl=jl((function(e,t){var n;n=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(i){function r(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(c){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,!0!==o[l]&&(s+="="+o[l].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),l=s.slice(1).join("=");n||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=t(s[0]);if(l=(i.read||i)(l,c)||t(l),n)try{l=JSON.parse(l)}catch(u){}if(r[c]=l,e===c)break}catch(u){}}return e?r[e]:r}}return r.set=o,r.get=function(e){return a(e,!1)},r.getJSON=function(e){return a(e,!0)},r.remove=function(t,n){o(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}((function(){}))},e.exports=n()})),Vl=function(e,t){try{return e?Fl.get(e,{domain:t||document.domain}):Fl.get()}catch(n){return""}},zl=function(e,t,n,i){try{var r=i||document.domain,o=+new Date+(n||6048e5);Fl.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(a){}},Gl=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e,t){return Vl(e,t)},e.prototype.setCookie=function(e,t,n,i){zl(e,t,n,i)},e}(),Wl={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(i){}return n||{}}catch(i){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(i){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){return Vl(e,t)},setCookie:function(e,t,n,i){zl(e,t,n,i)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(Hl){return!1}}()},Kl={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(i){}return n||{}}catch(i){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(i){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){return Vl(e,t)},setCookie:function(e,t,n,i){zl(e,t,n,i)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(Hl){return!1}}()},$l=function(){function e(e,t){this._storage=t&&"session"===t?Kl:!e&&Wl.isSupportLS?Wl:new Gl}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,i){this._storage.setCookie(e,t,n,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),Yl=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,i=n?Ml(n).hostname:"",r=Rl(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,n,i){var r=new $l(!1),o=new $l(!1,"session"),a=e?"_tea_utm_cache_"+e:"_tea_utm_cache",s=e?"_$utm_from_url_"+e:"_$utm_from_url",l={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],u={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var d in u)u[d]&&(-1!==c.indexOf(d)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[d]=u[d]):l[d]=u[d],h=!0);if(h)o.setItem(s,"1"),r.setCookie(a,JSON.stringify(l),i,n);else{var f=r.getCookie(a,n);f&&(l=JSON.parse(f))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(p){return u}return l}(this.appid,r,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:i,utm:this.utm,latest_data:this.last(n,i)}},e.prototype.last=function(e,t){var n="",i="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,i=t,a=!0;var s=Rl(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:i,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,n="",i=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(n="Microsoft Internet Explorer",i=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(n="sougoubrowser",i=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(n="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),i=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),i=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(n="360browser",i=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),i=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),i=r.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(n="openlanguage xiaomi",i=r.substring(e+7,e+13)):(n="xiaomi",i=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(n="Firefox",i=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))&&(n="qqbrowser",i=r.substring(e+3,e+8)),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<n.length;i++){var r=n[i];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},l=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?n.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(r){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),ql={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},Xl={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},Jl="5.1.3",Zl=function(){function e(e,t){this.collector=e,this.config=t,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","_staging_flag"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return e.prototype.checkVerify=function(e){var t=this;if(!e||!e.length)return!1;var n=e[0];if(!n)return!1;var i=n.events,r=n.header;if(!i||!i.length)return!1;var o=!0;return i.forEach((function(e){if(!e)return o=!1,void(e.checkEvent="事件异常");t.checkEventName(e.event)||(o=!1,e.checkEvent="事件名不能以 $ or __开头"),t.checkEventParams(e.params)||(o=!1,e.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(r)||(o=!1),o},e.prototype.checkEventName=function(e){return!!e&&this.calculate(e,"event")},e.prototype.checkEventParams=function(e){var t=e;if("string"==typeof e&&(t=JSON.parse(t)),!Object.keys(t).length)return!0;for(var n in t)return!(!this.calculate(n,"params")||"string"==typeof t[n]&&t[n].length>1024&&(console.warn("params: "+n+" can not over 1024 byte, please check;"),1));return!0},e.prototype.calculate=function(e,t){return-1!==("event"===t?this.eventNameWhiteList:this.paramsNameWhiteList).indexOf(e)||!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||(console.warn(("event"===t?"event":"params")+" name: "+e+" can not start with $ or __, pleace check;"),!1)},e}();(Hl=Bl||(Bl={})).Init="init",Hl.Config="config",Hl.Start="start",Hl.Ready="ready",Hl.UnReady="un-ready",Hl.TokenComplete="token-complete",Hl.TokenStorage="token-storage",Hl.TokenFetch="token-fetch",Hl.TokenError="token-error",Hl.ConfigUuid="config-uuid",Hl.ConfigWebId="config-webid",Hl.ConfigDomain="config-domain",Hl.CustomWebId="custom-webid",Hl.TokenChange="token-change",Hl.TokenReset="token-reset",Hl.ConfigTransform="config-transform",Hl.EnvTransform="env-transform",Hl.SessionReset="session-reset",Hl.SessionResetTime="session-reset-time",Hl.SetSessionId="set-session-id",Hl.Event="event",Hl.Events="events",Hl.EventNow="event-now",Hl.CleanEvents="clean-events",Hl.BeconEvent="becon-event",Hl.SubmitBefore="submit-before",Hl.SubmitScuess="submit-scuess",Hl.SubmitAfter="submit-after",Hl.SubmitError="submit-error",Hl.SubmitVerify="submit-verify",Hl.Stay="stay",Hl.ResetStay="reset-stay",Hl.StayReady="stay-ready",Hl.SetStay="set-stay",Hl.RouteChange="route-change",Hl.RouteReady="route-ready",Hl.Ab="ab",Hl.AbVar="ab-var",Hl.AbAllVars="ab-all-vars",Hl.AbConfig="ab-config",Hl.AbExternalVersion="ab-external-version",Hl.AbVersionChangeOn="ab-version-change-on",Hl.AbVersionChangeOff="ab-version-change-off",Hl.AbOpenLayer="ab-open-layer",Hl.AbCloseLayer="ab-close-layer",Hl.AbReady="ab-ready",Hl.AbComplete="ab-complete",Hl.AbTimeout="ab-timeout",Hl.Profile="profile",Hl.ProfileSet="profile-set",Hl.ProfileSetOnce="profile-set-once",Hl.ProfileUnset="profile-unset",Hl.ProfileIncrement="profile-increment",Hl.ProfileAppend="profile-append",Hl.ProfileClear="profile-clear",Hl.Autotrack="autotrack",Hl.AutotrackReady="autotrack-ready",Hl.CepReady="cep-ready",Hl.TracerReady="tracer-ready",Hl.sessionRecord="session-record",Hl.SessionRecordStart="session-record-start",Hl.SessionRecordPause="session-record-pause",Hl.SessionRecordEnd="session-record-end",Hl.SessionRecordReport="session-record-report",Hl.DestoryInstance="destory-instance",Hl.VisualCollectReady="visual-collect-ready",Hl.VisualApiReady="visual-api-ready",Hl.VisualApiUpdate="visual-api-update",function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(Ul||(Ul={}));var Ql=Bl,ec=void 0,tc=(new Date).getTimezoneOffset(),nc=parseInt(""+-tc/60,10),ic=60*tc,rc=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var n=new Yl(t.app_id,t.cookie_domain||"",t.cookie_expire||7776e6).init();this.eventCheck=new Zl(e,t);var i="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new $l(!1,"session"),this.localStorage=new $l(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var r=this.localStorage.getItem(i);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:ec,user_type:ec,user_id:ec,user_is_auth:ec,user_is_login:ec,device_id:ec,web_id:ec,ip_addr_id:ec,user_unique_id_type:ec},header:{app_id:ec,app_name:ec,app_install_id:ec,install_id:ec,app_package:ec,app_channel:ec,app_version:ec,ab_version:ec,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:ec,traffic_type:ec,client_ip:ec,device_brand:ec,os_api:ec,access:ec,language:n.language,region:ec,app_language:ec,app_region:ec,creative_id:n.utm.creative_id,ad_id:n.utm.ad_id,campaign_id:n.utm.campaign_id,log_type:ec,rnd:ec,platform:n.platform,sdk_version:Jl,sdk_lib:"js",province:ec,city:ec,timezone:nc,tz_offset:ic,tz_name:ec,sim_region:ec,carrier:ec,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:n.utm.utm_term,utm_content:n.utm.utm_content,utm_source:n.utm.utm_source,utm_medium:n.utm.utm_medium,utm_campaign:n.utm.utm_campaign,tracer_data:JSON.stringify(n.utm.tracer_data),custom:{},wechat_unionid:ec,wechat_openid:ec}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(n),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=Ll(Xl[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.initABData=function(){var e="__tea_sdk_ab_version_"+this.initConfig.app_id,t=null;if(this.initConfig.ab_cross){var n=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=n?JSON.parse(n):null}else t=this.localStorage.getItem(e);this.setAbCache(t)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.clearAbCache=function(){this.ab_version="",this.ab_cache={}},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t="/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid"}var n="";return this.initConfig.caller&&(n="?sdk_version=5.1.3&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+n},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){void 0!==e[n]&&null!==e[n]||t.delete(n);try{t.eventCheck.calculate(n,"config")}catch(Hl){}if("traffic_type"===n&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[n]),"evtParams"===n)t.evtParams=kl({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===n)t.evtParams=kl({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var i="",r="";if(n.indexOf(".")>-1){var o=n.split(".");i=o[0],r=o[1]}i?"user"===i||"header"===i?t.envInfo[i][r]=e[n]:t.envInfo.header.custom[r]=e[n]:Object.hasOwnProperty.call(t.envInfo.user,n)?["user_type","ip_addr_id"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:["user_is_auth","user_is_login"].indexOf(n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n]):Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(t){console.log("get config stringify error "),this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(i){console.log("setStore error"),this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(t){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(n){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),console.log("delete error")}},e}(),oc=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[AppLog WEB SDK] [instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("[AppLog WEB SDK] [instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[AppLog WEB SDK] [instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),ac=function(){function e(){this.spiderBot=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"]}return e.prototype.checkSpider=function(e){if(!e.enable_spider)return!1;var t=window.navigator.userAgent;if(!t)return!0;var n=!1;return this.spiderBot.forEach((function(e){-1!==t.indexOf(e)&&(n=!0)})),n},e}(),sc=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(i){console.log("AppLogBridge, error:"+JSON.stringify(i.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: "+e)}catch(t){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(n){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(t){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(n){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(t){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(t){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge埋点上报",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(n){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(t){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(t){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(t){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(t){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(t){console.error("profileAppend error")}},e}(),lc=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},cc=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new $l(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSessionTimeCheck=t.disable_session_check,this.disableSession||(this.setSessionId(),this.collect.on(Ql.SessionReset,(function(e){n.resetSessionId(e)})),this.collect.on(Ql.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:lc(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:lc(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.disableSessionTimeCheck||(this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(e){var t={sessionId:e||lc(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,t)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:lc(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),uc=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.eventCheck=new Zl(e,t),this.cacheStorgae=new $l(!0),this.localStorage=new $l(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||t.report_time||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=t.report_url||this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.pageId=lc(),this.collect.on(Ql.Ready,(function(){n.reportAll(!1)})),this.collect.on(Ql.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on(Ql.Event,(function(e){n.event(e)})),this.collect.on(Ql.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on(Ql.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),Il((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var n=Sl(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var i=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),i)}}catch(r){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.beconEvent=function(e){var t=Sl(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroy||this.collect.sdkStop||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);var r=this.split(this.merge(i));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.handleRefer=function(){var e="";try{if(this.config.spa||this.config.autotrack){var t=this.localStorage.getItem(this.refer_key)||{};e=t.routeChange?t.refer_key:this.configManager.get("referrer")}else e=this.configManager.get("referrer")}catch(n){e=document.referrer}return e},e.prototype.merge=function(e,t){var n=this,i=this.configManager.get(),r=i.header,o=i.user;this.config.enable_pageid&&(r.custom.page_id=this.pageId),r.referrer=this.handleRefer(),r.custom=JSON.stringify(r.custom);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),l=e.map((function(e){try{Object.keys(a).length&&!t&&(e.params=kl({},a,e.params)),s&&(e.params.$user_unique_id_type=s);var i=n.configManager.getAbCache();return i&&i.uuid&&i.uuid===o.user_unique_id&&n.configManager.getAbVersion()&&(e.ab_sdk_version=n.configManager.getAbVersion()),e.session_id=n.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(Hl){return n.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:Hl.message}),e}})),c=JSON.parse(JSON.stringify({events:l,user:o,header:r}));c.local_time=Math.floor(Date.now()/1e3),c.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,c.verbose=1;var u=[];return u.push(c),u},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&(this.config.disable_track_event||e.forEach((function(e){try{var i=JSON.parse(JSON.stringify(e));n.config.filter&&((i=n.config.filter(i))||console.warn("filter must return data !!")),n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var r=i||e,o=JSON.parse(JSON.stringify(r));if(n.eventCheck.checkVerify(o),!r.length)return;n.collect.emit(Ql.SubmitBefore,r),n.collect.requestManager.useRequest({url:n.reportUrl,data:r,success:function(e,t){e&&0!==e.e?(n.collect.emit(Ql.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:o,code:e.e,failType:"数据异常失败",status:"fail"})):(n.collect.emit(Ql.SubmitScuess,{eventData:t,res:e}),n.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:o,code:200,status:"success"}))},fail:function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit(Ql.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:o,code:t,failType:"网络异常失败",status:"fail"})},timeout:n.timeout,useBeacon:t,withCredentials:n.enable_ttwebid}),n.collect.emit(Ql.SubmitAfter,r)}catch(a){console.warn("something error, "+JSON.stringify(a.stack)),n.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}})))},e}(),hc=function(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},dc=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new $l(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(Ql.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on(Ql.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(Ql.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(Ql.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:hc(),user_unique_id:this.configManager.get("user_unique_id")||hc()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=Rl(window.location.href);return!(!t||!t.Web_ID||(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),0))}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:n});var i=hc();this.collect.requestManager.useRequest({url:t,data:n,success:function(t){var n;t&&0===t.e?(n=t.web_id,e.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})):(n=i,e.collect.configManager.set({localWebId:i}),e.collect.emit(Ql.TokenError),e.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"WEBID请求返回值异常",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})},fail:function(){e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i}),e.collect.configManager.set({localWebId:i}),e.collect.emit(Ql.TokenError),e.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")},timeout:3e5})},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Ql.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");(n||t)&&this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Ql.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(Ql.TokenChange,"uuid"),this.collect.emit(Ql.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&this.configManager.get("user_unique_id")!==this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(Ql.TokenReset,"uuid"))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(Ql.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(Ql.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.enableCookie||this.enable_ttwebid?(this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain),this.enable_ttwebid&&(delete e.web_id,this.storage.setItem(this.tokenKey,e))):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this;return new Promise((function(t){e.collect.requestManager.useRequest({url:e.configManager.getUrl("tobid"),data:{app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")},success:function(e){e&&0===e.e?t(e.tobid):t("")},fail:function(){t("")},time:3e4,withCredentials:e.enable_ttwebid})}))},e}(),fc=function(){function e(e,t){this.collector=e,this.config=t,this.requestType=t.request_type||"xhr",this.supportBeacon=!(!window.navigator||!window.navigator.sendBeacon),this.errorCode={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005}}return e.prototype.useFetch=function(e){var t=e.url,n=e.data,i=e.method,r=e.success,o=e.fail;window.fetch?fetch(t,{method:i||"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(n)}).then((function(e){return e.json()})).then((function(e){r&&r(e)})).catch((function(e){o&&o(n,e)})):(this.requestType="xhr",console.log("your brwoser not support fetch, use xhr"),this.useRequest({url:t,data:n,method:i,success:r,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,n=e.data,i=e.success,r=e.fail;window.navigator.sendBeacon(t,JSON.stringify(n))?i&&i():r&&r(n,this.errorCode.BEACON_FALSE)},e.prototype.useRequest=function(e){var t=this,n=e.url,i=e.data,r=e.method,o=e.success,a=e.fail,s=e.timeout,l=e.useBeacon,c=e.withCredentials,u=e.app_key,h=e.forceXhr;if(l&&this.supportBeacon)this.useBeacon({url:n,data:i,method:r,success:o,fail:a});else if("fetch"!==this.requestType||h)try{var d=new XMLHttpRequest,f=r||"POST";d.open(f,""+n,!0),d.setRequestHeader("Content-Type","application/json; charset=utf-8"),u&&d.setRequestHeader("X-MCS-AppKey",""+u),c&&(d.withCredentials=!0),s&&(d.timeout=s,d.ontimeout=function(){a&&a(i,t.errorCode.TIMEOUT)}),d.onload=function(){if(o){var e=null;if(d.responseText){try{e=JSON.parse(d.responseText)}catch(t){e={}}o(e,i)}}},d.onerror=function(){d.abort(),a&&a(i,t.errorCode.XHR_ON)},d.send(JSON.stringify(i))}catch(p){}else this.useFetch({url:n,data:i,method:r,success:o,fail:a})},e}(),pc=function(){function e(e,t){if(this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,this.eventVerifyReady=!1,t.enable_debug){var n=e.adapters.storage;this.collect=e,this.config=t,this.app_id=t.app_id,this.cacheStorgae=new n(!1,"session"),this.eventVerifyInfo=[],this.sdk_type=Jl.includes("tob")?"tob":"inner",this.filterEvent=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"],this.load()}}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(n){console.log("devTool load fail, "+n.message)}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach((function(t){var n=t.split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}))}catch(n){}return e},e.prototype.load=function(){return e=this,void 0,n=function(){var t,n,i;return function(t,n){var i,r,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(t,s)}catch(e){a=[6,e],r=0}finally{i=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),(t=this.parseUrl()).open_devtool_web&&t.app_id){if(parseInt(t.app_id)!==this.app_id)return[2]}else if(!this.getStorage())return[2];return this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool(),[4,this.fetchEventInfo()];case 1:return n=e.sent(),this.sendData("devtool:web:verify",n.verifyStatus),this.eventVerifyInfo=n.data,[3,3];case 2:return i=e.sent(),console.log("debug fail, "+i.message),[3,3];case 3:return[2]}}))},new((t=void 0)||(t=Promise))((function(i,r){function o(e){try{s(n.next(e))}catch(t){r(t)}}function a(e){try{s(n.throw(e))}catch(t){r(t)}}function s(e){e.done?i(e.value):new t((function(t){t(e.value)})).then(o,a)}s((n=n.apply(e,[])).next())}));var e,t,n},e.prototype.getStorage=function(){var e=this.cacheStorgae.getItem("__applog_devtool_web");return e&&parseInt(e)===this.app_id},e.prototype.setStorage=function(){this.cacheStorgae.setItem("__applog_devtool_web",this.app_id)},e.prototype.loadDevTool=function(){this.loadScript("https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/debug-web.0.0.2.js")},e.prototype.loadBaseInfo=function(){var e=this;this.info=[{title:"基本信息",type:1,infoName:{app_id:this.config.app_id,channel:this.config.channel,"上报域名":this.collect.configManager.getDomain(),"SDK版本":Jl,"SDK引入方式":"npm"}},{title:"用户信息",type:2,infoName:{uuid:this.collect.configManager.get("user").user_unique_id||"",web_id:this.collect.configManager.get("user").web_id||"",ssid:"点击获取SSID"}},{title:"公共参数信息",type:2,infoName:{"浏览器":this.collect.configManager.get("browser"),"浏览器版本":this.collect.configManager.get("browser_version"),"平台":this.collect.configManager.get("platform"),"设备型号":this.collect.configManager.get("device_model"),"操作系统":this.collect.configManager.get("os_name"),"操作系统版本":this.collect.configManager.get("os_version"),"屏幕分辨率":this.collect.configManager.get("resolution"),"来源":this.collect.configManager.get("referrer"),"自定义信息":""}},{title:"配置信息",type:3,infoName:{"全埋点":!!this.config.autotrack,"停留时长":!!this.config.enable_stay_duration}},{title:"A/B配置信息",type:4,infoName:{"A/B实验":!!this.config.enable_ab_test}},{title:"客户端信息",type:3,infoName:{"打通开关":!!this.config.Native}}],this.log=[],this.event=[],this.collect.on(Ql.Ready,(function(){e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id,e.info[2].infoName["自定义信息"]=JSON.stringify(e.collect.configManager.get("custom")),e.config.enable_ab_test&&(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["A/B域名"]=e.config.ab_channel_domain||Ll(ql[e.config.channel]),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()),e.config.Native&&(e.info[5].infoName["是否打通"]=!!e.collect.bridgeReport)}))},e.prototype.loadHook=function(){var e=this;this.collect.stop(),this.collect.on(Ul.DEBUGGER_MESSAGE,(function(t){switch(t.type){case Ul.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType?(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()):"USER"===t.secType&&(e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id),void e.updateInfo();case Ul.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var r=t.data[0],o=r.events,a=r.header;if(a.custom=JSON.parse(a.custom),!o.length)return;o.forEach((function(n){n.checkShow=!0,n.searchShow=!0,n.type=-1!==e.filterEvent.indexOf(n.event)?"sdk":"cus",n.type=e.collect.bridgeReport?"bridge":n.type,n.params=JSON.parse(n.params),"fail"===t.status&&(n.info={message:"code: "+t.code+", msg: "+t.failType},n.failType=t.failType);var r=!1,o=!1,a=[];e.eventVerifyInfo&&e.eventVerifyInfo.length&&(e.eventVerifyInfo.forEach((function(e){e.eventStatus=!1})),e.eventVerifyInfo.forEach((function(t){n.event===t.name&&(o=!0,r=!0,n.verifyStatus=t.status,Object.keys(n.params).forEach((function(r){if("event_index"!==r){var s={};s.paramsKey=r,s.paramsKeyValue=n.params[""+r],s.paramsStatus=!1,s.paramsStatusInfo="属性未录入",t.params.forEach((function(t){r===t.name&&(t.checked=!0,i(n.params[""+r])!==e.formatParamsType(t.value_type)?s.paramsStatusInfo="属性类型错误,应为"+e.formatParamsType(t.value_type):(s.paramsStatus=!0,s.paramsStatusInfo=""))})),a.push(s),s.paramsStatusInfo&&(o=!1)}})),t.params.forEach((function(e){e.checked||(o=!1,a.push({paramsKey:e.name,paramsStatus:!1,paramsStatusInfo:"缺少属性"+e.name}))})))}))),n.reportStatus="success"===t.status,n.paramsInfo=a,n.eventStatus=o&&"success"===t.status,n.eventRecord=r})),e.updateEvent(r)}return}}))},e.prototype.formatParamsType=function(e){switch(e){case 0:return"string";case 1:case 2:return"number";case 3:return"boolean"}},e.prototype.fetchEventInfo=function(){var e=this;try{return new Promise((function(t){var n=Ll("1fz22z22z1nz21z4mz4bz4bz18z1nz1nz1jz1mz1ez1fz1mz1kz1cz4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22z4bz18z1nz1nz1jz1mz1ez1bz1cz24z22z1mz1mz1jz21z4bz1mz1nz1cz1lz18z1nz1gz4bz24z4dz4bz18z1nz1nz16z1jz1mz1ez16z1kz1cz22z18")+"?app_id="+e.app_id+"&t="+e.sdk_type+"&nc=false";e.collect.requestManager.useRequest({url:n,method:"GET",success:function(n){e.eventVerifyReady=!0,e.collect.reStart(),t({data:n.data,verifyStatus:!0})},fail:function(){e.eventVerifyReady=!0,e.collect.reStart(),t({data:[],verifyStatus:!1})},timeout:3e3})}))}catch(t){return{data:[],verifyStatus:!1}}},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(t.origin===location.origin){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event,appid:e.app_id}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.info[1].infoName.ssid=t.tobid,e.updateInfo()})),t&&t.data&&t.data.type}}))},e.prototype.sendData=function(e,t){try{var n={type:e,payload:t};(window.opener||window.parent).postMessage(n,this.devToolOrigin)}catch(i){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady||this.eventVerifyReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.appendChild(document.createTextNode("#debugger-applog-web {\n position: fixed;\n width: 50px;\n height: 50px;\n background-image: url('https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/applog.png');;\n bottom: 5%;\n right: 10%;\n cursor: pointer;\n z-index:100;\n background-size: 50px;\n }")),e.appendChild(t);var n=document.createElement("div");n.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web"></div>';var i=document.createElement("div");i.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(n),document.getElementsByTagName("body")[0].appendChild(i),document.getElementById("debugger-applog-web").addEventListener("click",(function(){(window.opener||window.parent).postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),gc={autotrack:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/autotrack.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/ab.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/stay.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/route.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},cep:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/cep.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/cep.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/cep.js"},object:"LogCep"},tracer:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/tracer.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"},retry:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/retry.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/retry.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/retry.js"},object:"LogRetry"},visual:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/visual.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/visual.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/visual.js"},object:"LogVisual"}},vc=["ab","autotrack","Stay","store","et","profile","cep","heartbeat","monitor","route","tracer"],yc=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroy=!1,this.sdkReady=!1,this.adapters={},this.loadType="base",this.sdkStop=!1,this.name=e,this.hook=new El,this.remotePlugin=new Map,this.Types=Ql,this.adapters.storage=$l,this.loadType="full"}return e.usePlugin=function(t,n,i){if(n){for(var r=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=i||{},r=!0;break}r||e.plugins.push({name:n,plugin:t,options:i})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,n){e&&("full"===this.loadType&&vc.includes(e)?console.info("your sdk version has "+e+" plugin already ~"):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:n}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},e.prototype.init=function(t){var n,i=this;this.logger=new oc(this.name,t.log),this.inited?this.logger.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!"):t&&xl(t)?t.app_id&&"number"==typeof(n=t.app_id)&&!isNaN(n)?t.app_key&&"string"!=typeof t.app_key?this.logger.warn("app_key param is error, must be string, please check!"):(t.channel_domain||-1!==["cn","sg","va"].indexOf(t.channel)||(this.logger.warn("channel must be `cn`, `sg`,`va` !"),t.channel="cn"),this.spider=new ac,this.spider.checkSpider(t)?this.logger.warn("your env may be a spider, can not report!"):(this.appBridge=new sc(this,t.enable_native),this.requestManager=new fc(this,t),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new rc(this,t),this.debugger=new pc(this,t),this.initConfig=t,this.emit(Ql.Init),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:t,level:"info",time:Date.now()}),this.destroy=!1,t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.set({app_id:t.app_id}),this.eventManager=new uc,this.tokenManager=new dc,this.sessionManager=new cc,Promise.all([new Promise((function(e){i.once(Ql.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once(Ql.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var n=t.plugin,r=t.options,o=Object.assign(i.initConfig,r),a=new n;return a.apply(i,o),e.push(a),e}),i.pluginInstances)}catch(n){console.warn("load plugin error, "+n.message),i.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}i.sdkReady=!0,i.emit(Ql.Ready),i.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:i.configManager.get("user")}),i.logger.info("appid: "+t.app_id+", userInfo:"+JSON.stringify(i.configManager.get("user"))),i.logger.info("appid: "+t.app_id+", sdk is ready, version type is "+i.loadType+", version is "+Jl+", you can report now !!!"),t.disable_auto_pv&&(i.disableAutoPageView=!0);try{"full"===i.loadType&&(t.enable_ab_test||t.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(n){i.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}i.pageView(),i.on(Ql.TokenChange,(function(e){"webid"===e&&i.pageView(),i.logger.info("appid: "+t.app_id+" token change, new userInfo:"+JSON.stringify(i.configManager.get("user"))),i.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user")})})),i.on(Ql.TokenReset,(function(){i.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+JSON.stringify(i.configManager.get("user"))),i.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user")})})),i.on(Ql.RouteChange,(function(e){e.init||t.disable_route_report||i.pageView()}))})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t)),this.inited=!0)):this.logger.warn("app_id param is error, must be number, please check!"):this.logger.warn("init params error,please check!")},e.prototype.config=function(e){if(this.inited)if(e&&xl(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=kl({},e),n=this.initConfig.configPersist||this.initConfig.config_persist||!1;if(this.initConfig&&n){var i=this.configManager.getStore();i&&(t=Object.assign(i,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]])}return n}(t,["web_id","user_unique_id"]);this.configManager.set(r),t.hasOwnProperty("web_id")&&this.emit(Ql.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit(Ql.ConfigUuid,t.user_unique_id),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:t})}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},e.prototype.setUserUniqueID=function(e){this.config({user_unique_id:e})},e.prototype.setHeaderInfo=function(e,t){var n={};n[e]=t,this.config(n)},e.prototype.removeHeaderInfo=function(e){var t={};t[e]=void 0,this.config(t)},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(Ql.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.started=!0,this.emit(Ql.Start),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(Ql.Ready)))},e.prototype.event=function(e,t){var n=this;try{var i=[];if(Array.isArray(e))e.forEach((function(e){var t=n.processEvent(e[0],e[1]||{});t&&i.push(t)}));else{var r=this.processEvent(e,t);if(!r)return;i.push(r)}this.bridgeReport?i.forEach((function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))})):i.length&&(this.emit(Ql.Event,i),this.emit(Ql.SessionResetTime))}catch(o){this.logger.warn("something error, please check"),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message})}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))this.logger.warn("beconEvent not support batch report, please check");else{var n=[],i=this.processEvent(e,t||{});i&&(n.push(i),n.length&&(this.emit(Ql.BeconEvent,n),this.emit(Ql.SessionResetTime)))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return this.logger.warn("eventName is null, please check"),null;var n=e;/^event\./.test(e)&&(n=e.slice(6));var r=t;"object"!=i(r)&&(r={}),r.profile?delete r.profile:r.event_index=Pl();var o=void 0;return r.local_ms?(o=r.local_ms,delete r.local_ms):o=+new Date,{event:n,params:r,local_time_ms:o,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(a){return this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message}),{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.stop=function(){this.sdkStop=!0},e.prototype.reStart=function(){this.sdkStop=!1},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){if(void 0===e&&(e={}),this.inited){var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},n=kl({},t,e);this.event("predefine_pageview",n)}else console.warn("predefinePageView must be use after function init")},e.prototype.clearEventCache=function(){this.emit(Ql.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=Nl(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(Ql.CustomWebId)}},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=Nl(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(Ql.CustomWebId)}},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.getSessionId=function(){return lc()},e.prototype.setSessionId=function(e){this.emit(Ql.SessionReset,e)},e.prototype.resetStayDuration=function(e,t,n){this.emit(Ql.ResetStay,{url_path:e,title:t,url:n},Ql.Stay)},e.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(Ql.SetStay,{url_path:e,title:t,url:n},Ql.Stay)},e.prototype.getToken=function(e,t){var n=this;if(this.inited){var i=!1,r=function(t){if(!i){i=!0;var r=n.configManager.get().user;return t&&(r.tobid=t,r["diss".split("").reverse().join("")]=t),e(kl({},r))}},o=function(){n.tokenManager.getTobId().then((function(e){r(e)}))};this.sdkReady?o():(t&&setTimeout((function(){r()}),t),this.on(Ql.Ready,(function(){o()})))}else console.warn("getToken must be use after function init")},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(Ql.ProfileSet,e,Ql.Profile),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(Ql.ProfileSetOnce,e,Ql.Profile),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit(Ql.ProfileIncrement,e,Ql.Profile),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(Ql.ProfileUnset,e,Ql.Profile),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(Ql.ProfileAppend,e,Ql.Profile),this.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit(Ql.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,Ql.Ab)},e.prototype.getVar=function(e,t,n){this.emit(Ql.AbVar,{name:e,defaultValue:t,callback:n},Ql.Ab)},e.prototype.getABconfig=function(e,t){this.emit(Ql.AbConfig,{params:e,callback:t},Ql.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(Ql.AbVersionChangeOn,e,Ql.Ab),function(){t.emit(Ql.AbVersionChangeOff,e,Ql.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(Ql.AbVersionChangeOff,e,Ql.Ab)},e.prototype.openOverlayer=function(){this.emit(Ql.AbOpenLayer,"",Ql.Ab)},e.prototype.closeOverlayer=function(){this.emit(Ql.AbCloseLayer,"",Ql.Ab)},e.prototype.getAllVars=function(e){this.emit(Ql.AbAllVars,e,Ql.Ab)},e.prototype.destoryInstace=function(){this.destroy||(this.destroy=!0,this.off(Ql.TokenComplete),this.emit(Ql.DestoryInstance))},e.prototype.destroyInstance=function(){this.destroy||(this.destroy=!0,this.off(Ql.TokenComplete),this.emit(Ql.DestoryInstance))},e.plugins=[],e}(),mc="__rangers_ab_style__",_c={},bc=[],kc=function(e){e.length&&e.forEach((function(e){bc.push(e)}))};function wc(e,t,n,i){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||i||"*",a={type:t,payload:n};r.postMessage(JSON.stringify(a),o)}function Tc(e,t){_c[e]=_c[e]||[],_c[e].push(t)}function Sc(e){if(bc.some((function(e){return"*"===e}))||bc.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(r){t=void 0}if(!t)return;var n=t.type,i=t.payload;_c[n]&&_c[n].forEach((function(t){"function"==typeof t&&t(e,i)}))}}function Cc(e,t){var n={};if(Object.keys(e).length)for(var i in e){if("filter"===i||"autotrack"===i||"enable_stay_duration"===i)break;n[i]=e[i]}(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:n,version:t},"*"),window.addEventListener("message",Sc,!1)}var Ec,xc="",Oc=!1;function Pc(e){var t=e.event,n=e.editorUrl;e.collectInstance,e.fromSession,Oc||(Oc=!0,Dl(n,(function(){wc(t,"abEditorScriptloadSuccess")}),(function(){t&&wc(t,"abEditorScriptloadError"),Oc=!1})))}!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(Ec||(Ec={}));var Lc=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="complete",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data=null,this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[]}return e.prototype.apply=function(e,t){var n=this;if(t.enable_ab_test){this.collect=e,this.config=t;var i=t.enable_multilink,r=t.ab_channel_domain,o=t.enable_ab_visual,a=t.ab_cross,s=t.ab_cookie_domain,l=t.ab_timeout,c=r||Ll(ql[t.channel||"cn"]),u=e.adapters.storage,h=this.collect.Types;this.types=h,this.cacheStorgae=new u(!1),this.timeout=l||3e3,this.enable_multilink=i,this.enable_ab_visual=o,this.abKey="__tea_sdk_ab_version_"+t.app_id,this.ab_cross=a,this.ab_cookie_domain=s||"",this.fetchUrl=c+"/service/2/abtest_config/",this.reportUrl=""+e.configManager.getUrl("event"),this.exposureLimit=t.exposure_limit||20,this.ab_batch_time=t.ab_batch_time||500,this.collect.on(h.TokenChange,(function(e){"uuid"===e&&n.readyStatus&&(n.clearCache(),n.fetchAB())})),this.collect.on(h.TokenReset,(function(e){"uuid"===e&&n.readyStatus&&(n.clearCache(),n.fetchAB())})),this.collect.on(h.AbVar,(function(e){var t=e.name,i=e.defaultValue,r=e.callback;n.getVar(t,i,r)})),this.collect.on(h.AbAllVars,(function(e){n.getAllVars(e)})),this.collect.on(h.AbConfig,(function(e){var t=e.params,i=e.callback;n.getABconfig(t,i)})),this.collect.on(h.AbExternalVersion,(function(e){n.setExternalAbVersion(e)})),this.collect.on(h.AbOpenLayer,(function(){n.openOverlayer()})),this.collect.on(h.AbCloseLayer,(function(){n.closeOverlayer()})),this.collect.on(h.AbVersionChangeOn,(function(e){n.changeListener.set(e,e)})),this.collect.on(h.AbVersionChangeOff,(function(e){n.changeListener.get(e)&&n.changeListener.delete(e)})),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(this.fetchAB(),this.readyStatus=!0),this.collect.emit(h.AbReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.loadMode=function(){var e,t,n=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e){return}}(),i="";if(n){var r=n.scenario,o=n.href;r?(this.editMode=!0,i=r):!o||-1===o.indexOf("datatester")&&-1===o.indexOf("visual-editor")||(this.editMode=!0,i="visual-editor")}this.enable_ab_visual&&(function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},kc(["*"]);var n,i="";Cc(t,Jl);var r="";try{var o=window.performance.getEntriesByType("resource");if(o&&o.length&&(o.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(r=e.name)})),r||document.currentScript&&(r=document.currentScript.src),r&&(n=r.split("/"))&&n.length)){i="https:/";for(var a=2;a<n.length&&a!==n.length-1;a++)i=i+"/"+n[a];i+="/visual-ab-core"}}catch(s){}Tc("tea:openVisualABEditor",(function(n){var r=n.data;if("string"==typeof n.data)try{r=JSON.parse(n.data)}catch(s){r=void 0}if(r){var o=r.lang;if(r.appId!==t.app_id)return wc(n,"appIdError"),void console.error("abtest appid is not belong the page appid please check");var a=r.version;xc=a&&i?i+(a?"."+a:".1.0.1")+".js?query="+Date.now():"https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-core.js?query="+Date.now(),window.TEAVisualEditor.lang=o,window.TEAVisualEditor.__ab_domin=t.channel_domain||"",Pc({event:n,editorUrl:xc,collectInstance:e})}}))}(this.collect,this.config),"visual-editor"===i)?this.collect.destoryInstace():this.enable_multilink&&(e=this.collect,t=this.config,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id,Tc("tea:openTesterEventInspector",(function(t){var n=t.data;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(a){n=void 0}if(n){var i=n.referrer,r=n.lang,o=n.appId;window.TEAVisualEditor.__editor_ajax_domain=i||"",window.TEAVisualEditor.__ab_appId=o||"",window.TEAVisualEditor.lang=r||"",Pc({event:t,editorUrl:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/tester-event-inspector.js?query="+Date.now(),collectInstance:e})}})))},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,n=e.ab_ext_version,i=e.ab_version_multilink,r=e.data,o=this.checkFromUrl();o?this.mulilinkVersions.push(o):this.mulilinkVersions=i||[],this.extVersions=n||[],this.versions=t||[],this.data=r;var a=this.versions.concat(this.extVersions);this.enable_multilink&&(a=a.concat(this.mulilinkVersions)),this.configVersions(a.join(","))},e.prototype.checkFromUrl=function(){var e=Rl(window.location.href);return e&&e.vid?e.vid:""},e.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(e=e.concat(this.mulilinkVersions)),this.configVersions(e.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach((function(t){"function"==typeof t&&t(e)}))},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,n){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof n)throw new Error("callback must be a function");var i={name:e,defaultValue:t,callback:n,type:Ec.Var};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(i,e):this.callbacks.push(i)},e.prototype.getRealVar=function(e,t){var n=e.name,i=e.defaultValue,r=e.callback,o=this.data;if(o){if(xl(o[n])){var a=o[n].vid;return"$ab_url"===t?this.mulilinkVersions.includes(a)||this.mulilinkVersions.push(a):this.versions.includes(a)||this.versions.push(a),this.updateVersions(),this.fechEvent(a,t,i),r(o[n].val),void this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 曝光了实验"+n,level:"info",time:Date.now(),data:o[n]})}this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getVar",level:"info",time:Date.now(),data:i}),r(i)}else r(i)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:Ec.All};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},e.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getAllVars",level:"info",time:Date.now(),data:this.data})},e.prototype.fechEvent=function(e,t,n){try{if(this.config.disable_track_event)return;if(!e)return;var i=this.collect.configManager.get(),r=i.header,o=i.user,a=this.getABCache();if(a&&a.uuid&&a.uuid!==o.user_unique_id)return;var s={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?n:window.location.href}),local_time_ms:Date.now()};r.custom=JSON.stringify(r.custom);var l={events:[s],user:o,header:r};this.reportExposure(l,t)}catch(c){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:c.message})}},e.prototype.reportExposure=function(e,t){var n=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report(t):this.reportTimeout=setTimeout((function(){n.report(t),clearTimeout(n.reportTimeout)}),this.ab_batch_time)},e.prototype.report=function(e){var t=this;this.collect.requestManager.useRequest({url:this.reportUrl,data:this.exposureCache,timeout:2e4,useBeacon:"$ab_url"===e}),this.exposureCache.forEach((function(e){t.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:[e],code:200,status:"success"})})),this.exposureCache=[]},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var n=Object.keys(e);n&&n.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.get=function(e){if(this.ab_cross){var t=this.cacheStorgae.getCookie(e,this.ab_cookie_domain);return t?JSON.parse(t):{}}return this.cacheStorgae.getItem(e)},e.prototype.set=function(e,t){this.ab_cross?this.cacheStorgae.setCookie(e,t,2592e6,this.ab_cookie_domain):this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t)},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},e.prototype.openOverlayer=function(e){var t=this;if(function(){if(!document.getElementById(mc)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id=mc,n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}}(),e)var n=setTimeout((function(){t.closeOverlayer(),clearTimeout(n)}),e)},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById(mc))&&e.parentElement.removeChild(e)},e.prototype.fetchComplete=function(e,t){var n=this;try{if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var i=[];Object.keys(e).forEach((function(t){var n=e[t].vid;n&&i.push(n)})),this.versions=this.versions.filter((function(e){return i.includes(e)}));var r=e.$ab_url,o=e.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroy)return;this.getVar("$ab_modification",window.location.href,(function(){var e;e=o.val,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.__ab_config=e,Dl("https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-loader.js?query="+Date.now(),(function(){console.log("load visual render success")}),(function(){console.log("load visual render fail")})),n.closeOverlayer()}))}else if(r&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return i.includes(e)}));var a=r.val,s=r.vid;a&&s&&this.getVar("$ab_url",a,(function(){n.editMode||(a!==window.location.href?setTimeout((function(){if(!n.collect.destroy){var e=""+a;e=-1===e.indexOf("http")?"https://"+e:e,Ml(e).host!==location.host?e=e+"&vid="+s:window.history.replaceState("","",e),window.location.href=e}}),100):n.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(e){return n[e.type===Ec.Var?"getRealVar":"getRealAllVars"](e,"")})),this.callbacks=[]}catch(l){}},e.prototype.fetchAB=function(e){var t=this,n=this.collect.configManager.get(),i={header:kl({aid:this.config.app_id},n.user||{},n.header||{},{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 发起AB实验请求",level:"info",logType:"fetch",time:Date.now(),data:i}),this.collect.requestManager.useRequest({url:this.fetchUrl,data:i,success:function(i){t.fetchStatus="complete",t.refreshFetchStatus="complete";var r=i.data;"success"===i.message?(t.fetchComplete(r,n.user.user_unique_id),e&&e(r)):(t.fetchComplete(null,n.user.user_unique_id),e&&e(null)),t.collect.emit(t.types.AbComplete,r),t.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求成功",level:"info",logType:"fetch",time:Date.now(),data:r})},fail:function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,n.user.user_unique_id),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求网络异常",level:"error",logType:"fetch",time:Date.now()})},timeout:this.timeout})},e}(),Ic=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;t.event_verify_url&&("string"==typeof t.event_verify_url?(this.url=t.event_verify_url+"/v1/list_test",e.on(e.Types.SubmitBefore,(function(t){e.requestManager.useBeacon({url:n.url,data:t})}))):console.log("please use correct et_test url"))},e}(),Dc=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.focusState=!0,this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,xl(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageAlive(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var n=t?this.aliveDTime:Date.now()-this.sessionStartTime;n<0||n>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||t&&"hidden"===document.visibilityState||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.aliveName,kl({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:n,is_support_visibility_change:Al(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e},this.options.params)),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)}),1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this;this.focusState=document.hasFocus();var t=function(){e.timerHandler&&(clearInterval(e.timerHandler),e.sendEvent(!1)),e.focusState=!1},n=function(){e.focusState=!0,e.sessionStartTime=Date.now(),e.timerHandler=e.setUpTimer()};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),Ac=function(){function e(e,t){var n=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.focusState=!0,this.visibilitychange=function(){"hidden"===document.visibilityState?n.activeEndTime=Date.now():"visible"===document.visibilityState&&(n.activeEndTime&&(n.totalTime+=n.activeEndTime-n.activeStartTime,n.activeTimes+=1),n.activeEndTime=void 0,n.activeStartTime=Date.now())},this.beforeunload=function(){if(n.totalTime+=(n.activeEndTime||Date.now())-n.activeStartTime,n.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:n.totalTime,page_title:document.title||location.pathname}))}catch(e){}n.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||t.max_duration||864e5,this.pageStartTime=Date.now(),xl(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.resetData()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.resetParams=function(e,t,n){this.url_path=e,this.url=n,this.title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageClose(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.resetParams(location.pathname,document.title,location.href)},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.closeName,kl({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:Al()},this.options.params)),this.pageStartTime=Date.now(),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this;this.focusState=document.hasFocus();var t=function(){e.focusState=!1},n=function(){e.focusState=!0};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),Mc=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new Dc(e,t),this.pageClose=new Ac(e,t);var i=this.collect.Types;this.collect.on(i.ResetStay,(function(e){var t=e.url_path,i=e.title,r=e.url;n.resetStayDuration(t,i,r)})),this.collect.on(i.RouteChange,(function(e){e.init||t.disable_route_report||n.resetStayDuration()})),this.collect.on(i.SetStay,(function(e){var t=e.url_path,i=e.title,r=e.url;n.setStayParmas(t,i,r)})),this.enable(this.url_path,this.title,this.url),this.ready(i.Stay),this.collect.emit(i.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.enable=function(e,t,n){this.pageAlive.enable(e,t,n),this.pageClose.enable(e,t,n)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.pageAlive.setParams(e,t,n),this.pageClose.setParams(e,t,n),this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e.prototype.reset=function(e,t,n){this.disable(),this.enable(e,t,n)},e.prototype.resetStayDuration=function(e,t,n){this.reset(e,t,n),this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e}(),Rc=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var i=e.Types;this.eventCheck=new Zl(e,t),this.cache={},this.collect.on(i.ProfileSet,(function(e){n.setProfile(e)})),this.collect.on(i.ProfileSetOnce,(function(e){n.setOnceProfile(e)})),this.collect.on(i.ProfileUnset,(function(e){n.unsetProfile(e)})),this.collect.on(i.ProfileIncrement,(function(e){n.incrementProfile(e)})),this.collect.on(i.ProfileAppend,(function(e){n.appendProfile(e)})),this.collect.on(i.ProfileClear,(function(){n.cache={}})),this.ready(i.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var n=[];n.push(this.collect.processEvent(e,t));var i=this.collect.eventManager.merge(n);this.collect.requestManager.useRequest({url:this.reportUrl,data:i}),this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:i,code:200,status:"success"})}catch(r){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set",kl({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set_once",kl({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",kl({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",kl({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var n in e)"string"==typeof e[n]||"Array"===Object.prototype.toString.call(e[n]).slice(8,-1)?t[n]=e[n]:console.warn("please check the value of param: "+n+", must be string or array !!!");Object.keys(t).length&&this.report("__profile_append",kl({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype.pushCache=function(e){var t=this;Object.keys(e).forEach((function(n){t.cache[n]={val:t.clone(e[n]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var n=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var r in e)"string"==typeof e[r]||"number"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1)?i[r]=e[r]:console.warn("please check the value of params:"+r+", must be string,number,Array !!!");var o=Object.keys(i);if(!o.length)return;if(!this.eventCheck.checkEventParams(i))return;var a=Date.now();return o.filter((function(i){var r=n.cache[i];return t?!r:!(r&&n.compare(r.val,e[i])&&a-r.timestamp<n.duration)})).reduce((function(e,t){return e[t]=i[t],e}),{})}catch(s){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),console.log("error")}},e.prototype.compare=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),e}},e.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},e}(),Nc=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,i=Date.now()+t;return n=window.setTimeout((function r(){var o=Date.now()-i;e(),i+=t,n=window.setTimeout(r,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var i=this.collect.Types;this.collect.on(i.SessionResetTime,(function(){n.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),jc=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;t.channel_domain||t.disable_track_event||t.disable_sdk_monitor||(this.collect=e,this.config=t,this.url=e.configManager.getUrl("event"),this.collect.on(e.Types.Ready,(function(){n.sdkOnload()})),this.collect.on(e.Types.SubmitError,(function(e){var t=e.type,i=e.eventData,r=e.errorCode;"f_data"===t&&n.sdkError(i,r)})))},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,i=t.user,r=n.app_id,o=n.app_name,a=n.sdk_version,s=i.web_id,l={events:[{event:"onload",params:JSON.stringify({app_id:r,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOC",url:location.href}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.collect.requestManager.useRequest({url:e.url,data:[l],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(c){}},e.prototype.sdkError=function(e,t){var n=this;try{var i=e[0],r=i.user,o=i.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:a.map((function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(r)}),local_time_ms:Date.now()}})),user:{user_unique_id:r.user_unique_id},header:{}};setTimeout((function(){n.collect.requestManager.useRequest({url:n.url,data:[s],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(l){}},e}();function Bc(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}function Uc(e){for(var t=e;t&&!Bc(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}var Hc=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},Fc=function(e,t){if("string"==typeof t)return Hc(e,t);if(Ol(t)){for(var n=!1,i=0;i<t.length;i++)if(Hc(e,t[i])){n=!0;break}return n}},Vc=function(){function e(e,t,n){var i=this;this.statistics=!1,this.pageView=!1,this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,n=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,n=!0):t=t.parentElement;return n}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var n=e;return!("none"===n.style.display||!Bc(n,"container")&&!function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0}(n)&&!t.svg)})(e.target,i.options)&&i.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){i.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){i.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&i.eventHandel({eventType:"dom",eventName:"beat"},kl({beat_type:0},e)),i.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){i.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=n.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat,this.domContainer=e.container||document}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e){if(this.config.click&&(Ol(this.domContainer)?this.domContainer.forEach((function(e){e.addEventListener("click",t.clickEvent,!0)})):this.domContainer.addEventListener("click",this.clickEvent,!0)),this.config.pv){this.collect.on("route-change",(function(e){var n=e.config,i=e.name;t.getPageViewEvent(n,i),t.pageView=!0}));var n=setTimeout((function(){t.pageView||(t.getPageViewEvent(t.getDefaultConfig()),t.pageView=!0,clearTimeout(n))}),2e3)}if(this.config.beat){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var i=0,r=null;window.addEventListener("scroll",(function(){clearTimeout(r),r=setTimeout(o,500),i=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==i&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(l){}try{var a=window.performance&&window.performance.getEntriesByType("paint");if(a&&a.length){new PerformanceObserver((function(e){var n=e.getEntries(),i=n[n.length-1],r=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]});var s=setTimeout((function(){t.statistics||(t.getPageLoadEvent(a[0].startTime||0),t.statistics=!0,clearTimeout(s))}),2e3)}else this.getPageLoadEvent(0)}catch(l){this.getPageLoadEvent(0)}}}},e.prototype.removeListener=function(){var e=this;Ol(this.domContainer)?this.domContainer.forEach((function(t){t.removeEventListener("click",e.clickEvent,!0)})):this.domContainer.removeEventListener("click",this.clickEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var n;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(n=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),Il((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(n)}))}catch(i){}},e.prototype.getDefaultConfig=function(){return{is_html:1,url:location.href,referrer:document.referrer,page_key:location.href,refer_page_key:document.referrer,page_title:document.title||location.pathname,page_manual_key:"",refer_page_manual_key:"",refer_page_title:"",page_path:location.pathname,page_host:location.host}},e}(),zc={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},Gc=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function Wc(e,t,n,i){var r,o,a={},s=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return{left:t.left,top:t.top,element_width:n,element_height:i}}}(t),l=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,i=e.clientY,r=t.left,o=t.top,a=n-r>=0?n-r:0,s=i-o>=0?i-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,s),c=s.element_width,u=s.element_height,h=l.touch_x,d=l.touch_y,f=function(e){var t=[];if(!e)return{element_path:"",positions:[]};for(;null!==e.parentElement;)t.push(e),e=e.parentElement;var n=[],i=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,n=e.parentElement;if(n)for(var i=n.children,r=0;r<i.length&&i[r]!==e;r++)i[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),Bc(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,o=t.index;n.unshift(r),i.unshift(o)})),{element_path:"/"+n.join("/"),positions:i}}(t),p=f.element_path,g=f.positions,v=(r=Uc(t),o=[],function e(t){var n,i,r=(i="",3===(n=t).nodeType?i=n.textContent.trim():n.dataset&&n.dataset.hasOwnProperty("teaTitle")||n.hasAttribute("ata-tea-title")?i=n.getAttribute("data-tea-title"):n.hasAttribute("title")?i=n.getAttribute("title"):"INPUT"===n.nodeName&&["button","submit"].includes(n.getAttribute("type"))?i=n.getAttribute("value"):"IMG"===n.nodeName&&n.getAttribute("alt")&&(i=n.getAttribute("alt")),i.slice(0,200));if(r&&-1===o.indexOf(r)&&o.push(r),t.childNodes.length>0)for(var a=t.childNodes,s=0;s<a.length;s++)8!==a[s].nodeType&&e(a[s])}(r),o),y=window.performance.timing.navigationStart,m=Date.now()-y,_=g.map((function(e){return""+e})),b=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(b=window.TEAVisualEditor.getOriginXpath({xpath:p,positions:_})),a.element_path=b&&b.xpath||p,a.positions=b&&b.positions||_,i&&!i.text&&(a.texts=v,a.element_title=function(e){if(!e)return"";var t="";return e.textContent?t=e.textContent.trim():e.innerText&&(t=e.innerText.trim()),"input"!==e.tagName&&"INPUT"!==e.tagName||(t=e.value||""),t}(t)),a.element_id=t.getAttribute("id")||"",a.element_class_name=t.getAttribute("class")||"",a.element_type=t.nodeType,a.element_width=Math.floor(c),a.element_height=Math.floor(u),a.touch_x=h,a.touch_y=d,a.page_manual_key="",a.elememt_manual_key="",a.since_page_start_ms=m,a.page_start_ms=y,a.page_path=location.pathname,a.page_host=location.host,n.track_attr&&function(e,t){return!!Fc(e,t)}(t,n.track_attr)){var k=function(e,t){var n={};if("string"==typeof t)Hc(e,t)&&(n.attrs=e.getAttribute(t));else if(Ol(t))for(var i=0;i<t.length;i++)Hc(e,t[i])&&(n[t[i]]=e.getAttribute(t[i]));return n}(t,n.track_attr);for(var w in k)a[w]=k[w]}var T=Uc(t);return"A"===T.tagName&&(a.href=T.getAttribute("href")),"IMG"===t.tagName&&(a.src=t.getAttribute("src")),a}var Kc=function(e,t,n,i,r){return kl({event:e},Wc(t,n,i,r),{is_html:1,page_key:window.location.href,page_title:document.title})},$c=function(){function e(e,t){this.ignore={text:!1},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure"},t&&!1===t.text&&(this.ignore.text=!0),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName)}return e.prototype.handleEvent=function(e,t){try{if(function(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}(e.target))return null;var n="bav2b_click";switch(t){case"click":return n=this.eventName.click,Kc(n,e,e.target,this.options,this.ignore);case"exposure":return n=this.eventName.exposure,Kc(n,e,e.target,this.options,this.ignore);case"change":return kl({},Kc(n="bav2b_change",e,e.target,this.options),function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(n){return{}}}(n,e.target));case"submit":return Kc(n="bav2b_submit",e,e.target,this.options)}}catch(Hl){return console.error(Hl),null}},e.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage.getItem("_tea_cache_duration");if(t){var n=JSON.parse(t);e.refer_page_duration_ms=n?n.duration:""}e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(i){console.log("page event error "+JSON.stringify(i))}return e},e.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var n=e.lcp,i=window.performance.timing,r=i.loadEventEnd-i.navigationStart;t.page_init_cost_ms=parseInt(n||(r>0?r:0)),t.page_start_ms=i.navigationStart}catch(o){console.log("page_statistics event error "+JSON.stringify(o))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(t){console.log("beat event error "+JSON.stringify(t))}return e},e}(),Yc=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var n=e.eventSend,i=t.event;delete t.event,n&&"becon"===n?this.collect.beconEvent(i,t):this.collect.event(i,t)},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}(),qc="_TEA_VE_OPEN",Xc="_TEA_VE_APIHOST",Jc="lang",Zc="_VISUAL_EDITOR_V",Qc="_VISUAL_EDITOR_U";function eu(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||Fl.get(Jc),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||Fl.get(Xc),n=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||Fl.get(Zc),i=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||Fl.get(Qc),r=+new Date,o=new Date(r+18e5);Fl.set(qc,"1",{expires:o}),Fl.set(Xc,t,{expires:o}),Fl.set(Qc,i,{expires:o}),Fl.set(Jc,e,{expires:o}),Fl.set(Zc,n||"",{expires:o})}catch(a){console.log("set cookie err")}}var tu=!1;function nu(e){var t=e.event,n=e.editorUrl,i=e.autoTrackInstance;tu||(tu=!0,Dl(n,(function(){wc(t,"editorScriptloadSuccess"),i.destroy()}),(function(){t&&wc(t,"editorScriptloadError"),tu=!1})))}var iu,ru=function(){function e(e){this._instance=null,this._intersection=e,this.init()}return e.prototype.init=function(){var e=this;this._instance=new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)}))})),this._instance.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd)})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove)}))},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),n.mapChild(e,t)}))},e.prototype.exposureAdd=function(e,t){this._intersection.exposureAdd(e,t)},e.prototype.exposureRemove=function(e){this._intersection.exposureRemove(e)},e._exposure_observer=null,e}(),ou=function(){function e(t,n){this.count=1,this.instance=this.buildObserver(),this.observeMap=e._observer_map,t.autotrack.exposure.ratio?this.Ratio=t.autotrack.exposure.ratio:0===t.autotrack.exposure.ratio?this.Ratio=0:this.Ratio=.5,this.EventHandle=n}return e.prototype.buildObserver=function(){var t=this;if(!e._observer_instance)return IntersectionObserver&&(e._observer_instance=new IntersectionObserver((function(e){e.forEach((function(e){t.observeMap.get(e.target._observeId)&&t.exposureEvent(e)}))}),{threshold:[.01,.25,.5,.75,1]})),e._observer_instance},e.prototype.exposureAdd=function(e,t){var n=e;"mutation"===t&&(n=e.target);var i=n._observeId;if(i||this.observeMap.has(i)){if(!1===n.visible){var r=n.getBoundingClientRect(),o=r.top,a=r.left,s=r.right,l=r.bottom;o>=0&&l<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(n.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else n._observeId=this.count,n.visible=!1,this.observeMap.set(this.count,n),this.observe(n),this.count++},e.prototype.exposureRemove=function(e){this.observeMap.has(e._observeId)&&(this.observeMap.delete(e._observeId),this.unobserve(e))},e.prototype.exposureEvent=function(e){if(e.intersectionRatio>=this.Ratio&&e.isIntersecting){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===e.target.visible)return;e.target.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e)}else e.target.visible=!1},e.prototype.observe=function(e){this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance.unobserve(e)},e._observer_instance=null,e._observer_map=new Map,e}(),au=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new ou(e,t),this._observer=new ru(this._intersection),this.initObserver())}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}(),su={hashTag:!1,impr:!1},lu=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var n=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(n.Autotrack),this.collect.emit(n.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==i(t)?t:{},t=Object.assign(su,t),this.destroyed=!1,this.options=t,this.Config=new Gc(zc,this.options),this.Exposure=new au(this.config,this.handle.bind(this)),this.Listener=new Vc(t,this.collect,this.Config),this.EventHandle=new $c(this.config,t),this.Request=new Yc(this.collect),this.autoTrackStart=!0,this.init(),function(t,n){window.TEAVisualEditor=window.TEAVisualEditor||{};var i="",r="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-editor-rangers.js?query="+Date.now();window.TEAVisualEditor.appId=n.app_id;var o=n.channel_domain,a="";if(kc(["*"]),o){var s,l="";try{var c=window.performance.getEntriesByType("resource");if(c&&c.length&&(c.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(l=e.name)})),l&&(s=l.split("/"))&&s.length)){a="https:/";for(var u=2;u<s.length&&u!==s.length-1;u++)a=a+"/"+s[u];if(a&&a.indexOf("/5.0")){var h=a.split("/5.0");a=h[0]||a}}}catch(e){}}if(Cc(n,Jl),"1"===Fl.get(qc)){var d=function(){var e=Fl.get(Xc);try{e=JSON.parse(e)}catch(t){}return e}(),f="";d&&(window.TEAVisualEditor.__editor_ajax_domain=d,f=Fl.get(Qc)),nu({event:null,editorUrl:f||r,autoTrackInstance:t}),eu()}else try{Tc("tea:openVisualEditor",(function(n){var s=n.data;if("string"==typeof n.data)try{s=JSON.parse(n.data)}catch(e){s=void 0}if(s){var l=s.referrer,c=s.lang;if(l&&(window.TEAVisualEditor.__editor_ajax_domain=l),i=r,o){var u=s.version;i=a?a+(u?"/visual-editor-rangers-v"+u:"/visual-editor-rangers-v1.0.0")+".js":r,window.TEAVisualEditor.__editor_verison=u}window.TEAVisualEditor.__editor_url=i,window.TEAVisualEditor.lang=c,nu({event:n,editorUrl:i,autoTrackInstance:t}),eu()}})),window.TEAVisualEditor.openAutotrackEditor=function(){nu({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:t})}}catch(e){console.log("receive message error")}try{Tc("tea:openHeatMapCore",(function(e){var i=e.data.app_id;i&&i!==n.app_id||nu({event:e,editorUrl:"https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/heatmap-core.js?query="+Date.now(),autoTrackInstance:t})}))}catch(e){console.log("openHeatMapCore error")}}(this,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this));try{"base"===this.collect.loadType&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){}},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var n=e.eventName;if("click"===n||"exposure"===n||"change"===n||"submit"===n){var i=this.EventHandle.handleEvent(t,n);null!==i&&this.Request.send({eventType:"custom",eventName:"report_"+n+"_event",extra:{methods:"GET"}},i)}else if("page_view"===n||"page_statistics"===n){var r;r="page_view"===n?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},r)}else if("beat"===n){var o=this.EventHandle.handleBeadtEvent(t),a=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:a},o)}}catch(s){console.log("handel dom event error "+JSON.stringify(s))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}();!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(iu||(iu={}));var cu={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},uu=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(t.app_id&&t.enable_tracer&&!t.disable_track_event){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var i=this.collect.Types;this.collect.on(i.Event,(function(){n.addCount("log")})),this.collect.on(i.SubmitError,(function(e){var t=e.type,i=e.eventDate,r=e.errorCode,o=e.response;n.addErrorCount(i,t,r,o)})),this.listener(),this.collect.emit(i.TracerReady)}},e.prototype.addCount=function(e,t,n){void 0===t&&(t="net"),void 0===n&&(n=1);try{this.tracerCache||(this.tracerCache=new Map);var i=void 0;if(this.tracerCache.has(e))(r=this.tracerCache.get(e)).has(t)?(i=r.get(t).params.count,i++,r.set(t,this.processTracer(i,e,t))):(i=n,r.set(t,this.processTracer(n,e,t)));else{var r=new Map;i=n,r.set(t,this.processTracer(n,e,t)),this.tracerCache.set(e,r)}"net"===t&&i>=this.limit[e]&&this.report(!1)}catch(o){console.log(o)}},e.prototype.addErrorCount=function(e,t,n,i){var r=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(i&&i.hasOwnProperty("sc")?this.addCount("log",t,o.length-i.sc):this.addCount("log",t,o.length),this.errorCode[t]=n):o.forEach((function(e){var i="log";for(var o in cu)if(-1!==cu[o].indexOf(e.event)){i=o;break}r.addCount(i,t,1),r.errorCode[t]=n})))}}catch(a){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach((function(e){console.log(e),e.forEach((function(e){t.push(e)}))})),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var n=this.collect.eventManager.merge(e);this.collect.requestManager.useRequest({url:this.reportUrl,data:n,useBeacon:t}),this.tracerCache=null}catch(i){}},e.prototype.processTracer=function(e,t,n){var i={count:e,state:n,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:Jl};"f_net"!==n&&"f_data"!==n||(i.errorCode=this.errorCode[n]);var r=this.collect.processEvent("applog_trace",i);if(r&&r.event)return delete r.is_bav,r},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),Il((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),hu=function(){function e(){this.retryWaitTime=3e3,this.retryStatus=!1,this.retryCacheStatus=!1}return e.prototype.apply=function(e,t){var n=this;if(t.enable_storage&&!t.disable_storage&&(this.collect=e,this.config=t,!this.collect.destroy)){var i=e.Types,r=e.adapters.storage;this.storage=new r(!1),this.eventUrl=this.collect.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+t.app_id,this.storageNum=t.storage_num||50,this.retryNum=t.retry_num||3,this.retryInterval=1e3,e.on(i.SubmitError,(function(e){"f_data"!==e.type&&n.storeData(e)})),e.on(i.Ready,(function(){n.checkStorage()}))}},e.prototype.retryRightNow=function(e){var t=this;if(this.retryStatus)this.errorCache.push(e);else{var n=0;this.retryStatus=!0;var i=setInterval((function(){if(3===n)return t.storeData(t.errorCache),t.retryStatus=!1,void clearInterval(i);var r=e.eventData;t.fetchData(r,(function(){t.retryStatus=!1,clearInterval(i),t.retryCacheStatus&&t.errorCache.splice(0,1),t.errorCache.length&&(t.retryCacheStatus=!0,t.retryRightNow(t.errorCache[0]))}),(function(){n++}))}),this.retryInterval)}},e.prototype.storeData=function(e){var t=this.storage.getItem(this.eventKey),n=e.eventData;Object.keys(t).length!==this.storageNum&&(t[Date.now()]=n,this.storage.setItem(this.eventKey,t))},e.prototype.checkStorage=function(){var e=this;try{if(!window.navigator.onLine)return;var t=this.storage.getItem(this.eventKey);if(!t||!Object.keys(t).length)return;var n={events:[{event:"ontest",params:{app_id:this.config.app_id},local_time_ms:Date.now()}],user:{user_unique_id:this.collect.configManager.get("web_id")},header:{}};this.fetchData([n],(function(){var n=JSON.parse(JSON.stringify(t)),i=function(i){e.fetchData(t[i],(function(){delete n[i],e.storage.setItem(e.eventKey,n)}),(function(){}),!1)};for(var r in t)i(r)}),(function(){console.log("network error,compensate report fail")}),!0)}catch(i){console.warn("error check storage")}},e.prototype.fetchData=function(e,t,n,i){this.collect.requestManager.useRequest({url:this.eventUrl,data:e,timeout:3e4,success:t,fail:n,app_key:i?"566f58151b0ed37e":""})},e}(),du=jl((function(e,t){e.exports=function(){var e="millisecond",t="second",n="minute",r="hour",o="day",a="week",s="month",l="quarter",c="year",u="date",h="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},v={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+g(i,2,"0")+":"+g(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var i=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(i,s),o=n-r<0,a=t.clone().add(i+(o?-1:1),s);return+(-(i+(n-r)/(o?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(i){return{M:s,y:c,w:a,d:o,D:u,h:r,m:n,s:t,ms:e,Q:l}[i]||String(i||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",m={};m[y]=p;var _=function(e){return e instanceof T},b=function(e,t,n){var i;if(!e)return y;if("string"==typeof e)m[e]&&(i=e),t&&(m[e]=t,i=e);else{var r=e.name;m[r]=e,i=r}return!n&&i&&(y=i),i||!n&&y},k=function(e,t){if(_(e))return e.clone();var n="object"==i(t)?t:{};return n.date=e,n.args=arguments,new T(n)},w=v;w.l=b,w.i=_,w.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function i(e){this.$L=b(e.locale,null,!0),this.parse(e)}var p=i.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(d);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return w},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},p.isAfter=function(e,t){return k(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<k(e)},p.$g=function(e,t,n){return w.u(e)?this[t]:this.set(n,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,i){var l=this,h=!!w.u(i)||i,d=w.p(e),f=function(e,t){var n=w.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return h?n:n.endOf(o)},p=function(e,t){return w.w(l.toDate()[e].apply(l.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},g=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case c:return h?f(1,0):f(31,11);case s:return h?f(1,v):f(0,v+1);case a:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return f(h?y-b:y+(6-b),v);case o:case u:return p(m+"Hours",0);case r:return p(m+"Minutes",1);case n:return p(m+"Seconds",2);case t:return p(m+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(i,a){var l,h=w.p(i),d="set"+(this.$u?"UTC":""),f=(l={},l[o]=d+"Date",l[u]=d+"Date",l[s]=d+"Month",l[c]=d+"FullYear",l[r]=d+"Hours",l[n]=d+"Minutes",l[t]=d+"Seconds",l[e]=d+"Milliseconds",l)[h],p=h===o?this.$D+(a-this.$W):a;if(h===s||h===c){var g=this.clone().set(u,1);g.$d[f](p),g.init(),this.$d=g.set(u,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[w.p(e)]()},p.add=function(e,i){var l,u=this;e=Number(e);var h=w.p(i),d=function(t){var n=k(u);return w.w(n.date(n.date()+Math.round(t*e)),u)};if(h===s)return this.set(s,this.$M+e);if(h===c)return this.set(c,this.$y+e);if(h===o)return d(1);if(h===a)return d(7);var f=(l={},l[n]=6e4,l[r]=36e5,l[t]=1e3,l)[h]||1,p=this.$d.getTime()+e*f;return w.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var i=e||"YYYY-MM-DDTHH:mm:ssZ",r=w.z(this),o=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=function(e,n,r,o){return e&&(e[n]||e(t,i))||r[n].substr(0,o)},d=function(e){return w.s(o%12||12,e,"0")},p=n.meridiem||function(e,t,n){var i=e<12?"AM":"PM";return n?i.toLowerCase():i},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:w.s(s+1,2,"0"),MMM:u(n.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:w.s(this.$D,2,"0"),d:String(this.$W),dd:u(n.weekdaysMin,this.$W,l,2),ddd:u(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:w.s(o,2,"0"),h:d(1),hh:d(2),a:p(o,a,!0),A:p(o,a,!1),m:String(a),mm:w.s(a,2,"0"),s:String(this.$s),ss:w.s(this.$s,2,"0"),SSS:w.s(this.$ms,3,"0"),Z:r};return i.replace(f,(function(e,t){return t||g[e]||r.replace(":","")}))},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(e,i,u){var h,d=w.p(i),f=k(e),p=6e4*(f.utcOffset()-this.utcOffset()),g=this-f,v=w.m(this,f);return v=(h={},h[c]=v/12,h[s]=v,h[l]=v/3,h[a]=(g-p)/6048e5,h[o]=(g-p)/864e5,h[r]=g/36e5,h[n]=g/6e4,h[t]=g/1e3,h)[d]||g,u?v:w.a(v)},p.daysInMonth=function(){return this.endOf(s).$D},p.$locale=function(){return m[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),i=b(e,t,!0);return i&&(n.$L=i),n},p.clone=function(){return w.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},i}(),S=T.prototype;return k.prototype=S,[["$ms",e],["$s",t],["$m",n],["$H",r],["$W",o],["$M",s],["$y",c],["$D",u]].forEach((function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),k.extend=function(e,t){return e.$i||(e(t,T,k),e.$i=!0),k},k.locale=b,k.isDayjs=_,k.unix=function(e){return k(1e3*e)},k.en=m[y],k.Ls=m,k.p={},k}()})),fu=jl((function(e,t){var n,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_;e.exports=(s=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:l=31536e6,months:c=2592e6,days:a=864e5,hours:o=36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof _},f=function(e,t,n){return new _(e,n,t.$l)},p=function(e){return r.p(e)+"s"},g=function(e){return e<0},v=function(e){return g(e)?Math.ceil(e):Math.floor(e)},y=function(e){return Math.abs(e)},m=function(e,t){return e?g(e)?{negative:!0,format:""+y(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},_=function(){function e(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*h[p(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==i(e))return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var o=e.match(u);if(o){var a=o.slice(2).map((function(e){return Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var t=e.prototype;return t.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*h[n]}),0)},t.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=v(e/l),e%=l,this.$d.months=v(e/c),e%=c,this.$d.days=v(e/a),e%=a,this.$d.hours=v(e/o),e%=o,this.$d.minutes=v(e/6e4),e%=6e4,this.$d.seconds=v(e/1e3),e%=1e3,this.$d.milliseconds=e},t.toISOString=function(){var e=m(this.$d.years,"Y"),t=m(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=m(n,"D"),r=m(this.$d.hours,"H"),o=m(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=m(a,"S"),l=e.negative||t.negative||i.negative||r.negative||o.negative||s.negative,c=r.format||o.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+i.format+c+r.format+o.format+s.format;return"P"===u||"-P"===u?"P0D":u},t.toJSON=function(){return this.toISOString()},t.format=function(e){var t=e||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return t.replace(s,(function(e,t){return t||String(n[e])}))},t.as=function(e){return this.$ms/h[p(e)]},t.get=function(e){var t=this.$ms,n=p(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?v(t/h[n]):this.$d[n],0===t?0:t},t.add=function(e,t,n){var i;return i=t?e*h[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+i*(n?-1:1),this)},t.subtract=function(e,t){return this.add(e,t,!0)},t.locale=function(e){var t=this.clone();return t.$l=e,t},t.clone=function(){return f(this.$ms,this)},t.humanize=function(e){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!e)},t.milliseconds=function(){return this.get("milliseconds")},t.asMilliseconds=function(){return this.as("milliseconds")},t.seconds=function(){return this.get("seconds")},t.asSeconds=function(){return this.as("seconds")},t.minutes=function(){return this.get("minutes")},t.asMinutes=function(){return this.as("minutes")},t.hours=function(){return this.get("hours")},t.asHours=function(){return this.as("hours")},t.days=function(){return this.get("days")},t.asDays=function(){return this.as("days")},t.weeks=function(){return this.get("weeks")},t.asWeeks=function(){return this.as("weeks")},t.months=function(){return this.get("months")},t.asMonths=function(){return this.as("months")},t.years=function(){return this.get("years")},t.asYears=function(){return this.as("years")},e}(),function(e,t,i){n=i,r=i().$utils(),i.duration=function(e,t){var n=i.locale();return f(e,{$l:n},t)},i.isDuration=d;var o=t.prototype.add,a=t.prototype.subtract;t.prototype.add=function(e,t){return d(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)},t.prototype.subtract=function(e,t){return d(e)&&(e=e.asMilliseconds()),a.bind(this)(e,t)}})}));du.extend(fu);var pu=["__cep_sdk_onboard","__cep_trigger_sdk","_be_active"],gu=["and","or","not"],vu=function(){function e(){this.support=!0,this.currentPlan=1,this.shouldSendEvent=!1,this.staing=!1,this.test=!1,this.cepReady=!1,this.eventCache=[]}return e.prototype.apply=function(e,t){var n=this;if(t.cep){this.collect=e,this.config=t;var i=e.adapters.storage,r=e.Types;this.types=r,this.storage=new i(!1),this.configManager=e.configManager,this.url=t.cep_url?""+t.cep_url:e.configManager.getDomain()+"/service/2/cep_settings/",this.reportUrl=e.configManager.getUrl("event"),this.key="__tea_cep_plan_"+t.app_id,this.quotasKey="__tea_cep_plan_quotas_"+t.app_id,this.isWait=!1,this.eventCache=[],this.test=e.configManager.staging,this.collect.on(r.SubmitAfter,(function(e){n.matchEvent(e)})),this.init()}},e.prototype.init=function(){var e=this,t=!0,n=0,i=0,r=0,o=!1,a=this.storage.getItem(this.key)||{};if(a&&Object.keys(a).length&&(o=!0,n=a.last_update_time,i=a.fetch_interval,r=a.config_version||0,t=Date.now()-n>1e3*i),t){var s=this.configManager.get(),l=s.header,c=s.user;this.collect.requestManager.useRequest({url:this.url,data:{header:l,user:c,local_time:Date.now(),config_version:r},success:function(t){t&&0===t.code?(a.fetch_interval=t.fetch_interval,a.data=t.data,a.last_update_time=Date.now(),a.config_version=t.config_version,e.clearQuotas(),e.initState(t.data),e.storage.setItem(e.key,a),t.data.forEach((function(t){e.event("__cep_sdk_onboard",t.plan_id)}))):304!==t.code&&400!==t.code||!o?console.log("code: "+t.code+", request error,please try leater"):(console.log("code: "+t.code+", use old rules~"),a.last_update_time=Date.now(),e.storage.setItem(e.key,a),e.initState(a.data))},fail:function(){o?(e.planData=a.data,e.initState(a.data)):(e.support=!1,console.log("request error,please try leater"))},timeout:5e3})}else a.last_update_time=Date.now(),this.storage.setItem(this.key,a),console.log("rule still work, use cache"),this.initState(a.data)},e.prototype.initState=function(e){var t=this;e&&e.length&&(this.stateArray=new Map,this.waitArray=new Map,this.planData=e,e.forEach((function(e){var n=new Map;if(e.pattern&&e.pattern.events){var i=1===e.pattern.events.length;e.pattern.events.forEach((function(e){n.set(e.id,{id:e.id,isMatch:!1,event:null,after:e.after||null,connection:e.connection||null,window:e.window||null,matchTime:0,initTime:Date.now(),singleRule:i})})),t.stateArray.set(e.plan_id,{patternState:n,singleRule:i,pattern:{aid:e.aid,biz_id:e.biz_id,end_time:e.end_time,start_time:e.start_time,web_sdk_version:e.web_sdk_version,stage:e.stage},quotas:e.quotas})}})),this.cepReady=!0,this.dealCache(),this.collect.emit(this.types.CepReady))},e.prototype.check=function(e){var t=Date.now();return Date.now()>1e3*e.end_time?(console.log("event rules:"+e.plan_id+" is over"),!1):t<1e3*e.start_time||t>1e3*e.end_time?(console.log("rule:"+e.plan_id+" time error"),!1):(this.staing="testing"===e.staing,!(Jl<e.web_sdk_version&&(this.support=!1,console.log("you sdk version is old,please update to "+e.web_sdk_version+" at least"),1)))},e.prototype.dealCache=function(){var e=this;if(this.eventCache.length){var t=1;this.eventCache.forEach((function(n){e.matchEvent(n),t++})),t===this.eventCache.length&&(this.eventCache=[])}},e.prototype.matchEvent=function(e){if(this.support&&(!this.staing||this.test)&&e&&e.length)try{if(!this.cepReady)return void this.eventCache.push(e);var t=e[0],n=t.header,i=t.user,r=t.events;r.length&&r.reverse();for(var o=0;o<r.length;o++){var a=r[o].event;if(-1!==pu.indexOf(a))return!1;this.matchRule(n,i,r[o])}}catch(s){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),void console.log(s.message)}},e.prototype.matchRule=function(e,t,n){try{for(var i=0;i<this.planData.length;i++){var r=this.planData[i],o=r.plan_id;if(this.check(r)&&this.checkQuotas(o)&&r.pattern&&r.pattern.events)for(var a=r.pattern.events,s=0;s<a.length;s++)if(this.rule(e,t,n,a[s].condition)){var l=this.stateArray.get(o).patternState,c=l.get(a[s].id);if(this.stateArray.get(o).singleRule){this.changeStatus(o,a[s].id,n),this.publish([n],o,a[s].id);break}if(!c.isMatch){c.after&&l.get(c.after).isMatch?this.changeStatus(o,a[s].id,n):c.after||this.changeStatus(o,a[s].id,n);break}}}this.statusCheck()}catch(u){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),void console.log(u.message)}},e.prototype.changeStatus=function(e,t,n){var i=this.stateArray.get(e),r=i.patternState.get(t);r.isMatch=!0,r.event=n,r.matchTime=n.local_time_ms||Date.now(),i.patternState.set(t,r),this.stateArray.set(e,i)},e.prototype.statusCheck=function(){var e,t,n,i;try{for(var r=wl(this.stateArray),o=r.next();!o.done;o=r.next()){var a=Tl(o.value,2),s=a[0],l=a[1],c=l.patternState;if(l.isSingle)break;try{for(var u=wl(c),h=u.next();!h.done;h=u.next()){var d=Tl(h.value,2),f=d[0],p=d[1];if(p.after&&(!p.after||c.get(p.after).isMatch)){if("NOT_FOLLOWED_BY"===p.connection){p.isMatch?this.reset(s,f):Date.now()-c.get(p.after).matchTime>p.window?this.publish([c.get(p.after).event,p.event],s,f):this.startWait(s,f,p);break}p.isMatch?p.matchTime-c.get(p.after).matchTime<=p.window?this.publish([c.get(p.after).event,p.event],s,f):this.reset(s,f):Date.now()-c.get(p.after).matchTime>p.window?this.reset(s,f):this.startWait(s,f,p);break}}}catch(g){n={error:g}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(v){e={error:v}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.startWait=function(e,t,n){var i=this;try{this.waitArray.get(e)||this.waitArray.set(e,new Map);var r=this.waitArray.get(e);if(!r.get(t)){var o=setTimeout((function(){var r=i.stateArray.get(e).patternState,o=r.get(t);if("NOT_FOLLOWED_BY"===o.connection)!o.isMatch&&r.get(o.after).isMatch||o.matchTime-r.get(o.after).matchTime>n.window?((a=i.waitArray.get(e).get(t)).triggerWait=!0,i.waitArray.set(e,i.waitArray.get(e).set(t,a)),i.publish([r.get(o.after).event],e,t)):i.reset(e,t);else if("FOLLOWED_BY"===o.connection){var a;o.isMatch&&r.get(o.after).isMatch?((a=i.waitArray.get(e).get(t)).triggerWait=!0,i.waitArray.set(e,i.waitArray.get(e).set(t,a)),i.publish([r.get(o.after).event],e,t)):i.reset(e,t)}}),n.window);r.set(t,{waitFn:o,triggerWait:!1}),this.waitArray.set(e,r)}}catch(a){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message}),console.log(a.message,a.stack)}},e.prototype.rule=function(e,t,n,i){var r=this;try{var o=n.event,a=n.params;if(a=JSON.parse(a),-1!==gu.indexOf(i.op)){if(i.conditions&&i.conditions.length){var s=i.conditions,l=0,c=new Map;c.set(l,{op:i.op,result:void 0,resultList:[],resultKey:[],resultLength:s.length}),function n(i,s){for(var u=0;u<i.length;u++)if(l++,-1!==gu.indexOf(i[u].op)&&i[u].hasOwnProperty("conditions"))c.set(l,{op:i[u].op,result:void 0,fatherKey:s,resultList:[],resultKey:[],resultLength:i[u].conditions.length}),n(i[u].conditions,l);else{var h=r.scope(i[u].key),d=h.scope,f=h.key,p=h.key2,g=d?"header"===d?p?JSON.parse(e[p])[f]:e[f]:"user"===d?t[f]:a[f]:o,v=r.calculate(i[u].op,g,i[u].value);c.set(l,{op:i[u].op,result:v,fatherKey:s})}}(s,l);for(var u=c.get(0);void 0===u.result||u.resultList.length<u.resultLength;)c.forEach((function(e,t){if(void 0!==e.result&&void 0!==e.fatherKey){var n=c.get(e.fatherKey);n.resultList.length<n.resultLength&&-1===n.resultKey.indexOf(t)&&(n.resultKey.push(t),n.resultList.push(e.result),c.set(e.fatherKey,n))}})),c.forEach((function(e){e.resultList&&e.resultList.length===e.resultLength&&("and"===e.op&&(e.result=-1===e.resultList.indexOf(!1)),"or"===e.op&&(e.result=-1!==e.resultList.indexOf(!0)))}));return c.get(0).result}return!1}var h=this.scope(i.key),d=h.scope,f=h.key,p=h.key2,g=d?"header"===d?p?JSON.parse(e[p])[f]:e[f]:"user"===d?t[f]:a[f]:o;return this.calculate(i.op,g,i.value)}catch(v){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:v.message}),console.log(v.message),!1}},e.prototype.publish=function(e,t,n){try{var i=this.configManager.get().user,r={biz_id:this.stateArray.get(t).pattern.biz_id,plan_id:t,uid:i.user_id||"",did:i.device_id||"",uuid:i.user_unique_id,events:e,extra:{url:window.location.href}};this.collect.emit("__cep_match",r),(window.opener||window.parent).postMessage({type:"__cep_match",data:r},"*"),this.event("__cep_trigger_sdk",t),this.addQuotas(t),this.reset(t,n),console.log(this.stateArray)}catch(o){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message}),void console.log(o.message)}},e.prototype.addQuotas=function(e){var t=this.stateArray.get(e).quotas;if(t&&t.length){var n=this.storage.getItem(this.quotasKey)||{};n[e]||(n[e]={value:0,lastTime:Date.now()});var i=n[e].value;0===i&&(n[e].lastTime=Date.now()),n[e].value=i+1,this.storage.setItem(this.quotasKey,n)}},e.prototype.checkQuotas=function(e){var t=this.stateArray.get(e).quotas,n=this.storage.getItem(this.quotasKey)||{};if(n[e]||(n[e]={value:0,lastTime:Date.now()}),t&&t.length){var i=t[0].granularity,r=t[0].value;if("per_keyid"!==t[0].type)return!0;var o=this.release(i);return"all"===o?!(n[e].value>=r&&(console.log("plan:"+e+" limit"),1)):Date.now()-n[e].lastTime>=o?(n[e].value=0,n[e].lastTime=Date.now(),this.storage.setItem(this.quotasKey,n),!0):!(n[e].value>=r&&(console.log("plan:"+e+" limit"),1))}return!0},e.prototype.clearQuotas=function(){this.storage.setItem(this.quotasKey,null)},e.prototype.release=function(e){if("all"===e)return e;var t=du.duration(e);return t?t.asMilliseconds():"all"},e.prototype.reset=function(e,t){var n=this.stateArray.get(e);if(n.singleRule){var i=n.patternState.get(t);i.isMatch=!1,i.event=null,i.matchTime=0,i.initTime=Date.now(),n.patternState.set(t,i)}else n.patternState.forEach((function(e){e.isMatch=!1,e.event=null,e.matchTime=0,e.initTime=Date.now()}));this.stateArray.set(e,n);var r=this.waitArray.get(e);r&&r.get(t)&&(clearTimeout(r.get(t).waitFn),r.delete(t))},e.prototype.event=function(e,t){try{var n={event:e,params:JSON.stringify({plan_id:t||"",biz_id:this.stateArray.get(t).pattern.biz_id}),local_time_ms:Date.now()},i=this.configManager.get(),r=i.header,o=i.user;r.custom=JSON.stringify(r.custom);var a={events:[n],user:o,header:r};this.collect.requestManager.useRequest({url:this.reportUrl,data:[a]})}catch(s){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),void console.log(s.message)}},e.prototype.scope=function(e){var t="",n="";if(e.indexOf(".")>-1){var i=e.split(".");t=i[0],e=i[1],"header"===t&&"custom"===e&&(e=i[2],n=i[1])}return{scope:t,key:e,key2:n}},e.prototype.calculate=function(e,t,n){try{if("="===e)return t===n;if(-1!==["=","<",">",">=","<=","!="].indexOf(e))switch(e){case"=":return t===n;case"<":return t<n;case">":return t>n;case">=":return t>=n;case"<=":return t<=n;case"!=":return t!==n}else{if(-1!==["in","contains"].indexOf(e))return-1!==n.indexOf(t);if(-1!==["is not null","is null"].indexOf(e))return"is null"===e?null==t:null!=t;if(-1!==["startswith","endswith"].indexOf(e)){if("startswith"===e)return 0===t.indexOf(n);var i=t.length-n.length;return t.substr(i,n.length)===n}}}catch(r){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),console.log(r.message),!1}},e}(),yu="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,mu=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,n){if("sdk"===t)if(gc.hasOwnProperty(n)){var r=gc[n].object,o=gc[n].src[e.channel]+"?query="+Date.now();e.exist(n,r,o)}else console.warn("your "+n+" is not exist,please check plugin name");else"object"==i(t)&&(t.src?e.exist(n,t.call,t.src):e.process(n,t.instance,"INSTANCE"))}))}catch(t){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,n){var i=this;yu[t]?(this.process(e,yu[t]),console.log("已有"+e+"插件,避免重复加载~")):this.loadPlugin(e,n,(function(){i.process(e,yu[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","–","load plugin:"+e+" success","-")}),(function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","–","load plugin:"+e+" error","-")}))},e.prototype.process=function(e,t,n){try{if(n){var i=new t;i.apply&&i.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(r){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),console.log("excude "+e+" error, message:"+r.message)}},e.prototype.loadPlugin=function(e,t,n,i){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(n),o.onerror=function(){i(t)},o.onload=function(){r._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(a){this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}},e}(),_u=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var n=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(n.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==i(this.config.autotrack)&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(!e.collect.sdkStop&&!e.collect.destroy){"function"==typeof history.onpushstate&&history.onpushstate({state:n});var o=t.call.apply(t,Sl([history,n],i));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a,"pushState"),o}}};var n=history.replaceState;history.replaceState=function(t){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];if(!e.collect.sdkStop&&!e.collect.destroy){"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var o=n.call.apply(n,Sl([history,t],i));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a),o}}}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.getLocation=function(){return this.lastLocation},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this,t=null;window.addEventListener("hashchange",(function(n){if(!e.collect.sdkStop&&!e.collect.destroy&&e.lastLocation!==window.location.href&&(clearTimeout(t),e.allowHash)){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var i=e.getPopStateChangeEventData();e.sendPv(i)}})),window.addEventListener("popstate",(function(n){e.collect.sdkStop||e.collect.destroy||e.lastLocation!==window.location.href&&(t=setTimeout((function(){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var t=e.getPopStateChangeEventData();e.sendPv(t)}),10))}))},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e},e.prototype.pageConfig=function(){try{var e,t=this.storage.getItem(this.cache_key)||{},n=this.storage.getItem("__tea_cache_first_"+this.appid);return e=!n||1!=n,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:t&&t.refer_manual_key||"",refer_page_title:t&&t.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+e}}catch(i){return this.collect.emit(Ul.DEBUGGER_MESSAGE,{type:Ul.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e.prototype.handleRefer=function(){var e="";try{var t=this.storage.getItem()||{};e=t.routeChange?t.refer_key:this.collect.configManager.get("referrer")}catch(n){e=document.referrer}return e},e.prototype.setReferCache=function(e){var t=this.storage.getItem(this.cache_key)||{};t.refer_key=e,t.routeChange=!0,this.storage.setItem(this.cache_key,t)},e}();yc.usePlugin(mu,"extend"),yc.usePlugin(Lc,"ab"),yc.usePlugin(Mc,"stay"),yc.usePlugin(lu,"autotrack"),yc.usePlugin(Ic,"et"),yc.usePlugin(Rc,"profile"),yc.usePlugin(hu,"retry"),yc.usePlugin(vu,"cep"),yc.usePlugin(Nc,"heartbeat"),yc.usePlugin(jc,"monitor"),yc.usePlugin(_u,"route"),yc.usePlugin(uu,"tracer"),new yc("default");var bu=yc;function ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function wu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ku(Object(n),!0).forEach((function(t){xu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ku(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tu(e){return(Tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Su(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cu(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Ou(i.key),i)}}function Eu(e,t,n){return t&&Cu(e.prototype,t),n&&Cu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xu(e,t,n){return(t=Ou(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ou(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var Pu=function(e){return e&&e.Math==Math&&e},Lu=Pu("object"==("undefined"==typeof globalThis?"undefined":i(globalThis))&&globalThis)||Pu("object"==("undefined"==typeof window?"undefined":i(window))&&window)||Pu("object"==("undefined"==typeof self?"undefined":i(self))&&self)||Pu("object"==i(zn)&&zn)||function(){return this}()||zn||Function("return this")(),Iu={},Du=function(e){try{return!!e()}catch(t){return!0}},Au=!Du((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Mu=!Du((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Ru=Mu,Nu=Function.prototype.call,ju=Ru?Nu.bind(Nu):function(){return Nu.apply(Nu,arguments)},Bu={},Uu={}.propertyIsEnumerable,Hu=Object.getOwnPropertyDescriptor,Fu=Hu&&!Uu.call({1:2},1);Bu.f=Fu?function(e){var t=Hu(this,e);return!!t&&t.enumerable}:Uu;var Vu,zu,Gu=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Wu=Mu,Ku=Function.prototype,$u=Ku.call,Yu=Wu&&Ku.bind.bind($u,$u),qu=Wu?Yu:function(e){return function(){return $u.apply(e,arguments)}},Xu=qu,Ju=Xu({}.toString),Zu=Xu("".slice),Qu=function(e){return Zu(Ju(e),8,-1)},eh=Du,th=Qu,nh=Object,ih=qu("".split),rh=eh((function(){return!nh("z").propertyIsEnumerable(0)}))?function(e){return"String"==th(e)?ih(e,""):nh(e)}:nh,oh=function(e){return null==e},ah=oh,sh=TypeError,lh=function(e){if(ah(e))throw sh("Can't call method on "+e);return e},ch=rh,uh=lh,hh=function(e){return ch(uh(e))},dh="object"==("undefined"==typeof document?"undefined":i(document))&&document.all,fh={all:dh,IS_HTMLDDA:void 0===dh&&void 0!==dh},ph=fh.all,gh=fh.IS_HTMLDDA?function(e){return"function"==typeof e||e===ph}:function(e){return"function"==typeof e},vh=gh,yh=fh.all,mh=fh.IS_HTMLDDA?function(e){return"object"==i(e)?null!==e:vh(e)||e===yh}:function(e){return"object"==i(e)?null!==e:vh(e)},_h=Lu,bh=gh,kh=function(e){return bh(e)?e:void 0},wh=function(e,t){return arguments.length<2?kh(_h[e]):_h[e]&&_h[e][t]},Th=qu({}.isPrototypeOf),Sh="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Ch=Lu,Eh=Sh,xh=Ch.process,Oh=Ch.Deno,Ph=xh&&xh.versions||Oh&&Oh.version,Lh=Ph&&Ph.v8;Lh&&(zu=(Vu=Lh.split("."))[0]>0&&Vu[0]<4?1:+(Vu[0]+Vu[1])),!zu&&Eh&&(!(Vu=Eh.match(/Edge\/(\d+)/))||Vu[1]>=74)&&(Vu=Eh.match(/Chrome\/(\d+)/))&&(zu=+Vu[1]);var Ih=zu,Dh=Ih,Ah=Du,Mh=Lu.String,Rh=!!Object.getOwnPropertySymbols&&!Ah((function(){var e=Symbol();return!Mh(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Dh&&Dh<41})),Nh=Rh&&!Symbol.sham&&"symbol"==i(Symbol.iterator),jh=wh,Bh=gh,Uh=Th,Hh=Object,Fh=Nh?function(e){return"symbol"==i(e)}:function(e){var t=jh("Symbol");return Bh(t)&&Uh(t.prototype,Hh(e))},Vh=String,zh=function(e){try{return Vh(e)}catch(t){return"Object"}},Gh=gh,Wh=zh,Kh=TypeError,$h=function(e){if(Gh(e))return e;throw Kh(Wh(e)+" is not a function")},Yh=$h,qh=oh,Xh=function(e,t){var n=e[t];return qh(n)?void 0:Yh(n)},Jh=ju,Zh=gh,Qh=mh,ed=TypeError,td={exports:{}},nd=Lu,id=Object.defineProperty,rd=function(e,t){try{id(nd,e,{value:t,configurable:!0,writable:!0})}catch(n){nd[e]=t}return t},od=rd,ad="__core-js_shared__",sd=Lu[ad]||od(ad,{}),ld=sd;(td.exports=function(e,t){return ld[e]||(ld[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE",source:"https://github.com/zloirock/core-js"});var cd=lh,ud=Object,hd=function(e){return ud(cd(e))},dd=hd,fd=qu({}.hasOwnProperty),pd=Object.hasOwn||function(e,t){return fd(dd(e),t)},gd=qu,vd=0,yd=Math.random(),md=gd(1..toString),_d=function(e){return"Symbol("+(void 0===e?"":e)+")_"+md(++vd+yd,36)},bd=Lu,kd=td.exports,wd=pd,Td=_d,Sd=Rh,Cd=Nh,Ed=bd.Symbol,xd=kd("wks"),Od=Cd?Ed.for||Ed:Ed&&Ed.withoutSetter||Td,Pd=function(e){return wd(xd,e)||(xd[e]=Sd&&wd(Ed,e)?Ed[e]:Od("Symbol."+e)),xd[e]},Ld=ju,Id=mh,Dd=Fh,Ad=Xh,Md=function(e,t){var n,i;if("string"===t&&Zh(n=e.toString)&&!Qh(i=Jh(n,e)))return i;if(Zh(n=e.valueOf)&&!Qh(i=Jh(n,e)))return i;if("string"!==t&&Zh(n=e.toString)&&!Qh(i=Jh(n,e)))return i;throw ed("Can't convert object to primitive value")},Rd=TypeError,Nd=Pd("toPrimitive"),jd=function(e,t){if(!Id(e)||Dd(e))return e;var n,i=Ad(e,Nd);if(i){if(void 0===t&&(t="default"),n=Ld(i,e,t),!Id(n)||Dd(n))return n;throw Rd("Can't convert object to primitive value")}return void 0===t&&(t="number"),Md(e,t)},Bd=jd,Ud=Fh,Hd=function(e){var t=Bd(e,"string");return Ud(t)?t:t+""},Fd=mh,Vd=Lu.document,zd=Fd(Vd)&&Fd(Vd.createElement),Gd=function(e){return zd?Vd.createElement(e):{}},Wd=Gd,Kd=!Au&&!Du((function(){return 7!=Object.defineProperty(Wd("div"),"a",{get:function(){return 7}}).a})),$d=Au,Yd=ju,qd=Bu,Xd=Gu,Jd=hh,Zd=Hd,Qd=pd,ef=Kd,tf=Object.getOwnPropertyDescriptor;Iu.f=$d?tf:function(e,t){if(e=Jd(e),t=Zd(t),ef)try{return tf(e,t)}catch(n){}if(Qd(e,t))return Xd(!Yd(qd.f,e,t),e[t])};var nf={},rf=Au&&Du((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),of=mh,af=String,sf=TypeError,lf=function(e){if(of(e))return e;throw sf(af(e)+" is not an object")},cf=Au,uf=Kd,hf=rf,df=lf,ff=Hd,pf=TypeError,gf=Object.defineProperty,vf=Object.getOwnPropertyDescriptor,yf="enumerable",mf="configurable",_f="writable";nf.f=cf?hf?function(e,t,n){if(df(e),t=ff(t),df(n),"function"==typeof e&&"prototype"===t&&"value"in n&&_f in n&&!n.writable){var i=vf(e,t);i&&i.writable&&(e[t]=n.value,n={configurable:mf in n?n.configurable:i.configurable,enumerable:yf in n?n.enumerable:i.enumerable,writable:!1})}return gf(e,t,n)}:gf:function(e,t,n){if(df(e),t=ff(t),df(n),uf)try{return gf(e,t,n)}catch(i){}if("get"in n||"set"in n)throw pf("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var bf=nf,kf=Gu,wf=Au?function(e,t,n){return bf.f(e,t,kf(1,n))}:function(e,t,n){return e[t]=n,e},Tf={exports:{}},Sf=Au,Cf=pd,Ef=Function.prototype,xf=Sf&&Object.getOwnPropertyDescriptor,Of=Cf(Ef,"name"),Pf={EXISTS:Of,PROPER:Of&&"something"===function(){}.name,CONFIGURABLE:Of&&(!Sf||Sf&&xf(Ef,"name").configurable)},Lf=gh,If=sd,Df=qu(Function.toString);Lf(If.inspectSource)||(If.inspectSource=function(e){return Df(e)});var Af,Mf,Rf,Nf=If.inspectSource,jf=gh,Bf=Lu.WeakMap,Uf=jf(Bf)&&/native code/.test(String(Bf)),Hf=td.exports,Ff=_d,Vf=Hf("keys"),zf=function(e){return Vf[e]||(Vf[e]=Ff(e))},Gf={},Wf=Uf,Kf=Lu,$f=mh,Yf=wf,qf=pd,Xf=sd,Jf=zf,Zf=Gf,Qf="Object already initialized",ep=Kf.TypeError,tp=Kf.WeakMap;if(Wf||Xf.state){var np=Xf.state||(Xf.state=new tp);np.get=np.get,np.has=np.has,np.set=np.set,Af=function(e,t){if(np.has(e))throw ep(Qf);return t.facade=e,np.set(e,t),t},Mf=function(e){return np.get(e)||{}},Rf=function(e){return np.has(e)}}else{var ip=Jf("state");Zf[ip]=!0,Af=function(e,t){if(qf(e,ip))throw ep(Qf);return t.facade=e,Yf(e,ip,t),t},Mf=function(e){return qf(e,ip)?e[ip]:{}},Rf=function(e){return qf(e,ip)}}var rp={set:Af,get:Mf,has:Rf,enforce:function(e){return Rf(e)?Mf(e):Af(e,{})},getterFor:function(e){return function(t){var n;if(!$f(t)||(n=Mf(t)).type!==e)throw ep("Incompatible receiver, "+e+" required");return n}}},op=qu,ap=Du,sp=gh,lp=pd,cp=Au,up=Pf.CONFIGURABLE,hp=Nf,dp=rp.enforce,fp=rp.get,pp=String,gp=Object.defineProperty,vp=op("".slice),yp=op("".replace),mp=op([].join),_p=cp&&!ap((function(){return 8!==gp((function(){}),"length",{value:8}).length})),bp=String(String).split("String"),kp=Tf.exports=function(e,t,n){"Symbol("===vp(pp(t),0,7)&&(t="["+yp(pp(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!lp(e,"name")||up&&e.name!==t)&&(cp?gp(e,"name",{value:t,configurable:!0}):e.name=t),_p&&n&&lp(n,"arity")&&e.length!==n.arity&&gp(e,"length",{value:n.arity});try{n&&lp(n,"constructor")&&n.constructor?cp&&gp(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var i=dp(e);return lp(i,"source")||(i.source=mp(bp,"string"==typeof t?t:"")),e};Function.prototype.toString=kp((function(){return sp(this)&&fp(this).source||hp(this)}),"toString");var wp=gh,Tp=nf,Sp=Tf.exports,Cp=rd,Ep=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(wp(n)&&Sp(n,o,i),i.global)r?e[t]=n:Cp(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=n:Tp.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},xp={},Op=Math.ceil,Pp=Math.floor,Lp=Math.trunc||function(e){var t=+e;return(t>0?Pp:Op)(t)},Ip=function(e){var t=+e;return t!=t||0===t?0:Lp(t)},Dp=Ip,Ap=Math.max,Mp=Math.min,Rp=function(e,t){var n=Dp(e);return n<0?Ap(n+t,0):Mp(n,t)},Np=Ip,jp=Math.min,Bp=function(e){return e>0?jp(Np(e),9007199254740991):0},Up=Bp,Hp=function(e){return Up(e.length)},Fp=hh,Vp=Rp,zp=Hp,Gp=function(e){return function(t,n,i){var r,o=Fp(t),a=zp(o),s=Vp(i,a);if(e&&n!=n){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Wp={includes:Gp(!0),indexOf:Gp(!1)},Kp=pd,$p=hh,Yp=Wp.indexOf,qp=Gf,Xp=qu([].push),Jp=function(e,t){var n,i=$p(e),r=0,o=[];for(n in i)!Kp(qp,n)&&Kp(i,n)&&Xp(o,n);for(;t.length>r;)Kp(i,n=t[r++])&&(~Yp(o,n)||Xp(o,n));return o},Zp=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Qp=Jp,eg=Zp.concat("length","prototype");xp.f=Object.getOwnPropertyNames||function(e){return Qp(e,eg)};var tg={};tg.f=Object.getOwnPropertySymbols;var ng=wh,ig=xp,rg=tg,og=lf,ag=qu([].concat),sg=ng("Reflect","ownKeys")||function(e){var t=ig.f(og(e)),n=rg.f;return n?ag(t,n(e)):t},lg=pd,cg=sg,ug=Iu,hg=nf,dg=function(e,t,n){for(var i=cg(t),r=hg.f,o=ug.f,a=0;a<i.length;a++){var s=i[a];lg(e,s)||n&&lg(n,s)||r(e,s,o(t,s))}},fg=Du,pg=gh,gg=/#|\.prototype\./,vg=function(e,t){var n=mg[yg(e)];return n==bg||n!=_g&&(pg(t)?fg(t):!!t)},yg=vg.normalize=function(e){return String(e).replace(gg,".").toLowerCase()},mg=vg.data={},_g=vg.NATIVE="N",bg=vg.POLYFILL="P",kg=vg,wg=Lu,Tg=Iu.f,Sg=wf,Cg=Ep,Eg=rd,xg=dg,Og=kg,Pg=function(e,t){var n,r,o,a,s,l=e.target,c=e.global,u=e.stat;if(n=c?wg:u?wg[l]||Eg(l,{}):(wg[l]||{}).prototype)for(r in t){if(a=t[r],o=e.dontCallGetSet?(s=Tg(n,r))&&s.value:n[r],!Og(c?r:l+(u?".":"#")+r,e.forced)&&void 0!==o){if(i(a)==i(o))continue;xg(a,o)}(e.sham||o&&o.sham)&&Sg(a,"sham",!0),Cg(n,r,a,e)}},Lg=Qu,Ig=Array.isArray||function(e){return"Array"==Lg(e)},Dg=TypeError,Ag=function(e){if(e>9007199254740991)throw Dg("Maximum allowed index exceeded");return e},Mg=Hd,Rg=nf,Ng=Gu,jg=function(e,t,n){var i=Mg(t);i in e?Rg.f(e,i,Ng(0,n)):e[i]=n},Bg={};Bg[Pd("toStringTag")]="z";var Ug="[object z]"===String(Bg),Hg=Ug,Fg=gh,Vg=Qu,zg=Pd("toStringTag"),Gg=Object,Wg="Arguments"==Vg(function(){return arguments}()),Kg=Hg?Vg:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Gg(e),zg))?n:Wg?Vg(t):"Object"==(i=Vg(t))&&Fg(t.callee)?"Arguments":i},$g=qu,Yg=Du,qg=gh,Xg=Kg,Jg=Nf,Zg=function(){},Qg=[],ev=wh("Reflect","construct"),tv=/^\s*(?:class|function)\b/,nv=$g(tv.exec),iv=!tv.exec(Zg),rv=function(e){if(!qg(e))return!1;try{return ev(Zg,Qg,e),!0}catch(t){return!1}},ov=function(e){if(!qg(e))return!1;switch(Xg(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return iv||!!nv(tv,Jg(e))}catch(t){return!0}};ov.sham=!0;var av=!ev||Yg((function(){var e;return rv(rv.call)||!rv(Object)||!rv((function(){e=!0}))||e}))?ov:rv,sv=Ig,lv=av,cv=mh,uv=Pd("species"),hv=Array,dv=function(e){var t;return sv(e)&&(t=e.constructor,(lv(t)&&(t===hv||sv(t.prototype))||cv(t)&&null===(t=t[uv]))&&(t=void 0)),void 0===t?hv:t},fv=function(e,t){return new(dv(e))(0===t?0:t)},pv=Du,gv=Ih,vv=Pd("species"),yv=function(e){return gv>=51||!pv((function(){var t=[];return(t.constructor={})[vv]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},mv=Pg,_v=Du,bv=Ig,kv=mh,wv=hd,Tv=Hp,Sv=Ag,Cv=jg,Ev=fv,xv=yv,Ov=Ih,Pv=Pd("isConcatSpreadable"),Lv=Ov>=51||!_v((function(){var e=[];return e[Pv]=!1,e.concat()[0]!==e})),Iv=function(e){if(!kv(e))return!1;var t=e[Pv];return void 0!==t?!!t:bv(e)};mv({target:"Array",proto:!0,arity:1,forced:!Lv||!xv("concat")},{concat:function(e){var t,n,i,r,o,a=wv(this),s=Ev(a,0),l=0;for(t=-1,i=arguments.length;t<i;t++)if(Iv(o=-1===t?a:arguments[t]))for(r=Tv(o),Sv(l+r),n=0;n<r;n++,l++)n in o&&Cv(s,l,o[n]);else Sv(l+1),Cv(s,l++,o);return s.length=l,s}});var Dv=Qu,Av=qu,Mv=function(e){if("Function"===Dv(e))return Av(e)},Rv=$h,Nv=Mu,jv=Mv(Mv.bind),Bv=function(e,t){return Rv(e),void 0===t?e:Nv?jv(e,t):function(){return e.apply(t,arguments)}},Uv=Bv,Hv=rh,Fv=hd,Vv=Hp,zv=fv,Gv=qu([].push),Wv=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,c,u,h){for(var d,f,p=Fv(l),g=Hv(p),v=Uv(c,u),y=Vv(g),m=0,_=h||zv,b=t?_(l,y):n||a?_(l,0):void 0;y>m;m++)if((s||m in g)&&(f=v(d=g[m],m,p),e))if(t)b[m]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:Gv(b,d)}else switch(e){case 4:return!1;case 7:Gv(b,d)}return o?-1:i||r?r:b}},Kv={forEach:Wv(0),map:Wv(1),filter:Wv(2),some:Wv(3),every:Wv(4),find:Wv(5),findIndex:Wv(6),filterReject:Wv(7)},$v=Kv.map;Pg({target:"Array",proto:!0,forced:!yv("map")},{map:function(e){return $v(this,e,arguments.length>1?arguments[1]:void 0)}});var Yv=Jp,qv=Zp,Xv=Object.keys||function(e){return Yv(e,qv)},Jv=hd,Zv=Xv;Pg({target:"Object",stat:!0,forced:Du((function(){Zv(1)}))},{keys:function(e){return Zv(Jv(e))}});var Qv=Kg,ey=String,ty=function(e){if("Symbol"===Qv(e))throw TypeError("Cannot convert a Symbol value to a string");return ey(e)},ny=qu,iy=Ip,ry=ty,oy=lh,ay=ny("".charAt),sy=ny("".charCodeAt),ly=ny("".slice),cy=function(e){return function(t,n){var i,r,o=ry(oy(t)),a=iy(n),s=o.length;return a<0||a>=s?e?"":void 0:(i=sy(o,a))<55296||i>56319||a+1===s||(r=sy(o,a+1))<56320||r>57343?e?ay(o,a):i:e?ly(o,a,a+2):r-56320+(i-55296<<10)+65536}},uy={codeAt:cy(!1),charAt:cy(!0)},hy=uy.charAt,dy=lh,fy=Ip,py=ty;Pg({target:"String",proto:!0,forced:!0},{at:function(e){var t=py(dy(this)),n=t.length,i=fy(e),r=i>=0?i:n+i;return r<0||r>=n?void 0:hy(t,r)}});var gy=Kg,vy=Ug?{}.toString:function(){return"[object "+gy(this)+"]"};Ug||Ep(Object.prototype,"toString",vy,{unsafe:!0});var yy=lf,my=function(){var e=yy(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},_y=ju,by=pd,ky=Th,wy=my,Ty=RegExp.prototype,Sy=function(e){var t=e.flags;return void 0!==t||"flags"in Ty||by(e,"flags")||!ky(Ty,e)?t:_y(wy,e)},Cy=Pf.PROPER,Ey=Ep,xy=lf,Oy=ty,Py=Du,Ly=Sy,Iy="toString",Dy=RegExp.prototype.toString,Ay=Py((function(){return"/a/b"!=Dy.call({source:"a",flags:"b"})})),My=Cy&&Dy.name!=Iy;(Ay||My)&&Ey(RegExp.prototype,Iy,(function(){var e=xy(this);return"/"+Oy(e.source)+"/"+Oy(Ly(e))}),{unsafe:!0});var Ry=Gd("span").classList,Ny=Ry&&Ry.constructor&&Ry.constructor.prototype,jy=Ny===Object.prototype?void 0:Ny,By=Du,Uy=function(e,t){var n=[][e];return!!n&&By((function(){n.call(null,t||function(){return 1},1)}))},Hy=Kv.forEach,Fy=Uy("forEach")?[].forEach:function(e){return Hy(this,e,arguments.length>1?arguments[1]:void 0)},Vy=Lu,zy={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Gy=jy,Wy=Fy,Ky=wf,$y=function(e){if(e&&e.forEach!==Wy)try{Ky(e,"forEach",Wy)}catch(t){e.forEach=Wy}};for(var Yy in zy)zy[Yy]&&$y(Vy[Yy]&&Vy[Yy].prototype);$y(Gy);var qy=Lu,Xy=qu,Jy=$h,Zy=gh,Qy=String,em=TypeError,tm=function(e,t,n){try{return Xy(Jy(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(i){}},nm=lf,im=function(e){if("object"==i(e)||Zy(e))return e;throw em("Can't set "+Qy(e)+" as a prototype")},rm=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=tm(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(i){}return function(n,i){return nm(n),im(i),t?e(n,i):n.__proto__=i,n}}():void 0),om=gh,am=mh,sm=rm,lm=function(e,t,n){var i,r;return sm&&om(i=t.constructor)&&i!==n&&am(r=i.prototype)&&r!==n.prototype&&sm(e,r),e},cm=qu(1..valueOf),um="\t\n\v\f\r \u2028\u2029\ufeff",hm=lh,dm=ty,fm=um,pm=qu("".replace),gm=RegExp("^["+fm+"]+"),vm=RegExp("(^|[^"+fm+"])["+fm+"]+$"),ym=function(e){return function(t){var n=dm(hm(t));return 1&e&&(n=pm(n,gm,"")),2&e&&(n=pm(n,vm,"$1")),n}},mm={start:ym(1),end:ym(2),trim:ym(3)},_m=Pg,bm=Au,km=Lu,wm=qy,Tm=qu,Sm=kg,Cm=pd,Em=lm,xm=Th,Om=Fh,Pm=jd,Lm=Du,Im=xp.f,Dm=Iu.f,Am=nf.f,Mm=cm,Rm=mm.trim,Nm="Number",jm=km.Number;wm.Number;var Bm=jm.prototype,Um=km.TypeError,Hm=Tm("".slice),Fm=Tm("".charCodeAt),Vm=function(e){var t=Pm(e,"number");return"bigint"==typeof t?t:zm(t)},zm=function(e){var t,n,i,r,o,a,s,l,c=Pm(e,"number");if(Om(c))throw Um("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=Rm(c),43===(t=Fm(c,0))||45===t){if(88===(n=Fm(c,2))||120===n)return NaN}else if(48===t){switch(Fm(c,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+c}for(a=(o=Hm(c,2)).length,s=0;s<a;s++)if((l=Fm(o,s))<48||l>r)return NaN;return parseInt(o,i)}return+c},Gm=Sm(Nm,!jm(" 0o1")||!jm("0b1")||jm("+0x1")),Wm=function(e){return xm(Bm,e)&&Lm((function(){Mm(e)}))},Km=function(e){var t=arguments.length<1?0:jm(Vm(e));return Wm(this)?Em(Object(t),this,Km):t};Km.prototype=Bm,Gm&&(Bm.constructor=Km),_m({global:!0,constructor:!0,wrap:!0,forced:Gm},{Number:Km});Gm&&function(e,t){for(var n,i=bm?Im(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)Cm(t,n=i[r])&&!Cm(e,n)&&Am(e,n,Dm(t,n))}(wm.Number,jm);var $m=Tf.exports,Ym=nf,qm=function(e,t,n){return n.get&&$m(n.get,t,{getter:!0}),n.set&&$m(n.set,t,{setter:!0}),Ym.f(e,t,n)},Xm=Au,Jm=Pf.EXISTS,Zm=qu,Qm=qm,e_=Function.prototype,t_=Zm(e_.toString),n_=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,i_=Zm(n_.exec);Xm&&!Jm&&Qm(e_,"name",{configurable:!0,get:function(){try{return i_(n_,t_(this))[1]}catch(e){return""}}});var r_=Pg,o_=rh,a_=hh,s_=Uy,l_=qu([].join);r_({target:"Array",proto:!0,forced:o_!=Object||!s_("join",",")},{join:function(e){return l_(a_(this),void 0===e?",":e)}});var c_,u_,h_,d_,f_="undefined"!=typeof process&&"process"==Qu(process),p_=nf.f,g_=pd,v_=Pd("toStringTag"),y_=function(e,t,n){e&&!n&&(e=e.prototype),e&&!g_(e,v_)&&p_(e,v_,{configurable:!0,value:t})},m_=wh,__=qm,b_=Au,k_=Pd("species"),w_=function(e){var t=m_(e);b_&&t&&!t[k_]&&__(t,k_,{configurable:!0,get:function(){return this}})},T_=Th,S_=TypeError,C_=av,E_=zh,x_=TypeError,O_=function(e){if(C_(e))return e;throw x_(E_(e)+" is not a constructor")},P_=lf,L_=O_,I_=oh,D_=Pd("species"),A_=function(e,t){var n,i=P_(e).constructor;return void 0===i||I_(n=P_(i)[D_])?t:L_(n)},M_=Mu,R_=Function.prototype,N_=R_.apply,j_=R_.call,B_="object"==("undefined"==typeof Reflect?"undefined":i(Reflect))&&Reflect.apply||(M_?j_.bind(N_):function(){return j_.apply(N_,arguments)}),U_=wh("document","documentElement"),H_=qu([].slice),F_=TypeError,V_=function(e,t){if(e<t)throw F_("Not enough arguments");return e},z_=/(?:ipad|iphone|ipod).*applewebkit/i.test(Sh),G_=Lu,W_=B_,K_=Bv,$_=gh,Y_=pd,q_=Du,X_=U_,J_=H_,Z_=Gd,Q_=V_,eb=z_,tb=f_,nb=G_.setImmediate,ib=G_.clearImmediate,rb=G_.process,ob=G_.Dispatch,ab=G_.Function,sb=G_.MessageChannel,lb=G_.String,cb=0,ub={},hb="onreadystatechange";q_((function(){c_=G_.location}));var db=function(e){if(Y_(ub,e)){var t=ub[e];delete ub[e],t()}},fb=function(e){return function(){db(e)}},pb=function(e){db(e.data)},gb=function(e){G_.postMessage(lb(e),c_.protocol+"//"+c_.host)};nb&&ib||(nb=function(e){Q_(arguments.length,1);var t=$_(e)?e:ab(e),n=J_(arguments,1);return ub[++cb]=function(){W_(t,void 0,n)},u_(cb),cb},ib=function(e){delete ub[e]},tb?u_=function(e){rb.nextTick(fb(e))}:ob&&ob.now?u_=function(e){ob.now(fb(e))}:sb&&!eb?(d_=(h_=new sb).port2,h_.port1.onmessage=pb,u_=K_(d_.postMessage,d_)):G_.addEventListener&&$_(G_.postMessage)&&!G_.importScripts&&c_&&"file:"!==c_.protocol&&!q_(gb)?(u_=gb,G_.addEventListener("message",pb,!1)):u_=hb in Z_("script")?function(e){X_.appendChild(Z_("script")).onreadystatechange=function(){X_.removeChild(this),db(e)}}:function(e){setTimeout(fb(e),0)});var vb={set:nb,clear:ib},yb=function(){this.head=null,this.tail=null};yb.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var mb,_b,bb,kb,wb,Tb=yb,Sb=/ipad|iphone|ipod/i.test(Sh)&&"undefined"!=typeof Pebble,Cb=/web0s(?!.*chrome)/i.test(Sh),Eb=Lu,xb=Bv,Ob=Iu.f,Pb=vb.set,Lb=Tb,Ib=z_,Db=Sb,Ab=Cb,Mb=f_,Rb=Eb.MutationObserver||Eb.WebKitMutationObserver,Nb=Eb.document,jb=Eb.process,Bb=Eb.Promise,Ub=Ob(Eb,"queueMicrotask"),Hb=Ub&&Ub.value;if(!Hb){var Fb=new Lb,Vb=function(){var e,t;for(Mb&&(e=jb.domain)&&e.exit();t=Fb.get();)try{t()}catch(n){throw Fb.head&&mb(),n}e&&e.enter()};Ib||Mb||Ab||!Rb||!Nb?!Db&&Bb&&Bb.resolve?((kb=Bb.resolve(void 0)).constructor=Bb,wb=xb(kb.then,kb),mb=function(){wb(Vb)}):Mb?mb=function(){jb.nextTick(Vb)}:(Pb=xb(Pb,Eb),mb=function(){Pb(Vb)}):(_b=!0,bb=Nb.createTextNode(""),new Rb(Vb).observe(bb,{characterData:!0}),mb=function(){bb.data=_b=!_b}),Hb=function(e){Fb.head||mb(),Fb.add(e)}}var zb=Hb,Gb=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},Wb=Lu.Promise,Kb="object"==("undefined"==typeof Deno?"undefined":i(Deno))&&Deno&&"object"==i(Deno.version),$b=!Kb&&!f_&&"object"==("undefined"==typeof window?"undefined":i(window))&&"object"==("undefined"==typeof document?"undefined":i(document)),Yb=Lu,qb=Wb,Xb=gh,Jb=kg,Zb=Nf,Qb=Pd,ek=$b,tk=Kb,nk=Ih;qb&&qb.prototype;var ik=Qb("species"),rk=!1,ok=Xb(Yb.PromiseRejectionEvent),ak={CONSTRUCTOR:Jb("Promise",(function(){var e=Zb(qb),t=e!==String(qb);if(!t&&66===nk)return!0;if(!nk||nk<51||!/native code/.test(e)){var n=new qb((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[ik]=i,!(rk=n.then((function(){}))instanceof i))return!0}return!t&&(ek||tk)&&!ok})),REJECTION_EVENT:ok,SUBCLASSING:rk},sk={},lk=$h,ck=TypeError,uk=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw ck("Bad Promise constructor");t=e,n=i})),this.resolve=lk(t),this.reject=lk(n)};sk.f=function(e){return new uk(e)};var hk,dk,fk,pk=Pg,gk=f_,vk=Lu,yk=ju,mk=Ep,_k=rm,bk=y_,kk=w_,wk=$h,Tk=gh,Sk=mh,Ck=function(e,t){if(T_(t,e))return e;throw S_("Incorrect invocation")},Ek=A_,xk=vb.set,Ok=zb,Pk=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(n){}},Lk=Gb,Ik=Tb,Dk=rp,Ak=Wb,Mk=sk,Rk="Promise",Nk=ak.CONSTRUCTOR,jk=ak.REJECTION_EVENT,Bk=ak.SUBCLASSING,Uk=Dk.getterFor(Rk),Hk=Dk.set,Fk=Ak&&Ak.prototype,Vk=Ak,zk=Fk,Gk=vk.TypeError,Wk=vk.document,Kk=vk.process,$k=Mk.f,Yk=$k,qk=!!(Wk&&Wk.createEvent&&vk.dispatchEvent),Xk="unhandledrejection",Jk=function(e){var t;return!(!Sk(e)||!Tk(t=e.then))&&t},Zk=function(e,t){var n,i,r,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(2===t.rejection&&iw(t),t.rejection=1),!0===s?n=o:(u&&u.enter(),n=s(o),u&&(u.exit(),r=!0)),n===e.promise?c(Gk("Promise-chain cycle")):(i=Jk(n))?yk(i,n,l,c):l(n)):c(o)}catch(h){u&&!r&&u.exit(),c(h)}},Qk=function(e,t){e.notified||(e.notified=!0,Ok((function(){for(var n,i=e.reactions;n=i.get();)Zk(n,e);e.notified=!1,t&&!e.rejection&&tw(e)})))},ew=function(e,t,n){var i,r;qk?((i=Wk.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),vk.dispatchEvent(i)):i={promise:t,reason:n},!jk&&(r=vk["on"+e])?r(i):e===Xk&&Pk("Unhandled promise rejection",n)},tw=function(e){yk(xk,vk,(function(){var t,n=e.facade,i=e.value;if(nw(e)&&(t=Lk((function(){gk?Kk.emit("unhandledRejection",i,n):ew(Xk,n,i)})),e.rejection=gk||nw(e)?2:1,t.error))throw t.value}))},nw=function(e){return 1!==e.rejection&&!e.parent},iw=function(e){yk(xk,vk,(function(){var t=e.facade;gk?Kk.emit("rejectionHandled",t):ew("rejectionhandled",t,e.value)}))},rw=function(e,t,n){return function(i){e(t,i,n)}},ow=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Qk(e,!0))},aw=function e(t,n,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===n)throw Gk("Promise can't be resolved itself");var r=Jk(n);r?Ok((function(){var i={done:!1};try{yk(r,n,rw(e,i,t),rw(ow,i,t))}catch(o){ow(i,o,t)}})):(t.value=n,t.state=1,Qk(t,!1))}catch(o){ow({done:!1},o,t)}}};if(Nk&&(zk=(Vk=function(e){Ck(this,zk),wk(e),yk(hk,this);var t=Uk(this);try{e(rw(aw,t),rw(ow,t))}catch(n){ow(t,n)}}).prototype,(hk=function(e){Hk(this,{type:Rk,done:!1,notified:!1,parent:!1,reactions:new Ik,rejection:!1,state:0,value:void 0})}).prototype=mk(zk,"then",(function(e,t){var n=Uk(this),i=$k(Ek(this,Vk));return n.parent=!0,i.ok=!Tk(e)||e,i.fail=Tk(t)&&t,i.domain=gk?Kk.domain:void 0,0==n.state?n.reactions.add(i):Ok((function(){Zk(i,n)})),i.promise})),dk=function(){var e=new hk,t=Uk(e);this.promise=e,this.resolve=rw(aw,t),this.reject=rw(ow,t)},Mk.f=$k=function(e){return e===Vk||undefined===e?new dk(e):Yk(e)},Tk(Ak)&&Fk!==Object.prototype)){fk=Fk.then,Bk||mk(Fk,"then",(function(e,t){var n=this;return new Vk((function(e,t){yk(fk,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete Fk.constructor}catch(hV){}_k&&_k(Fk,zk)}pk({global:!0,constructor:!0,wrap:!0,forced:Nk},{Promise:Vk}),bk(Vk,Rk,!1),kk(Rk);var sw={},lw=sw,cw=Pd("iterator"),uw=Array.prototype,hw=Kg,dw=Xh,fw=oh,pw=sw,gw=Pd("iterator"),vw=function(e){if(!fw(e))return dw(e,gw)||dw(e,"@@iterator")||pw[hw(e)]},yw=ju,mw=$h,_w=lf,bw=zh,kw=vw,ww=TypeError,Tw=ju,Sw=lf,Cw=Xh,Ew=Bv,xw=ju,Ow=lf,Pw=zh,Lw=function(e){return void 0!==e&&(lw.Array===e||uw[cw]===e)},Iw=Hp,Dw=Th,Aw=function(e,t){var n=arguments.length<2?kw(e):t;if(mw(n))return _w(yw(n,e));throw ww(bw(e)+" is not iterable")},Mw=vw,Rw=function(e,t,n){var i,r;Sw(e);try{if(!(i=Cw(e,"return"))){if("throw"===t)throw n;return n}i=Tw(i,e)}catch(hV){r=!0,i=hV}if("throw"===t)throw n;if(r)throw i;return Sw(i),n},Nw=TypeError,jw=function(e,t){this.stopped=e,this.result=t},Bw=jw.prototype,Uw=function(e,t,n){var r,o,a,s,l,c,u,h=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),g=!(!n||!n.INTERRUPTED),v=Ew(t,h),y=function(e){return r&&Rw(r,"normal",e),new jw(!0,e)},m=function(e){return d?(Ow(e),g?v(e[0],e[1],y):v(e[0],e[1])):g?v(e,y):v(e)};if(f)r=e.iterator;else if(p)r=e;else{if(!(o=Mw(e)))throw Nw(Pw(e)+" is not iterable");if(Lw(o)){for(a=0,s=Iw(e);s>a;a++)if((l=m(e[a]))&&Dw(Bw,l))return l;return new jw(!1)}r=Aw(e,o)}for(c=f?e.next:r.next;!(u=xw(c,r)).done;){try{l=m(u.value)}catch(hV){Rw(r,"throw",hV)}if("object"==i(l)&&l&&Dw(Bw,l))return l}return new jw(!1)},Hw=Pd("iterator"),Fw=!1;try{var Vw=0,zw={next:function(){return{done:!!Vw++}},return:function(){Fw=!0}};zw[Hw]=function(){return this},Array.from(zw,(function(){throw 2}))}catch(hV){}var Gw=Wb,Ww=ak.CONSTRUCTOR||!function(e,t){if(!t&&!Fw)return!1;var n=!1;try{var i={};i[Hw]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(hV){}return n}((function(e){Gw.all(e).then(void 0,(function(){}))})),Kw=ju,$w=$h,Yw=sk,qw=Gb,Xw=Uw;Pg({target:"Promise",stat:!0,forced:Ww},{all:function(e){var t=this,n=Yw.f(t),i=n.resolve,r=n.reject,o=qw((function(){var n=$w(t.resolve),o=[],a=0,s=1;Xw(e,(function(e){var l=a++,c=!1;s++,Kw(n,t,e).then((function(e){c||(c=!0,o[l]=e,--s||i(o))}),r)})),--s||i(o)}));return o.error&&r(o.value),n.promise}});var Jw=Pg,Zw=ak.CONSTRUCTOR,Qw=Wb,eT=wh,tT=gh,nT=Ep,iT=Qw&&Qw.prototype;if(Jw({target:"Promise",proto:!0,forced:Zw,real:!0},{catch:function(e){return this.then(void 0,e)}}),tT(Qw)){var rT=eT("Promise").prototype.catch;iT.catch!==rT&&nT(iT,"catch",rT,{unsafe:!0})}var oT=ju,aT=$h,sT=sk,lT=Gb,cT=Uw;Pg({target:"Promise",stat:!0,forced:Ww},{race:function(e){var t=this,n=sT.f(t),i=n.reject,r=lT((function(){var r=aT(t.resolve);cT(e,(function(e){oT(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var uT=ju,hT=sk;Pg({target:"Promise",stat:!0,forced:ak.CONSTRUCTOR},{reject:function(e){var t=hT.f(this);return uT(t.reject,void 0,e),t.promise}});var dT=lf,fT=mh,pT=sk,gT=function(e,t){if(dT(e),fT(t)&&t.constructor===e)return t;var n=pT.f(e);return(0,n.resolve)(t),n.promise},vT=Pg,yT=ak.CONSTRUCTOR,mT=gT;wh("Promise"),vT({target:"Promise",stat:!0,forced:yT},{resolve:function(e){return mT(this,e)}});var _T=Pg,bT=Wb,kT=Du,wT=wh,TT=gh,ST=A_,CT=gT,ET=Ep,xT=bT&&bT.prototype;if(_T({target:"Promise",proto:!0,real:!0,forced:!!bT&&kT((function(){xT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=ST(this,wT("Promise")),n=TT(e);return this.then(n?function(n){return CT(t,e()).then((function(){return n}))}:e,n?function(n){return CT(t,e()).then((function(){throw n}))}:e)}}),TT(bT)){var OT=wT("Promise").prototype.finally;xT.finally!==OT&&ET(xT,"finally",OT,{unsafe:!0})}var PT=Au,LT=Ig,IT=TypeError,DT=Object.getOwnPropertyDescriptor,AT=PT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(hV){return hV instanceof TypeError}}(),MT=zh,RT=TypeError,NT=Pg,jT=hd,BT=Rp,UT=Ip,HT=Hp,FT=AT?function(e,t){if(LT(e)&&!DT(e,"length").writable)throw IT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},VT=Ag,zT=fv,GT=jg,WT=function(e,t){if(!delete e[t])throw RT("Cannot delete property "+MT(t)+" of "+MT(e))},KT=yv("splice"),$T=Math.max,YT=Math.min;NT({target:"Array",proto:!0,forced:!KT},{splice:function(e,t){var n,i,r,o,a,s,l=jT(this),c=HT(l),u=BT(e,c),h=arguments.length;for(0===h?n=i=0:1===h?(n=0,i=c-u):(n=h-2,i=YT($T(UT(t),0),c-u)),VT(c+n-i),r=zT(l,i),o=0;o<i;o++)(a=u+o)in l&>(r,o,l[a]);if(r.length=i,n<i){for(o=u;o<c-i;o++)s=o+n,(a=o+i)in l?l[s]=l[a]:WT(l,s);for(o=c;o>c-i+n;o--)WT(l,o-1)}else if(n>i)for(o=c-i;o>u;o--)s=o+n-1,(a=o+i-1)in l?l[s]=l[a]:WT(l,s);for(o=0;o<n;o++)l[o+u]=arguments[o+2];return FT(l,c-i+n),r}});var qT=Ip,XT=ty,JT=lh,ZT=RangeError,QT=Pg,eS=qu,tS=Ip,nS=cm,iS=function(e){var t=XT(JT(this)),n="",i=qT(e);if(i<0||i==1/0)throw ZT("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},rS=Du,oS=RangeError,aS=String,sS=Math.floor,lS=eS(iS),cS=eS("".slice),uS=eS(1..toFixed),hS=function e(t,n,i){return 0===n?i:n%2==1?e(t,n-1,i*t):e(t*t,n/2,i)},dS=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=sS(r/1e7)},fS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=sS(i/t),i=i%t*1e7},pS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=aS(e[t]);n=""===n?i:n+lS("0",7-i.length)+i}return n};QT({target:"Number",proto:!0,forced:rS((function(){return"0.000"!==uS(8e-5,3)||"1"!==uS(.9,0)||"1.25"!==uS(1.255,2)||"1000000000000000128"!==uS(0xde0b6b3a7640080,0)}))||!rS((function(){uS({})}))},{toFixed:function(e){var t,n,i,r,o=nS(this),a=tS(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw oS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return aS(o);if(o<0&&(l="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*hS(2,69,1))-69)<0?o*hS(2,-t,1):o/hS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(dS(s,0,n),i=a;i>=7;)dS(s,1e7,0),i-=7;for(dS(s,hS(10,i,1),0),i=t-1;i>=23;)fS(s,1<<23),i-=23;fS(s,1<<i),dS(s,1,1),fS(s,2),c=pS(s)}else dS(s,0,n),dS(s,1<<-t,0),c=pS(s)+lS("0",a);return c=a>0?l+((r=c.length)<=a?"0."+lS("0",a-r)+c:cS(c,0,r-a)+"."+cS(c,r-a)):l+c}}),Pg({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var gS=Du,vS=Lu.RegExp,yS=gS((function(){var e=vS("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),mS=yS||gS((function(){return!vS("a","y").sticky})),_S={BROKEN_CARET:yS||gS((function(){var e=vS("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:mS,UNSUPPORTED_Y:yS},bS={},kS=Au,wS=rf,TS=nf,SS=lf,CS=hh,ES=Xv;bS.f=kS&&!wS?Object.defineProperties:function(e,t){SS(e);for(var n,i=CS(t),r=ES(t),o=r.length,a=0;o>a;)TS.f(e,n=r[a++],i[n]);return e};var xS,OS=lf,PS=bS,LS=Zp,IS=Gf,DS=U_,AS=Gd,MS=zf("IE_PROTO"),RS=function(){},NS=function(e){return"<script>"+e+"</"+"script>"},jS=function(e){e.write(NS("")),e.close();var t=e.parentWindow.Object;return e=null,t},BS=function(){try{xS=new ActiveXObject("htmlfile")}catch(hV){}var e,t;BS="undefined"!=typeof document?document.domain&&xS?jS(xS):((t=AS("iframe")).style.display="none",DS.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(NS("document.F=Object")),e.close(),e.F):jS(xS);for(var n=LS.length;n--;)delete BS.prototype[LS[n]];return BS()};IS[MS]=!0;var US,HS,FS=Object.create||function(e,t){var n;return null!==e?(RS.prototype=OS(e),n=new RS,RS.prototype=null,n[MS]=e):n=BS(),void 0===t?n:PS.f(n,t)},VS=Du,zS=Lu.RegExp,GS=VS((function(){var e=zS(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),WS=Du,KS=Lu.RegExp,$S=WS((function(){var e=KS("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),YS=ju,qS=qu,XS=ty,JS=my,ZS=_S,QS=td.exports,eC=FS,tC=rp.get,nC=GS,iC=$S,rC=QS("native-string-replace",String.prototype.replace),oC=RegExp.prototype.exec,aC=oC,sC=qS("".charAt),lC=qS("".indexOf),cC=qS("".replace),uC=qS("".slice),hC=(HS=/b*/g,YS(oC,US=/a/,"a"),YS(oC,HS,"a"),0!==US.lastIndex||0!==HS.lastIndex),dC=ZS.BROKEN_CARET,fC=void 0!==/()??/.exec("")[1];(hC||fC||dC||nC||iC)&&(aC=function(e){var t,n,i,r,o,a,s,l=this,c=tC(l),u=XS(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=YS(aC,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=dC&&l.sticky,p=YS(JS,l),g=l.source,v=0,y=u;if(f&&(p=cC(p,"y",""),-1===lC(p,"g")&&(p+="g"),y=uC(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==sC(u,l.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),fC&&(n=new RegExp("^"+g+"$(?!\\s)",p)),hC&&(i=l.lastIndex),r=YS(oC,f?n:l,y),f?r?(r.input=uC(r.input,v),r[0]=uC(r[0],v),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:hC&&r&&(l.lastIndex=l.global?r.index+r[0].length:i),fC&&r&&r.length>1&&YS(rC,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&d)for(r.groups=a=eC(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var pC=aC;Pg({target:"RegExp",proto:!0,forced:/./.exec!==pC},{exec:pC});var gC=Mv,vC=Ep,yC=pC,mC=Du,_C=Pd,bC=wf,kC=_C("species"),wC=RegExp.prototype,TC=function(e,t,n,i){var r=_C(e),o=!mC((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!mC((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[kC]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!a||n){var s=gC(/./[r]),l=t(r,""[e],(function(e,t,n,i,r){var a=gC(e),l=t.exec;return l===yC||l===wC.exec?o&&!r?{done:!0,value:s(t,n,i)}:{done:!0,value:a(n,t,i)}:{done:!1}}));vC(String.prototype,e,l[0]),vC(wC,r,l[1])}i&&bC(wC[r],"sham",!0)},SC=uy.charAt,CC=function(e,t,n){return t+(n?SC(e,t).length:1)},EC=qu,xC=hd,OC=Math.floor,PC=EC("".charAt),LC=EC("".replace),IC=EC("".slice),DC=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,AC=/\$([$&'`]|\d{1,2})/g,MC=ju,RC=lf,NC=gh,jC=Qu,BC=pC,UC=TypeError,HC=function(e,t){var n=e.exec;if(NC(n)){var i=MC(n,e,t);return null!==i&&RC(i),i}if("RegExp"===jC(e))return MC(BC,e,t);throw UC("RegExp#exec called on incompatible receiver")},FC=B_,VC=ju,zC=qu,GC=TC,WC=Du,KC=lf,$C=gh,YC=oh,qC=Ip,XC=Bp,JC=ty,ZC=lh,QC=CC,eE=Xh,tE=function(e,t,n,i,r,o){var a=n+e.length,s=i.length,l=AC;return void 0!==r&&(r=xC(r),l=DC),LC(o,l,(function(o,l){var c;switch(PC(l,0)){case"$":return"$";case"&":return e;case"`":return IC(t,0,n);case"'":return IC(t,a);case"<":c=r[IC(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=OC(u/10);return 0===h?o:h<=s?void 0===i[h-1]?PC(l,1):i[h-1]+PC(l,1):o}c=i[u-1]}return void 0===c?"":c}))},nE=HC,iE=Pd("replace"),rE=Math.max,oE=Math.min,aE=zC([].concat),sE=zC([].push),lE=zC("".indexOf),cE=zC("".slice),uE="$0"==="a".replace(/./,"$0"),hE=!!/./[iE]&&""===/./[iE]("a","$0"),dE=!WC((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));GC("replace",(function(e,t,n){var i=hE?"$":"$0";return[function(e,n){var i=ZC(this),r=YC(e)?void 0:eE(e,iE);return r?VC(r,e,i,n):VC(t,JC(i),e,n)},function(e,r){var o=KC(this),a=JC(e);if("string"==typeof r&&-1===lE(r,i)&&-1===lE(r,"$<")){var s=n(t,o,a,r);if(s.done)return s.value}var l=$C(r);l||(r=JC(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=nE(o,a);if(null===d)break;if(sE(h,d),!c)break;""===JC(d[0])&&(o.lastIndex=QC(a,XC(o.lastIndex),u))}for(var f,p="",g=0,v=0;v<h.length;v++){for(var y=JC((d=h[v])[0]),m=rE(oE(qC(d.index),a.length),0),_=[],b=1;b<d.length;b++)sE(_,void 0===(f=d[b])?f:String(f));var k=d.groups;if(l){var w=aE([y],_,m,a);void 0!==k&&sE(w,k);var T=JC(FC(r,void 0,w))}else T=tE(y,a,m,_,k,r);m>=g&&(p+=cE(a,g,m)+T,g=m+y.length)}return p+cE(a,g)}]}),!dE||!uE||hE);var fE=mh,pE=Qu,gE=Pd("match"),vE=function(e){var t;return fE(e)&&(void 0!==(t=e[gE])?!!t:"RegExp"==pE(e))},yE=Rp,mE=Hp,_E=jg,bE=Array,kE=Math.max,wE=function(e,t,n){for(var i=mE(e),r=yE(t,i),o=yE(void 0===n?i:n,i),a=bE(kE(o-r,0)),s=0;r<o;r++,s++)_E(a,s,e[r]);return a.length=s,a},TE=B_,SE=ju,CE=qu,EE=TC,xE=lf,OE=oh,PE=vE,LE=lh,IE=A_,DE=CC,AE=Bp,ME=ty,RE=Xh,NE=wE,jE=HC,BE=pC,UE=Du,HE=_S.UNSUPPORTED_Y,FE=4294967295,VE=Math.min,zE=[].push,GE=CE(/./.exec),WE=CE(zE),KE=CE("".slice),$E=!UE((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));EE("split",(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=ME(LE(this)),r=void 0===n?FE:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!PE(e))return SE(t,i,e,r);for(var o,a,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(o=SE(BE,h,i))&&!((a=h.lastIndex)>u&&(WE(l,KE(i,u,o.index)),o.length>1&&o.index<i.length&&TE(zE,l,NE(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===i.length?!s&&GE(h,"")||WE(l,""):WE(l,KE(i,u)),l.length>r?NE(l,0,r):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:SE(t,this,e,n)}:t,[function(t,n){var r=LE(this),o=OE(t)?void 0:RE(t,e);return o?SE(o,t,r,n):SE(i,ME(r),t,n)},function(e,r){var o=xE(this),a=ME(e),s=n(i,o,a,r,i!==t);if(s.done)return s.value;var l=IE(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(HE?"g":"y"),h=new l(HE?"^(?:"+o.source+")":o,u),d=void 0===r?FE:r>>>0;if(0===d)return[];if(0===a.length)return null===jE(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=HE?0:p;var v,y=jE(h,HE?KE(a,p):a);if(null===y||(v=VE(AE(h.lastIndex+(HE?p:0)),a.length))===f)p=DE(a,p,c);else{if(WE(g,KE(a,f,p)),g.length===d)return g;for(var m=1;m<=y.length-1;m++)if(WE(g,y[m]),g.length===d)return g;p=f=v}}return WE(g,KE(a,f)),g}]}),!$E,HE);var YE=Pf.PROPER,qE=Du,XE=um,JE=mm.trim;Pg({target:"String",proto:!0,forced:function(e){return qE((function(){return!!XE[e]()||"
"!=="
"[e]()||YE&&XE[e].name!==e}))}("trim")},{trim:function(){return JE(this)}});var ZE=Kv.filter;Pg({target:"Array",proto:!0,forced:!yv("filter")},{filter:function(e){return ZE(this,e,arguments.length>1?arguments[1]:void 0)}});var QE=ju,ex=lf,tx=oh,nx=Bp,ix=ty,rx=lh,ox=Xh,ax=CC,sx=HC;TC("match",(function(e,t,n){return[function(t){var n=rx(this),i=tx(t)?void 0:ox(t,e);return i?QE(i,t,n):new RegExp(t)[e](ix(n))},function(e){var i=ex(this),r=ix(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return sx(i,r);var a=i.unicode;i.lastIndex=0;for(var s,l=[],c=0;null!==(s=sx(i,r));){var u=ix(s[0]);l[c]=u,""===u&&(i.lastIndex=ax(r,nx(i.lastIndex),a)),c++}return 0===c?null:l}]}));var lx=nf.f,cx=Au,ux=Lu,hx=qu,dx=kg,fx=lm,px=wf,gx=xp.f,vx=Th,yx=vE,mx=ty,_x=Sy,bx=_S,kx=function(e,t,n){n in e||lx(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},wx=Ep,Tx=Du,Sx=pd,Cx=rp.enforce,Ex=w_,xx=GS,Ox=$S,Px=Pd("match"),Lx=ux.RegExp,Ix=Lx.prototype,Dx=ux.SyntaxError,Ax=hx(Ix.exec),Mx=hx("".charAt),Rx=hx("".replace),Nx=hx("".indexOf),jx=hx("".slice),Bx=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Ux=/a/g,Hx=/a/g,Fx=new Lx(Ux)!==Ux,Vx=bx.MISSED_STICKY,zx=bx.UNSUPPORTED_Y,Gx=cx&&(!Fx||Vx||xx||Ox||Tx((function(){return Hx[Px]=!1,Lx(Ux)!=Ux||Lx(Hx)==Hx||"/a/i"!=Lx(Ux,"i")})));if(dx("RegExp",Gx)){for(var Wx=function(e,t){var n,i,r,o,a,s,l=vx(Ix,this),c=yx(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===Wx)return e;if((c||vx(Ix,e))&&(e=e.source,u&&(t=_x(d))),e=void 0===e?"":mx(e),t=void 0===t?"":mx(t),d=e,xx&&"dotAll"in Ux&&(i=!!t&&Nx(t,"s")>-1)&&(t=Rx(t,/s/g,"")),n=t,Vx&&"sticky"in Ux&&(r=!!t&&Nx(t,"y")>-1)&&zx&&(t=Rx(t,/y/g,"")),Ox&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],a={},s=!1,l=!1,c=0,u="";i<=n;i++){if("\\"===(t=Mx(e,i)))t+=Mx(e,++i);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:Ax(Bx,jx(e,i+1))&&(i+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||Sx(a,u))throw new Dx("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:r+=t}return[r,o]}(e),e=o[0],h=o[1]),a=fx(Lx(e,t),l?this:Ix,Wx),(i||r||h.length)&&(s=Cx(a),i&&(s.dotAll=!0,s.raw=Wx(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=Mx(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+Mx(e,++i);return r}(e),n)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{px(a,"source",""===d?"(?:)":d)}catch(hV){}return a},Kx=gx(Lx),$x=0;Kx.length>$x;)kx(Wx,Lx,Kx[$x++]);Ix.constructor=Wx,Wx.prototype=Ix,wx(ux,"RegExp",Wx,{constructor:!0})}Ex("RegExp");var Yx="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function qx(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,n=0;n<e.length;n++){var i=e[n].end,r=e[n].begin;Number.isNaN(Number(i))||Number.isNaN(Number(r))||r<0||i<0||i<r||(t+=e[n].end-e[n].begin)}return t=parseInt(1e3*t,10)}function Xx(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n}function Jx(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var n=e.split(": "),i=n.shift(),r=n.join(": ");t[i]=r}))}catch(hV){return t}return t}function Zx(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];Yx&&(t=console).log.apply(t,["[logger]",e].concat(i))}function Qx(){try{return Math.round(window.performance.now())}catch(hV){return(new Date).getTime()}}function eO(){return(new Date).getTime()}function tO(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,i){try{e||i(new Error("url is undefined"));var r=Qx(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=Jx(s),a.connectTime=Qx()-o,a.status=s.status,a.statusText=s.statusText,r=Qx())},s.onload=function(){n(a)},s.onprogress=function(e){var t,n=Qx()-r;t=parseInt(e.loaded/1e3/(n/1e3),10),a.speed=0|t,a.costTime=n},s.onerror=function(){a.status||(a.status=-1,a.costTime=Qx()-r),i(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=Qx()-r),n(a)},s.onabort=function(){n(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(Hl){i(Hl)}}))}function nO(e){return!e||window.location.href.indexOf(e)>-1}function iO(e){return!!e&&/^blob:/.test(e)}var rO={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function oO(e){if(!e)return{};var t={};return Object.keys(rO).map((function(n){if(e[n]||"string"!=typeof rO[n]){if(!e[n]&&rO[n]instanceof Array){var i=rO[n].filter((function(t){return void 0!==e[t]}));i.length>0?t[n]=e[i[0]]:t[n]=""}}else t[n]=e[rO[n]]||""})),t}function aO(e,t){return e&&("string"==typeof t||"number"==typeof t)?"".concat(e," ").concat(t):t}function sO(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function lO(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(Hl){var n=e.className&&"object"===Tu(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function cO(e){return"String"===sO(e)?e.replace("P","p"):e?"Number"===sO(e)?"".concat(e):void 0:""}function uO(e){try{return JSON.stringify(e)}catch(Hl){return""}}var hO=0,dO=1,fO=2;function pO(e){if(!e||"String"!==sO(e))return 0;var t=0;try{var n=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),i=e.match(n);if(null!==i)t=parseInt(i[2],10);else{var r=e.split("/");r.length>5&&8===r[4].length&&(t=parseInt(r[4],16))}return t>0?t<parseInt((new Date).getTime()/1e3,10)?dO:fO:hO}catch(Hl){return hO}}var gO=[];function vO(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var n=gO||[],i=function(i){if(n[i].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(n[i][e])})),t.url=n[i].name,t.duration=Math.round(n[i].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},r=n.length-1;r>=0;r--){if("break"===i(r))break}return t}catch(Hl){return t}}"undefined"!=typeof window&&function(){try{new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");gO.length>30&&gO.splice(0,gO.length-30);for(var n=0;n<t.length;n++)gO.push(t[n])})).observe({entryTypes:["resource"]})}catch(Hl){console.warn("PerformanceObserver not support",Hl)}}();var yO="videoplayer_oneplay",mO="videoplayer_oneopera",_O="videoplayer_oneerror",bO="videoplayer_oneevent",kO="videoplayer_onetemp",wO={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},TO={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},SO=0,CO=1,EO=2,xO=3,OO=4,PO=0,LO=1,IO=2,DO=3,AO=1,MO=2,RO=3,NO=4,jO=5,BO=6,UO=7,HO="error_retry",FO="oneerror",VO="oneevent",zO="onetemp",GO=0,WO=1,KO=432e5,$O=36e5,YO=["tag","subtag","device_type"],qO={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var XO=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(Hl){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(Hl){return!0}}()?window.localStorage:{},JO="__xgplayerlogkey",ZO={set:function(e){try{var t=this.get();t.push(e),XO.setItem(JO,JSON.stringify(t))}catch(hV){}},get:function(){try{var e=XO.getItem(JO);return e=e?JSON.parse(e):[]}catch(hV){return[]}},remove:function(){try{XO.removeItem(JO)}catch(hV){}},clear:function(){try{XO.clear()}catch(hV){}}},QO={},eP=Qu,tP=hh,nP=xp.f,iP=wE,rP="object"==("undefined"==typeof window?"undefined":i(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];QO.f=function(e){return rP&&"Window"==eP(e)?function(e){try{return nP(e)}catch(hV){return iP(rP)}}(e):nP(tP(e))};var oP={},aP=Pd;oP.f=aP;var sP=qy,lP=pd,cP=oP,uP=nf.f,hP=ju,dP=wh,fP=Pd,pP=Ep,gP=Pg,vP=Lu,yP=ju,mP=qu,_P=Au,bP=Rh,kP=Du,wP=pd,TP=Th,SP=lf,CP=hh,EP=Hd,xP=ty,OP=Gu,PP=FS,LP=Xv,IP=xp,DP=QO,AP=tg,MP=Iu,RP=nf,NP=bS,jP=Bu,BP=Ep,UP=qm,HP=td.exports,FP=Gf,VP=_d,zP=Pd,GP=oP,WP=function(e){var t=sP.Symbol||(sP.Symbol={});lP(t,e)||uP(t,e,{value:cP.f(e)})},KP=function(){var e=dP("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=fP("toPrimitive");t&&!t[i]&&pP(t,i,(function(e){return hP(n,this)}),{arity:1})},$P=y_,YP=rp,qP=Kv.forEach,XP=zf("hidden"),JP="Symbol",ZP=YP.set,QP=YP.getterFor(JP),eL=Object.prototype,tL=vP.Symbol,nL=tL&&tL.prototype,iL=vP.TypeError,rL=vP.QObject,oL=MP.f,aL=RP.f,sL=DP.f,lL=jP.f,cL=mP([].push),uL=HP("symbols"),hL=HP("op-symbols"),dL=HP("wks"),fL=!rL||!rL.prototype||!rL.prototype.findChild,pL=_P&&kP((function(){return 7!=PP(aL({},"a",{get:function(){return aL(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=oL(eL,t);i&&delete eL[t],aL(e,t,n),i&&e!==eL&&aL(eL,t,i)}:aL,gL=function(e,t){var n=uL[e]=PP(nL);return ZP(n,{type:JP,tag:e,description:t}),_P||(n.description=t),n},vL=function(e,t,n){e===eL&&vL(hL,t,n),SP(e);var i=EP(t);return SP(n),wP(uL,i)?(n.enumerable?(wP(e,XP)&&e[XP][i]&&(e[XP][i]=!1),n=PP(n,{enumerable:OP(0,!1)})):(wP(e,XP)||aL(e,XP,OP(1,{})),e[XP][i]=!0),pL(e,i,n)):aL(e,i,n)},yL=function(e,t){SP(e);var n=CP(t),i=LP(n).concat(kL(n));return qP(i,(function(t){_P&&!yP(mL,n,t)||vL(e,t,n[t])})),e},mL=function(e){var t=EP(e),n=yP(lL,this,t);return!(this===eL&&wP(uL,t)&&!wP(hL,t))&&(!(n||!wP(this,t)||!wP(uL,t)||wP(this,XP)&&this[XP][t])||n)},_L=function(e,t){var n=CP(e),i=EP(t);if(n!==eL||!wP(uL,i)||wP(hL,i)){var r=oL(n,i);return!r||!wP(uL,i)||wP(n,XP)&&n[XP][i]||(r.enumerable=!0),r}},bL=function(e){var t=sL(CP(e)),n=[];return qP(t,(function(e){wP(uL,e)||wP(FP,e)||cL(n,e)})),n},kL=function(e){var t=e===eL,n=sL(t?hL:CP(e)),i=[];return qP(n,(function(e){!wP(uL,e)||t&&!wP(eL,e)||cL(i,uL[e])})),i};bP||(tL=function(){if(TP(nL,this))throw iL("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?xP(arguments[0]):void 0,t=VP(e),n=function e(n){this===eL&&yP(e,hL,n),wP(this,XP)&&wP(this[XP],t)&&(this[XP][t]=!1),pL(this,t,OP(1,n))};return _P&&fL&&pL(eL,t,{configurable:!0,set:n}),gL(t,e)},BP(nL=tL.prototype,"toString",(function(){return QP(this).tag})),BP(tL,"withoutSetter",(function(e){return gL(VP(e),e)})),jP.f=mL,RP.f=vL,NP.f=yL,MP.f=_L,IP.f=DP.f=bL,AP.f=kL,GP.f=function(e){return gL(zP(e),e)},_P&&(UP(nL,"description",{configurable:!0,get:function(){return QP(this).description}}),BP(eL,"propertyIsEnumerable",mL,{unsafe:!0}))),gP({global:!0,constructor:!0,wrap:!0,forced:!bP,sham:!bP},{Symbol:tL}),qP(LP(dL),(function(e){WP(e)})),gP({target:JP,stat:!0,forced:!bP},{useSetter:function(){fL=!0},useSimple:function(){fL=!1}}),gP({target:"Object",stat:!0,forced:!bP,sham:!_P},{create:function(e,t){return void 0===t?PP(e):yL(PP(e),t)},defineProperty:vL,defineProperties:yL,getOwnPropertyDescriptor:_L}),gP({target:"Object",stat:!0,forced:!bP},{getOwnPropertyNames:bL}),KP(),$P(tL,JP),FP[XP]=!0;var wL=Rh&&!!Symbol.for&&!!Symbol.keyFor,TL=Pg,SL=wh,CL=pd,EL=ty,xL=td.exports,OL=wL,PL=xL("string-to-symbol-registry"),LL=xL("symbol-to-string-registry");TL({target:"Symbol",stat:!0,forced:!OL},{for:function(e){var t=EL(e);if(CL(PL,t))return PL[t];var n=SL("Symbol")(t);return PL[t]=n,LL[n]=t,n}});var IL=Pg,DL=pd,AL=Fh,ML=zh,RL=wL,NL=(0,td.exports)("symbol-to-string-registry");IL({target:"Symbol",stat:!0,forced:!RL},{keyFor:function(e){if(!AL(e))throw TypeError(ML(e)+" is not a symbol");if(DL(NL,e))return NL[e]}});var jL=Ig,BL=gh,UL=Qu,HL=ty,FL=qu([].push),VL=Pg,zL=wh,GL=B_,WL=ju,KL=qu,$L=Du,YL=gh,qL=Fh,XL=H_,JL=function(e){if(BL(e))return e;if(jL(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?FL(n,r):"number"!=typeof r&&"Number"!=UL(r)&&"String"!=UL(r)||FL(n,HL(r))}var o=n.length,a=!0;return function(e,t){if(a)return a=!1,t;if(jL(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},ZL=Rh,QL=String,eI=zL("JSON","stringify"),tI=KL(/./.exec),nI=KL("".charAt),iI=KL("".charCodeAt),rI=KL("".replace),oI=KL(1..toString),aI=/[\uD800-\uDFFF]/g,sI=/^[\uD800-\uDBFF]$/,lI=/^[\uDC00-\uDFFF]$/,cI=!ZL||$L((function(){var e=zL("Symbol")();return"[null]"!=eI([e])||"{}"!=eI({a:e})||"{}"!=eI(Object(e))})),uI=$L((function(){return'"\\udf06\\ud834"'!==eI("\udf06\ud834")||'"\\udead"'!==eI("\udead")})),hI=function(e,t){var n=XL(arguments),i=JL(t);if(YL(i)||void 0!==e&&!qL(e))return n[1]=function(e,t){if(YL(i)&&(t=WL(i,this,QL(e),t)),!qL(t))return t},GL(eI,null,n)},dI=function(e,t,n){var i=nI(n,t-1),r=nI(n,t+1);return tI(sI,e)&&!tI(lI,r)||tI(lI,e)&&!tI(sI,i)?"\\u"+oI(iI(e,0),16):e};eI&&VL({target:"JSON",stat:!0,arity:3,forced:cI||uI},{stringify:function(e,t,n){var i=XL(arguments),r=GL(cI?hI:eI,null,i);return uI&&"string"==typeof r?rI(r,aI,dI):r}});var fI=tg,pI=hd;Pg({target:"Object",stat:!0,forced:!Rh||Du((function(){fI.f(1)}))},{getOwnPropertySymbols:function(e){var t=fI.f;return t?t(pI(e)):[]}});var gI=Pg,vI=Au,yI=qu,mI=pd,_I=gh,bI=Th,kI=ty,wI=qm,TI=dg,SI=Lu.Symbol,CI=SI&&SI.prototype;if(vI&&_I(SI)&&(!("description"in CI)||void 0!==SI().description)){var EI={},xI=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:kI(arguments[0]),t=bI(CI,this)?new SI(e):void 0===e?SI():SI(e);return""===e&&(EI[t]=!0),t};TI(xI,SI),xI.prototype=CI,CI.constructor=xI;var OI="Symbol(test)"==String(SI("test")),PI=yI(CI.valueOf),LI=yI(CI.toString),II=/^Symbol\((.*)\)[^)]+$/,DI=yI("".replace),AI=yI("".slice);wI(CI,"description",{configurable:!0,get:function(){var e=PI(this);if(mI(EI,e))return"";var t=LI(e),n=OI?AI(t,7,-1):DI(t,II,"$1");return""===n?void 0:n}}),gI({global:!0,constructor:!0,forced:!0},{Symbol:xI})}var MI=[{key:"QQBrowser",reg:/(qqbrowser)\/([\d.]+)/},{key:"QIHU360EE",reg:/qihu 360ee/},{key:"QIHU360SE",reg:/qihu 360se/},{key:"2345Explorer",reg:/(2345explorer)\/([\d.]+)/},{key:"Sogou",reg:/(metasr)/},{key:"Wexin",reg:/(micromessenger)\/([\d.]+)/},{key:"Openlanguage",reg:/(openlanguage)\/([\d.]+)/},{key:"NewsArticle",reg:/(newsarticle)\/([\d.]+)/},{key:"VideoArticle",reg:/(videoarticle)\/([\d.]+)/},{key:"Hotsoon",reg:/(live_stream)_([\d.]+)/},{key:"Aweme",reg:/(aweme)_([\d.]+)/},{key:"Lark",reg:/(lark)\/([\d.]+)/},{key:"PlayStation",reg:/(playstation)/},{key:"BingPreview",reg:/(bingpreview)\/([\d.]+)/},{key:"Baiduspider",reg:/(baiduspider-render)\/([\d.]+)/},{key:"YandexBot",reg:/(yandexbot)\/([\d.]+)/},{key:"Chrome",reg:/(chrome)\/([\d.]+)/},{key:"Safari",reg:/(version)\/([\d.]+)\s*(safari)/}],RI=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}];function NI(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"].map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),e):(t=null,e)}var jI=["Baiduspider","YandexBot"];function BI(e,t){var n=!1;return jI.map((function(t){t===e&&(n=!0)})),/spider/.test(t)&&(n=!0),n}function UI(){var e=navigator.mimeTypes;if(e){for(var t=0;t<e.length;t++){if(e[t].type&&e[t].type.indexOf("360")>-1)return!0;if(e[t].type&&e[t].type.indexOf("application/vnd.chromium.remoting-viewer")>-1)return!0;if(e[t].description&&e[t].description.indexOf("360")>-1)return!0}return!1}}var HI="undefined"!=typeof navigator&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=e.toLocaleLowerCase();var t=/(iphone)/.test(e)||/(ipad)/.test(e),n=/(android)/.test(e),i=/(windows phone)/.test(e),r=t||n||i,o={isIOS:t,isAndroid:n,isMobile:r,isPC:!r,isPad:/(ipad)/.test(e)},a=NI();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=MI;/trident/.test(e)&&(u=RI);for(var h=0;h<u.length;h++)if(c=u[h].reg.exec(e)){s=u[h].key,l=c.length>2?c[2]:"";break}if(s)o["is".concat(s)]=!0,o.name=s,o.appVersion=l;else{var d=UI();d&&(o.name="360EE")}if(o.name&&"Trident"!==o.name){var f=/(trident)/.exec(e);f&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident")}return o.isSpider=BI(o.name,e),o}(navigator.userAgent);var FI=[1,1,1,1,1];function VI(){return parseInt(FI.join(""),10)}FI[0]=HI.isSupportMP4?FI[1]+1:FI[1],FI[1]="undefined"!=typeof MediaSource&&MediaSource.isTypeSupported&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))?FI[1]+1:FI[1],function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(Hl){return Promise.resolve(t)}}({type:"file",video:{contentType:'video/mp4;codecs="hev1.1.6.L120.90"',width:1920,height:1080,bitrate:1e4,framerate:30}}).then((function(e){e&&e.supported?FI[2]=FI[2]+1:FI[2]=1})).catch((function(){FI[2]=FI[2]-1}));var zI={range:"0-1048576",timer:6e4,timeout:15e3},GI=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Su(this,e),Object.keys(zI).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=zI[e])})),this.options=t,this._headers={},this.intervalId=null,this.ishangUp=!1,this._data={contentLength:0,statusText:"",status:-1,speed:0,costTime:0,connectTime:0,contentType:""},this.url=[]}return Eu(e,[{key:"setData",value:function(e){var t=this;if(Object.keys(e).map((function(n){"headers"!==n&&(t._data[n]=e[n])})),e.headers&&Object.keys(e.headers).length>0){this._headers=oO(e.headers),e.headers["content-type"]&&(this._data.contentType=e.headers["content-type"]);var n=(e.headers["content-range"]||"").split("/");n&&n.length>1&&(this._data.contentLength=parseInt(n[1]))}}},{key:"contentLength",get:function(){return this._data.length||0}},{key:"trigger",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",i=this.options;this.url=e,!this.url||"start"!==n&&(this.ishangUp||this.intervalId)?Zx("task>>cant`t trigger url",this.ishangUp,this.intervalId):(Zx("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===n?500:i.timer),tO(this.url,{range:"start"===n?"0-1024":i.range,timeout:i.timeout}).then((function(e){Zx("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){Zx("getXhr>>error ",e),t.ishangUp=!1,t._data.status=-1})))}},{key:"url",get:function(){return this.options.url},set:function(e){e&&(this.options.url=e)}},{key:"serverIp",get:function(){return this._headers.x_response_sinfo||""}},{key:"headers",get:function(){return this._headers||{}}},{key:"status",get:function(){return this._data.status||-1}},{key:"speed",get:function(){return this._data.speed}},{key:"clear",value:function(){clearTimeout(this.intervalId),this.intervalId=null}}]),e}();const WI="0.11.30";Zx("xgVodLogger version is ".concat(WI));var KI,$I=(KI="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(KI,"]")}),YI=1300,qI="__tea_cache_tokens_".concat(YI),XI=-1,JI="",ZI=null,QI=function(){function e(t,n){var i=this;if(Su(this,e),xu(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===sO(e)?e:"";"String"!==sO(t)&&(t=""),i.urlLog={initial_url:t,initial_host:Xx(t),initial_ip:""}})),xu(this,"onXgLogCache",(function(){var e,t=i._getLogCache();t&&(i._templog={vtype:null===(e=i.player)||void 0===e?void 0:e.vtype,log:t},i.onOneTemp())})),xu(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),i.onOneEvent({end_type:"degrade"},e))})),xu(this,"onMediaFormatError",(function(e){i.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),xu(this,"onDrmTypeChange",(function(e){i.addIfExist("drm_type",{drm_type:e},i._options)})),xu(this,"onReplayBtnClick",(function(){i.resetLoggerParams()})),xu(this,"onBeforeDefinitionChange",(function(){i.resLogs.ldst=Qx(),i._endType="switch"})),xu(this,"onDefinitionChange",(function(e){var t=e.from,n=e.to;i.changeResolution({from:t,to:n,startTime:i.resLogs.ldst,operaType:"switch"}),Zx("onDefinitionChange from:".concat(t,", to:").concat(n))})),xu(this,"onDefiChangeSuccess",(function(){Zx("onDefinitionChangeSuccess"),i.updateVideoSize(),i.triggerTask("start")})),xu(this,"onAbrChange",(function(e){var t=e.prev,n=e.cur,r=e.abrInfo;if(i.player.abrInstance){var o=i.player.abrInstance.eventInfo;Zx("abrChange",o),o.last_definition=t,o.now_definition=n,i.abrInfo.abr_event_info.video_switch.push(o),i.changeResolution({from:t,to:n,startTime:Qx(),operaType:"abr_switch",abrInfo:r})}})),xu(this,"onAbrPrestallEnd",(function(e){i.abrInfo.abr_user_info.cancel_abr=e?1:0})),xu(this,"onTimeUpdate",(function(){var e=i.playlogs,t=i.resLogs,n=i.player;if(i.errorLog.try_err_c=0,e.vt||1!==i.startStep||(e.vt=eO(),Zx("onTimeUpdate: first frame inited","currentTime11:".concat(n.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),i.startStep=2),!t.initial_resolution){var r=n.currentDefitionFromPler&&n.currentDefitionFromPlayer.definition?n.currentDefitionFromPlayer.definition:n.config.defaultDefinition||"".concat(n.video.videoHeight,"p")||"";r=cO(r),t.initial_resolution=r}t.final_resolution||(t.final_resolution=t.initial_resolution);var o=e.played.length;o<1?e.played.push({begin:n.currentTime,end:-1}):e.played[o-1].end=n.currentTime;var a=t.played.length;a<1?t.played.push({begin:n.currentTime,end:-1}):t.played[a-1].end=n.currentTime,i.lastVideoTime=n.currentTime||0})),xu(this,"onVideoProgress",(function(){i.updateBuffers()})),xu(this,"onCanplay",(function(){Zx("onCanplay","this.startStep:".concat(i.startStep," ").concat(eO())),i.setVt()})),xu(this,"onLoadeddata",(function(){Zx("onLoadeddata","this.startStep:".concat(i.startStep," ").concat(eO())),i.setVt(),i.updateVideoSize()})),xu(this,"onLoadStart",(function(){i.commonParams.web_url=location.href;var e=nO(i.player.currentSrc);i.triggerTask("start"),Zx("onLoadStart","this.startStep:".concat(i.startStep," ").concat(eO()," isSrcEmpty:").concat(e," player.src:").concat(i.player.src)),0!==i.startStep||e||"visible"!==document.visibilityState||i.setPt()})),xu(this,"onDashStateChange",(function(e){Zx("onDashStateChange","this.startStep:".concat(i.startStep," ").concat(Qx()," state:").concat(e));var t=i.playlogs;if(i.startStep<2)switch(e){case"player_start":t.dash_pst=Qx();break;case"wasm_start":t.dash_wst=Qx();break;case"wasm_ready":t.dash_wrt=Qx();break;case"init_finished":t.dash_ift=Qx();break;case"core_start":t.dash_cst=Qx();break;case"start_play":t.dash_spt=Qx()}})),xu(this,"onBufferedChange",(function(){var e=i.player.video&&i.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>i.player.duration&&(i.bft=eO())}})),xu(this,"onPlayerInited",(function(){Zx("player init"),i._playerCreatedTime=eO(),i.playlogs.rt=eO()})),xu(this,"onNotAutoPlay",(function(){Zx("onNotAutoPlay","autoplay:".concat(i.isAutoplay)),0===i.isAutoplay?i.isAutoplay=2:1===i.isAutoplay&&(i.isAutoplay=3)})),xu(this,"onDashError",(function(e){e=e||{};var t=i.errorLog;t.last_errors.push(e.errorCode),t.accu_errc++,i.onOneError({errorType:e.errorTypeCode,code:e.errorCode,url:e.url||"",headers:e.headers||{}},0)})),xu(this,"onPlayerError",(function(e){e=e||{};var t=i.errorLog,n=i.player;if(Zx("onPlayerError","this.player.type:".concat(i.player.type," this.player.replayRunning:").concat(i.player.replayRunning," isSupportMP4:").concat(HI.isSupportMP4," isPC:").concat(HI.isPC)),Zx("onPlayerError",e),i.load_state=DO,i._endType="error",i.suspendWaitingStatus("onPlayerError"),"dash"!==n.type||!n.replayRunning){if(e.url||(e.url=i.player.currentSrc),HI.isPC&&!HI.isSupportMP4||HI.isSpider)return t.errc=TO[5],t.errt=wO.notSupport,i.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(i._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&wO[e.errorType]?wO[e.errorType]:9999),e.errorCode?t.errc=e.errorCode>0&&TO[e.errorCode]?TO[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&TO[e.code]?TO[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),i.onOnePlay(AO),i.onOneTemp(AO),i.sendDegradeLog("playCatch_end",i.playlogs.degrade);var r=!1,o=e.mediaError;o&&i._options.needXhrCheck&&(4===o.code||2===o)&&(r=!0),i.onOneError({endState:UO,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),i.sendEventsQueue()}})),xu(this,"onPlayInterfaceInfo",(function(e){Zx("onPlayInterfaceInfo",e);var t=i.errorLog,n=i.apiLog,r=i.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?n.vsc=e[t]:"message"===t?n.vsc_message=e.message||"success,视频可正常播放":n[t]=e[t]})),r.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(n.vsc=e.code||10,n.vsc_message=e.message||"success,视频可正常播放",e.error)){var o=e.error;t.errt=1e3,t.errc=o.errc||-9998,t.last_errors.push(o.errc||-9998),0===t.fir_errc&&(t.fir_errc=o.errc||-9998),t.accu_errc++,1===t.accu_errc&&(t.fir_errt=Qx()),i.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),xu(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i.netLog;if(e.speed){var n=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=n,t.totalSpeed+=n,t.rqCount++}"oversize"!==e.type&&t.requestCount++,e.connectTime&&(t.connectCost=e.connectTime);var r=t.rqCount<7?100:e.costTime>=5e3?20:10;if(!("success"===e.type&&parseInt(100*Math.random(),10)<=r)){var o=vO(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=Jx(a));var c=wu(wu({},l=oO(l)),{},{download_speed:t.downloadSpeed,connect_cost:t.connectCost,c_dur:o.connectDuration||0,d_dur:o.domainDuration||0,r_dur:o.duration||0,rqtt:(new Date).getTime(),x_cache:l.x_response_cache||"",server_ip:l.x_response_sinfo});e.status?t.status=e.status:a&&a instanceof window.XMLHttpRequest&&(t.status=a.status||0),c.status=t.status;var u=e.cdnUrl||e.url;"error"===e.type&&i.merror.cdn.push(wu(wu({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:Xx(u)},c),l)),i.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:Xx(u)},c,"error"===e.type?0:2)}})),xu(this,"onNext",(function(){if(Zx("onNext:startStep:",i.startStep),i.startStep>0){if(i._reportInvalidVV(MO))return;i.onOnePlay(MO),i.onOneTemp(MO),i.sendEventsQueue()}i.vtype=null,i.playlogs.lc=0,i.resetLoggerParams()})),xu(this,"onNextEnded",(function(){var e=i.player,t=i.resLogs,n=cO(e.config.defaultDefinition||"");t.initial_resolution=n,t.final_resolution=n})),xu(this,"onXgLogWaiting",(function(e){var t=i.playlogs,n=i.resLogs,r=i.stall;if(i._options.checkByInnerLog&&0===e.type){Zx("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:i.realSpeed,avg_speed:i.avgSpeed,mse_op:i.mp4MseOpLength,mp4_load_range:i.mp4LoadSegmentTimeRange,bitrate:i.curBitrate};if("waitingStart"===e.eventType)return i.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void i.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=Qx();Zx("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),i.appendStallInfo("end",c,o),t.bc++,i.checkInBuffer(i.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),n.bc++,t.bu_acu_t+=a,n.bu_acu_t+=a,r.end=i.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=i.cur_play_pos),i.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),xu(this,"onSeeking",(function(){if(!nO(i.player.src)){var e=i.resLogs,t=i.playlogs,n=i.player,r=i.seekLog;Zx("onSeeking","currentTime:".concat(n.currentTime)),0===i.startStep&&i.setPt(),i.suspendWaitingStatus("seek"),i.isSeeking&&i.suspendSeekStatus("seek",!1),i.isSeeking=!0,t.played.push({begin:i.player.currentTime,end:-1}),e.played.push({begin:i.player.currentTime,end:-1}),r.lastSeekStartTime=Qx(),r.seekBefore=i.lastVideoTime.toString(),r.intervalId=setTimeout((function(){i.isSeeking&&i.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),xu(this,"onSeeked",(function(){nO(i.player.src)||i.isSeeking&&i.suspendSeekStatus("seeked",!0)})),xu(this,"onPlaying",(function(){i.suspendWaitingStatus("play"),i.load_state=LO;var e=Qx();i.pauseLog.isPausing&&(i.pauseLog.isPausing=!1,i.pauseLog.pause_acu_t+=e-i.pauseLog.pause_start)})),xu(this,"onPlayCatch",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0};if(Zx("onPlayCatch",e,t),e){switch(e){case"mp42dash":i.vtype="DASH_2";break;case"dash2mp4":i.vtype="MP4_2";break;case"dash1mp4":i.vtype="MP4_1";break;default:i.vtype=e}var n=i.errorLog,r=i.playlogs,o=i.merror;o.playCatch.push(wu({errc:t.errorCode,errt:t.errorType},t.headers)),i.setBr("playcatch"),n.accu_errc++,n.try_err_c++,n.fir_errc=t.errorCode,t.errorCode&&n.last_errors.push(t.errorCode),i.suspendWaitingStatus("playcatch"),i.sendDegradeLog("playCatch",r.degrade,{cdn_url:t.url}),r.degrade=e,i.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||i.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:BO,costTime:t.costTime,message:t.errorMessage||t.message},0)}})),xu(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=i.errorLog,n=i.playlogs;Zx("onMediaExpied",e),i.suspendWaitingStatus("expied"),i.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),n.at=(new Date).getTime(),i.merror.expied.push(wu({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},oO(e.headers||{}))),i.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),xu(this,"onLog",(function(e){Zx("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case HO:break;case zO:i._templog||(i._templog={}),i._templog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(i){e[i]="append"===n?aO(e[i],t[i]):t[i]})),e}(i._templog,e.data,e.action),i._templog.preload_hit&&(i._cacheFile=WO);break;case FO:var n=i.errorLog;n.accu_errc++,n.try_err_c++,i.setBr("mp4error"),n.last_errors.push(e.code),i.onOneError(e,0);break;case VO:var r=function(e,t){var n={ext:e.ext||{},data:{}};return Object.keys(e).map((function(i){t[i]?n.data[t[i]]=e[i]:"ext"!==i&&(n.ext[i]=e[i])})),n}(e,{costTime:"costTime",vid:"vid",end_type:"end_type",pos:"cur_play_pos",cdnUrl:"cdn_url"});r.ext&&["start","end"].map((function(e){r.ext[e]&&(r.ext["ext_".concat(e)]=r.ext[e],delete r.ext[e])})),i.onOneEvent(r.data,r.ext,2)}})),xu(this,"onPlay",(function(){Zx("onPlay","this.startStep :".concat(i.startStep," this.isEnded:").concat(i.isEnded)),i.isEnded&&(i.resetLoggerParams(),i.setPt())})),xu(this,"onPause",(function(){Zx("onPause");var e=i.pauseLog;e.isPausing=!0,e.pause_start=Qx()})),xu(this,"onWaiting",(function(){var e=i._options;i.updateCurBuffer("onWaiting"),e.checkByInnerLog||(Zx("onWaiting>","isSeeking:".concat(i.isSeeking," startStep:").concat(i.startStep," intervalId:").concat(i.stallIntervalId)),i.isSeeking||0===i.playlogs.vt||i.inWaitingStart>0||(i.stallIntervalId&&(window.clearTimeout(i.stallIntervalId),i.stallIntervalId=null),i.inWaitingStart=Qx(),i.waitStartTime=i.cur_play_pos,i.stallIntervalId=window.setTimeout((function(){var e=i.stall;Zx("this.stallIntervalId>>".concat(i.stallIntervalId," cost: ").concat(Qx()-i.inWaitingStart)),i._endType="wait",i.load_state=IO,i.vtype.indexOf("MP4")>-1&&i.player.currentTime>10&&i.task&&(i.triggerTask("waiting",i.initial_url),i.requestCount++),e.start=i.waitStartTime,e.bc++,1===e.bc&&(e.startf=i.waitStartTime),window.clearTimeout(i.stallIntervalId),i.stallIntervalId=null,i.startWaitingStatus(i.inWaitingStart,Qx()-i.inWaitingStart),i.stallIntervalId=setTimeout((function(){i.inWaitingStart>0&&i.suspendWaitingStatus("timeout")}),6e4)}),200)))})),xu(this,"onEnded",(function(){if(i.initial_url){Zx("onEnded","watchDur:".concat(i.watchDur," vt:").concat(i.vt," pt:").concat(i.pt)),i.isEnded=!0;var e=i.resLogs.df;i.changeResolution({from:e,to:e,startTime:Qx(),operaType:"leave_switch",endType:"ended"}),i.onOnePlay(RO),i.sendDegradeLog("playCatch_end",i.playlogs.degrade),i.onOneTemp(RO),i.sendEventsQueue(),i.playlogs.lc++}})),xu(this,"onUnload",(function(){0!==i.startStep&&i.initial_url&&(i.onOneTemp(NO),i.sendDegradeLog("playCatch_end",i.playlogs.degrade),i._reportInvalidVV(NO)||i.onOnePlay(NO,!0))})),xu(this,"onVisibilitychange",(function(){var e=i.playlogs.vt;"visible"===document.visibilityState&&(e||i.setPt())})),xu(this,"onDestroy",(function(){Zx("onDestroy:this.startStep:".concat(i.startStep," initial_url:").concat(i.initial_url," ").concat(!!i.initial_url)),i.onOnePlay(jO),i.startStep>0&&i.initial_url&&(i.onOneTemp(jO),i.sendDegradeLog("playCatch_end",i.playlogs.degrade));var e=i.resLogs.df;i.changeResolution({from:e,to:e,startTime:Qx(),operaType:"leave_switch",endType:"destroy"}),i.sendEventsQueue(),HI.isPC?window.removeEventListener("beforeunload",i.onUnload):(HI.isMobile||HI.isPad)&&window.removeEventListener("pagehide",i.onUnload),document.removeEventListener("visibilitychange",i.onVisibilitychange),i.listeners.forEach((function(e){i.player.off(e.evt,e.handler)})),i.clearTimers(),i.player.off("destroy",i.onDestroy),i.task&&i.task.clear()})),xu(this,"onOnePlay",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Zx("onOnePlay _isOnePlayReport:".concat(i._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!i._isOnePlayReport){var n=i.errorLog,r=i.playlogs,o=i.abrInfo,a=i.resLogs,s=i.player,l=i.apiLog,c=i.pauseLog,u=i.stall,h=i.netLog,d=i.watchDur;i._isOnePlayReport=!0;var f=eO(),p=i.getBufferTime(s),g=i.getFrameInfo(),v=i.getPerformance(),y=n.errc;i.setExt();var m=wu(wu(wu(wu({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:i.vid,initial_url:i.initial_url,initial_host:i.initial_host,initial_ip:i.curHeaders.x_response_sinfo||0,initial_type:i.initial_type},i.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:i.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||eO(),vt:i.vt,lt:i.lt,lpt:i.lpt,fvt:i.fvt,nvt:i.nvt,bft:i.bft,sc:i.seekLog.sc,sat:i.seekLog.sat,bc:i.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:i.videoNetworkState,status:i.curStatus,first_buf_startt:u.startf,first_buf_endt:u.endf,lc:r.lc,bu_acu_t:i.bu_acu_t>KO?0:i.bu_acu_t,de_bu_acu_t:r.de_bu_acu_t||0,n_bu_acu_t:r.n_bu_acu_t||0,pause_acu_t:c.pause_acu_t,cur_play_pos:i.cur_play_pos,load_state:i.load_state,play_speed:i.playbackRate,playback_state:i.playback_state,end_state:e,watch_dur:d>KO?0:d,switch_resolution_c:i.switchResolutionCount,is_start_play_automatically:i.isAutoplay,start_time:i.start_time,finish:i.finish,errt:n.errt,errc:y,vsc:l.vsc,vsc_message:l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:i.videoWidth,height:i.videoHeight,vd:i.vd,video_length:parseInt(p.video,10),audio_length:parseInt(p.audio,10),df:i.resolution,lf:a.lf,play_c:0,player_created_t:i.player_created_t,fir_errt:n.fir_errt,fir_errc:n.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:i.mute,volume:i.volume,download_speed:i.realSpeed?i.realSpeed:i.task&&i.task.speed?i.task.speed:h.downloadSpeed,avg_speed:i.avgSpeed?i.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:i.curBitrate,preload_state:i.preloadState,preload_hit:i.preLoadData.hit||0,preload_cached:i.preLoadData.duration||i.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:i.watingCost,br:r.br,fbrt:r.fbrt,try_err_c:n.try_err_c,accu_errc:n.accu_errc,dash_pst:i.dash_pst,dash_wst:i.dash_wst,dash_wrt:i.dash_wrt,dash_ift:i.dash_ift,dash_cst:i.dash_cst,dash_spt:i.dash_spt,dash_break:2===s.dashBufferBreak?1:0,merror:uO(i.merror),ex:uO(i.exInfo),perf:uO(v),bufs:uO(i.buffers.allBuffer),vs:a.vs,vds:a.vds,vps:a.vps},i.buffers.curBuffer),{},{degrade:r.degrade,cache_file:i._cacheFile},g),{},{fullScreen:i._getFullScreenType()});0!==i.vt&&(m.et=f);var _=i._logstrcache||i._getLogCache();if(0===m.fvt&&_&&(m.log=_,i._logstrcache=null),null!=s&&s.softDecoder&&(m.soft_decoder=s.softDecoder),s&&s.dashState&&(m.dash_state=s.dashState),s.abrInstance){var b=s.abrInstance;if(i.updateAbrInfo(o,b,s.playbackRate),b.getAbrVVStats){var k=b.getAbrVVStats();Object.keys(k).forEach((function(e){m[e]=k[e]}))}}if(o.abr_init_opts=s.config.autoBitrateOpts||{},m.abr_info=uO(i.abrInfo),t){var w=!i._options.disableLocalCache;i.reportLog(yO,m,w?1:0)}else i.reportLog(yO,m)}})),xu(this,"onOneEvent",(function(e){var t=e.costTime,n=e.vid,r=e.end_type,o=e.cur_play_pos,a=e.cdn_url,s=e.cdn_host,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;Zx("onOneEvent",r);var u=i.buffers,h=u.curBuffer,d=u.allBuffer,f=i.getFrameInfo(),p=wu(wu({local_time:(new Date).getTime(),v:n||i.vid,cost_time:t,end_type:r||i.end_type,cdn_url:a||i.url,cdn_host:s||"",initial_type:i.initial_type,resolution:i.resolution,play_speed:i.playbackRate,first_frame_interval:Qx()-i.pt,last_switch_interval:i.getLastInterval("lastSwitchStartTime",i.resLogs,!1),last_seek_interval:i.updateSeekPt(!1),last_event_interval:i.getLastInterval("lastEventTime"),cur_play_pos:o||i.cur_play_pos,video_ready_s:i.videoReadyState,video_seeking:i.videoSeeking,video_paused:i.videoPaused,bufs:uO(d),retry_count:i._retryCount,at:i.playlogs.at,bc:i.stall.bc,stay_seconds:parseInt(((new Date).getTime()-i.playlogs.at)/1e3,10),preload_state:i.preloadState,preload_hit:i.preLoadData.hit,preload_cached:i.preLoadData.duration||i.preLoadData.byteLength},h),f);if("waitstart"===r&&"function"==typeof i._options.getPageFPS){var g=i._options.getPageFPS();p.cur_fps=g.curFPS||0,p.avg_fps=g.avgFPS||0}var v=i.player;v&&v.dashState&&(p.dash_state=i.player.dashState),Object.keys(l).forEach((function(e){p[e]=l[e]})),p.ex=uO(i.getPlayerExt()),i.addIfExist("drm_type",i._options,p),i.reportLog(bO,p,c)})),xu(this,"onOneTemp",(function(){if(Zx("onOneTemp>>",!i._templog),i._templog){var e=i.player,t=i.playlogs,n=i.pauseLog,r=i.errorLog,o=i.resLogs,a=i.watchDur,s=wu(wu(wu({local_time:(new Date).getTime()},i._templog),{},{v:i.vid,initial_type:i.initial_type,pt:i.pt,vt:i.vt,lt:i.lt,fvt:i.fvt,bc:i.bc,bu_acu_t:i.bu_acu_t>KO?0:i.bu_acu_t,pause_acu_t:n.pause_acu_t,cur_play_pos:i.cur_play_pos,watch_dur:a>KO?0:a,finish:i.finish,errt:r.errt,errc:r.errc,vd:i.vd,df:i.resolution,lf:o.lf,br:t.br,fbrt:t.fbrt,try_err_c:r.try_err_c,accu_errc:r.accu_errc,dash_break:2===e.dashBufferBreak?1:0,bufs:uO(i.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},i.buffers.curBuffer),{},{degrade:t.degrade});0!==i.vt&&(s.et=eO()),["drm_type","dynamic_type"].forEach((function(e){i.addIfExist(e,i._options,s)})),i.reportLog(kO,s,0),i._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(n&&n.line_app_id){n.isTask&&(this.task=new GI),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),n.codec_type=n.codec_type||"h264",this._options=n,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(n.line_app_id,10)||0,this.line_user_id=(n.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=n.playerVersion,this.closeSeekLog=n.closeSeekLog||!1,this.start_time=1e3*(n.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),Zx("logger constructor:".concat(this.player.video))}catch(Hl){console.error(Hl)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return Eu(e,[{key:"resetLoggerParams",value:function(){Zx("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:eO(),vt:0,rt:this.isEnded?eO():0,at:0,pt:0,bu_acu_t:0,bc:0,br:0,fbrt:"",dbc:0,de_bu_acu_t:0,nbc:0,n_bu_acu_t:0,played:[{begin:0,end:-1}],dash_pst:0,dash_wst:0,dash_wrt:0,dash_ift:0,dash_cst:0,dash_spt:0,interruptCount:0,degrade:"none",lc:e},this.degradeLog={bu_acu_t:0,bc:0,watch_dur:0,hasSendEnd:!1},this.buffers={allBuffer:[],curBuffer:{buf_diff:0,buf_s_pos:0,buf_e_pos:0,buf_include:0}},this.netLog={downloadSpeed:0,requestCount:0,connectCost:0,totalSpeed:0,rqCount:0,status:0},this.merror={cdn:[],player:[],playCatch:[],expied:[]},this.exInfo={stall:[]},this._templog=null,this._isOnePlayReport=!1,this.startStep=0,this.bft=0,this.initializeLogDatas(),this.initializeUrlLog()}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=XI,this.lastEventTime=XI,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:Qx(),seekBefore:0,sat:0,sc:0},this.resLogs={lastSwitchStartTime:XI,switch_count:0,abr_switch_count:0,initial_resolution:"",final_resolution:"",ldst:0,ldet:0,df:"",lf:"",played:[],bc:0,bu_acu_t:0,sc:0,sat:0,buf:0,lbuf:0,lplayed:0,vs:0,vds:0,vps:0,vis:0,bitrate:0},this.apiLog={code:0,message:"",logid:"",api:"",auth:"",error:{}},this.errorLog={accu_errc:0,try_err_c:0,errt:0,errc:0,fir_errt:0,fir_errc:HI.isSupportMP4?0:1005,last_errors:[]},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={sc:0,startf:0,endf:0,start:0,end:0,cost:0,acc:0},this._playerCreatedTime=0,this.load_state=PO,this.lv_method=6,this.isSeeking=!1,this.isEnded=!1,this.startStep=0,this.isAutoplay=this.player.config&&this.player.config.autoplay?1:0,this.abrInfo={abr_general_info:{},abr_event_info:{video_switch:[],video_stall:[],video_exit:{}},abr_play_info:{start_play_time_ms:0,is_hint:0,playback_info:{internet_speed_record:[],play_bitrate_record:[],buffer_length_record:[],play_speed_record:[]}},abr_user_info:{cancel_abr:0},abr_init_opts:this.player.config.autoBitrateOpts||{}},this._cacheFile=GO}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(qI).web_id||"0"}catch(hV){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(Hl){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))}(e),Zx("sessionId ".concat(this._sessionId))}},{key:"initializeTracker",value:function(){var e=this,t=this._options;if(window.__xgplayer_vod_log__)this.tracker=window.__xgplayer_vod_log__;else{this.tracker=window.__xgplayer_vod_log__=new ZI("tracker");var n=t.channel||"cn",i={app_id:"cn"===(n="va"===n||"sg"===n?n:"cn")?YI:1300===YI?323254:YI,channel:n,log:!1,disable_sdk_monitor:!0};t.channelDomain&&(i.channel_domain=t.channelDomain),i.enable_ab_test=!!t.enableAbTest,this.tracker.init(i)}this.initSessionId();var r=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:WI,pc:this.playerCoreVersion,pv:this.playerVersion,line_app_id:this.line_app_id,line_user_id:this.line_user_id,app_version:t.appVersion||"",platform:HI.isPad?"pad":HI.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:VI(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent},Zx("commonParams ",this.commonParams);var a={evtParams:this.commonParams,disable_auto_pv:!0};Zx("Browser.name ",HI.name),!HI.name||HI.isChrome||HI.isSafari||(a.browser=HI.name,HI.appVersion&&(a.browser_version=HI.appVersion)),this.line_user_id&&(a.user_unique_id=this.line_user_id,a.web_id=this.line_user_id),t.referrer&&(a.referrer=t.referrer,a.referrer_host=Xx(t.referrer)),t.ext&&Object.keys(t.ext).map((function(n){e.exInfo[n]=t.ext[n]})),this.tracker.config(a),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=ZO.get();ZO.remove(),t.map((function(t){Object.keys(t).map((function(n){if(Zx("sendLocalLog",n,t[n]),e.player){e.player.emit("abLog",n,t[n]);var i=e._options.sendLocalCallback;i&&"function"==typeof i&&i(n,t[n])}e._track(n,t[n])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(e,t):this.tracker.event(e,t)}},{key:"bindEvt",value:function(){var e=this;this.listeners=[{evt:"play",handler:this.onPlay},{evt:"playing",handler:this.onPlaying},{evt:"pause",handler:this.onPause},{evt:"waiting",handler:this.onWaiting},{evt:"playInterfaceInfo",handler:this.onPlayInterfaceInfo},{evt:"DRM_ERROR",handler:this.onDashError},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"progress",handler:this.onVideoProgress},{evt:"dashStateChange",handler:this.onDashStateChange},{evt:"autoplay was prevented",handler:this.onNotAutoPlay},{evt:"autoplay_was_prevented",handler:this.onNotAutoPlay},{evt:"seeking",handler:this.onSeeking},{evt:"seeked",handler:this.onSeeked},{evt:"complete",handler:this.onPlayerInited},{evt:"timeupdate",handler:this.onTimeUpdate},{evt:"bufferedChange",handler:this.onBufferedChange},{evt:"beforeDefinitionChange",handler:this.onBeforeDefinitionChange},{evt:"definitionChange",handler:this.onDefinitionChange},{evt:"definitionChangeSuccess",handler:this.onDefiChangeSuccess},{evt:"drmTypeChange",handler:this.onDrmTypeChange},{evt:"replayBtnClick",handler:this.onReplayBtnClick},{evt:"initialUrl",handler:this.initializeUrlLog},{evt:"ABR_CHANGE",handler:this.onAbrChange},{evt:"playCatch",handler:this.onPlayCatch},{evt:"log",handler:this.onLog},{evt:"ABR_PRESTALL_END",handler:this.onAbrPrestallEnd},{evt:"progress_event",handler:this.onProgressEvent},{evt:"logger_next",handler:this.onNext},{evt:"playnext",handler:this.onNext},{evt:"nextEnded",handler:this.onNextEnded},{evt:"media_format_error",handler:this.onMediaFormatError},{evt:"xglog",handler:this.onXgLogWaiting},{evt:"xglog_cache",handler:this.onXgLogCache},{evt:"degrade",handler:this.onDegrade}];var t=this.player.config.errorKey;Zx(">>>errorKey",t);var n={evt:"error",handler:this.onPlayerError};t&&(n.evt=t),this.listeners.push(n),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t,n=(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache);return this._logstrcache=n,n}},{key:"addIfExist",value:function(e,t,n){if($I(t)){var i=t[e];!(null==i)&&(n[e]=i)}}},{key:"changeResolution",value:function(e){var t=e.from,n=e.to,i=e.startTime,r=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=cO(t),n=cO(n),l.ldet=Qx(),l.df=n,l.lf=t,l.final_resolution=n,l.switch_count++;var c=l.ldet-i,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:qx(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:r,endType:s,stateBefore:t,stateAfter:n},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t[e],r=Qx(),o=i===XI?XI:r-i;return n&&(t[e]=r),o}},{key:"updateSeekPt",value:function(e){return this.getLastInterval("lastSeekStartTime",this.seekLog,e)}},{key:"_reportInvalidVV",value:function(e){return!!this._isInvaidVV()&&(this.onOneError({endState:e,errorType:9998,code:-1,url:this.player.currentSrc,headers:{}},0),this._isOnePlayReport=!0,!0)}},{key:"_isInvaidVV",value:function(){return 0===this.vt&&-1===this.curStatus}},{key:"bindUnload",value:function(){HI.isPC?window.addEventListener("beforeunload",this.onUnload):(HI.isMobile||HI.isPad)&&window.addEventListener("pagehide",this.onUnload),document.addEventListener("visibilitychange",this.onVisibilitychange),this.player.once("destroy",this.onDestroy)}},{key:"clearTimers",value:function(){var e=this.seekLog;e.intervalId&&window.clearTimeout(e.intervalId),this.stallIntervalId&&window.clearTimeout(this.stallIntervalId)}},{key:"sendDegradeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"playCatch",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Zx("sendDegradeLog",e,t,n);var i=this.degradeLog;if(!(i.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(i.hasSendEnd=!0);var r=this.bu_acu_t-i.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:n.url},wu({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-i.bc,bu_acu_t:r>KO?0:r,watch_dur:this.watchDur-i.watch_dur},n),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?qO.FULLSCREEN_TYPE:this.player.isCssfullScreen?qO.CSS:qO.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,n=0,i=e.video&&e.video.buffered;if(i){for(var r=i.length,o=0,a=0;a<r;a++)o+=i.end(a)-i.start(a);t=n=1e3*o}return{video:t,audio:n}}},{key:"updateAbrInfo",value:function(e,t,n){e.abr_general_info=t.generalInfo,e.abr_event_info.video_exit={local_time_ms:(new Date).getTime(),buffer_length:t.bufferLength,internet_speed:t.downloadSpeed,now_bitrate:t.nowBitrate,play_speed:n},t.getAbrPlayInfo&&(e.abr_play_info=t.getAbrPlayInfo())}},{key:"getPerformance",value:function(){return this.player.performance||{}}},{key:"setExt",value:function(){var e=this,t=this.player.ext||{};t.performance&&delete t.performance,Object.keys(t).map((function(n){"performance"!==n&&(e.exInfo[n]=t[n])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,n=e.operaType,i=e.stateBefore,r=e.stateAfter,o=e.endType,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=this.getLastInterval("lastOperaTime"),c={local_time:(new Date).getTime(),v:this.vid,opera_type:n,state_before:i,state_after:r,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:uO(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount},u=this.player;u&&u.dashState&&(c.dash_state=this.player.dashState),Object.keys(a).forEach((function(e){c[e]=a[e]})),this.addIfExist("drm_type",this._options,c),this.reportLog(mO,c,s)}},{key:"onOneError",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:0,code:0,url:"",headers:{},costTime:0,vid:"",message:"",preload_hit:0,preload_cached:0},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Zx("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=oO(t.headers||{}),u=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=wu(wu(wu({v:t.vid||this.vid,video_pos:this.cur_play_pos,local_time:(new Date).getTime(),cost_time:t&&t.costTime?t.costTime:0,errt:t.errorType,errc:h,es:this.es,cdn_url:t.url||this.url,bufs:uO(this.buffers.allBuffer),resolution:a.final_resolution,last_errors:r.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:c.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},c),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:l.degrade,end_state:t.endState||AO,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:uO(this.exInfo),pref:uO(u),video_ready_s:this.videoReadyState});s&&s.dashState&&(d.dash_state=s.dashState);var f=this.player.currentSrc,p=iO(f)?iO(t.url)?this.initial_url:t.url:f,g={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:iO(f)?1:0};if(i&&"String"===sO(p)){var v={};tO(p,{range:"0-8",timeout:2e3}).then((function(e){Zx("getXhr>>check result ",e);var t=oO(e.headers||{});d.server_ip=t.x_response_sinfo,v=wu(wu({},g),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){v=wu(wu({},g),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=pO(p);v.isexpired=t,d.net=uO(v),e.reportLog(_O,d,n)}))}else d.net=uO(g),this.reportLog(_O,d,n)}},{key:"reportLog",value:function(t,n,i){var r=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;n.dynamic_type=this.dynamicType;var l="Array"===sO(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;n.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(n.abtest_tag=a);var c=this._options;if(n.codec_type=this.codecType,$I(c)&&(YO.forEach((function(e){r.addIfExist(e,c,n)})),Object.keys(s).forEach((function(e){r.addIfExist(e,s,n)})),n.vtype=this.vtype),n.support=VI(),1===i){var u={};return u[t]=n,void ZO.set(u)}2!==i?(this.player&&this.player.emit("abLog",t,n),this._track(t,n)):this.addEventsQueue(t,n)}},{key:"addEventsQueue",value:function(e,t){this.eventQueue.push({event:e,params:t}),this.eventQueue.length>=this._options.maxQueueCount&&this.sendEventsQueue()}},{key:"sendEventsQueue",value:function(){for(;this.eventQueue.length>0;){var e=this.eventQueue.pop();this._track(e.event,e.params)}}},{key:"startWaitingStatus",value:function(e,t){this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus"),this.onOneEvent({costTime:t,end_type:"waitstart"},{},2)}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;Zx("triggerTask>>",e);var n=nO(t=t||this.player.src);!n&&this.vtype.indexOf("MP4")>-1&&this.task&&this.task.trigger(t,e)}},{key:"appendStallInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;this.exInfo.stall||(this.exInfo.stall=[]);var i=this.exInfo.stall;if("start"===e){i.length>6&&i.splice(0,i.length-6);var r=this.buffers.curBuffer;i.push({start:t,end:-1,endType:"waitstart",cost:0,cur:this.cur_play_pos,buf_s:r.buf_s_pos,buf_e:r.buf_e_pos,buf_i:r.buf_include})}else if("end"===e){var o=i.length-1;if(o<0)return;i[o].end<0&&(i[o].end=t,i[o].endType=n,i[o].cost=t-i[o].start)}Zx("appendStallInfo",i)}},{key:"suspendWaitingStatus",value:function(e){var t=Qx(),n=this.playlogs,i=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||n.vt<=0)){if(Zx("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-o>200){var a=t-this.inWaitingStart;if(n.bc++,this.checkInBuffer(this.player.currentTime)?(n.de_bu_acu_t+=a,n.dbc++):(n.nbc++,n.n_bu_acu_t+=a),i.bc++,n.bu_acu_t+=a,i.bu_acu_t+=a,r.end=this.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=this.cur_play_pos),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var s=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:(new Date).getTime(),stall_duration:parseFloat((a/1e3).toFixed(2)),buffer_length:s.bufferLength,internet_speed:s.downloadSpeed,now_bitrate:s.nowBitrate,play_speed:this.player.playbackRate,is_abr:s.isCurrentInAbr?1:0})}this.onOneEvent({costTime:a,end_type:"waitend_".concat(e)||"waitend"},{},2)}this._endType="",this.load_state=LO,this.inWaitingStart=0,this.waitStartTime=0,window.clearTimeout(this.stallIntervalId),this.stallIntervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var n=this.seekLog,i=this.resLogs,r=this.player,o=Qx()-n.lastSeekStartTime;Zx("suspendSeekStatus>>","".concat(e," currentTime:").concat(r.currentTime," costTime:").concat(o," sat:").concat(n.sat," resLogs.sat:").concat(i.sat)),n.intervalId&&window.clearTimeout(n.intervalId),n.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=n.seekBefore,l=(r.currentTime||0).toString();n.sc++,n.sat+=o>$O?0:o,i.sc++,i.sat+=o>$O?0:o,this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:o,operaType:a,stateBefore:s,stateAfter:l,endType:e})}}},{key:"setPt",value:function(){var e=this.playlogs;this.startStep=1,!e.pt&&this.player.currentTime&&(this.isSeeking=!0),e.pt||(e.pt=eO(),Zx("setPt","init pt :".concat(e.pt,", document.visibilityState:").concat(document.visibilityState)))}},{key:"setVt",value:function(){var e=this.playlogs;1===this.startStep&&(e.vt||(e.vt=eO(),Zx("setVt: first frame inited","vt-pt:".concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt))),this.startStep=2)}},{key:"setBr",value:function(e){var t=this.playlogs;t.vt>0&&(0===t.br&&(t.fbrt=e||""),t.br++)}},{key:"codecType",get:function(){var e=this.player;return e&&e.config&&e.config.codecType?e.config.codecType:this._options.codec_type||"h264"}},{key:"url",get:function(){var e=this.player;return e&&e.config?e.config.url:""}},{key:"vid",get:function(){var e=this.player;return e&&e.config?e.config.vid:""}},{key:"bc",get:function(){return this.playlogs.bc}},{key:"bu_acu_t",get:function(){return this.playlogs.bu_acu_t}},{key:"pt",get:function(){return this.playlogs.pt||eO()}},{key:"vt",get:function(){var e=this.playlogs,t=e.vt;return e.pt>0?t:0}},{key:"fvt",get:function(){var e=this.playlogs,t=e.vt,n=e.pt,i=0;return t>0&&n>0&&(i=parseInt(t-n,10)),i>6e4?6e4:i}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,n=e.nt;return t>0&&n>0?parseInt(t-n,10):0}},{key:"dash_pst",get:function(){return this.playlogs.dash_pst}},{key:"dash_wst",get:function(){return this.playlogs.dash_wst}},{key:"dash_wrt",get:function(){return this.playlogs.dash_wrt}},{key:"dash_ift",get:function(){return this.playlogs.dash_ift}},{key:"dash_cst",get:function(){return this.playlogs.dash_cst}},{key:"dash_spt",get:function(){return this.playlogs.dash_spt}},{key:"getFrameInfo",value:function(){if(this.player&&this.player.videoFrameInfo){var e=this.player.videoFrameInfo,t=e.dropped,n=e.corrupted,i=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:parseInt(100*i,10),corrupted:n}}return{f_total:0,drop_count:0,drop_rate:0,corrupted:0}}},{key:"vd",get:function(){var e=this.player;return e.duration&&"number"==typeof e.duration&&e.duration>0?parseInt(1e3*e.duration,10):e.config.duration&&"number"==typeof e.config.duration?parseInt(1e3*e.config.duration,10):0}},{key:"cur_play_pos",get:function(){return parseInt(1e3*this.player.currentTime,10)}},{key:"volume",get:function(){return this.player.volume}},{key:"buffer_time",get:function(){var e=0;try{var t=this.player.getBufferedRange();e=t[1]-t[0]}catch(Hl){e=0}return e}},{key:"player_created_t",get:function(){return this._playerCreatedTime}},{key:"playbackRate",get:function(){return this.player.playbackRate}},{key:"mute",get:function(){return this.player.muted?0:1}},{key:"videoWidth",get:function(){var e=this.player;return e&&e.video?e.video.videoWidth:0}},{key:"videoHeight",get:function(){var e=this.player;return e&&e.video?e.video.videoHeight:0}},{key:"preload",get:function(){var e=this.player;return!(!e||!e.video)&&e.video.preload}},{key:"initial_url",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_url?this.urlLog.initial_url:nO(e)?"":e}},{key:"initial_host",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_host?this.urlLog.initial_host:Xx(nO(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?oO(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,n=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:n.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?"".concat(e.definition):this.resLogs.df}},{key:"sessionId",get:function(){return this._sessionId}},{key:"finish",get:function(){return this.isEnded?1:0}},{key:"end_type",get:function(){return this._endType}},{key:"avgSpeed",get:function(){return this.player&&this.player.avgSpeed?this.player.avgSpeed:0}},{key:"realSpeed",get:function(){return this.player&&this.player.realTimeSpeed?this.player.realTimeSpeed:0}},{key:"mp4MseOpLength",get:function(){if(!this.player||!this.player.plugins)return-1;var e=this.player.plugins.mp4encryptplayer;return e?e.opQueueLen||0:-1}},{key:"mp4LoadSegmentTimeRange",get:function(){if(!this.player||!this.player.plugins)return"";var e=this.player.plugins.mp4encryptplayer;return e?e.loadSegmentTimeRange.join(","):""}},{key:"preLoadData",get:function(){if(!this.player||!this.player.plugins)return[];var e=this.player.plugins.mp4encryptplayer;if(e&&e.preLoadData)return{hit:1,duration:e.preLoadData.duration,length:e.preLoadData.byteLength};var t=this.player.stat||{};if(t.preLoadData){var n=t.preLoadData.length;return{hit:n>0,length:n}}return{hit:0,duration:0,length:0}}},{key:"preloadState",get:function(){if(!this.player||!this.player.plugins)return 0;if(void 0!==this.player.preloadState)return this.player.preloadState||0;var e=this.player.plugins.mp4encryptplayer;return e&&e.preloadState?e.preloadState:0}},{key:"curBitrate",get:function(){var e=this.player,t=e.config,n=e.curDefinition;return n&&n.bitrate?n.bitrate:t.defaultBitrate?t.defaultBitrate:0}},{key:"videoReadyState",get:function(){var e=this.player;return e&&e.video?e.video.readyState:-1}},{key:"videoSeeking",get:function(){var e=this.player;return e&&e.video&&e.video.seeking?1:0}},{key:"videoPaused",get:function(){var e=this.player;return e&&e.video&&e.video.paused?1:0}},{key:"switchResolutionCount",get:function(){return this.resLogs.switch_count}},{key:"isError",get:function(){return this.player._isError||this.player.video.error}},{key:"isPlaying",get:function(){return lO(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return lO(this.player.root,"xgplayer-ended")||lO(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return lO(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return lO(this.player.root,"xgplayer-isloading")}},{key:"es",get:function(){return this.isPlaying?"playing":"beforePlay"}},{key:"lt",get:function(){var e=0;return 0===this.vt&&(Zx("lt init",this.playlogs.lt),e=eO()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?xO:this.isStop?SO:this.isPause?EO:this.isLoading?OO:CO}},{key:"is_start_play_automatically",get:function(){return"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,n=e.cumulateTime?e.cumulateTime:qx(t.played);return n>=0?n:0}},{key:"vtype",get:function(){if(this.__vtype)return this.__vtype;var e=this.player?this.player.vtype||this.player.config.vtype:"";return e||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=Qx()-this.inWaitingStart;return e>$O?0:e}return 0}},{key:"videoNetworkState",get:function(){var e=this.player;return e&&e.video?e.video.networkState:-1}},{key:"eagleid",get:function(){var e=this.player;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?(e.__dash__.curReqVideoSegInfo.headers||{}).eagleid:""}},{key:"initial_type",get:function(){var e=this.player.config||{};return e&&e.vodLogOpts&&void 0!==e.vodLogOpts.currentDashType?parseInt(e.vodLogOpts.currentDashType,10):-1}},{key:"dynamicType",get:function(){var e=this.player;return this.__dt?this.__dt:e&&e.__dash__&&e.__dash__.dash&&e.__dash__.dash.mpd?(this.__dt=e.__dash__.dash.mpd.dashType,this.__dt):""}},{key:"updateBuffers",value:function(){var e=this.player.buffered,t=[];if(!e||e.length<1)this.buffers.allBuffer=[];else{for(var n=0;n<e.length;n++){var i=parseInt(1e3*e.start(n),10),r=parseInt(1e3*e.end(n),10);t.push({s:i,e:r})}this.buffers.allBuffer=t}}},{key:"updateCurBuffer",value:function(e){var t=this.player,n=t.buffered,i=t.currentTime,r={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!n||n.length<1)return r;for(var o=-1,a=-1,s=parseInt(1e3*i,10),l=n.length-1;l>-1;l--){var c=parseInt(1e3*n.start(l),10),u=parseInt(1e3*n.end(l),10);if(s>=c&&s<=u){r.buf_include=1,r.buf_s_pos=c,r.buf_e_pos=u,r.buf_diff=u-s;break}s<c&&(o<0||c-s<o)?(o=c-s,a=l):s>u&&(o<0||s-u<o)&&(o=s-u,a=l)}1!==r.buf_include&&(a<0&&(a=n.length-1),r.buf_s_pos=parseInt(1e3*n.start(a),10),r.buf_e_pos=parseInt(1e3*n.end(a),10)),this.buffers.curBuffer=r}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.player.buffered;if(!n)return!1;e=parseInt(1e3*e,10);for(var i=0;i<n.length;i++){var r=parseInt(1e3*n.start(i),10)+t,o=parseInt(1e3*n.end(i),10)+t;if(e>r&&e<o)return!0}return!1}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,n=this.resLogs,i=0,r=0;if(t.__dash__&&t.__dash__.dash&&t.__dash__.dash.mpd.mediaList){var o=t.__dash__.dash.mpd.mediaList.video,a=o[o.selectedIdx];Zx("updateVideoSize》》videoItem",a),r=a?a.bitrate||a.bandwidth:0,i=a?a.size:0}else{var s=this.player.curDefinition;s?(r=s.bitrate||t.config.bitrate||0,i=parseInt(s.bitrate*t.duration/8,10)):(i=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}Zx("updateVideoSize","bitrate:".concat(r,", vs:").concat(i)),i&&(n.vs=i,n.vis=parseInt(i/t.duration,10),n.bitrate=r||n.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,n=this.player;if(0!==e.vis){for(var i=parseInt(qx(t.played)/1e3,10),r=n.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);Zx("updateVds","pdur:".concat(i," bdur:").concat(o," \n lbuf:").concat(e.lbuf," lplayed:").concat(e.lplayed," bitrate: ").concat(e.bitrate," vis:").concat(e.vis," vs:").concat(e.vs)),e.vps+=parseInt((i-e.lplayed)*e.vis,10),e.vds+=parseInt((o-e.lbuf)*e.vis,10),e.lplayed=i,e.lbuf=o}else Zx("updateVds","vis:".concat(e.vis))}}],[{key:"TEA_ID",get:function(){return YI},set:function(e){qI="__tea_cache_tokens_".concat(YI=e)}},{key:"AB_SDK_VERSION",get:function(){return JI},set:function(e){JI="Array"===sO(e)?e.join(","):e}},{key:"Collector",set:function(e){ZI=e}},{key:"defaultConfig",value:function(){return{line_app_id:"",line_user_id:"",isTask:!1,codec_type:"",playerCoreVersion:"",playerVersion:"",start_time:0,maxQueueCount:5,channel:"cn",channelDomain:"",absdkVersion:"",checkByInnerLog:!0,drm_type:0,vtype:"MP4",tag:"普通视频",subtag:"",dynamic_type:"",sendLocalCallback:function(){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1}}}]),e}();QI.TEA_ID=4951,QI.Collector=bu;var eD,tD=function(e){if(e&&e.player){var t=e.player.config.vodLogOpts||{};e.player.vodLogger=new QI(e.player,t),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new QI(this,this.config.vodLogOpts||{})};function nD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function iD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nD(Object(n),!0).forEach((function(t){uD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rD(){rD=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(P){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new E(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&n.call(m,a)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(r,a,s,l){var c=h(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,l)}))}l(c.arg)}var a;r(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){o(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function w(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function T(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=g,r(_,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new k(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,l,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;C(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function oD(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(hV){return void n(hV)}s.done?t(l):Promise.resolve(l).then(i,r)}function aD(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){oD(o,i,r,a,s,"next",e)}function s(e){oD(o,i,r,a,s,"throw",e)}a(void 0)}))}}function sD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lD(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,yD(i.key),i)}}function cD(e,t,n){return t&&lD(e.prototype,t),n&&lD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uD(e,t,n){return(t=yD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hD(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fD(e,t)}function dD(e){return(dD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function fD(e,t){return(fD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function pD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gD(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pD(e)}function vD(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Hl){return!1}}();return function(){var n,i=dD(e);if(t){var r=dD(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gD(this,n)}}function yD(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function mD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mD(Object(n),!0).forEach((function(t){xD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bD(){bD=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(P){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new E(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&n.call(m,a)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(r,a,s,l){var c=h(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,l)}))}l(c.arg)}var a;r(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){o(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function w(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function T(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=g,r(_,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new k(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,l,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;C(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function kD(e){return(kD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wD(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(hV){return void n(hV)}s.done?t(l):Promise.resolve(l).then(i,r)}function TD(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){wD(o,i,r,a,s,"next",e)}function s(e){wD(o,i,r,a,s,"throw",e)}a(void 0)}))}}function SD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CD(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,VD(i.key),i)}}function ED(e,t,n){return t&&CD(e.prototype,t),n&&CD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xD(e,t,n){return(t=VD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OD(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&LD(e,t)}function PD(e){return(PD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function LD(e,t){return(LD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ID(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Hl){return!1}}function DD(e,t,n){return(DD=ID()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&LD(r,n.prototype),r}).apply(null,arguments)}function AD(e){var t="function"==typeof Map?new Map:void 0;return AD=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return DD(e,arguments,PD(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),LD(i,e)},AD(e)}function MD(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function RD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ND(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return RD(e)}function jD(e){var t=ID();return function(){var n,i=PD(e);if(t){var r=PD(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ND(this,n)}}function BD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=PD(e)););return e}function UD(){return UD="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=BD(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},UD.apply(this,arguments)}function HD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function FD(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return HD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HD(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function VD(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}tD.pluginName="__xgVodLogger",tD.playerConfig={},tD.Collector=bu,tD.setABSdkVersion=function(e){QI.AB_SDK_VERSION=e};var zD="network",GD="network_timeout",WD="network_forbidden",KD="network_notfound",$D="network_range_not_satisfiable",YD="demux",qD="remux",XD="media",JD="drm",ZD="other",QD="runtime",eA=(xD(eD={},"manifest",{HLS:1100,DASH:1200}),xD(eD,zD,2100),xD(eD,GD,2101),xD(eD,WD,2103),xD(eD,KD,2104),xD(eD,$D,2116),xD(eD,YD,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),xD(eD,qD,{FMP4:4100,MP4:4200}),xD(eD,XD,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,EME_HIJACK:5301}),xD(eD,JD,{LICENSE:7100,CUSTOM_LICENSE:7200}),xD(eD,ZD,8e3),xD(eD,QD,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),eD),tA=function(e){OD(n,e);var t=jD(n);function n(e,i,r,o,a){var s;return SD(this,n),(s=t.call(this,a||(null==r?void 0:r.message))).errorType=e===GD?zD:e,s.originError=r,s.ext=o,s.errorCode=eA[e][i]||eA[e],s.errorMessage=s.message,s.errorCode||(s.errorType=ZD,s.errorCode=eA[s.errorType]),s}return ED(n,null,[{key:"create",value:function(e,t,i,r,o){return e instanceof n?e:(e instanceof Error&&(i=e,e=""),e||(e=ZD),new n(e,t,i,r,o))}},{key:"network",value:function(e){var t;return new n(null!=e&&e.isTimeout?GD:zD,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),n}(AD(Error)),nA={DEBUG:1,LOG:2,WARN:3,ERROR:4},iA=["Boolean","Number","String","Undefined","Null","Date","Object"],rA=function(){function e(t,n){SD(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=(null==n?void 0:n.disabled)||!0,this.logCacheLevel=(null==n?void 0:n.logCacheLevel)||3,this.logMaxSize=(null==n?void 0:n.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return ED(e,[{key:"debug",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[nA.DEBUG].concat(i)),e.disabled||(t=console).debug.apply(t,[this._prefix,oA()].concat(i))}},{key:"log",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[nA.LOG].concat(i)),e.disabled||(t=console).log.apply(t,[this._prefix,oA()].concat(i))}},{key:"warn",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[nA.WARN].concat(i)),e.disabled||(t=console).warn.apply(t,[this._prefix,oA()].concat(i))}},{key:"error",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[nA.ERROR].concat(i)),e.disabled||(t=console).error.apply(t,[this._prefix,oA()].concat(i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=i.map((function(e){return sA(e)}));t=this._prefix+oA()+JSON.stringify(o)}catch(Hl){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function oA(){return(new Date).toLocaleString()}function aA(e){if("object"!==kD(e))return e;var t=Object.prototype.toString.call(e).slice(8,-1);switch(t){case"Array":case"Uint8Array":case"ArrayBuffer":return t+"["+e.length+"]";case"Object":return"{}";default:return t}}function sA(e,t,n){n||(n=1),t||(t=2);var i={};if(!e||"object"!==kD(e))return e;var r=Object.prototype.toString.call(e).slice(8,-1);if(!iA.includes(r))return r;if(!(n>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n===t?i[o]=aA(e[o]):"object"===kD(e[o])?i[o]=sA(e[o],t,n+1):i[o]=e[o]);return i}}xD(rA,"disabled",!0);var lA="fetch",cA="xhr",uA="arraybuffer",hA="text",dA="json",fA=function(e){OD(n,e);var t=jD(n);function n(e,i,r,o){var a;return SD(this,n),xD(RD(a=t.call(this,o)),"retryCount",0),xD(RD(a),"isTimeout",!1),xD(RD(a),"loaderType",lA),xD(RD(a),"startTime",0),xD(RD(a),"endTime",0),xD(RD(a),"options",{}),a.url=e,a.request=i,a.response=r,a}return ED(n)}(AD(Error)),pA=Object.prototype.toString;function gA(e){if("[object Object]"!==pA.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function vA(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function yA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mA(e,t){if(e){if(!t)return e;var n,i=Object.keys(t).map((function(e){if(null!=(n=t[e]))return Array.isArray(n)?e+="[]":n=[n],n.map((function(t){var n;return n=t,"[object Date]"===pA.call(n)?t=t.toISOString():function(e){return null!==e&&"object"===kD(e)}(t)&&(t=JSON.stringify(t)),"".concat(yA(e),"=").concat(yA(t))})).join("&")})).filter(Boolean).join("&");if(i){var r=e.indexOf("#");-1!==r&&(e=e.slice(0,r)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}}function _A(e,t,n,i,r,o,a,s,l,c,u){return r=null!=r?parseFloat(r):null,i=parseInt(i||"0",10),Number.isNaN(i)&&(i=0),{data:e,done:t,options:{range:l,vid:c,index:s,contentLength:i,age:r,startTime:o,firstByteTime:a,endTime:Date.now(),priOptions:u},response:n}}function bA(e,t){return Math.round(8*e*1e3/t/1024)}var kA="error",wA="core.ttfb",TA="core.loadstart",SA="core.loadresponseheaders",CA="core.loadcomplete",EA="core.loadretry",xA="core.metadataparsed",OA="real_time_speed",PA=2097152,LA=function(e){OD(i,e);var t,n=jD(i);function i(){var e;return SD(this,i),xD(RD(e=n.call(this)),"_abortController",null),xD(RD(e),"_timeoutTimer",null),xD(RD(e),"_reader",null),xD(RD(e),"_response",null),xD(RD(e),"_aborted",!1),xD(RD(e),"_index",-1),xD(RD(e),"_range",null),xD(RD(e),"_receivedLength",0),xD(RD(e),"_running",!1),xD(RD(e),"_logger",null),xD(RD(e),"_vid",""),xD(RD(e),"_onProcessMinLen",0),xD(RD(e),"_onCancel",null),xD(RD(e),"_priOptions",null),e}return ED(i,[{key:"load",value:function(e){var t,n=this,i=e.url,r=e.vid,o=e.timeout,a=e.responseType,s=e.onProgress,l=e.index,c=e.onTimeout,u=e.onCancel,h=e.range,d=e.transformResponse,f=e.request,p=e.params,g=e.logger,v=e.method,y=e.headers,m=e.body,_=e.mode,b=e.credentials,k=e.cache,w=e.redirect,T=e.referrer,S=e.referrerPolicy,C=e.onProcessMinLen,E=e.priOptions;this._logger=g,this._aborted=!1,this._onProcessMinLen=C,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=l,this._range=h||[0,0],this._vid=r||i,this._priOptions=E||{};var x={method:v,headers:y,body:m,mode:_,credentials:b,cache:k,redirect:w,referrer:T,referrerPolicy:S,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},O=!1;clearTimeout(this._timeoutTimer),i=mA(i,p);var P=vA(h);P&&(y=f?f.headers:x.headers=x.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",P):y.Range=P),o&&(this._timeoutTimer=setTimeout((function(){if(O=!0,n.cancel(),c){var e=new fA(i,x,null,"timeout");e.isTimeout=!0,c(e,{index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions})}}),o));var L=Date.now();return this._logger.debug("[fetch load start], index,",l,",range,",h),new Promise((function(e,t){fetch(f||i,f?void 0:x).then(function(){var r=TD(bD().mark((function r(o){var c,u,f,p;return bD().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(clearTimeout(n._timeoutTimer),n._response=o,!n._aborted&&n._running){r.next=4;break}return r.abrupt("return");case 4:if(d&&(o=d(o,i)||o),o.ok){r.next=7;break}throw new fA(i,x,o,"bad network response");case 7:if(c=Date.now(),a!==hA){r.next=15;break}return r.next=11,o.text();case 11:u=r.sent,n._running=!1,r.next=37;break;case 15:if(a!==dA){r.next=22;break}return r.next=18,o.json();case 18:u=r.sent,n._running=!1,r.next=37;break;case 22:if(!s){r.next=29;break}return n.resolve=e,n.reject=t,n._loadChunk(o,s,L,c),r.abrupt("return");case 29:return r.next=31,o.arrayBuffer();case 31:u=r.sent,u=new Uint8Array(u),n._running=!1,f=Date.now()-L,p=bA(u.byteLength,f),n.emit(OA,{speed:p,len:u.byteLength,time:f,vid:n._vid,index:n._index,range:n._range,priOptions:n._priOptions});case 37:n._logger.debug("[fetch load end], index,",l,",range,",h),e(_A(u,!0,o,o.headers.get("Content-Length"),o.headers.get("age"),L,c,l,h,n._vid,n._priOptions));case 39:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){var r;clearTimeout(n._timeoutTimer),n._running=!1,n._aborted&&!O||((e=e instanceof fA?e:new fA(i,x,null,null===(r=e)||void 0===r?void 0:r.message)).startTime=L,e.endTime=Date.now(),e.isTimeout=O,e.options={index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions},t(e))}))}))}},{key:"cancel",value:(t=TD(bD().mark((function e(){return bD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(hV){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,n,i){var r=this;if(!e.body||!e.body.getReader){this._running=!1;var o=new fA(e.url,"",e,"onProgress of bad response.body.getReader");return o.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(o)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(PA),this._writeIdx=0);var a,s,l,c=this._reader=e.body.getReader(),u=function(){var o=TD(bD().mark((function o(){var h,d,f,p,g,v,y,m;return bD().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=Date.now(),o.prev=1,o.next=4,c.read();case 4:a=o.sent,l=Date.now(),o.next=13;break;case 8:return o.prev=8,o.t0=o.catch(1),l=Date.now(),r._aborted||(r._running=!1,o.t0.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},r.reject(o.t0)),o.abrupt("return");case 13:if(d=(null===(h=r._range)||void 0===h?void 0:h.length)>0?r._range[0]:0,f=d+r._receivedLength,!r._aborted){o.next=19;break}return r._running=!1,t(void 0,!1,{range:[f,f],vid:r._vid,index:r._index,startTime:s,endTime:l,st:n,firstByteTime:i,priOptions:r._priOptions},e),o.abrupt("return");case 19:p=a.value?a.value.byteLength:0,r._receivedLength+=p,r._logger.debug("【fetchLoader,onProgress call】,task,",r._range,", start,",f,", end,",d+r._receivedLength,", done,",a.done),r._onProcessMinLen>0?r._writeIdx+p>=r._onProcessMinLen||a.done?((g=new Uint8Array(r._writeIdx+p)).set(r._cache.slice(0,r._writeIdx),0),p>0&&g.set(a.value,r._writeIdx),r._writeIdx=0,r._logger.debug("【fetchLoader,onProgress enough】,done,",a.done,",len,",g.byteLength,", writeIdx,",r._writeIdx)):p>0&&r._writeIdx+p<PA?(r._cache.set(a.value,r._writeIdx),r._writeIdx+=p,r._logger.debug("【fetchLoader,onProgress cache】,len,",p,", writeIdx,",r._writeIdx)):p>0&&(v=new Uint8Array(r._writeIdx+p+2048),r._logger.debug("【fetchLoader,onProgress extra start】,size,",r._writeIdx+p+2048,", datalen,",p,", writeIdx,",r._writeIdx),v.set(r._cache.slice(0,r._writeIdx),0),p>0&&v.set(a.value,r._writeIdx),r._writeIdx+=p,delete r._cache,r._cache=v,r._logger.debug("【fetchLoader,onProgress extra end】,len,",p,", writeIdx,",r._writeIdx)):g=a.value,(g&&g.byteLength>0||a.done)&&t(g,a.done,{range:[r._range[0]+r._receivedLength-(g?g.byteLength:0),r._range[0]+r._receivedLength],vid:r._vid,index:r._index,startTime:s,endTime:l,st:n,firstByteTime:i,priOptions:r._priOptions},e),a.done?(y=Date.now()-n,m=bA(r._receivedLength,y),r.emit(OA,{speed:m,len:r._receivedLength,time:y,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions}),r._running=!1,r._logger.debug("[fetchLoader onProgress end],task,",r._range,",done,",a.done),r.resolve(_A(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),n,i,r._index,r._range,r._vid,r._priOptions))):u();case 25:case"end":return o.stop()}}),o,null,[[1,8]])})));return function(){return o.apply(this,arguments)}}();u()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),i}(hi);var IA=function(e){OD(n,e);var t=jD(n);function n(){var e;return SD(this,n),xD(RD(e=t.call(this)),"_xhr",null),xD(RD(e),"_aborted",!1),xD(RD(e),"_timeoutTimer",null),xD(RD(e),"_range",null),xD(RD(e),"_receivedLength",0),xD(RD(e),"_url",null),xD(RD(e),"_onProgress",null),xD(RD(e),"_index",-1),xD(RD(e),"_headers",null),xD(RD(e),"_currentChunkSizeKB",384),xD(RD(e),"_timeout",null),xD(RD(e),"_xhr",null),xD(RD(e),"_withCredentials",null),xD(RD(e),"_startTime",-1),xD(RD(e),"_loadCompleteResolve",null),xD(RD(e),"_loadCompleteReject",null),xD(RD(e),"_runing",!1),xD(RD(e),"_logger",!1),xD(RD(e),"_vid",""),xD(RD(e),"_responseType",void 0),xD(RD(e),"_credentials",void 0),xD(RD(e),"_method",void 0),xD(RD(e),"_transformResponse",void 0),xD(RD(e),"_firstRtt",void 0),xD(RD(e),"_onCancel",null),xD(RD(e),"_priOptions",null),e}return ED(n,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=mA(e.url,e.params);var n=Date.now();return new Promise((function(e,n){t._loadCompleteResolve=e,t._loadCompleteReject=n,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof fA?e:new fA(t._url,t._request)).startTime=n,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===uA&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,n=this._range[0]+this._receivedLength,i=this._range[1];t<this._range[1]-n&&(i=n+t),e=[n,i],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var n=this._xhr=new XMLHttpRequest;n.open(this._method||"GET",this._url,!0),n.responseType=this._responseType,this._timeout&&(n.timeout=this._timeout),n.withCredentials=this._withCredentials,n.onload=this._onLoad.bind(this),n.onreadystatechange=this._onReadyStatechange.bind(this),n.onerror=function(e){var n,i,r;t._running=!1;var o=new fA(t._url,t._request,null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.response,"xhr.onerror.status:"+(null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.status)+",statusText,"+(null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.statusText));o.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(o)},n.ontimeout=function(e){t.cancel();var n=new fA(t._url,t._request,{status:408},"timeout");t._onTimeout&&(n.isTimeout=!0,t._onTimeout(n,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),n.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(n)};var i=this._headers||{},r=vA(e);r&&(i.Range=r),i&&Object.keys(i).forEach((function(e){n.setRequestHeader(e,i[e])})),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),n.send(this._body)}catch(Hl){Hl.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(Hl)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,n=e.target.status;if(n<200||n>299){var i=new fA(this._url,null,_D(_D({},e.target.response),{},{status:n}),"bad response,status:"+n);return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}var r,o=null,a=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===uA){var l,c=new Uint8Array(e.target.response);if(r=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var u=Date.now()-this._startTime,h=bA(this._receivedLength,u);this.emit(OA,{speed:h,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[r,s+this._receivedLength],priOptions:this._priOptions})}o=c,a=!((null===(l=this._range)||void 0===l?void 0:l.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",r,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",a)}else a=!0,o=e.target.response;var d={ok:n>=200&&n<300,status:n,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(d=this._transformResponse(d,this._url)||d),this._onProgress&&this._onProgress(o,a,{index:this._index,vid:this._vid,range:[r,s+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},d),a?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(_A(this._onProgress?null:o,a,d,d.headers["content-length"],d.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,UD(PD(n.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,n={},i=FD(e.getAllResponseHeaders().trim().split("\r\n"));try{for(i.s();!(t=i.n()).done;){var r=t.value.split(": ");n[r[0].toLowerCase()]=r.slice(1).join(": ")}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),n}(hi),DA=["retry","retryDelay","onRetryError","transformError"],AA=function(){function e(t,n){var i,r,o;SD(this,e),this.promise=((o=new Promise((function(e,t){i=e,r=t}))).used=!1,o.resolve=function(){return o.used=!0,i.apply(void 0,arguments)},o.reject=function(){return o.used=!0,r.apply(void 0,arguments)},o),this.alive=!!n.onProgress,!n.logger&&(n.logger=new rA("Loader")),this._loaderType=t,this._loader=t===lA&&window.fetch?new LA:new IA,this._config=n,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=n.retryCheckFunc,this._logger=n.logger}var t;return ED(e,[{key:"exec",value:function(){var e=this,t=this._config,n=t.retry,i=t.retryDelay,r=t.onRetryError,o=t.transformError,a=MD(t,DA),s=function(){var t=TD(bD().mark((function t(){var l,c,u;return bD().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:l=t.sent,e.promise.resolve(l),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,o&&(c=o(c)||c),r&&e._retryCount>0&&r(c,e._retryCount,{index:a.index,vid:a.vid,range:a.range,priOptions:a.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=n)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",a.range),e._retryTimer=setTimeout(s,i),t.abrupt("return");case 26:e.promise.reject(c);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=TD(bD().mark((function e(){return bD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function MA(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var RA=function(e){OD(i,e);var t,n=jD(i);function i(e){var t;return SD(this,i),xD(RD(t=n.call(this,e)),"type",lA),xD(RD(t),"_queue",[]),xD(RD(t),"_alive",[]),xD(RD(t),"_currentTask",null),xD(RD(t),"_config",void 0),t._config=function(e){return _D({loaderType:lA,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:hA,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),t._config.loaderType!==cA&&LA.isSupported()||(t.type=cA),t.log=e.logger,t}return ED(i,[{key:"isFetch",value:function(){return this.type===lA}},{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?n=e:n.url=e||n.url||this._config.url,(n=Object.assign({},this._config,n)).params&&(n.params=Object.assign({},n.params)),n.headers&&gA(n.headers)&&(n.headers=Object.assign({},n.headers)),n.body&&gA(n.body)&&(n.body=Object.assign({},n.body)),n.transformRequest&&(n=n.transformRequest(n)||n),n.logger=this.log;var i=new AA(this.type,n);return i.loader.on(OA,(function(e){t.emit(OA,e)})),this._queue.push(i),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),i.promise}},{key:"cancel",value:(t=TD(bD().mark((function e(){var t;return bD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,MA();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,n;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(n=e._alive)||void 0===n?void 0:n.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return LA.isSupported()}}]),i}(hi),NA="core.rtcstatechange",jA={},BA={},UA={exports:{}},HA=UA.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(HA).forEach((function(e){HA[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,i){var r=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:r&&!n[e.name]&&(n[e.name]={});var o=e.push?{}:r?n[e.name]:n;!function(e,n,i,r){if(r&&!i)n[r]=t(e[1]);else for(var o=0;o<i.length;o+=1)null!=e[o+1]&&(n[i[o]]=t(e[o+1]))}(i.match(e.reg),o,e.names,e.name),e.push&&n[e.push].push(o)},i=UA.exports,r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(r).forEach((function(e){var t=e[0],r=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(i[t]||[]).length;s+=1){var l=i[t][s];if(l.reg.test(r))return n(l,a,r)}})),t.media=o,t};var o=function(e,n){var i=n.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&n.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],i=e.split(" ").map(t),r=0;r<i.length;r+=3)n.push({component:i[r],ip:i[r+1],port:i[r+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,i=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),i=!0),{scid:n,paused:i}}))}))}}(BA);var FA=UA.exports,VA=/%[sdv%]/g,zA=function(e){var t=1,n=arguments,i=n.length;return e.replace(VA,(function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},GA=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var o=t.names[r];t.name?i.push(n[t.name][o]):i.push(n[t.names[r]])}else i.push(n[t.name]);return zA.apply(null,i)},WA=["v","o","s","i","u","e","p","c","b","t","r","z","a"],KA=["i","c","b","a"],$A=BA,YA=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||WA,i=t.innerOrder||KA,r=[];return n.forEach((function(t){FA[t].forEach((function(n){n.name in e&&null!=e[n.name]?r.push(GA(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){r.push(GA(t,n,e))}))}))})),e.media.forEach((function(e){r.push(GA("m",FA.m[0],e)),i.forEach((function(t){FA[t].forEach((function(n){n.name in e&&null!=e[n.name]?r.push(GA(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){r.push(GA(t,n,e))}))}))}))})),r.join("\r\n")+"\r\n"};jA.write=YA,jA.parse=$A.parse,jA.parseParams=$A.parseParams,jA.parseFmtpConfig=$A.parseFmtpConfig,jA.parsePayloads=$A.parsePayloads,jA.parseRemoteCandidates=$A.parseRemoteCandidates,jA.parseImageAttributes=$A.parseImageAttributes,jA.parseSimulcastStreamList=$A.parseSimulcastStreamList;var qA=new rA("rts"),XA=function(e){hD(r,e);var t,n,i=vD(r);function r(e){var t;return sD(this,r),uD(pD(t=i.call(this)),"_url",""),uD(pD(t),"_pc",null),uD(pD(t),"_audioTransceicer",null),uD(pD(t),"_videoTransceicer",null),uD(pD(t),"_mediaStream",null),uD(pD(t),"_media",null),uD(pD(t),"_opts",null),uD(pD(t),"_loader",null),uD(pD(t),"_retry",0),uD(pD(t),"_waitingTimer",0),uD(pD(t),"_rctConnectStartTs",0),uD(pD(t),"_onTrack",(function(e){if(qA.log("addTrack: ",e.track,e.streams),t["_".concat(e.track.kind)]=e.track,!t._mediaStream){t._mediaStream=new MediaStream,t._media.srcObject=t._mediaStream;var n=t._media.play();n&&n.catch&&n.catch((function(e){}))}t._mediaStream.addTrack(e.track)})),uD(pD(t),"_mockWaitingByTimeupdate",(function(){var e,n;"connected"!==(null===(e=t._pc)||void 0===e?void 0:e.connectionState)&&"connected"!==(null===(n=t._pc)||void 0===n?void 0:n.iceConnectionState)||(clearTimeout(t._waitingTimer),t._waitingTimer=setTimeout((function(){var e;null!==(e=t._media)&&void 0!==e&&e.paused||t.emit("waiting")}),t._opts.stallInterval))})),uD(pD(t),"_onLoadedData",(function(){qA.log("loadeddata emit"),t.getStatsSnapshoot().then((function(e){t.emit(xA,{type:"video",elapsed:Date.now()-t._rctConnectStartTs,meta:e.video}),t.emit(xA,{type:"audio",elapsed:Date.now()-t._rctConnectStartTs,meta:e.audio})}))})),uD(pD(t),"_onLoaderRetry",(function(e,n){t.emit(EA,{error:tA.network(e),retryTime:n})})),t._opts=function(e){return iD({retryCount:0,retryDelay:1e3,loadTimeout:5e3,stallInterval:400,delayHint:0},e)}(e),t._media=t._opts.media,t._loader=new RA(iD(iD({},e.fetchOptions),{},{responseType:"json",method:"POST",retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onLoaderRetry,logger:qA})),t._retry=t._opts.retryCount,t._bindMediaEvent(),t}return cD(r,[{key:"pc",get:function(){return this._pc}},{key:"audioTrack",get:function(){return this._audio}},{key:"videoTack",get:function(){return this._video}},{key:"getStats",value:function(){return e=this._pc,new Promise((function(t){var n;null===(n=e.getStats(null))||void 0===n||n.then((function(e){var n,i;t((i=[],(n=e).forEach((function(e){"inbound-rtp"===e.type&&i.push(e)})),i.map((function(e){var t=n.get(e.codecId),i=n.get(e.trackId);return{type:e.mediaType,inboundRtp:e,codec:t,track:i}}))))}))})).catch((function(){}));var e}},{key:"getStatsSnapshoot",value:function(){return this.getStats().then((function(e){return function(e){var t,n,i,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,T,S,C,E,x,O,P,L=null==e?void 0:e.filter((function(e){return"video"===e.type}))[0],I=null==e?void 0:e.filter((function(e){return"audio"===e.type}))[0];return{video:L?{codec:null===(t=L.codec)||void 0===t?void 0:t.mimeType,payloadType:null===(n=L.codec)||void 0===n?void 0:n.payloadType,sdpFmtpLine:null===(i=L.codec)||void 0===i?void 0:i.sdpFmtpLine,bytesReceived:null===(r=L.inboundRtp)||void 0===r?void 0:r.bytesReceived,firCount:null===(o=L.inboundRtp)||void 0===o?void 0:o.firCount,pliCount:null===(a=L.inboundRtp)||void 0===a?void 0:a.pliCount,frameHeight:null===(s=L.inboundRtp)||void 0===s?void 0:s.frameHeight,frameWidth:null===(l=L.inboundRtp)||void 0===l?void 0:l.frameWidth,framesDecoded:null===(c=L.inboundRtp)||void 0===c?void 0:c.framesDecoded,framesDropped:null===(u=L.inboundRtp)||void 0===u?void 0:u.framesDropped,framesPerSecond:null===(h=L.inboundRtp)||void 0===h?void 0:h.framesPerSecond,framesReceived:null===(d=L.inboundRtp)||void 0===d?void 0:d.framesReceived,jitter:null===(f=L.inboundRtp)||void 0===f?void 0:f.jitter,jitterBufferDelay:null===(p=L.inboundRtp)||void 0===p?void 0:p.jitterBufferDelay,keyFramesDecoded:null===(g=L.inboundRtp)||void 0===g?void 0:g.keyFramesDecoded,nackCount:null===(v=L.inboundRtp)||void 0===v?void 0:v.nackCount,packetsLost:null===(y=L.inboundRtp)||void 0===y?void 0:y.packetsLost,packetsReceived:null===(m=L.inboundRtp)||void 0===m?void 0:m.packetsReceived}:void 0,audio:I?{codec:null===(_=I.codec)||void 0===_?void 0:_.mimeType,payloadType:null===(b=I.codec)||void 0===b?void 0:b.payloadType,sdpFmtpLine:null===(k=I.codec)||void 0===k?void 0:k.sdpFmtpLine,bytesReceived:null===(w=I.inboundRtp)||void 0===w?void 0:w.bytesReceived,audioLevel:null===(T=I.inboundRtp)||void 0===T?void 0:T.audioLevel,jitter:null===(S=I.inboundRtp)||void 0===S?void 0:S.jitter,jitterBufferDelay:null===(C=I.inboundRtp)||void 0===C?void 0:C.jitterBufferDelay,packetsLost:null===(E=I.inboundRtp)||void 0===E?void 0:E.packetsLost,packetsReceived:null===(x=I.inboundRtp)||void 0===x?void 0:x.packetsReceived,totalSamplesDuration:null===(O=I.inboundRtp)||void 0===O?void 0:O.totalSamplesDuration,totalSamplesReceived:null===(P=I.inboundRtp)||void 0===P?void 0:P.totalSamplesReceived}:void 0}}(e)}))}},{key:"load",value:(n=aD(rD().mark((function e(t){var n,i=this;return rD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._disconnect(),this._url=t,this._retry=this._opts.retryCount,(n=this._pc)&&n.close(),e.prev=5,this._pc=new RTCPeerConnection,this._bindRTCEvents(),e.next=10,this._connect(t);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),setTimeout((function(){return i._emitError(tA.create(ZD,null,e.t0))}));case 15:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e){return n.apply(this,arguments)})},{key:"switchURL",value:function(e){this.load(e||this._url)}},{key:"_bindRTCEvents",value:function(){var e=this,t=this._pc;t.addEventListener("track",this._onTrack),t.addEventListener("connectionstatechange",(function(){if(qA.warn("onconnectionstatechange:",t.connectionState),e.emit(NA,{state:t.connectionState,url:e._url}),"disconnected"!==t.connectionState&&"failed"!==t.connectionState||e.emit("waiting"),"failed"===t.connectionState){if(0===e._retry)return void e._emitError(tA.network(new Error("rtc connect failed")));e._retry--,e.load(e._url)}"connected"===t.connectionState&&e.emit(wA,{url:e._url,responseUrl:e._url,elapsed:Date.now()-e._rctConnectStartTs})}))}},{key:"_bindMediaEvent",value:function(){this._media.addEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media.addEventListener("loadeddata",this._onLoadedData)}},{key:"_connect",value:(t=aD(rD().mark((function e(){var t,n,i,r,o,a,s,l,c,u,h,d;return rD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this._pc).addTransceiver){e.next=11;break}return this._audioTransceicer=t.addTransceiver("audio",{direction:"recvonly"}),this._videoTransceicer=t.addTransceiver("video",{direction:"recvonly"}),(i=this._opts.delayHint)&&(this._audioTransceicer.receiver.playoutDelayHint=i,this._audioTransceicer.receiver.jitterBufferDelayHint=i,this._videoTransceicer.receiver.playoutDelayHint=i,this._videoTransceicer.receiver.jitterBufferDelayHint=i),e.next=8,t.createOffer();case 8:n=e.sent,e.next=14;break;case 11:return e.next=13,t.createOffer({iceRestart:!0,offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 13:n=e.sent;case 14:return qA.log("local offer"),qA.log(n.sdp),(r=jA.parse(n.sdp)).media.filter((function(e){return"audio"===e.type})).forEach((function(e){var t,n=null===(t=e.rtp.filter((function(e){return"opus"===e.codec}))[0])||void 0===t?void 0:t.payload;n&&e.fmtp.forEach((function(e){e.payload===n&&(e.config="minptime=10;stereo=1;useinbandfec=1")}))})),n.sdp=jA.write(r),qA.log("local offer modified:\n",n.sdp),e.next=22,t.setLocalDescription(n);case 22:return e.prev=22,s=/_?session_id=([^&$]+)/.exec(this._url),l=s?s[1]:Date.now()+"",this.emit(TA,{url:this._url,offersdp:n.sdp,sessionId:l}),c=Date.now(),e.next=29,this._loader.load(this._url,{body:JSON.stringify({sessionId:l,version:"1.0-html",localSdp:n})});case 29:if(u=e.sent,this.emit(SA,{headers:u.response.headers}),200===(null==(h=null==u?void 0:u.data)?void 0:h.code)){e.next=34;break}throw new Error("code: ".concat(null==h?void 0:h.code,", message:").concat(null==h?void 0:h.message));case 34:return qA.log("answer:"),qA.log(null===(o=h.remoteSdp)||void 0===o?void 0:o.sdp),this.emit(CA,{url:this._url,elapsed:Date.now()-c,answersdp:null===(a=h.remoteSdp)||void 0===a?void 0:a.sdp}),(d=jA.parse(h.remoteSdp.sdp)).media.forEach((function(e){e.fingerprint.hash=e.fingerprint.hash.toUpperCase()})),h.remoteSdp.sdp=jA.write(d),qA.log("answer modified:\n",h.remoteSdp.sdp),this._rctConnectStartTs=Date.now(),e.next=44,this._pc.setRemoteDescription(h.remoteSdp);case 44:e.next=49;break;case 46:e.prev=46,e.t0=e.catch(22),this._emitError(tA.network(e.t0));case 49:case"end":return e.stop()}}),e,this,[[22,46]])}))),function(){return t.apply(this,arguments)})},{key:"_disconnect",value:function(){var e;null===(e=this._loader)||void 0===e||e.cancel(),this._audioTransceicer=null,this._videoTransceicer=null,this._mediaStream=null}},{key:"_emitError",value:function(e){this.emit(kA,e)}},{key:"destroy",value:function(){var e;this._disconnect(),null===(e=this._media)||void 0===e||e.removeEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media&&(this._media.srcObject=null),this._pc&&this._pc.close(),this._loader=null,this._media=null,this._pc=null}}],[{key:"enableLogger",value:function(){rA.enable()}},{key:"disableLogger",value:function(){rA.disable()}}]),r}(hi);try{localStorage.getItem("xgd")?XA.enableLogger():XA.disableLogger()}catch(hV){}function JA(){return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)}var ZA=function(e){hD(i,e);var t,n=vD(i);function i(){var e;sD(this,i);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return uD(pD(e=n.call.apply(n,[this].concat(r))),"_rts",null),uD(pD(e),"_rtsOpts",null),uD(pD(e),"_init",(function(){var t;null===(t=e._rts)||void 0===t||t.destroy();var n=e.player.config,i=n.rts||{};e._rtsOpts=i,e._rts=new XA(iD({media:e.player.video},i)),e._rts.load(n.url)})),uD(pD(e),"_onSwitchURL",(function(t){e._rts&&(e.player.config.url=t,e._rts.switchURL(t))})),e}return cD(i,[{key:"pc",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.pc}},{key:"videoTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.videoTack}},{key:"audioTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.audioTrack}},{key:"core",get:function(){return this._rts}},{key:"version",get:function(){return"0.2.0-alpha.3"}},{key:"beforePlayerInit",value:function(){var e,t=this;this._init(),this.player.switchURL=this._onSwitchURL,null===(e=this.player)||void 0===e||e.useHooks("replay",(function(){var e;return null===(e=t._rts)||void 0===e?void 0:e.switchURL()})),this.on(tr,this._onSwitchURL),this.on(er,this.destroy),this._transErrorEvent(),this._transCoreEvent(TA),this._transCoreEvent(CA),this._transCoreEvent(wA),this._transCoreEvent(SA),this._transCoreEvent(EA),this._transCoreEvent(xA),this._transCoreEvent(NA);try{Vr.defineGetterOrSetter(this.player,{__url:{get:function(){try{return URL.createObjectURL(new MediaSource)}catch(Hl){var e,n;null!==(e=t.player)&&void 0!==e&&null!==(n=e.video)&&void 0!==n&&n.srcObject||(t.player.video.srcObject=new MediaStream)}}}})}catch(Hl){}}},{key:"getStats",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStats()}},{key:"getStatsSnapshoot",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStatsSnapshoot()}},{key:"_transErrorEvent",value:function(){var e=this;this._rts.on(kA,(function(t){if(e.player){var n=new Oi(e.player,t),i=e._rtsOpts,r=i.backupConstruct,o=i.backupURL;if(o){var a,s=e.player;s.emit("core_event",iD(iD({},{url:s.config.url,code:n.errorCode,message:n.message,httpCode:n.httpCode}),{},{eventName:"core.degrade"})),s.emit("degrade",{url:s.config.url,code:n.errorCode,message:n.message,httpCode:n.httpCode}),s.unRegisterPlugin("rts"),e._rts=null,s.rts=null,null!==(a=s.video)&&void 0!==a&&a.srcObject&&(s.video.srcObject=null),s.config.url=o,r?s.registerPlugin(r).beforePlayerInit():s.video.src=o}else e.player.emit(Ai,n)}})),this._rts.on("waiting",(function(){var t;null===(t=e.player)||void 0===t||t.emit("waiting")}))}},{key:"_transCoreEvent",value:function(e){var t=this;this._rts.on(e,(function(n){t.player&&t.player.emit("core_event",iD(iD({},n),{},{eventName:e}))}))}},{key:"destroy",value:function(){var e;null===(e=this._rts)||void 0===e||e.destroy()}}],[{key:"pluginName",get:function(){return"rts"}},{key:"isSupported",value:function(){return JA()}},{key:"getCapacity",value:function(){return function(){if(!JA())return Promise.reject("RTCPeerConnection no support");var e;try{(e=new RTCPeerConnection).addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"})}catch(Hl){return Promise.reject(null==Hl?void 0:Hl.message)}return e.createOffer().then((function(t){var n,i,r,o;qA.log(t.sdp);var a=jA.parse(t.sdp),s=null===(n=a.media)||void 0===n?void 0:n.filter((function(e){return"video"===e.type}))[0],l=null===(i=a.media)||void 0===i?void 0:i.filter((function(e){return"audio"===e.type}))[0],c=null==s||null===(r=s.rtp)||void 0===r?void 0:r.filter((function(e){return"VP8"===e.codec||"VP9"===e.codec||"H264"===e.codec})),u=null==l||null===(o=l.rtp)||void 0===o?void 0:o.filter((function(e){return"opus"===e.codec})),h=null==s?void 0:s.fmtp,d=null==l?void 0:l.fmtp;return h&&c.map((function(e){var t;e.config=null===(t=h.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),d&&u.map((function(e){var t;e.config=null===(t=d.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),e.close(),{video:c,audio:u}}))}()}},{key:"isSupportedH264",value:(t=aD(rD().mark((function e(t){var n,r,o,a,s;return rD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.getCapacity();case 3:if(r=e.sent,o=null===(n=r.video)||void 0===n?void 0:n.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length){e.next=10;break}return e.next=8,i.getCapacity();case 8:s=e.sent,o=null===(a=s.video)||void 0===a?void 0:a.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length;case 10:return e.abrupt("return",!!o);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),function(e){return t.apply(this,arguments)})}]),i}(Vr);function QA(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var eM=Math.max;var tM=ce?function(e,t){return ce(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:An,nM=tM,iM=Date.now;var rM=function(e){var t=0,n=0;return function(){var i=iM(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(nM),oM=rM;function aM(e,t){return oM(function(e,t,n){return t=eM(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=eM(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),QA(e,this,s)}}(e,t,An),e+"")}var sM,lM=Object.prototype.hasOwnProperty,cM=(sM=function(e,t){if(He(t)||Ge(t))fe(t,We(t),e);else for(var n in t)lM.call(t,n)&&de(e,n,t[n])},aM((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=sM.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!U(n))return!1;var r=i(t);return!!("number"==r?Ge(n)&&xe(t,n.length):"string"==r&&t in n)&&S(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var s=t[n];s&&sM(e,s,n,o)}return e}))),uM=cM,hM=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"beforeCreate",value:function(e){var t=(e.player.config.rtm||{}).backupStreamType,n={flv:window.FlvPlayer,hls:window.HlsPlayer};e.player.config.rts=uM({},e.player.config.rtm,{backupConstruct:n[t]})}},{key:"afterCreate",value:function(){var e=this.player;e.on("degrade",(function(){e.unRegisterPlugin("rtm")}))}}],[{key:"pluginName",get:function(){return"rtm"}}]),n}(ZA),dM=function(e){return e.PLAYER_CREATED_FINISH="player_create_finish",e.PLAYER_REBUILD="player_rebuild",e.NOT_SUPPORT_HARDWARE_DECODER="not_support_hardware_decoder",e.NOT_SUPPORT_SOFT_DECODER="not_support_soft_decoder",e.TOKEN_EXPIRED="playAuthToken_expired",e.UMD_LOAD_FAIL="umd_load_fail",e}(dM||{}),fM=function(e){return e.DANMU_CHANGE="danmu_change",e.TIME_SHIFT_CHANGE="time_shift_change",e.AI_SUBTITLE_LANG_CHANGE="ai_subtitle_lang_change",e.AI_SUBTITLE_MATCH="ai_subtitle_match",e.CANCEL_UNMUTE="cancel_unmute",e.REFRESH_CLICK="refresh_click",e.PLAY_BACKUP_CHANGE="play_backup_change",e.PLAY_BACKUP_CHANGE_FINISH="play_backup_change_finish",e.PLAY_ERROR_BUTTON_CLICK="play_error_button_click",e.PlAY_URL_CHANGE="play_url_change",e.SHOW_PLAY_ERROR="show_play_error",e.PLAYER_EXTEND_BUTTON="player_extend_button",e.LONG_WAITING="long_waiting",e.OFTEN_WAITING="often_waiting",e.DEFINITION_DEMOTE="definition_demote",e.LARKWINDOW_CHANGE="larkWindow_change",e.PANEL_MODE_CHANGE="panel_mode_change",e.INNER_DEFINITION_CHANGE="inner_definition_change",e.LINE_CHANGE="line_change",e.GET_PLAY_URL_ERR="get_play_url_err",e.MEDIA_EXPIRED="MEDIA_EXPIRED",e.MIRROR_CHANGE="mirror_change",e.TIME_SCALE_CHANGE="time_scale_change",e.MUSIC_MODE_CHANGE="music_mode_change",e.MUSIC_CHANGE="music_change",e.MUSIC_LIST_CHANGE="music_list_change",e.AUTOPLAY_SUCCESS="autoplay_success",e.AUTOPLAY_FAILED="autoplay_failed",e}(fM||{}),pM=Object.freeze(Object.defineProperty({__proto__:null,SDKEvents:dM,PluginEvents:fM},Symbol.toStringTag,{value:"Module"})),gM=3,vM=3,yM=4,mM=5,_M=6,bM=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.playerData=i.playerConfig.playerData,i}return l(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playerData,n=t.getLineList(),i=t.current.lineId;Array.isArray(n)&&n.length>0&&(e.config.list=n.map((function(t){return t.text=e.player.i18n[t.lineTextKey]||t.lineTextKey,t}))),e.config.defaultLine=i}},{key:"afterCreate",value:function(){m(h(n.prototype),"afterCreate",this).call(this),this.config.list.length<2&&this.hide()}},{key:"afterPlayerInit",value:function(){}},{key:"renderItemList",value:function(){var e=this,t=this.config,i=t.list,r=t.defaultLine,o=0,a=i.map((function(t,n){var i,a={lineId:t.lineId||"",showText:e.i18n[t.lineTextKey]||t.lineTextKey,isCurrent:!1,selected:!1};return yi.isUndefined(t.lineId)||(null===(i=t.lineId)||void 0===i?void 0:i.toString())!==(null==r?void 0:r.toString())||(a.isCurrent=!0,a.selected=!0,o=n),a}));m(h(n.prototype),"renderItemList",this).call(this,a,o)}},{key:"onItemClick",value:function(e,t){this.player.emit(fM.LINE_CHANGE,{from:this.playerData.current.lineId,to:t.to.lineId}),this.playerData.current.lineId=t.to.lineId,this.player.emit(dM.PLAYER_REBUILD)}}],[{key:"pluginName",get:function(){return"sdkMultilinePlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.CONTROLS_RIGHT,index:yM,list:[],defaultLine:0,className:"xgplayer-multiline",hidePortrait:!1,isShowIcon:!0}}}]),n}(ns),kM=function(e){u(i,e);var n=v(i);function i(e){var t;return a(this,i),(t=n.call(this,e)).playerData=null,t.toastInfo={},t.canChange=!0,t._playTimer=null,t.playerData=t.playerConfig.playerData,t.dataMonitoring(),t}return l(i,[{key:"registerLanguageTexts",value:function(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"beforeCreate",value:function(e){this.toastInfo={},this.canChange=!0;var t=this.getConfig(e.player),n=t.defaultDefinition,i=t.list;e.config.defaultDefinition=n,e.config.list=i}},{key:"getConfig",value:function(e){var t=this,n={list:[],defaultDefinition:""},i=e.config.playerData;this.toastInfo={},this.canChange=!0;var r=i.current,o=r.lineId,a=r.definition,s=i.getDefinitionListByLineId(o);return Array.isArray(s)&&s.length>0&&(n.list=s.map((function(n){return n.text||(n.text=t.getShowText(e.i18n,n)),n}))),n.defaultDefinition=a,n}},{key:"dataMonitoring",value:function(){var e=this;Wn.subscribeProperty(this.playerData.current,"definition",(function(n,i){if(e.canChange&&n!==i&&e.player){var r=e.config.list,o=(void 0===r?[]:r).find((function(e){return e.definition===i}));o&&o.url&&(e.player.changeDefinition(t(t({},o),{},{definition:i,url:o.url})),e.player.emit(fM.INNER_DEFINITION_CHANGE,{from:n,to:i,url:o.url}),e.player.emit(fM.PlAY_URL_CHANGE,{url:o.url,from:fM.INNER_DEFINITION_CHANGE}),e.renderItemList(i),e.player.config.isLive&&(e._playTimer=setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3)))}}))}},{key:"showToast",value:function(e){var t,n=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i){var r=e.showText,o=i.add("".concat(this.langText.switching).concat(r,"..."),0,!0);this.toastInfo[o]={showTime:Date.now(),delayClose:!1},this.toastInfo[o].timer=setTimeout((function(){var e;null!==(e=n.toastInfo[o])&&void 0!==e&&e.delayClose&&(i.remove(o),clearTimeout(n.toastInfo[o].timer),delete n.toastInfo[o])}),2e3),this.player.once(sr,(function(){var e;Date.now()-(null===(e=n.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?(i.remove(o),delete n.toastInfo[o]):n.toastInfo[o].delayClose=!0}))}}},{key:"afterCreate",value:function(){m(h(i.prototype),"afterCreate",this).call(this),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.hide():(this.renderItemList(this.config.list),this.show()))}},{key:"afterPlayerInit",value:function(){}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return e[t.definitionTextKey]||t.definitionTextKey||t.definition}},{key:"renderItemList",value:function(e){var t=this,n=this.config,r=n.list,o=n.defaultDefinition,a=0,s=r.map((function(n,i){var r={url:n.url,definition:n.definition||"",showText:t.getShowText(t.i18n,n),isCurrent:!1,selected:!1},s="string"==typeof e?n.definition===e:n.definition===o;return!yi.isUndefined(n.definition)&&s&&(r.isCurrent=!0,r.selected=!0,a=i),r}));m(h(i.prototype),"renderItemList",this).call(this,s,a)}},{key:"onItemClick",value:function(e,t){this.showToast(t.to),this.playerData.current.definition=t.to.definition,"ontouchstart"in window&&this.optionsList.hide()}},{key:"destroy",value:function(){Object.values(this.toastInfo).forEach((function(e){null!=e&&e.timer&&clearTimeout(e.timer)})),clearTimeout(this._playTimer)}}],[{key:"pluginName",get:function(){return"sdkDefinitionPlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.CONTROLS_RIGHT,index:gM,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,className:"xgplayer-definition",isShowIcon:!0,isNeedAuto:!0,allowedSize:null}}}]),i}(ns);function wM(){return(new DOMParser).parseFromString('<svg width="19" height="16" viewBox="0 0 19 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_18_7532)" filter="url(#filter0_d_18_7532)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.33333 3.19115C9.33333 2.79702 8.91856 2.54067 8.56604 2.71694L4.66668 4.66662C4.66667 4.66662 4.66667 4.66663 4.66667 4.66663C4.66667 4.66664 4.66666 4.66665 4.66665 4.66665H3.19685C2.90404 4.66665 2.66666 4.90402 2.66666 5.19684V9.4698C2.66666 9.76261 2.90404 9.99998 3.19685 9.99998H4.55791C4.62971 9.99998 4.70076 10.0146 4.76676 10.0429L8.5943 11.6832C8.94415 11.8332 9.33333 11.5765 9.33333 11.1959V3.19115Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 6.87773L14.8934 4.7138C14.9485 4.6509 15.0377 4.6509 15.0927 4.7138L15.2921 4.94158C15.3471 5.00448 15.3471 5.10646 15.2921 5.16936L13.3986 7.33329L15.2921 9.49722C15.3471 9.56012 15.3471 9.6621 15.2921 9.725L15.0927 9.95278C15.0377 10.0157 14.9485 10.0157 14.8934 9.95278L13 7.78886L11.1066 9.95278C11.0515 10.0157 10.9623 10.0157 10.9073 9.95278L10.7079 9.725C10.6529 9.6621 10.6529 9.56012 10.7079 9.49722L12.6014 7.33329L10.7079 5.16936C10.6529 5.10646 10.6529 5.00448 10.7079 4.94158L10.9073 4.7138C10.9623 4.6509 11.0515 4.6509 11.1066 4.7138L13 6.87773Z" fill="white" stroke="white" stroke-width="0.530187"/>\n </g>\n <defs>\n <filter id="filter0_d_18_7532" x="-0.666667" y="0" width="19.3333" height="19.3333" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feOffset dy="2.66667"/>\n <feGaussianBlur stdDeviation="1.33333"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_7532"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_7532" result="shape"/>\n </filter>\n <clipPath id="clip0_18_7532">\n <rect width="14" height="14" fill="white" transform="translate(2)"/>\n </clipPath>\n </defs>\n</svg>\n\n',"image/svg+xml").firstChild}var TM=Si.isWeixin,SM=Si.os,CM=Si.device,EM=SM.isAndroid,xM=SM.isIos,OM="mobile"===CM,PM=0,LM=!1,IM=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).state={mode:0,showUnmuteBt:!1},i.userClickPlay=function(){if(!LM){var e=i.player.play();e&&e.then?e.then((function(){console.log("user action autoplay success"),LM=!0})).catch((function(e){console.warn("user action autoplay fail:",e)})):(console.warn("no play promise"),LM=!0)}},i}return l(n,[{key:"afterCreate",value:function(){this.initState(),this.initEvents(),this.setWXAutoPlay()}},{key:"registerLanguageTexts",value:function(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"},muted:{jp:"ミュート",en:"muted",zh:"已静音","zh-hk":"已靜音"}}}},{key:"registerIcons",value:function(){return{muted:{icon:wM,class:"xgplayer-muted-svg"}}}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initState",value:function(){var e=this.player.config,t=e.enableDegradeMuteAutoplay,n=e.enableWxJsBridgeAutoplay,i=e.enableUserActionAutoplay;t&&(this.config.enableDegradeMuteAutoplay=!0),n&&(this.config.enableWxJsBridgeAutoplay=!0),i&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}},{key:"initEvents",value:function(){this.player.on(Ji,this.handleAutoplayPrevented.bind(this)),this.player.on(Xi,this.handleAutoplayStart.bind(this)),this.player.on(Hi,this.handleVolumechange.bind(this)),this.setUserActionAutoPlay()}},{key:"setWXAutoPlay",value:function(){TM&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1))}},{key:"wxCanPlayFn",value:function(){var e=this;window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(function(){e.wxTimer=setTimeout((function(){e.wxTimer&&clearTimeout(e.wxTimer);var t=e.player.play();t&&t.then?t.then((function(){console.log("wechat autoplay success")})).catch((function(t){console.warn("wechat autoplay fail:",t),e.state.showUnmuteBt=!1,e.renderUnmuteBt()})):console.warn("wechat browser no play promise")}))}))}},{key:"wxPlay",value:function(){this.player.readyState>=2?this.wxCanPlayFn():EM?this.player.once(Bi,this.wxCanPlayFn.bind(this)):xM&&this.player.once(Zi,this.wxCanPlayFn.bind(this))}},{key:"setUserActionAutoPlay",value:function(){var e=this;this.config.enableUserActionAutoplay&&this.player.once(fM.AUTOPLAY_FAILED,(function(){e.hasSetUserAutoplay=!0,(e.config.userActionDom instanceof window.Node?e.config.userActionDom:window.document.body).addEventListener("click",e.userClickPlay,!1)}))}},{key:"handleAutoplayPrevented",value:function(){return 0===this.state.mode?(console.warn("unmute autoplay fail"),this.player.emit(fM.AUTOPLAY_FAILED,{mode:"unmute"}),EM&&TM?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(console.warn("mute autoplay fail"),this.player.emit(fM.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(fM.AUTOPLAY_FAILED,{mode:"noSupport"}),void console.warn("not support autoplay")):void 0}},{key:"changeMuteMode",value:function(){var e=this;this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((function(){e.timer&&clearTimeout(e.timer);var t=e.player.play();t&&t.then?t.then((function(){console.log("degrade mute autoplay success")})).catch((function(t){console.warn("degrade mute autoplay fail:",t),e.player.muted=!1,e.state.showUnmuteBt=!1,e.renderUnmuteBt()})):console.warn("no play promise")}))}},{key:"handleAutoplayStart",value:function(){if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(fM.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(fM.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(fM.AUTOPLAY_SUCCESS,{mode:"unmute"})}},{key:"handleVolumechange",value:function(e){this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())}},{key:"renderUnmuteBt",value:function(){var e=this.root;if(e&&(e.innerHTML="",this.state.showUnmuteBt)){var t=this.langText.unmute,n=yi.createDom("div",t,void 0,"xgplayer-unmute-bt");e.appendChild(n),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute.bind(this)),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute.bind(this))}}},{key:"cancelUnmute",value:function(){var e,t,n=Date.now();if(n-PM>200){PM=n,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt();var i=null===(e=this.player.config)||void 0===e||null===(e=e.playerData)||void 0===e?void 0:e.isMobile,r="rtm"===(null===(t=this.player.config)||void 0===t||null===(t=t.playerData)||void 0===t||null===(t=t.current)||void 0===t?void 0:t.streamType);i&&r&&(this.player.volume>.5?this.player.volume=this.player.volume-.1:this.player.volume=this.player.volume+.1)}}},{key:"destroy",value:function(){if(this.player.off(Ji,this.handleAutoplayPrevented.bind(this)),this.player.off(Xi,this.handleAutoplayStart.bind(this)),this.player.off(Hi,this.handleVolumechange.bind(this)),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1),this.hasSetUserAutoplay){var e=OM?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}},{key:"render",value:function(){return'<div class="xgplayer-unmute"></div>'}}],[{key:"pluginName",get:function(){return"AutoplayPlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1}}}]),n}(Qr);function DM(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var AM=function(){return L.Date.now()},MM=/\s/;var RM=/^\s+/;function NM(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&MM.test(e.charAt(t)););return t}(e)+1).replace(RM,""):e}var jM=/^[-+]0x[0-9a-f]+$/i,BM=/^0b[01]+$/i,UM=/^0o[0-7]+$/i,HM=parseInt;function FM(e){if("number"==typeof e)return e;if(dn(e))return NaN;if(U(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=U(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=NM(e);var n=BM.test(e);return n||UM.test(e)?HM(e.slice(2),n?2:8):jM.test(e)?NaN:+e}var VM=Math.max,zM=Math.min;function GM(e,t,n){var i,r,o,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=i,o=r;return i=r=void 0,c=t,a=e.apply(o,n)}function p(e){return c=e,s=setTimeout(v,t),u?f(e):a}function g(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function v(){var e=AM();if(g(e))return y(e);s=setTimeout(v,function(e){var n=t-(e-l);return h?zM(n,o-(e-c)):n}(e))}function y(e){return s=void 0,d&&i?f(e):(i=r=void 0,a)}function m(){var e=AM(),n=g(e);if(i=arguments,r=this,l=e,n){if(void 0===s)return p(l);if(h)return clearTimeout(s),s=setTimeout(v,t),f(l)}return void 0===s&&(s=setTimeout(v,t)),a}return t=FM(t)||0,U(n)&&(u=!!n.leading,o=(h="maxWait"in n)?VM(FM(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=r=s=void 0},m.flush=function(){return void 0===s?a:y(AM())},m}var WM=Qr.POSITIONS,KM=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.refresh),this.initEvents()}},{key:"registerIcons",value:function(){return{refresh:{icon:DM,class:"xgplayer-refresh-svg"}}}},{key:"registerLanguageTexts",value:function(){return{refresh:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"}}}},{key:"initEvents",value:function(){this.handleRefresh=GM(this.handleRefresh.bind(this),200);var e="mobile"===Si.device?"touchend":"click";this.bind(e,this.handleRefresh),this.show()}},{key:"handleRefresh",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.addClass("xgplayer-is-enter"),t.pause(),t.emit(fM.REFRESH_CLICK),setTimeout((function(){t&&t.retry(),t.once("canplay",(function(){t.removeClass("xgplayer-is-enter")}))})))}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.handleRefresh)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-refresh">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="refresh">'.concat(this.langText.refresh,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"refresh"}},{key:"defaultConfig",get:function(){return{position:WM.CONTROLS_LEFT,index:1}}}]),n}(Qr);function $M(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var YM=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).panel=null,i.panelContainer=null,i}return l(n,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){this.renderMoreIcon()}},{key:"updateLang",value:function(e){if(this.panelContainer){var t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),n=this.getAndSplitList().extraList;t.forEach((function(t){var i,r=Number(t.getAttribute("plugin-index"));null!==(i=n[r])&&void 0!==i&&null!==(i=i.textTips)&&void 0!==i&&i[e]&&(t.innerHTML=n[r].textTips[e])}))}}},{key:"registerIcons",value:function(){return{more:{icon:$M,class:"xgplayer-more-svg"}}}},{key:"getAndSplitList",value:function(){var e,t,n,i,r,o=(null!==(e=this.player.config.ignores)&&void 0!==e?e:[]).map((function(e){return e.toLowerCase()})),a=this.config.iconPlugins.filter((function(e){return!o.includes(e.pluginName.toLowerCase())}));return a.length>this.config.maxShowNum+1?(i=a.slice(0,this.config.maxShowNum),r=a.slice(-(a.length-this.config.maxShowNum))):i=b(a),{list:null!==(t=i)&&void 0!==t?t:[],extraList:null!==(n=r)&&void 0!==n?n:[]}}},{key:"children",value:function(){var e=this,t=this.getAndSplitList().list,n={};return t.forEach((function(t){n[t.pluginName]={plugin:t,options:{root:e.root}}})),n}},{key:"renderMoreIcon",value:function(){var e=this,t=this.getAndSplitList().extraList;if(0!==t.length){var n=this.root,i=yi.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(function(){e.renderPanel(t)}));var r=yi.createDom("xg-icon","",{"data-index":0},"xgplayer-more");r.appendChild(i),n.appendChild(r)}}},{key:"renderPanel",value:function(e){var t=this;this.panelContainer||(this.panelContainer=yi.createDom("div","",{},"panel-content"),e.forEach((function(e,n){var i,r,o=yi.createDom("div","",{},"panel-icon-bt"),a=yi.createDom("div","",{},"panel-icon-svg");o.appendChild(a),t.registerExtraPlugin(e,a);var s="zh-cn"===t.player.lang?"zh":t.player.lang,l=null!==(i=null===(r=e.textTips)||void 0===r?void 0:r[s])&&void 0!==i?i:e.pluginName;o.appendChild(yi.createDom("span",l,{"plugin-index":n},"panel-icon-bt-text")),t.panelContainer.appendChild(o)}))),this.player.panel.showPanel(this.panelContainer)}},{key:"registerExtraPlugin",value:function(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}},{key:"destroy",value:function(){}},{key:"render",value:function(){return'<div class="xgplayer-rightTop-iconList"></div>'}}],[{key:"pluginName",get:function(){return"MoreButtonPlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}}]),n}(Qr);function qM(){return(new DOMParser).parseFromString('<svg width="150" height="162" viewBox="0 0 150 162" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M127.718 112.831H6.13675C4.19663 112.831 2.25651 108.974 2.90322 104.475C3.54993 99.9761 8.07687 99.9761 13.8972 99.9761C11.9571 97.4052 9.37028 88.4069 15.8373 81.3369C22.3044 74.2668 25.5379 74.2668 34.5918 75.5526C33.9451 63.9837 47.526 34.4178 77.2744 35.0605C107.023 35.7032 116.077 54.3421 119.957 63.3404C129.011 62.6976 147.765 66.554 149.706 87.1214C151.258 103.575 135.694 111.117 127.718 112.831Z" fill="#F1F4F8"/>\n<path d="M44.9346 91.6022L43.6782 99.8032" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M47.3545 125.695L48.6109 117.494" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M31.5347 97.7378L38.7295 101.869" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M60.7544 119.559L53.5595 115.428" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M69.6755 44.5318L138.35 26.0209C139.115 25.8148 139.804 26.5367 139.563 27.2909L121.081 85.1146C120.982 85.4243 120.739 85.6665 120.429 85.7641L52.0645 107.28C51.2996 107.521 50.5766 106.809 50.8062 106.04L68.9776 45.2111C69.0768 44.879 69.3409 44.622 69.6755 44.5318Z" fill="#D0D6E0" stroke="#D0D6E0" stroke-width="4" stroke-linecap="round"/>\n<path d="M83.1285 52.7415C91.6454 54.3438 107.322 62.0019 101.894 79.8155" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<path d="M84.138 62.3385C88.3894 63.1384 96.2148 66.9611 93.5053 75.8531" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<ellipse cx="83.6417" cy="71.98" rx="3.08443" ry="3.07025" transform="rotate(12.6375 83.6417 71.98)" fill="white"/>\n<path d="M43.4699 110.358C39.5425 109.114 30.6316 108.203 26.4077 114.511C21.1278 122.397 36.5031 152.755 2.11053 160.141" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n</svg>\n',"image/svg+xml").firstChild}var XM=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.state={showError:!1,retryTimes:0,idx:0},i._errDetailList=[],i.playerData=e.player.config.playerData,i}return l(n,[{key:"afterCreate",value:function(){var e,t;this.initEvents(),this.errNoteMap={other:null!==(e=null===(t=this.i18n.ERROR_TYPES)||void 0===t||null===(t=t.other)||void 0===t?void 0:t.msg)&&void 0!==e?e:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE,4:this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED,2100:this.i18n.NETWORK_ERROR,2101:this.i18n.NETWORK_TIMEOUT,9100:this.i18n.GET_URL_ERR_BY_TOKEN,9101:this.i18n.PLAY_AUTH_TOKEN_EXPIRED,9102:this.i18n.HLS_KEY_TOKEN_EXPIRED,5200:this.i18n.MEDIA_SOURCE_CANNOT_PLAY_TYPE,9999:this.i18n.VOD_LOG_NOT_CONFIGURED}}},{key:"registerLanguageTexts",value:function(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"}}}},{key:"registerIcons",value:function(){return{errorImg:{icon:qM,class:"xgplayer-error-svg"}}}},{key:"updateLang",value:function(){if(this.$errorDom){var e=this.$errorDom.querySelector(".xgplayer-error-tips");if(e){var t,n,i=null!==(t=null===(n=this.config.errorTipsText)||void 0===n?void 0:n[this.lang])&&void 0!==t?t:this.langText.errorTips;e.innerHTML=i}var r=this.$errorDom.querySelector(".xgplayer-error-button");r&&(r.innerHTML=this.langText.clickButton)}}},{key:"initEvents",value:function(){this.player.on(Ai,this.handleError.bind(this)),this.playerData.isLive&&(this.player.on(Ii,this.handleEnd.bind(this)),this.player.on(fM.REFRESH_CLICK,this.closeError.bind(this))),this.on(Bi,this.closeError.bind(this)),this.on(Pi,this.closeError.bind(this))}},{key:"handleError",value:function(e){this.isVodLogConError=9999===(null==e?void 0:e.errorCode),this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)}},{key:"handleEnd",value:function(){this.player&&this.player.pause(),this.config.isNeedDemoteBack&&this.changeMainOrBackup()}},{key:"getRetryList",value:function(){var e,t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url].concat(b(null!==(e=null==t?void 0:t.backUrlList)&&void 0!==e?e:[]))}},{key:"changeMainOrBackup",value:function(){var e=this;this.player.addClass(io.ENTER);var t=this.getRetryList(),n=this.config.retryLoopNum*t.length,i=(t.indexOf(this.player.config.url)+1)%t.length;this.state.idx=i;var r=t[i];if(!r||this.state.retryTimes===n)return this.player.removeClass(io.ENTER),this.state.retryTimes===n&&this.player.emit(fM.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(function(){e.state.retryTimes=0})),console.log("重试第".concat(this.state.retryTimes,"次"),r),this.player.emit(fM.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:r,retryTimes:this.state.retryTimes}),this.changeUrl(r),this.state.retryTimes=this.state.retryTimes+1}},{key:"changeUrl",value:function(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(fM.PlAY_URL_CHANGE,{url:e,from:fM.PLAY_BACKUP_CHANGE})}},{key:"resetTimes",value:function(){this.state.retryTimes=0,this.state.idx=0}},{key:"renderError",value:function(e){var t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(fM.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}},{key:"addErrDetail",value:function(e){Array.isArray(e)?this._errDetailList=[].concat(b(this._errDetailList),b(e)):this._errDetailList.push(e)}},{key:"getErrorDom",value:function(e){var t=this;if(!this.$errorDom){var n,i;if(this.$errorDom=yi.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){var r=yi.createDom("div","",void 0,"xgplayer-error-img");r.appendChild(this.icons.errorImg),this.$errorDom.appendChild(r)}if(this.config.errorTips){var o,a,s="";if(null!==(o=this.config)&&void 0!==o&&null!==(o=o.errorTipsText)&&void 0!==o&&o[this.lang])s=null===(a=this.config.errorTipsText)||void 0===a?void 0:a[this.lang];else if(e){var l,c,u=e.errorCode,h=this.player.errorNote?this.i18n[this.player.errorNote]:"";if(!h)h=null!==(l=null!==(c=this.errNoteMap[u])&&void 0!==c?c:this.errNoteMap.other)&&void 0!==l?l:"error";s=h}else s=this.langText.errorTips;var d=yi.createDom("div",s,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(d)}if(this.config.isNeedRefreshButton){var f=yi.createDom("div",this.langText.clickButton,void 0,"xgplayer-error-button");this.bind(".xgplayer-error-button","click",this.handleButtonClick.bind(this)),this.$errorDom.appendChild(f)}if(null!==(n=this._errDetailList)&&void 0!==n&&n.length)null===(i=this._errDetailList)||void 0===i||i.forEach((function(e){var n="function"==typeof e?e():e;if(n){var i=yi.createDom("div","".concat(n.label,": ").concat(n.value),void 0,"xgplayer-error-detail-info");t.$errorDom.appendChild(i)}}));this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}},{key:"handleButtonClick",value:function(){var e,t;null===(e=this.player)||void 0===e||e.emit(fM.PLAY_ERROR_BUTTON_CLICK),null===(t=this.player)||void 0===t||t.retry(),this.closeError()}},{key:"closeError",value:function(){this.state.showError=!1,this.renderError()}},{key:"destroy",value:function(){this.player.off(Ai,this.handleError.bind(this)),this.playerData.isLive&&this.player.off(Ii,this.handleEnd.bind(this))}},{key:"render",value:function(){return'<xgplayer-error class="xgplayer-error"></xgplayer-error>'}}],[{key:"pluginName",get:function(){return"sdkErrorPlugin"}},{key:"defaultConfig",get:function(){return{errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:Qr.POSITIONS.ROOT}}}]),n}(Qr);function JM(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.76a.76.76 0 01-.76-.76z" fill="#fff"/><circle cx="15.1" cy="14.201" r="3.4" fill="#3370FF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.185 13.756a.5.5 0 01.707 0l.866.866 1.78-1.78a.5.5 0 11.707.707l-2.133 2.134a.5.5 0 01-.707 0l-1.22-1.22a.5.5 0 010-.707z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function ZM(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.759a.76.76 0 01-.759-.76zm7.202 2.303a2.2 2.2 0 003.011 3.011l-3.011-3.01zm3.915 1.992a2.2 2.2 0 00-2.896-2.896l2.896 2.896zm1.383-.879a3.4 3.4 0 11-6.8 0 3.4 3.4 0 016.8 0z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function QM(){return(new DOMParser).parseFromString('<svg fill="none" stroke="currentColor" stroke-width="4" viewBox="0 0 48 48" width="1em" height="1em"\n class="arco-icon arco-icon-refresh">\n <path\n d="M38.837 18C36.463 12.136 30.715 8 24 8 15.163 8 8 15.163 8 24s7.163 16 16 16c7.455 0 13.72-5.1 15.496-12M40 8v10H30">\n </path>\n</svg>',"image/svg+xml").firstChild}function eR(e){return e&&e.ownerDocument||document}function tR(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function nR(e,t){e.classList?e.classList.add(t):tR(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var iR=!("undefined"==typeof window||!window.document||!window.document.createElement),rR=!1,oR=!1;try{var aR={get passive(){return rR=!0},get once(){return oR=rR=!0}};iR&&(window.addEventListener("test",aR,aR),window.removeEventListener("test",aR,!0))}catch(Hl){}function sR(e,t,n,i){if(i&&"boolean"!=typeof i&&!oR){var r=i.once,o=i.capture,a=n;!oR&&r&&(a=n.__once||function e(i){this.removeEventListener(t,e,o),n.call(this,i)},n.__once=a),e.addEventListener(t,a,rR?i:o)}e.addEventListener(t,n,i)}function lR(e){var t=eR(e);return t&&t.defaultView||window}function cR(e,t){return lR(e).getComputedStyle(e,t)}var uR=/([A-Z])/g;function hR(e){return e.replace(uR,"-$1").toLowerCase()}var dR=/^ms-/;function fR(e){return hR(e).replace(dR,"-ms-")}var pR=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function gR(e){return!(!e||!pR.test(e))}function vR(e,t){var n="",i="";if("string"==typeof t)return e.style.getPropertyValue(fR(t))||cR(e).getPropertyValue(fR(t));Object.keys(t).forEach((function(r){var o=t[r];o||0===o?gR(r)?i+=r+"("+o+") ":n+=fR(r)+": "+o+";":e.style.removeProperty(fR(r))})),i&&(n+="transform: "+i+";"),e.style.cssText+=";"+n}function yR(e,t,n,i){var r=i&&"boolean"!=typeof i?i.capture:i;e.removeEventListener(t,n,r),n.__once&&e.removeEventListener(t,n.__once,r)}function mR(e,t,n,i){return sR(e,t,n,i),function(){yR(e,t,n,i)}}function _R(e,t,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!0),e){var r=document.createEvent("HTMLEvents");r.initEvent(t,n,i),e.dispatchEvent(r)}}function bR(e,t,n,i){var r,o;null==n&&(r=vR(e,"transitionDuration")||"",o=-1===r.indexOf("ms")?1e3:1,n=parseFloat(r)*o||0);var a=function(e,t,n){void 0===n&&(n=5);var i=!1,r=setTimeout((function(){i||_R(e,"transitionend",!0)}),t+n),o=mR(e,"transitionend",(function(){i=!0}),{once:!0});return function(){clearTimeout(r),o()}}(e,n,i),s=mR(e,"transitionend",t);return function(){a(),s()}}var kR={transition:"","transition-duration":"","transition-delay":"","transition-timing-function":""};function wR(e){var t=e.node,n=e.properties,i=e.duration,r=void 0===i?200:i,o=e.easing,a=e.callback,s=[],l={},c="";Object.keys(n).forEach((function(e){var t=n[e];gR(e)?c+=e+"("+t+") ":(l[e]=t,s.push(hR(e)))})),c&&(l.transform=c,s.push("transform")),r>0&&(l.transition=s.join(", "),l["transition-duration"]=r/1e3+"s",l["transition-delay"]="0s",l["transition-timing-function"]=o||"linear");var u=bR(t,(function(e){e.target===e.currentTarget&&(vR(t,kR),a&&a.call(this,e))}),r);return t.clientLeft,vR(t,l),{cancel:function(){u(),vR(t,kR)}}}var TR=(new Date).getTime();var SR="clearTimeout",CR=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-TR)),i=setTimeout(e,n);return TR=t,i},ER=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};iR&&["","webkit","moz","o","ms"].some((function(e){var t=ER(e,"request");return t in window&&(SR=ER(e,"cancel"),CR=function(e){return window[t](e)}),!!CR}));var xR,OR=function(e){"function"==typeof window[SR]&&window[SR](e)},PR=CR;function LR(e,t){if(!xR){var n=document.body,i=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;xR=function(e,t){return i.call(e,t)}}return xR(e,t)}function IR(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var DR=Function.prototype.bind.call(Function.prototype.call,[].slice);var AR=Function.prototype.bind.call(Function.prototype.call,[].slice);function MR(e,t){return AR(e.querySelectorAll(t))}function RR(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function NR(e){return"window"in e&&e.window===e?e:RR(e)&&e.defaultView||!1}function jR(e){var t="pageXOffset"===e?"scrollLeft":"scrollTop";return function(n,i){var r=NR(n);if(void 0===i)return r?r[e]:n[t];r?r.scrollTo(r[e],i):n[t]=i}}var BR=jR("pageXOffset"),UR=jR("pageYOffset");function HR(e){var t=eR(e),n={top:0,left:0,height:0,width:0},i=t&&t.documentElement;return i&&IR(i,e)?(void 0!==e.getBoundingClientRect&&(n=e.getBoundingClientRect()),n={top:n.top+UR(i)-(i.clientTop||0),left:n.left+BR(i)-(i.clientLeft||0),width:n.width,height:n.height}):n}function FR(e,t){var n=NR(e);return n?n.innerHeight:t?e.clientHeight:HR(e).height}var VR=/^(?:input|select|textarea|button)$/i;function zR(e,t,n){void 0===t&&(t=null),void 0===n&&(n=null);for(var i=[];e;e=e.nextElementSibling)if(e!==t){if(n&&LR(e,n))break;i.push(e)}return i}var GR=function(e){return!!e&&"offsetParent"in e};function WR(e){for(var t=eR(e),n=e&&e.offsetParent;GR(n)&&"HTML"!==n.nodeName&&"static"===vR(n,"position");)n=n.offsetParent;return n||t.documentElement}function KR(){return KR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},KR.apply(this,arguments)}var $R;function YR(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function qR(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=YR(e.className,t):e.setAttribute("class",YR(e.className&&e.className.baseVal||"",t))}function XR(e,t){var n=vR(e,"position"),i="absolute"===n,r=e.ownerDocument;if("fixed"===n)return r||document;for(;(e=e.parentNode)&&!RR(e);){var o=i&&"static"===vR(e,"position"),a=(vR(e,"overflow")||"")+(vR(e,"overflow-y")||"")+vR(e,"overflow-x");if(!o&&(/(auto|scroll)/.test(a)&&(t||FR(e)<e.scrollHeight)))return e}return r||document}var JR=/ /gi,ZR=/\xA0/g,QR=/\s+([^\s])/gm;var eN={addEventListener:sR,removeEventListener:yR,triggerEvent:_R,animate:function(e,t,n,i,r){if(!("nodeType"in e))return wR(e);if(!t)throw new Error("must include properties to animate");return"function"==typeof i&&(r=i,i=""),wR({node:e,properties:t,duration:n,easing:i,callback:r})},filter:function(e,t){return function(n){var i=n.currentTarget,r=n.target;MR(i,e).some((function(e){return IR(e,r)}))&&t.call(this,n)}},listen:mR,style:vR,getComputedStyle:cR,attribute:function(e,t,n){if(e){if(void 0===n)return e.getAttribute(t);n||""===n?e.setAttribute(t,String(n)):e.removeAttribute(t)}},activeElement:function(e){void 0===e&&(e=eR());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(Hl){return e.body}},ownerDocument:eR,ownerWindow:lR,requestAnimationFrame:PR,cancelAnimationFrame:OR,matches:LR,height:FR,width:function(e,t){var n=NR(e);return n?n.innerWidth:t?e.clientWidth:HR(e).width},offset:HR,offsetParent:WR,position:function(e,t){var n,i={top:0,left:0};if("fixed"===vR(e,"position"))n=e.getBoundingClientRect();else{var r=t||WR(e);n=HR(e),"html"!==function(e){return e.nodeName&&e.nodeName.toLowerCase()}(r)&&(i=HR(r));var o=String(vR(r,"borderTopWidth")||0);i.top+=parseInt(o,10)-UR(r)||0;var a=String(vR(r,"borderLeftWidth")||0);i.left+=parseInt(a,10)-BR(r)||0}var s=String(vR(e,"marginTop")||0),l=String(vR(e,"marginLeft")||0);return KR({},n,{top:n.top-i.top-(parseInt(s,10)||0),left:n.left-i.left-(parseInt(l,10)||0)})},contains:IR,scrollbarSize:function(e){if((!$R&&0!==$R||e)&&iR){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),$R=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return $R},scrollLeft:BR,scrollParent:XR,scrollTo:function(e,t){var n=HR(e),i={top:0,left:0};if(e){var r=t||XR(e),o=NR(r),a=UR(r),s=FR(r,!0);o||(i=HR(r));var l=(n={top:n.top-i.top,left:n.left-i.left,height:n.height,width:n.width}).height,c=n.top+(o?0:a),u=c+l;a=a>c?c:u>a+s?u-s:a;var h=PR((function(){return UR(r,a)}));return function(){return OR(h)}}},scrollTop:UR,querySelectorAll:MR,closest:function(e,t,n){e.closest&&!n&&e.closest(t);var i=e;do{if(LR(i,t))return i;i=i.parentElement}while(i&&i!==n&&i.nodeType===document.ELEMENT_NODE);return null},addClass:nR,removeClass:qR,hasClass:tR,toggleClass:function(e,t){e.classList?e.classList.toggle(t):tR(e,t)?qR(e,t):nR(e,t)},transitionEnd:bR,childNodes:function(e){return e?DR(e.childNodes):[]},childElements:function(e){return e?Array.from(e.children):[]},nextUntil:function(e,t){return zR(e,e,t)},parents:function(e){return function(e,t){var n=null,i=[];for(n=e?e[t]:null;n&&9!==n.nodeType;)i.push(n),n=n[t]||null;return i}(e,"parentElement")},siblings:function(e){return zR(e&&e.parentElement?e.parentElement.firstElementChild:null,e)},clear:function(e){if(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}return null},insertAfter:function(e,t){return e&&t&&t.parentNode?(t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e):null},isInput:function(e){return!!e&&VR.test(e.nodeName)},isVisible:function(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},prepend:function(e,t){return e&&t?(t.firstElementChild?t.insertBefore(e,t.firstElementChild):t.appendChild(e),e):null},remove:function(e){return e&&e.parentNode?(e.parentNode.removeChild(e),e):null},text:function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);var i="";return e&&(i=(e.textContent||"").replace(JR," ").replace(ZR," "),t&&(i=i.trim()),n&&(i=i.replace(QR," $1"))),i}};var tN=function(){function e(t,n){a(this,e),this.ticks=[],this.range=[0,100],this.currentValue=0,this.currentTick={name:"",val:0,renderVal:0},this.buttonStatus=1,this.startClientX=0,this.wrapperWidth=1,this.wrapperLeft=0,this.handleChange=function(){},this.parent=t,this.ticks=n.ticks,this.itemProps=n,this.sliderTitle=document.createElement("div"),this.sliderTitle.innerHTML=n.name,this.sliderContent=document.createElement("div"),this.sliderValue=document.createElement("div"),this.wrapper=document.createElement("div"),this.inner=document.createElement("div"),this.button=document.createElement("div"),eN.addClass(this.wrapper,"wrapper"),eN.addClass(this.parent,"xg-player-slider"),eN.addClass(this.sliderContent,"line-slider"),eN.addClass(this.sliderTitle,"line-title"),eN.addClass(this.sliderValue,"line-value"),this.renderTicks(),this.rendInner(),this.parent.appendChild(this.sliderTitle),this.parent.appendChild(this.sliderContent),this.parent.appendChild(this.sliderValue),this.sliderContent.appendChild(this.wrapper),this.bindEvents(),this.setValue(n.defaultValue)}return l(e,[{key:"renderTicks",value:function(){var e=this.wrapper,t=document.createElement("div");eN.addClass(t,"ticks");for(var n=1;n<this.ticks.length-1;n++){var i=this.ticks[n],r=document.createElement("div");eN.addClass(r,"tick"),eN.style(r,{left:i.val+"%"}),t.appendChild(r)}e.appendChild(t)}},{key:"rendInner",value:function(){var e=this.wrapper,t=this.inner;eN.addClass(t,"inner");var n=this.button;eN.addClass(n,"button"),e.appendChild(t),e.appendChild(n)}},{key:"bindEvents",value:function(){eN.addEventListener(this.wrapper,"click",this.onClick.bind(this)),eN.addEventListener(this.button,"touchstart",this.onTouchStart.bind(this)),eN.addEventListener(this.button,"touchmove",function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return U(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),GM(e,t,{leading:i,maxWait:t,trailing:r})}(this.onTouchmove.bind(this),30)),eN.addEventListener(this.button,"touchend",this.onTouchend.bind(this)),eN.addEventListener(this.button,"touchcancel",this.onTouchend.bind(this))}},{key:"setValue",value:function(e){var t=this;if(e>this.range[1]||e<this.range[0])return!1;this.currentTick=this.getCurrentTick(e),this.currentValue=this.currentTick.val;var n=this.currentValue+"%";return setTimeout((function(){eN.style(t.inner,{width:n}),eN.style(t.button,{left:n})})),this.sliderValue.innerHTML=this.currentTick.name,this.handleChange(this.currentValue),!0}},{key:"renderText",value:function(e){var t=this;this.ticks=e.ticks,this.itemProps=e,this.sliderTitle.innerHTML=e.name,this.currentTick=this.ticks.filter((function(e){return e.val===t.currentValue}))[0],this.sliderValue.innerHTML=this.currentTick.name}},{key:"onChange",value:function(e){this.handleChange=e}},{key:"getCurrentTick",value:function(e){for(var t=0;t<this.ticks.length-1;t++)if(this.ticks[t].val<=e&&this.ticks[t+1].val>=e)return e-this.ticks[t].val>this.ticks[t+1].val-e?this.ticks[t+1]:this.ticks[t];return this.ticks[0]}},{key:"onMousedown",value:function(e){this.startClientX=e.clientX,this.onStart()}},{key:"onTouchStart",value:function(e){e.stopPropagation(),this.startClientX=e.touches[0].clientX,this.onStart()}},{key:"onStart",value:function(){this.buttonStatus=2;var e=eN.offset(this.wrapper);this.wrapperWidth=e.width,this.wrapperLeft=e.left}},{key:"onMousemove",value:function(e){if(2===this.buttonStatus){var t=e.clientX-this.startClientX;this.onMove(t)}}},{key:"onTouchmove",value:function(e){e.stopPropagation();var t=e.touches[0].clientX-this.startClientX;this.onMove(t)}},{key:"onMove",value:function(e){var t=this.startClientX+e;if(!(t-this.wrapperLeft<0||t-this.wrapperLeft>this.wrapperWidth)){this.startClientX=this.startClientX+e;var n=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;eN.style(this.inner,{width:n+"%"}),eN.style(this.button,{left:n+"%"})}}},{key:"onMouseup",value:function(e){console.log("mouse up",e.clientX),this.onEnd()}},{key:"onTouchend",value:function(){this.onEnd()}},{key:"onEnd",value:function(){this.buttonStatus=3;var e=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(e)}},{key:"onClick",value:function(e){e.stopPropagation();var t=eN.offset(this.wrapper);this.wrapperWidth=t.width,this.wrapperLeft=t.left;var n=(e.clientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(n)}}]),e}(),nN={danmuSwitch:"弹幕开关",danmuSetting:"弹幕设置",openDanmu:"打开弹幕",reset:"重置",opacity:"不透明度",area:"显示区域",speed:"弹幕速度",fontSize:"字体大小",danmuMask:"智能挡板",screen0:"1/4屏",screen1:"半屏",screen2:"3/4屏",screen3:"全屏",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"正常",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"极小",fontSize1:"适中",fontSize2:"极大"},iN={danmuSwitch:"Barrage switch",danmuSetting:"Barrage settings",openDanmu:"Open Barrage",reset:"Reset",opacity:"Opacity",area:"Display area",speed:"Barrage speed",fontSize:"Font size",danmuMask:"Intelligent blocking",screen0:"1/4 screen",screen1:"Half screen",screen2:"3/4 screen",screen3:"Full screen",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"Normal",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"Minimal",fontSize1:"Moderate",fontSize2:"Great"},rN={zh:nN,"zh-cn":nN,en:iN,jp:iN,"zh-hk":{danmuSwitch:"彈幕開關",danmuSetting:"彈幕設置",openDanmu:"打開彈幕",reset:"重置",opacity:"不透明度",area:"顯示區域",speed:"彈幕速度",fontSize:"字體大小",danmuMask:"智能擋板",screen0:"1/4屏",screen1:"半屏",screen2:"3/4屏",screen3:"全屏",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"正常",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"極小",fontSize1:"適中",fontSize2:"極大"}},oN=function(){function e(t){a(this,e),this.curLang="en",this._defaultConfig={opacity:99,area:99,fontSize:50,speed:40,active:!1,usePanel:!0,danmuItems:[],maskConfig:{maskUrl:"",maskOffset:0,interval:200},maskActive:!1,external:[]},Object.assign(this._defaultConfig,t)}return l(e,[{key:"updateLang",value:function(e){this.curLang=e,this.curLangMap=rN[e]||rN.en;var t=this.curLangMap;this.sliderItemsProps=[{key:"opacity",name:t.opacity,defaultValue:99,ticks:[{name:t.opacity0,val:0,renderVal:0},{name:t.opacity1,val:33,renderVal:.33},{name:t.opacity2,val:66,renderVal:.66},{name:t.opacity3,val:99,renderVal:1}]},{key:"area",name:t.area,defaultValue:99,ticks:[{name:t.screen0,val:0,renderVal:1/4},{name:t.screen1,val:33,renderVal:.5},{name:t.screen2,val:66,renderVal:3/4},{name:t.screen3,val:99,renderVal:1}]},{key:"speed",name:t.speed,defaultValue:40,ticks:[{name:t.speed0,val:0,renderVal:1/4},{name:t.speed1,val:20,renderVal:.5},{name:t.speed2,val:40,renderVal:1},{name:t.speed3,val:60,renderVal:5/4},{name:t.speed4,val:80,renderVal:1.5},{name:t.speed5,val:100,renderVal:2}]},{key:"fontSize",name:t.fontSize,defaultValue:50,ticks:[{name:t.fontSize0,val:0,renderVal:14},{name:t.fontSize1,val:50,renderVal:16},{name:t.fontSize2,val:100,renderVal:20}]}],this._defaultConfig.external.forEach((function(t){t.name=t.lang[e]||t.lang.en}))}},{key:"getConfig",value:function(){return this._defaultConfig}},{key:"updateConfig",value:function(e){Object.assign(this._defaultConfig,e)}},{key:"updateComments",value:function(e){this._defaultConfig.danmuItems=e}},{key:"getRenderVal",value:function(e,t){var n=this.sliderItemsProps.find((function(t){return t.key===e}))||this.sliderItemsProps[0];return(n.ticks.find((function(e){return e.val===t}))||n.ticks[0]).renderVal}}]),e}(),aN=function(){function e(t){a(this,e),this.state=t,this.root=yi.createDom("xg-danmu"),eN.addClass(this.root,"xgplayer-danmu-container")}var t;return l(e,[{key:"initDanmuContainer",value:function(){var e=this.state.getConfig(),t=e.opacity,n=void 0===t?1:t,i=e.fontSize,r=void 0===i?16:i,o=e.area,a=void 0===o?1:o,s=e.danmuItems,l=void 0===s?[]:s,c=e.active,u=e.speed,h=void 0===u?40:u,d=(c?l:[]).map((function(e){return!e.style&&(e.style={}),e})),f={container:this.root,comments:d,live:!1,area:{start:0,end:this.state.getRenderVal("area",a)}};this.danmuJs=new window["danmu.js"](f),this.setOpacity(this.state.getRenderVal("opacity",n)),this.setFontSize(this.state.getRenderVal("fontSize",r)),this.setSpeed(this.state.getRenderVal("speed",h))}},{key:"start",value:function(){this.danmuJs.start()}},{key:"pause",value:function(){this.danmuJs.pause()}},{key:"play",value:function(){this.danmuJs.play()}},{key:"stop",value:function(){this.danmuJs.stop()}},{key:"resize",value:function(){this.danmuJs.resize()}},{key:"sendDanmu",value:function(e){this.state.getConfig().active&&this.danmuJs.sendComment(e)}},{key:"clear",value:function(){this.danmuJs.clear()}},{key:"setProperty",value:function(e,t){return"opacity"===e?this.setOpacity(this.state.getRenderVal(e,t)):"area"===e?this.setArea(this.state.getRenderVal(e,t)):"speed"===e?this.setSpeed(this.state.getRenderVal(e,t)):"fontSize"===e?this.setFontSize(this.state.getRenderVal(e,t)):void 0}},{key:"setOpacity",value:function(e){this.danmuJs.setOpacity(e)}},{key:"setFontSize",value:function(e){this.danmuJs.setFontSize(e)}},{key:"setArea",value:function(e){this.danmuJs.setArea({start:0,end:this.state.getRenderVal("area",e)})}},{key:"setSpeed",value:function(e){this.danmuJs.setAllDuration("scroll",1e4/e)}},{key:"destroy",value:(t=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.danmuJs){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.danmuJs.stop();case 4:return e.next=6,this.danmuJs.destroy();case 6:this.danmuJs=null,this.root.parentNode.removeChild(this.root),this.root=null;case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),sN=function(){function e(t){a(this,e),this.state=t,this.root=document.createElement("div"),eN.addClass(this.root,"panel-box"),eN.addEventListener(this.root,"click",(function(e){e.stopPropagation()}))}return l(e,[{key:"destroy",value:function(){this.root.parentNode&&this.root.parentNode.removeChild(this.root),this.root=null}}]),e}(),lN=function(){function e(t){a(this,e),this.callback=function(){},this.key=t.key,this.name=t.name,this.value=t.value,this.root=document.createElement("div"),eN.addClass(this.root,"xg-player-switch-wrapper"),this.render()}return l(e,[{key:"render",value:function(){var e=this;if(!this.root.childNodes.length){var t=document.createElement("div");this.$left=t,eN.addClass(t,"left"),t.innerHTML=this.name;var n=document.createElement("div");this.$right=n,eN.addClass(n,"right"),n.innerHTML='<label class="switch">\n <input type="checkbox">\n <span class="slider round"></span>\n </label>',this.root.appendChild(t),this.root.appendChild(n);var i=this.$right.querySelector("input");eN.addEventListener(this.$right,"click",GM((function(t){t.stopPropagation(),e.value=!e.value,e.value?null==i||i.setAttribute("checked","checked"):null==i||i.removeAttribute("checked"),e.callback(e.value)}),50))}var r=this.$right.querySelector("input");this.value?null==r||r.setAttribute("checked","checked"):r.removeAttribute("checked"),r.checked=this.value}},{key:"renderName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$left.innerHTML=e}},{key:"onChange",value:function(e){this.callback=e}}]),e}(),cN="pc"===Si.device,uN=Qr.POSITIONS,hN=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).seekCost=window.performance.now(),i.eventBus=new hi,window["danmu.js"]?(i.state=new oN(e.config),i.state.updateLang(i.player.lang),i.iconWrap=document.createElement("div"),eN.addClass(i.iconWrap,"icon-warp"),i.tipsWrap=document.createElement("div"),eN.addClass(i.tipsWrap,"tips-wrap"),i.container=new aN(i.state),i.panel=new sN(i.state),i):g(i)}return l(n,[{key:"afterCreate",value:function(){var e;null===(e=this.player.root)||void 0===e||e.appendChild(this.container.root),this.renderIcon(),this.renderBox(),this.root.appendChild(this.iconWrap),cN&&(this.state.getConfig().usePanel&&this.root.appendChild(this.panel.root),this.renderTips(),eN.addClass(this.panel.root,"pc-panel"),this.root.appendChild(this.tipsWrap)),this.initEvents(),this.container.initDanmuContainer()}},{key:"afterPlayerInit",value:function(){this.initDanmuMask()}},{key:"updateLang",value:function(e){this.state.updateLang(this.player.lang),this.eventBus.emit("updateLang")}},{key:"registerIcons",value:function(){return{open:{icon:JM,class:"xgplayer-danmu-open-svg"},close:{icon:ZM,class:"xgplayer-danmu-close-svg"},reset:{icon:QM,class:"xgplayer-danmu-reset-svg"}}}},{key:"initEvents",value:function(){cN?this.bindPCEvent():this.bindMobileEvent(),this.bindPlayerEvent()}},{key:"bindPlayerEvent",value:function(){var e=this;this.once(Ni,(function(){e.container.start()})),this.on(Di,(function(){e.container.pause()})),this.on(Pi,(function(){e.container.play()})),this.on(Mi,(function(){e.seekCost=window.performance.now(),e.container.stop()})),this.on(Ri,GM((function(){e.container.start()}),300)),this.on([ir,rr,or],(function(){e.container.resize(),e.handleResize()})),this.on(ur,this.handlePIP.bind(this))}},{key:"bindPCEvent",value:function(){var e=this;eN.addEventListener(this.root,"click",this.onClick.bind(this)),eN.addEventListener(this.root,"mouseenter",(function(){var t=e.state.getConfig().active,n=e.player.controls;"rightSide"===e.config.listType?n.blur():n.focus(),t?(eN.style(e.panel.root,{display:"block"}),eN.style(e.tipsWrap,{display:"none"})):(eN.style(e.panel.root,{display:"none"}),eN.style(e.tipsWrap,{display:"block"}))})),eN.addEventListener(this.root,"mouseleave",(function(){var t=e.player.controls;"rightSide"===e.config.listType?t.focus():t.focusAwhile(),eN.style(e.panel.root,{display:"none"}),eN.style(e.tipsWrap,{display:"none"})}))}},{key:"bindMobileEvent",value:function(){var e=this;eN.addEventListener(this.root,"click",(function(){e.state.getConfig().usePanel?e.player.panel.showPanel(e.panel.root):e.onClick()}))}},{key:"onClick",value:function(){this.toggleDanmu(),this.renderIcon()}},{key:"toggleDanmu",value:function(){var e=this.state.getConfig(),t=e.active,n=e.maskActive,i=!t;i?(this.state.updateConfig({active:i}),n&&this.initMask()):(null==this||this.container.clear(),this.destroyMask(),this.state.updateConfig({active:i})),this.player.emit(fM.DANMU_CHANGE,{active:i}),this.danmuSwitchInSettingPanel&&(this.danmuSwitchInSettingPanel.value=i,this.danmuSwitchInSettingPanel.render())}},{key:"renderIcon",value:function(){this.iconWrap.innerHTML="",this.state.getConfig().active?this.iconWrap.appendChild(this.icons.open):this.iconWrap.appendChild(this.icons.close)}},{key:"renderTips",value:function(){this.tipsWrap.innerHTML=this.state.curLangMap.openDanmu}},{key:"renderBox",value:function(){var e=this;this.panel.root.innerHTML="";var t=document.createElement("div");eN.addClass(t,"box-header"),t.innerHTML='<div class="header-setting">'+this.state.curLangMap.danmuSetting+'</div> <div class="header-reset"></div>';var n=t.querySelector(".header-reset");n.appendChild(this.icons.reset),eN.addEventListener(n,"click",(function(t){t.stopPropagation(),e.eventBus.emit("reset")}),{capture:!0});var i=document.createElement("span");i.innerHTML=this.state.curLangMap.reset,n.appendChild(i),this.eventBus.on("updateLang",(function(){i.innerHTML=e.state.curLangMap.reset,t.querySelector(".header-setting").innerHTML=e.state.curLangMap.danmuSetting})),this.panel.root.appendChild(t),cN||this.renderTurnOff(),this.renderSliders(),this.renderSwitches()}},{key:"renderTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuSwitch,key:"active",value:this.state.getConfig().active||!1},n=new lN(t);this.danmuSwitchInSettingPanel=n,this.panel.root.appendChild(n.root),n.onChange((function(t){e.toggleDanmu(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){n.renderName(e.state.curLangMap.danmuSwitch)}))}},{key:"renderSwitches",value:function(){var e,t=this;null===(e=this.state.getConfig().external)||void 0===e||e.forEach((function(e){var n=new lN(e);t.panel.root.appendChild(n.root),t.eventBus.on("updateLang",(function(){n.renderName(e.name)})),n.onChange((function(n){var i=t.state.getConfig().external||[];i.forEach((function(t){t.key===e.key&&(t.value=n)})),t.state.updateConfig({external:i}),t.player.emit(fM.DANMU_CHANGE,{external:i})}))}))}},{key:"renderSliders",value:function(){var e=this;this.state.sliderItemsProps.forEach((function(t,n){var i,r,o=document.createElement("div"),a=new tN(o,t);null!=(null===(i=e.state.getConfig())||void 0===i?void 0:i[t.key])&&a.setValue(null===(r=e.state.getConfig())||void 0===r?void 0:r[t.key]);a.onChange((function(n){e.state.updateConfig(c({},t.key,n)),console.log("val",e.state.getConfig()),e.player.emit(fM.DANMU_CHANGE,c({},t.key,n)),e.container.setProperty(t.key,n)})),e.eventBus.on("reset",(function(){a.setValue(t.defaultValue)})),e.eventBus.on("updateLang",(function(){a.renderText(e.state.sliderItemsProps[n])})),e.panel.root.appendChild(o)}))}},{key:"sendDanmu",value:function(e){return this.container.sendDanmu(e)}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.state.updateConfig(e)}},{key:"getConfig",value:function(){return this.state.getConfig()}},{key:"initDanmuMask",value:function(){if(this.player){var e=this.state.getConfig(),t=e.maskConfig,n=e.active,i=e.maskActive;t.maskUrl&&(this.renderDanmuMaskTurnOff(),n&&i&&this.initMask())}}},{key:"renderDanmuMaskTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuMask,key:"maskActive",value:this.state.getConfig().maskActive||!1},n=new lN(t);this.panel.root.appendChild(n.root),n.onChange((function(t){e.state.updateConfig({maskActive:t}),t?e.initMask():e.destroyMask(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){n.renderName(e.state.curLangMap.danmuMask)}))}},{key:"initMask",value:function(){this.destroyMask();var e=this.state.getConfig(),t=e.maskConfig,n=e.maskActive,i=e.active;t.maskUrl&&n&&i&&(window.DanmuMask&&"function"==typeof window.DanmuMask&&(this.mask=new window.DanmuMask({player:this.player,url:t.maskUrl,originStart:t.maskOffset,interval:t.interval})),this.mask.init())}},{key:"destroyMask",value:function(){this.mask&&(this.mask.destroy(),this.mask=null)}},{key:"handleResize",value:function(){var e,t,n,i;if(this.mask){var r=this.player;this.mask.setContainerSize(null!==(e=null==r||null===(t=r.root)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0,null!==(n=null==r||null===(i=r.root)||void 0===i?void 0:i.offsetHeight)&&void 0!==n?n:0)}}},{key:"handlePIP",value:function(e){e?this.destroyMask():this.initMask()}},{key:"destroy",value:function(){this.destroyMask(),this.container.destroy(),this.panel.destroy()}},{key:"render",value:function(){return'<div class="xgplayer-danmu"></div>'}}],[{key:"pluginName",get:function(){return"DanmuPlugin"}},{key:"defaultConfig",get:function(){return{position:uN.CONTROLS_RIGHT,index:vM}}}]),n}(Qr),dN=qu,fN=$h,pN=mh,gN=pd,vN=H_,yN=Mu,mN=Function,_N=dN([].concat),bN=dN([].join),kN={},wN=function(e,t,n){if(!gN(kN,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";kN[t]=mN("C,a","return new C("+bN(i,",")+")")}return kN[t](e,n)},TN=yN?mN.bind:function(e){var t=fN(this),n=t.prototype,i=vN(arguments,1),r=function(){var n=_N(i,vN(arguments));return this instanceof r?wN(t,n.length,n):t.apply(e,n)};return pN(n)&&(r.prototype=n),r},SN=Pg,CN=B_,EN=TN,xN=O_,ON=lf,PN=mh,LN=FS,IN=Du,DN=wh("Reflect","construct"),AN=Object.prototype,MN=[].push,RN=IN((function(){function e(){}return!(DN((function(){}),[],e)instanceof e)})),NN=!IN((function(){DN((function(){}))})),jN=RN||NN;function BN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UN(e){return(UN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HN(e){var t=function(e,t){if("object"!==UN(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==UN(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===UN(t)?t:String(t)}function FN(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,HN(i.key),i)}}function VN(e,t,n){return t&&FN(e.prototype,t),n&&FN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zN(e,t){return(zN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function GN(e,t){if(t&&("object"===UN(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function WN(e){return(WN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function KN(e,t,n){return(t=HN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}SN({target:"Reflect",stat:!0,forced:jN,sham:jN},{construct:function(e,t){xN(e),ON(t);var n=arguments.length<3?e:xN(arguments[2]);if(NN&&!RN)return DN(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return CN(MN,i,t),new(CN(EN,e,i))}var r=n.prototype,o=LN(PN(r)?r:AN),a=CN(e,o,t);return PN(a)?a:o}});var $N=Au,YN=qu,qN=ju,XN=Du,JN=Xv,ZN=tg,QN=Bu,ej=hd,tj=rh,nj=Object.assign,ij=Object.defineProperty,rj=YN([].concat),oj=!nj||XN((function(){if($N&&1!==nj({b:1},nj(ij({},"a",{enumerable:!0,get:function(){ij(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=nj({},e)[n]||JN(nj({},t)).join("")!=i}))?function(e,t){for(var n=ej(e),i=arguments.length,r=1,o=ZN.f,a=QN.f;i>r;)for(var s,l=tj(arguments[r++]),c=o?rj(JN(l),o(l)):JN(l),u=c.length,h=0;u>h;)s=c[h++],$N&&!qN(a,l,s)||(n[s]=l[s]);return n}:nj,aj=oj;Pg({target:"Object",stat:!0,arity:2,forced:Object.assign!==aj},{assign:aj});var sj=qu,lj=Ep,cj=Date.prototype,uj="Invalid Date",hj="toString",dj=sj(cj.toString),fj=sj(cj.getTime);String(new Date(NaN))!=uj&&lj(cj,hj,(function(){var e=fj(this);return e==e?dj(this):uj}));var pj=TN;Pg({target:"Function",proto:!0,forced:Function.bind!==pj},{bind:pj});var gj,vj="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,yj=Lu,mj=B_,_j=gh,bj=vj,kj=Sh,wj=H_,Tj=V_,Sj=yj.Function,Cj=/MSIE .\./.test(kj)||bj&&((gj=yj.Bun.version.split(".")).length<3||0==gj[0]&&(gj[1]<3||3==gj[1]&&0==gj[2])),Ej=function(e,t){var n=t?2:1;return Cj?function(i,r){var o=Tj(arguments.length,1)>n,a=_j(i)?i:Sj(i),s=o?wj(arguments,n):[],l=o?function(){mj(a,this,s)}:a;return t?e(l,r):e(l)}:e},xj=Pg,Oj=Lu,Pj=Ej(Oj.setInterval,!0);xj({global:!0,bind:!0,forced:Oj.setInterval!==Pj},{setInterval:Pj});var Lj=Pg,Ij=Lu,Dj=Ej(Ij.setTimeout,!0);Lj({global:!0,bind:!0,forced:Ij.setTimeout!==Dj},{setTimeout:Dj});var Aj=!Du((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Mj=pd,Rj=gh,Nj=hd,jj=Aj,Bj=zf("IE_PROTO"),Uj=Object,Hj=Uj.prototype,Fj=jj?Uj.getPrototypeOf:function(e){var t=Nj(e);if(Mj(t,Bj))return t[Bj];var n=t.constructor;return Rj(n)&&t instanceof n?n.prototype:t instanceof Uj?Hj:null},Vj=Au,zj=Du,Gj=qu,Wj=Fj,Kj=Xv,$j=hh,Yj=Gj(Bu.f),qj=Gj([].push),Xj=Vj&&zj((function(){var e=Object.create(null);return e[2]=2,!Yj(e,2)})),Jj=function(e){return function(t){for(var n,i=$j(t),r=Kj(i),o=Xj&&null===Wj(i),a=r.length,s=0,l=[];a>s;)n=r[s++],Vj&&!(o?n in i:Yj(i,n))||qj(l,e?[n,i[n]]:i[n]);return l}},Zj={entries:Jj(!0),values:Jj(!1)}.values;Pg({target:"Object",stat:!0},{values:function(e){return Zj(e)}});var Qj=Lu,eB=Du,tB=ty,nB=mm.trim,iB=qu("".charAt),rB=Qj.parseFloat,oB=Qj.Symbol,aB=oB&&oB.iterator,sB=1/rB("\t\n\v\f\r \u2028\u2029\ufeff-0")!=-1/0||aB&&!eB((function(){rB(Object(aB))}))?function(e){var t=nB(tB(e)),n=rB(t);return 0===n&&"-"==iB(t,0)?-0:n}:rB;Pg({global:!0,forced:parseFloat!=sB},{parseFloat:sB});var lB,cB,uB={MENU_REPORT:"MENU_REPORT",MENU_LOG:"MENU_LOG"},hB={VID:5,TYPE:10,CODECS:20,SPEED:30,BUFFER:40,PLAY_QUALITY:50,SCHEME:60,RESOLUTION:70,VIEWPORT:80,VOLUME:90,CDN:100,P2P:110,PLAYER_VERSION:120},dB={MENU:0,INTERACT:1,CONTEXTMENU:2},fB={STATS:0,REPORT:1},pB={CLOSE:0,COPY:1},gB={SHOW:0,HIDE:1},vB={STATS:"STATS",REPORT:"REPORT",CLOSE:"CLOSE",COPY:"COPY",CONTEXTMENU_SHOW:"CONTEXTMENU_SHOW",CONTEXTMENU_HIDE:"CONTEXTMENU_HIDE"},yB=Object.freeze(Object.defineProperty({__proto__:null,CONTEXTMENU_TYPES:gB,EVENTS:uB,INFO_TYPES:hB,INTERACT_TYPES:pB,LOG_EVENTS:vB,LOG_TYPES:dB,MENU_TYPES:fB},Symbol.toStringTag,{value:"Module"}));function mB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Hl){return!1}}();return function(){var n,i=WN(e);if(t){var r=WN(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return GN(this,n)}}var _B={cn:(lB={},KN(lB,hB.VID,"VID"),KN(lB,hB.TYPE,"类型"),KN(lB,hB.CODECS,"编码"),KN(lB,hB.SPEED,"加载速度"),KN(lB,hB.BUFFER,"缓冲时长"),KN(lB,hB.PLAY_QUALITY,"丢帧率"),KN(lB,hB.SCHEME,"视频协议"),KN(lB,hB.RESOLUTION,"分辨率"),KN(lB,hB.VIEWPORT,"视图尺寸"),KN(lB,hB.VOLUME,"音量大小"),KN(lB,hB.CDN,"CDN"),KN(lB,hB.P2P,"P2P"),KN(lB,hB.PLAYER_VERSION,"播放器版本"),lB),en:(cB={},KN(cB,hB.VID,"Video ID"),KN(cB,hB.TYPE,"Video Type"),KN(cB,hB.CODECS,"Codecs"),KN(cB,hB.SPEED,"Connection Speed"),KN(cB,hB.BUFFER,"Buffer Health"),KN(cB,hB.PLAY_QUALITY,"Dropped Frames"),KN(cB,hB.SCHEME,"Protocol"),KN(cB,hB.RESOLUTION,"Res"),KN(cB,hB.VIEWPORT,"Viewport"),KN(cB,hB.VOLUME,"Volume"),KN(cB,hB.CDN,"CDN"),KN(cB,hB.P2P,"P2P"),KN(cB,hB.PLAYER_VERSION,"Player Version"),cB)},bB=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zN(e,t)}(n,e);var t=mB(n);function n(){return BN(this,n),t.apply(this,arguments)}return VN(n,[{key:"afterCreate",value:function(){}},{key:"onPluginsReady",value:function(){var e=this.player.plugins.stats;this.menuInst=new kB(this.player,this.config||{},e)}}],[{key:"pluginName",get:function(){return"MenuPlugin"}},{key:"defaultConfig",get:function(){return{enableDebug:!0}}}]),n}(Vr),kB=function(){function e(t,n,i){BN(this,e),this.player=t,this.options=n||{},this.statsPlugin=i;var r={report:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.71429 5C5.3198 5 5 5.3198 5 5.71429V14.2857C5 14.6802 5.3198 15 5.71429 15H14.2857C14.6802 15 15 14.6802 15 14.2857V10C15 9.44772 15.4477 9 16 9C16.5523 9 17 9.44772 17 10V14.2857C17 15.7848 15.7848 17 14.2857 17H5.71429C4.21523 17 3 15.7848 3 14.2857V5.71429C3 4.21523 4.21523 3 5.71429 3H10C10.5523 3 11 3.44772 11 4C11 4.55228 10.5523 5 10 5H5.71429Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.7071 3.29289C17.0976 3.68342 17.0976 4.31658 16.7071 4.70711L10.7071 10.7071C10.3166 11.0976 9.68342 11.0976 9.29289 10.7071C8.90237 10.3166 8.90237 9.68342 9.29289 9.29289L15.2929 3.29289C15.6834 2.90237 16.3166 2.90237 16.7071 3.29289Z" fill="currentColor"/></svg>',stats:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 10C9 9.44771 9.44771 9 10 9C10.5523 9 11 9.44772 11 10V13C11 13.5523 10.5523 14 10 14C9.44771 14 9 13.5523 9 13V10Z" fill="currentColor"/><path d="M10 6C9.44771 6 9 6.44772 9 7C9 7.55228 9.44771 8 10 8C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16Z" fill="currentColor"/></svg>',close:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.1231 4.08053C16.5136 4.47105 16.5136 5.10422 16.1231 5.49474L11.453 10.1648L16.1231 14.8349C16.5136 15.2254 16.5136 15.8586 16.1231 16.2491C15.7326 16.6397 15.0994 16.6397 14.7089 16.2491L10.0388 11.579L5.36873 16.2491C4.9782 16.6397 4.34504 16.6397 3.95451 16.2491C3.56399 15.8586 3.56399 15.2254 3.95451 14.8349L8.6246 10.1648L3.95451 5.49474C3.56399 5.10422 3.56399 4.47105 3.95451 4.08053C4.34504 3.69001 4.9782 3.69001 5.36873 4.08053L10.0388 8.75061L14.7089 4.08053C15.0994 3.69 15.7326 3.69 16.1231 4.08053Z" fill="currentColor"/></svg>',copy:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5H13.5C14.3284 5 15 5.67157 15 6.5V14C15 14.5523 15.4477 15 16 15C16.5523 15 17 14.5523 17 14V6.5C17 4.567 15.433 3 13.5 3H6ZM4 8H12V16H4L4 8ZM2 8C2 6.89543 2.89543 6 4 6H12C13.1046 6 14 6.89543 14 8V16C14 17.1046 13.1046 18 12 18H4C2.89543 18 2 17.1046 2 16V8ZM5.75 9.5C5.33579 9.5 5 9.83579 5 10.25C5 10.6642 5.33579 11 5.75 11H10.25C10.6642 11 11 10.6642 11 10.25C11 9.83579 10.6642 9.5 10.25 9.5H5.75ZM5 13.75C5 13.3358 5.33579 13 5.75 13H10.25C10.6642 13 11 13.3358 11 13.75C11 14.1642 10.6642 14.5 10.25 14.5H5.75C5.33579 14.5 5 14.1642 5 13.75Z" fill="currentColor"/></g></svg>'},o=Object.assign({},r,this.options.icons);this.options.icons=o,this.playerInstance="dash_"+(new Date).getTime(),window[this.playerInstance]=this.player,this.menuItems=[{name:"视频统计信息",handler:this.showPanelInfo.bind(this),type:fB.STATS,icon:o.stats,eventName:vB.STATS},{name:"播放问题反馈",handler:this._handleReport.bind(this),type:fB.REPORT,icon:o.report,eventName:vB.REPORT}],this.playerHandler=[{evt:"RESOLUTION_UPDATE",handler:this._resolutionUpdate.bind(this)},{evt:"menusegment",handler:this._recordLastSegment.bind(this)},{evt:"resourceReady",handler:this._startup.bind(this)},{evt:"canplay",handler:this._startup.bind(this)},{evt:"ended",handler:this.destroyDOM.bind(this)},{evt:"destroy",handler:this.destroy.bind(this)},{evt:"playertypechange",handler:this.destroyDOM.bind(this)},{evt:"codecsupdate",handler:this._codecsUpdate.bind(this)}];for(var a=0;a<this.playerHandler.length;a++){var s=this.playerHandler[a],l=s.evt,c=s.handler;this.player.on(l,c)}this.debugInfo={ua:navigator.userAgent,version:this.player.playerVersion},this._pollTimer=null,this.hasInitDOM=!1,this._cacheMap={},this.menuHandler=this._menuHandler.bind(this),this.munuHideHandler=this._munuHideHandler.bind(this),this.rootClickHandler=this._rootClickHandler.bind(this),this._initDatas()}return VN(e,[{key:"_reset",value:function(){this.hasInitDOM=!1,this._cacheMap={},this._lastSegment=null}},{key:"_noop",value:function(){}},{key:"_recordLastSegment",value:function(e){this._lastSegment=e}},{key:"_resolutionUpdate",value:function(e){if(!this._cacheUpdate(hB.RESOLUTION)){var t=this.infoItems[hB.RESOLUTION];e?(t.value=e,this.updateInfoItem(t)):(t.hide=!0,this.createPanelInfo())}}},{key:"_codecsUpdate",value:function(e){if(!this._cacheUpdate(hB.CODECS)){var t=this.infoItems[hB.CODECS];t.value=e,this.updateInfoItem(t)}}},{key:"_cacheUpdate",value:function(e){return!this.hasInitDOM&&(this._cacheMap[e]=!0,!0)}},{key:"_handleReport",value:function(){for(var e=this.player.video.readyState,t=this.player.video.buffered,n=[],i=0;i<t.length;i++){var r=t.start(i),o=t.end(i);n.push({start:r,end:o})}var a={readyState:e,curTime:this.player.video.currentTime,err:this.player.video.error||-1,buffer:n},s=Object.assign({debug_date:new Date,type:this.type},this.debugInfo,{videoInfo:a});this._lastSegment&&(s.segment=this._lastSegment),this.options.enableDebug&&this.statsPlugin&&(s.stats=this.statsPlugin.getStats()),this.player.emit(uB.MENU_REPORT,s)}},{key:"_startup",value:function(){if(!this.hasInitDOM){this.type=this.player.currentFormat,this._initDatas(),this._initDOM();for(var e=Object.keys(this._cacheMap),t=0;t<e.length;t++){var n=e[t],i=this.infoItems[n];this.updateInfoItem(i,!0)}}}},{key:"_initDatas",value:function(){var e;this.parentNode=this.player.root,this._isPlayQualitySupported=this.player.video&&"function"==typeof this.player.video.getVideoPlaybackQuality;var t=this.player.playerType,n=_B.cn,i=this.options.lang||"cn";this.langConfig=this.options.langConfig||_B[i]||n,this.infoItems=(KN(e={},hB.VID,{name:"VID",value:this.player.config.vid,render:wB,hide:!this.player.config.vid,key:"vid"}),KN(e,hB.TYPE,{name:"类型",value:t,render:wB,key:"player_type"}),KN(e,hB.CODECS,{name:"编码",value:this.player.menuCodeType,render:wB,key:"menuCodeType",hide:!this.player.menuCodeType}),KN(e,hB.SPEED,{name:"加载速度",value:0,render:wB,posfix:" KB/s",hide:!this._isMenusHide("speed"),key:"speed"}),KN(e,hB.BUFFER,{name:"缓冲时长",value:0,render:wB,posfix:"s",key:"buffer"}),KN(e,hB.PLAY_QUALITY,{name:"丢帧率",value:{droppedVideoFrames:0,totalVideoFrames:0},render:TB,hide:null===this.player.video.getVideoPlaybackQuality,key:"frames_info"}),KN(e,hB.SCHEME,{name:"视频协议",value:"HTTPS",render:wB,key:"scheme"}),KN(e,hB.CDN,{name:"CDN",value:this.player.CDNUrl?this.player.CDNUrl:"false",render:wB,hide:!this._isMenusHide("cdn"),key:"CDN"}),KN(e,hB.P2P,{name:"P2P",value:"false",render:wB,hide:!0,key:"p2p"}),KN(e,hB.RESOLUTION,{name:"分辨率",value:{width:0,height:0,fps:void 0},render:SB,hide:!this._isMenusHide("resolution"),key:"resolution"}),KN(e,hB.VIEWPORT,{name:"视图尺寸",value:{width:0,height:0},render:SB,key:"viewport"}),KN(e,hB.VOLUME,{name:"音量大小",value:(100*this.player.config.volume).toFixed(0)+"%",render:wB,key:"volume"}),KN(e,hB.PLAYER_VERSION,{name:"播放器版本",value:this.player.playerVersion,render:wB,key:"player_version"}),e);for(var r=Object.keys(this.infoItems),o=0;o<r.length;o++){var a=r[o];this.infoItems[a].type=a}for(var s=this.options.infoItems||[],l=0;l<s.length;l++){var c=s[l];c.name&&c.type&&c.key?(c.render&&xB(c.render)||(c.render=wB),this.infoItems[c.type]=c):EB("".concat(c.name))}}},{key:"_isMenusHide",value:function(e){return!0===(this.player.supportMenus||{})[e]}},{key:"renderItemByType",value:function(e,t){var n=this.infoItems[e];n?(n.value=t,this._cacheUpdate(e)||this.updateInfoItem(n)):EB("".concat(e," item null"))}},{key:"_initDOM",value:function(){if(this.parentNode&&yi){this.hasInitDOM=!0;var e=document.createDocumentFragment(),t=document.createElement("xg-menu");yi.addClass(t,"xg-menu"),this.rightMenu=t;for(var n=this.menuItems.filter((function(e){return!e.hide})),i=0;i<n.length;i++)e.appendChild(this.createMenuItem(n[i]));t.appendChild(e),this.toggle(this.rightMenu,!1),this.parentNode.appendChild(t),this.parentNode.addEventListener("contextmenu",this.menuHandler,!1),document.addEventListener("click",this.munuHideHandler,!1),this.parentNode.addEventListener("click",this.rootClickHandler,!0),this.createPanelInfo(),this.bindEvents(),this.tick()}}},{key:"_menuHandler",value:function(e){if(e.preventDefault(),e.stopPropagation(),this.isPIPMode())return!1;var t=this.getOffset(),n=e.clientX-t.x+document.body.scrollLeft+document.documentElement.scrollLeft,i=e.clientY-t.y+document.body.scrollTop+document.documentElement.scrollTop,r=this.parentNode.clientWidth,o=this.parentNode.clientHeight;this.toggle(this.rightMenu,!0);var a=this.rightMenu.offsetWidth,s=this.rightMenu.offsetHeight,l=n+a>r?r-a:n,c=i+s>o?o-s:i;this.rightMenu.style.left=l+"px",this.rightMenu.style.top=c+"px",this.emitLog(dB.CONTEXTMENU,gB.SHOW,vB.CONTEXTMENU_SHOW)}},{key:"getOffset",value:function(){for(var e=this.parentNode,t=0,n=0;e&&!Number.isNaN(e.offsetLeft)&&!Number.isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}}},{key:"_munuHideHandler",value:function(){this.rightMenu&&"block"===this.rightMenu.style.display&&this.emitLog(dB.CONTEXTMENU,gB.HIDE,vB.CONTEXTMENU_HIDE),this.toggle(this.rightMenu,!1)}},{key:"_rootClickHandler",value:function(e){"block"===this.rightMenu.style.display&&e.target===this.player.video&&(e.stopPropagation(),e.preventDefault(),this._munuHideHandler())}},{key:"tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e.tick(),e.isPIPMode()&&(e.toggle(e.rightMenu,!1),e.toggle(e.panelInfo,!1))}),500)}},{key:"_poll",value:function(){var e=this.bufferLength,t=this.infoItems[hB.BUFFER];if(t.value=e,this.updateInfoItem(t),this.player.video.getVideoPlaybackQuality){var n=this.player.video.getVideoPlaybackQuality(),i=this.infoItems[hB.PLAY_QUALITY];i.value={totalVideoFrames:n.totalVideoFrames,droppedVideoFrames:n.droppedVideoFrames},this.updateInfoItem(i)}var r=this.infoItems[hB.SPEED];if(!r.hide){var o=Math.floor(this.player.downloadSpeed);r.value=o,this.updateInfoItem(r)}}},{key:"bindEvents",value:function(){var e=this,t=this.player.video;this.handleVolumeChange=this._handleVolumeChange.bind(this),t.addEventListener("volumechange",this.handleVolumeChange);t.addEventListener("DOMNodeInserted",(function n(){t.removeEventListener("DOMNodeInserted",n),e._onWinElemSizeChange()})),this.onWinSizeChange=function(e,t,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||e.apply(r,o)},s=n&&!i;clearTimeout(i),i=setTimeout(a,t),s&&e.apply(r,o)}}(this._onWinElemSizeChange.bind(this),1e3,!1),window.addEventListener("resize",this.onWinSizeChange),e._onWinElemSizeChange()}},{key:"_onWinElemSizeChange",value:function(){if(this.player&&this.player.video){var e=this.player.video.getBoundingClientRect(),t=this.infoItems[hB.VIEWPORT];if(t.value={width:Math.floor(e.width),height:Math.floor(e.height)},this._cacheUpdate(hB.VIEWPORT))return;this.updateInfoItem(t)}}},{key:"_handleVolumeChange",value:function(){var e=this.infoItems[hB.VOLUME];e.value=(100*this.player.video.volume).toFixed(0)+"%",this._cacheUpdate(hB.VOLUME)||this.updateInfoItem(e)}},{key:"createMenuItem",value:function(e){var t=this,n=document.createElement("div");if(n.classList.add("v-menu-item"),e.clsName&&n.classList.add(e.clsName),e.icon){var i=document.createElement("div");yi.addClass(i,"menu-item-icon"),i.innerHTML=e.icon,n.appendChild(i)}var r=document.createElement("div");return yi.addClass(r,"menu-item-content"),r.textContent=e.name,n.appendChild(r),!1!==n.clickable&&n.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.toggle(t.rightMenu,!1),e.handler(),t.emitLog(dB.MENU,e.type,e.eventName)})),n}},{key:"createIconBtn",value:function(e,t,n,i){var r=document.createElement("div");return yi.addClass(r,e),r.innerHTML=t+"<div class='svg-hover'>".concat(n,"</div>"),i.appendChild(r),r}},{key:"createPanelInfo",value:function(){var e=this,t=document.createElement("xg-panel-info");yi.addClass(t,"xg-panel-info"),this.createIconBtn("xg-info-close xg-interact-icon",this.options.icons.close,"关闭",t).addEventListener("click",(function(){e.toggle(t,!1),e.panelVisible=!1,e.emitLog(dB.INTERACT,pB.CLOSE,vB.CLOSE)})),this.createIconBtn("xg-info-copy xg-interact-icon",this.options.icons.copy,"复制",t).addEventListener("click",(function(){for(var t=Object.values(e.infoItems).filter((function(e){return!e.hide})),n={},i=0;i<t.length;i++){var r=t[i],o=r.key,a=void 0;a=e.options.connectPrefix&&r.posfix?"".concat(r.value).concat(r.posfix):r.value,n[o]=a}e.options.enableDebug&&e.statsPlugin&&Object.assign(n,{stats:e.statsPlugin.getStats()}),e.copyToClipboard(JSON.stringify(n)),e.emitLog(dB.INTERACT,pB.COPY,vB.COPY)}));var n=document.createElement("ul");yi.addClass(n,"xg-panel-detail");for(var i=Object.values(this.infoItems).filter((function(e){return!e.hide})),r=document.createDocumentFragment(),o=0;o<i.length;o++){var a=this.createInfoItem(i[o]);r.appendChild(a)}n.appendChild(r),t.appendChild(n),this.panelInfo=t,this.player.root.appendChild(t)}},{key:"createInfoItem",value:function(e){var t=document.createElement("li");return e.elem=t,this.updateInfoItem(e),t}},{key:"showPanelInfo",value:function(){this.toggle(this.panelInfo,!0),this.panelVisible=!0;for(var e=Object.values(this.infoItems).filter((function(e){return!e.hide})),t=0;t<e.length;t++)this.updateInfoItem(e[t])}},{key:"copyToClipboard",value:function(e){var t=document.createElement("textarea");t.style.height="0px",t.style.width="1px",document.body.appendChild(t),t.value=e,t.select(),document.execCommand("copy"),document.body.removeChild(t)}},{key:"updateInfoItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.panelVisible||t){var n=e.elem;CB(n);var i=document.createElement("label"),r=this.langConfig[e.type]||e.name;i.textContent=r+"",yi.addClass(i,"xg-item-label"),n.appendChild(i);var o=document.createElement("span"),a=e.ctx||null,s=e.render.call(a,e.value);s instanceof Element?o.appendChild(s):o.textContent="".concat(s).concat(e.posfix?e.posfix:""),n.appendChild(o)}}},{key:"toggle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(e.style.display=t?"block":"none")}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,n=e[1]-Math.max(e[0],t);return n=Math.max(0,n).toFixed(2),parseFloat(n)}},{key:"destroyDOM",value:function(){this.parentNode.removeEventListener("contextmenu",this.menuHandler),document.removeEventListener("click",this.munuHideHandler,!1),this.parentNode.removeEventListener("click",this.rootClickHandler,!0),this._reset(),this.removeElement(this.rightMenu),this.removeElement(this.panelInfo),this.rightMenu=null,this.panelInfo=null,this._pollTimer&&clearTimeout(this._pollTimer)}},{key:"destroy",value:function(){this.destroyDOM(),this.destroyEvents()}},{key:"destroyEvents",value:function(){for(var e=0;e<this.playerHandler.length;e++){var t=this.playerHandler[e],n=t.evt,i=t.handler;this.player.off(n,i)}window.removeEventListener("resize",this.onWinSizeChange)}},{key:"removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"isPIPMode",value:function(){return yi.hasClass(this.parentNode,"xgplayer-pip-active")}},{key:"emitLog",value:function(e,t,n){this.player.emit(uB.MENU_LOG,{logType:e,code:t,event:n})}}]),e}();function wB(e){return e}function TB(e){var t=e.droppedVideoFrames,n=e.totalVideoFrames,i=0;i=0===n?0:t/n*100;var r=document.createElement("span"),o=document.createElement("span");o.textContent=t,r.appendChild(o);var a=document.createElement("span");return a.textContent="/".concat(n,", ").concat(i.toFixed(2),"%"),r.appendChild(a),r}function SB(e){var t=e.width,n=e.height,i=e.fps;return"".concat(t," * ").concat(n).concat(void 0!==i?" / ".concat(i,"fps"):"")}function CB(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function EB(e){console&&console.warn&&console.warn(e)}function xB(e){return"[object Function]"===Object.prototype.toString.call(e)}function OB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function PB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OB(Object(n),!0).forEach((function(t){MB(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OB(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function LB(e){return(LB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function IB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DB(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,VB(i.key),i)}}function AB(e,t,n){return t&&DB(e.prototype,t),n&&DB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function MB(e,t,n){return(t=VB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RB(e){return(RB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function NB(e,t){return(NB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function jB(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BB(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jB(e)}function UB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Hl){return!1}}();return function(){var n,i=RB(e);if(t){var r=RB(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return BB(this,n)}}function HB(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=RB(e)););return e}function FB(){return FB="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=HB(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},FB.apply(this,arguments)}function VB(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}bB.MenuEvents=yB,bB.Menu=kB;var zB=/^WEBVTT/,GB=/^STYLE+$/,WB=/^\:\:cue/,KB=/^}+$/,$B=/^\[Script Info\].*/,YB=[/[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/],qB=/^Format:\s/,XB=/^Style:\s/,JB=/^Dialogue:\s/;function ZB(e){var t=e.length;return 3===t?(60*(60*Number(e[0])+Number(e[1]))*1e3+1e3*Number(e[2]))/1e3:2===t?(60*Number(e[0])*1e3+1e3*Number(e[1]))/1e3:Number(e[0])}function QB(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function eU(e,t){return e>=0&&e<t.length?t[e]:""}var tU=function(){function e(){IB(this,e)}return AB(e,null,[{key:"parseJson",value:function(e){for(var t=[],n=0,i=0;i<e.length;i++){if(n>=50&&(n=0),0===n){var r={start:e[i].start,list:[e[i]],end:e[i].end};t.push(r)}else t[t.length-1].list.push(e[i]),t[t.length-1].end=e[i].end;n++}return t}},{key:"parse",value:function(t,n){var i=e.checkFormat(t);i||n({format:i});try{var r=[];"ass"===i?r=e.parseASS(t):"vtt"===i&&(r=e.parseVTT(t)),n({format:i,list:r.list,styles:r.styles})}catch(hV){console.error(hV),n({format:i},hV)}}},{key:"parseASSItem",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.split(","),i={},r="";try{var o=n.length-t.length;return r=(r=o>0?n.splice(t.length-1,o+1).join(",")+"":n[n.length-1]+"").replace(/\\n+/g,""),n[t.length-1]=r,t.map((function(e,t){"end"===e||"start"===e?i[e]=ZB(n[t].split(":")):"text"===e?i[e]=[n[t]]:"layer"===e?(i[e]=[n[t]],i.textTag=[n[t]]):i[e]="style"===e?[n[t]]:Number(n[t])?Number(n[t]):n[t]})),i}catch(hV){return console.error(hV),{}}}},{key:"parseASS",value:function(t){for(var n=t.split("\n"),i=[],r=0,o=0,a=[],s=[],l=null;r<n.length;){if(qB.test(n[r]))s=(s=n[r].replace(qB,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(XB.test(n[r]))a.push(n[r].replace(XB,"").replace(/\s+/g,""));else if(JB.test(n[r])){var c=e.parseASSItem(n[r].replace(JB,""),s);if(l&&c.start===l.start&&c.end===l.end)try{var u=l,h=u.text,d=u.textTag,f=u.style;h.push(c.text[0]),d.push(c.textTag[0]),f.push(c.style[0])}catch(hV){console.error(hV)}else{l=c;var p=null;o%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),i.push(p)):((p=i[i.length-1]).end=l.end,p.list.push(l)),o++}}r++}return{list:i,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var n=e.split(":");if(n.length>1){var i=n[0].trim().split("-"),r="";i.length>1?i.map((function(e,t){r+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):r=i[0],t[r]=n[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(zB,"")).split("\n"),n=[],i=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];i<t.length;){var h=eU(i,t).trim();if(!h||a&&QB(h))a=!h;else if(WB.test(h)&&GB.test(eU(i-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)KB.test(h)?(u.push({key:c,style:l}),l=null,c=null,s=!1):l+=h;else if(h){a=!1;var f=this.checkIsTime(t[i]);if(f){var p=this.parseVttTime(f);if(!o||p.start!==o.start||p.end!==o.end){(o=p).text=[],o.textTag=[];var g=null;r%50==0?((g={start:o.start,end:o.end,list:[]}).list.push(o),n.push(g)):((g=n[n.length-1]).end=o.end,g.list.push(o)),r++}}else if(o){var v=o,y=v.text,m=v.textTag,_=this.parseVttText(t[i]);y.push(_.text),m.push(_.tag)}a=!1}i++}return{list:n,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,n=null;t<YB.length&&!(n=YB[t].exec(e));)t++;return n?n[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),n="",i="default";if(t){i=t[0].replace(/\<|\>|\&/g,"");var r=RegExp("^<".concat(i,">(([\\s\\S])*?)</").concat(i,">$")).exec(e);r?n=r[1]:(n=e,i="")}else n=e;for(var o=/<(\w+).(\w+)>/g,a=o.exec(n);a&&a.length>2;)n=n.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(n);return{tag:i,text:n.replace(/\\n+/g,"<br/>")}}},{key:"parseVttTime",value:function(e){var t,n=e.split("--\x3e"),i=0;if(2===n.length){var r=n[0].split(":"),o=n[1].split(":");t=ZB(r),i=ZB(o)}return{start:t,end:i,time:e}}},{key:"isVTT",value:function(e){return zB.test(e)}},{key:"isASS",value:function(e){return $B.test(e)}},{key:"checkFormat",value:function(e){return e?zB.test(e)?"vtt":$B.test(e)?"ass":null:null}}]),e}(),nU=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"},{code:8,msg:"DATA_ERROR:subtitle.url is null"},{code:9,msg:"DATA_ERROR:subtitle.url length is 0"}];function iU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={code:nU[e].code,msg:nU[e].msg};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var rU=AB((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.url,i=t.method,r=void 0===i?"GET":i,o=t.type,a=void 0===o?"arraybuffer":o,s=t.timeout,l=void 0===s?1e4:s,c=t.data,u=void 0===c?{}:c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return IB(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if(a&&(i.responseType=a),l&&(i.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),i.onload=function(){200===i.status||206===i.status?e({context:h,res:i}):t(new Error({context:h,res:i,type:"error"}))},i.onerror=function(e){t(new Error({context:h,res:i,type:"error"}))},i.ontimeout=function(e){t(new Error({context:h,res:i,type:"error"}))},i.onabort=function(){t(new Error({context:h,res:i,type:"error"}))},"GET"===o)i.open(o,"".concat(n)),i.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));i.open(o,n),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(s.join("&"))}}))})),oU=function(){function e(){var t,n;IB(this,e);var i=new Promise((function(e,i){t=e,n=i}));return i.resolve=function(e){t(e),i.state="fulfilled"},i.reject=function(e){n(e),i.state="rejected",i.isBreak="DESTROYED"===e},i.state="pending",i}return AB(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function aU(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var n=e.className&&"object"===LB(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function sU(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):aU(e,t)||(e.className&&"object"===LB(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function lU(e,t,n){var i=t.length;if(i<1)return-1;if(t[n=n<0?0:n>=i?i-1:n].start<=e&&e<t[n].end)return n;for(var r=t[n].end<=e?n+1:0;r<i;r++){if(t[r].start<=e&&e<t[r].end)return r;if(e>t[r].end&&r+1<i&&e<t[r+1].start)return-1;if(e>t[r].end&&r+1>=i)return-1}return-1}function cU(e,t,n){var i=t.length;if(i<1)return[];var r=[];if((n=n<0?0:n>=i?i-1:n)<i)for(var o=t[n].end<=e?n:0;o<i&&(t[o].start<=e&&e<t[o].end&&r.push(o),!(e<t[o].start));o++);return r}function uU(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function hU(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r}function dU(e,t,n){if(n||(n=new oU),"json"===t){var i=tU.parseJson(e);n.resolve({list:i,format:"json"})}else"string"===t&&tU.parse(e,(function(e,t){if(t){var i=iU(2,t);n.reject(i,{format:e.format})}else if(e.format)n.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=iU(3);n.reject(r)}}));return n}function fU(e,t){return t||(t=new oU),new rU({url:e.url,type:"text"}).then((function(n){dU(n.res.response,"string").then((function(n){t.resolve(PB(PB({},n),e))})).catch((function(e){t.reject(e)}))})).catch((function(n){var i=iU(1,PB({statusText:n.statusText,status:n.status,type:n.type,message:"http load error",url:e.src},e));t.reject(i)})),t}function pU(e,t){return!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}var gU=function(){function e(){var t=this;IB(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return AB(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&e===n[r].target&&(i=r);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var n=this.__handlers,i=0;i<n.length;i++)if(n[i]&&e===n[i].target){n[i].handler&&n[i].handler.forEach((function(n){try{n(e,t)}catch(hV){console.error(hV)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var n=e.contentRect;t.__runHandler(e.target,n)}))}}]),e}(),vU=null;var yU="resize",mU="change",_U="off";function bU(e){var t=[];return e&&"String"===uU(e)?t.push({url:e,index:0,start:-1,end:-1}):"Array"===uU(e)&&e.forEach((function(e,n){t.push({url:e.url||e.src,index:n,start:e.start||-1,end:e.end||-1})})),t}var kU=!1,wU=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NB(e,t)}(n,e);var t=UB(n);function n(e){var i,r,o,a,s,l,c;return IB(this,n),MB(jB(i=t.call(this)),"_onTimeupdate",(function(){if(i._isOpen){var e=i.player.video,t=e.videoWidth,n=e.videoHeight;!i._videoMeta.scale&&t&&n&&i._onResize(i.player.root);var r=i._getPlayerCurrentTime();Math.round(Math.abs(1e3*r-i._ctime))<200||(i._ctime=1e3*r,i.currentText&&i.currentText.list&&("live"===i.config.updateMode?i._liveUpdate(r):i._update(r)))}})),MB(jB(i),"getItemsByIndex",void 0),MB(jB(i),"_onResize",(function(e){var t=jB(i),n=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=i.player.root),i._iId&&(clearTimeout(i._iId),i._iId=null),!n.scale){if(!i.player.video)return;var r=i.player.video,o=r.videoWidth,a=r.videoHeight;if(!o||!a)return;n.videoWidth=o,n.videoHeight=a,n.scale=parseInt(a/o*100,10)}i.__startResize(e)}})),MB(jB(i),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":i._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":i._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":i._onCoreSeiintime(e)}}catch(t){console.error(t)}})),MB(jB(i),"destroy",(function(){i.detachPlayer(),i.removeAllListeners(),i.player=null,i.textTrack=null})),r=navigator.userAgent,o=/(?:Windows Phone)/.test(r),a=/(?:SymbianOS)/.test(r)||o,s=/(?:Android)/.test(r),l=/(?:Firefox)/.test(r),c=/(?:iPad|PlayBook)/.test(r)||s&&!/(?:Mobile)/.test(r)||l&&/(?:Tablet)/.test(r),kU=/(?:iPhone)/.test(r)&&!c||s||a||c,i.currentText=null,i.currentExtText=null,i.textTrack=[],i._cid=-1,i._gid=-1,i._cids=[],i._iId=null,i._iC=0,i.player=null,i.root=null,i.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff",domRender:!0,updateMode:"vod",debugger:!1},i._ctime=0,i._loadingTrack={},Object.keys(i.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(i.config[t]=e[t])})),i._isOpen=i.config.defaultOpen||!1,i._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===uU(e.subTitles)?(e.player&&i.attachPlayer(e.player),i.seiTime=0,i.lastSeiTime=0,i._curTexts=[],i.setSubTitles(e.subTitles,i.config.defaultOpen),i):BB(i)}return AB(n,[{key:"version",get:function(){return"3.0.7"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._isOpen||n;i&&this.innerRoot&&this.switchOff(),this.currentText=null,this.textTrack=[],t.forEach((function(t){var n={};Object.keys(t).map((function(e){n[e]=t[e]})),n.url=bU(n.url),n.isDefault&&(e.currentText=n),e.textTrack.push(n)})),this._log("setSubTitles",r),r&&this.switch().catch((function(t){e._log("[switch]",t)})),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})),this.emit("reset",{list:this.textTrack,isOpen:r})}},{key:"updateSubTitle",value:function(e){for(var t=this,n=-1,i=0;i<this.textTrack.length;i++)if(pU(e,this.textTrack[i])){n=i;break}if(this._log("updateSubTitle",n,e),n>-1){var r=pU(this.currentText,this.textTrack[n]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=bU(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[n].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[n]),this._loadTrackUrls(this.currentText,2)):this.textTrack[n].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,n=e.format;t&&"vtt"===n&&(t.map((function(e){e.key||(e.key="xg-text-track-span")})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";e.map((function(e){n+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var i=document.createElement("style"),r=document.head||document.getElementsByTagName("head")[0];if(i.type="text/css",i.id="ssss",i.styleSheet){var o=function(){try{i.styleSheet.cssText=n}catch(Hl){}};i.styleSheet.disabled?setTimeout(o,10):o()}else{var a=document.createTextNode(n);i.appendChild(a)}r.appendChild(i)}(t,"xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e){this.player&&this.detachPlayer();var n,i,r=this.config,o=r.fontColor,a=r.mode,s=r.fitVideo,l=r.domRender;this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&sU(this.root,"text-track-hide"),!s&&sU(this.root,"text-track-no-fitvideo"),a&&sU(this.root,"text-track-".concat(a)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),o&&(this.root.style.color=o),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root.appendChild(this.root),n=e.root,i=this._onResize,vU||(vU=new gU),vU.addObserver(n,i)),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("core_event",this._onCoreEvents),this._isOpen&&this.switch().catch((function(e){t._log("[switch]",e)}))}}},{key:"detachPlayer",value:function(){var e,t,n=this.player,i=this.config;n&&(n.off("destroy",this.destroy),n.off("timeupdate",this._onTimeupdate),n.on("core_event",this._onCoreEvents),i.domRender&&(n.root&&(e=n.root,t=this._onResize,vU&&vU.unObserver(e,t),n.root.removeChild(this.root)),this.innerRoot=null,this.root=null),this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._log("switch",t),this._loadingTrack=t,new Promise((function(n,i){if(t.id||t.language)if(e.currentText&&pU(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),n(iU(0));else{var r=null;e.__removeByTime(e._curTexts,0);for(var o=0;o<e.textTrack.length;o++)if(pU(t,e.textTrack[o])){r=e.textTrack[o];break}if(e._log("nextSubtitle",r),r)e._emitPlayerSwitch(e.currentText,r),r.list?(e._loadingTrack={},e._updateCurrent(r),e.switchOn(),n(iU(0))):(e._log("this._loadTrack",r),e._updateCurrent(r),e._loadTrack(r).then((function(t){if(e.addStyles(t),e._loadingTrack.id===r.id||e._loadingTrack.language===t.language)e._loadingTrack={},e._updateCurrent(t),e.switchOn(),n(iU(0));else{var o=iU(6,{message:"check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(t.id)});i(o)}})).catch((function(e){i(e)})));else{var a=iU(4,new Error("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]")));i(a)}}else{if(e.currentText){e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn();var s=iU(0,{message:"switch default subtitle success"});return void n(s)}var l=iU(5,{message:"no default subtitle"});i(l)}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(n,i){if(t.id||t.language){for(var r=null,o=0;o<e.textTrack.length;o++)if(pU(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!pU(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,n(iU(0))}))}else e.currentExtText=null,n(iU(0))}))}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show(),this.emit(mU,this.currentText)}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide(),this.emit(_U)}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(e=console).log.apply(e,["[xgSubtitle]"].concat(n))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var n=new oU,i="",r="";if(e.json?(i="json",r=e.json):e.stringContent&&!e.url&&(i="string",r=e.stringContent),r)return dU(r,i).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,n.resolve(e)})).catch((function(e){n.reject(e)})),n;var o=e.url;return 0===o.length?(n.resolve(e),n):(fU(o.splice(0,1)[0]).then((function(i){e.format=i.format,e.styles=i.styles,e.list||(e.list=[]),t._pushList(e.list,i.list),o.length>1&&t._loadTrackUrls(e,2),n.resolve(e)})).catch((function(e){n.reject(e)})),n)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var n=PB({lang:t.language},t);this._log("emit subtile_switch ",t,n),this.player&&this.player.emit("switch_subtitle",n)}},{key:"_loadTrackUrls",value:function(e,t,n){var i=this,r=e.url.length,o=r>t?e.url.splice(0,t):e.url.splice(0,r),a=o.length;this._log("_loadTrackUrls",e.language,r,o.length,a),o.forEach((function(t,r){fU(PB(PB({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.format,e.list||(e.list=[]),i._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(n&&n.resolve(e),i._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},n=-1;e.url.forEach((function(e,i){e.url===t.url&&(n=i)})),n>-1&&e.url.splice(n,1)}},{key:"_pushList",value:function(e,t){var n=t[0].start,i=t[t.length-1].end;if(0===e.length||n>=e[e.length-1].end)t.forEach((function(t){e.push(t)}));else{for(var r=-1,o=0;o<e.length;o++)if(e[o].start>i){r=o;break}r>-1&&t.forEach((function(t,n){e.splice(r+n,0,t)}))}return e}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,this.config.domRender&&this.root&&(["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.__remove(this._cids)),this._cids=[],this._gid=-1,this._cid=-1,this._curTexts=[];var n=this._getPlayerCurrentTime();n&&("live"===this.config.updateMode?this._liveUpdate(n):this._update(n))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var n=[],i=0;i<e.length;i++)t.includes(e[i])||n.push(e[i]);return n}},{key:"getNewCid",value:function(e,t){for(var n=[],i=0;i<t.length;i++)e.includes(t[i])||n.push(t[i]);return n}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var n=[],i=lU(e,this.currentText.list,this._gid);if(i>-1&&(n=cU(e,this.currentText.list[i].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,i,n,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),n.length>0){var r=function(e,t,n){if(0===e.length||t<0||t>e.length-1)return[];var i=e[t].list;if(0===n.length)return[];var r=i.splice(n[0],n.length);return t>0&&e.splice(0,t),0===i.length&&e.splice(0,1),r}(this.currentText.list,i,n),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,n){e.index=n+a,t._curTexts.push(e)})),this.__render(r)}this.emit("update",this._curTexts)}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var n=lU(e,this.currentText.list,this._gid),i=[];if(n>-1&&(i=cU(e,this.currentText.list[n].list,this._cid)),i.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),void(this._cids=[]);if(this._cids!==i||n!==this._gid){this._gid=n,this._cid=i[0];var r=this.getDelCid(this._cids,i),o=this.getNewCid(this._cids,i);this._cids=i,this.config.domRender&&this.__remove(r);var a=[];o.map((function(e){var i=t.currentText.list[n].list[e];i.index=e,a.push(i)})),this.currentExtText&&o.map((function(e){var i=t.currentText.list[n].list[e];i.index=e,a.push(i)})),this.emit("update",a),this.__render(a,e)}}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return parseInt(1e3*e+1e3*this.seiTime-1e3*this.lastSeiTime,10)/1e3}},{key:"_onSubtitlePlaylist",value:function(e){this._log("_onSubtitlePlaylist",e);var t=e.map((function(e){return{label:e.name,language:e.lang,id:e.id,isDefault:e.default,url:[],mUrl:e.url}}));this.setSubTitles(t)}},{key:"_onSubtitleSegment",value:function(e){if(this._log("_onSubtitleSegment",e.length,e[0].lang,e[0].sn,e[e.length-1].sn,e[0].start,e[e.length-1].end),e&&0!==e.length){var t={language:e[0].lang,url:e.map((function(e){return{id:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end}}))};pU(t,this.currentText)&&this.updateSubTitle(t)}}},{key:"_onCoreSeiintime",value:function(e){try{var t=e.time/1e3;this._log("_onCoreSeiintime sei",t,this.seiTime,this.lastSeiTime),this.seiTime=t,this.lastSeiTime=this.player?this.player.currentTime:0}catch(n){}}},{key:"resize",value:function(e,t){var n,i=this,r=this.config,o=r.baseSizeX,a=r.baseSizeY,s=r.minMobileSize,l=r.minSize,c=r.fitVideo,u=r.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=parseInt(h*e,10)/100,n=e):(d=t,n=parseInt(t/h*100,10)),this._videoMeta.vWidth=n,this._videoMeta.vHeight=d;var f=0,p=0;h>120?(f=a,p=parseInt(f*d/1080,10)):(f=o,p=parseInt(f*n/1920,10));var g=kU?s:l,v={fontSize:p=p<g?g:p>f?f:p},y=parseInt((t-d)/2,10),m=parseInt((e-n)/2,10),_=parseInt(d*u,10)/100;this._videoMeta.vBottom=y,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(v.bottom=y+_,v.left=v.right=m),Object.keys(v).map((function(e){i.root.style[e]="".concat(v[e],"px")})),this.emit(yU,{vLeft:m,vBottom:y,marginBottom:_,vWidth:n,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,n=e.getBoundingClientRect(),i=this._videoMeta,r=n.width,o=n.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),r>0&&o>0&&(r!==i.lwidth||o!==i.lheight))this._iC=0,this.resize(r,o);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__removeByTime",value:function(e,t){for(var n=[],i=0;i<e.length;i++)(!t||e[i].end<t)&&n.push(i);0!==n.length&&(e.splice(n[0],n.length),this.config.domRender&&this.__remove(n))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){for(var n=this.innerRoot.children,i=[],r=0;r<n.length;r++){var o=Number(n[r].getAttribute("data-index"));e.includes(o)&&i.push(n[r])}i.map((function(e){t.innerRoot.removeChild(e)}))}}},{key:"__render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._log("__render",t.length,this.config.domRender),t.length>0&&this.config.domRender&&t.map((function(t){var n="text-track-".concat(e.config.line);t.text.map((function(i,r){r>0&&(n+=" text-track-deputy");var o={"data-start":t.start,"data-end":t.end,"data-index":t.index};e.innerRoot.appendChild(hU("xg-text-track-span",i,o,n))}))}))}},{key:"show",value:function(){var e,t;this.config.domRender&&(e=this.root,t="text-track-hide",e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):aU(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===LB(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(sU(this.root,"text-track-hide"),this.innerRoot.innerHTML="")}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=FB(RB(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=FB(RB(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=FB(RB(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=FB(RB(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){FB(RB(n.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,n=e.marginBottom;return this.config.fitVideo?t+n:n}}]),n}(hi),TU=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),c(p(i=t.call(this)),"_onChange",(function(e){var t=i._media.textTracks;if(t&&0!==t.length){for(var n=[],r=[],o=-1,a=0;a<t.length;a++){var s=t[a];"subtitles"===s.kind&&(n.push({id:s.id||s.language,language:s.language,text:s.label,isDefault:"showing"===s.mode}),-1===o&&"showing"===s.mode&&(o=a),r.push(s.language))}r.join("|")!==i._languages?(i._languages=r.join("|"),i.emit("reset",{list:n,isOpen:o>-1})):-1===o?i.emit("off"):i.curIndex!==o&&i.emit("change",n[o]),i.curIndex=o}})),i._media=e,i._list=[],i._languages="",i.curIndex=-1,i._init(),i}return l(n,[{key:"_init",value:function(){var e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):console.warn("current browser not support native subtitle")}},{key:"switch",value:function(e){var t=this;return new Promise((function(n,i){if(!e)return i({code:1,message:"no subtitle data"});for(var r=t._media.textTracks,o=0;o<r.length;o++){var a=r[o];a.language===e.language?a.mode="showing":"showing"===a.mode&&(a.mode="disabled")}return n({code:0})}))}},{key:"switchOff",value:function(){for(var e=this._media.textTracks,t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}},{key:"destroy",value:function(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}]),n}(hi);function SU(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0.5C0.895431 0.5 0 1.39543 0 2.5V13.5C0 14.6046 0.89543 15.5 2 15.5H16C17.1046 15.5 18 14.6046 18 13.5V2.5C18 1.39543 17.1046 0.5 16 0.5H2ZM7.49634 11.0454C8.00741 10.606 8.29061 10.0037 8.34595 9.23877H6.8811C6.84855 9.67171 6.71997 9.99235 6.49536 10.2007C6.27401 10.4058 5.93709 10.5083 5.48462 10.5083C4.98332 10.5083 4.61548 10.3309 4.3811 9.97607C4.14998 9.62126 4.03442 9.05973 4.03442 8.2915V7.75439C4.04093 7.01872 4.16463 6.47673 4.40552 6.12842C4.64966 5.77686 5.01587 5.60107 5.50415 5.60107C5.95337 5.60107 6.28703 5.70524 6.50513 5.91357C6.72648 6.11865 6.85506 6.45068 6.89087 6.90967H8.35571C8.27759 6.1154 7.98787 5.49854 7.48657 5.05908C6.98527 4.61963 6.32446 4.3999 5.50415 4.3999C4.9117 4.3999 4.39087 4.53988 3.94165 4.81982C3.49569 5.09652 3.15226 5.49528 2.91138 6.01611C2.67049 6.53695 2.55005 7.13916 2.55005 7.82275V8.25732C2.55005 9.32829 2.81047 10.1714 3.3313 10.7866C3.85539 11.3986 4.57316 11.7046 5.48462 11.7046C6.31795 11.7046 6.98853 11.4849 7.49634 11.0454ZM14.5393 11.0454C15.0504 10.606 15.3336 10.0037 15.3889 9.23877H13.9241C13.8915 9.67171 13.7629 9.99235 13.5383 10.2007C13.317 10.4058 12.9801 10.5083 12.5276 10.5083C12.0263 10.5083 11.6584 10.3309 11.4241 9.97607C11.193 9.62126 11.0774 9.05973 11.0774 8.2915V7.75439C11.0839 7.01872 11.2076 6.47673 11.4485 6.12842C11.6926 5.77686 12.0588 5.60107 12.5471 5.60107C12.9963 5.60107 13.33 5.70524 13.5481 5.91357C13.7695 6.11865 13.898 6.45068 13.9338 6.90967H15.3987C15.3206 6.1154 15.0308 5.49854 14.5295 5.05908C14.0282 4.61963 13.3674 4.3999 12.5471 4.3999C11.9547 4.3999 11.4338 4.53988 10.9846 4.81982C10.5387 5.09652 10.1952 5.49528 9.95435 6.01611C9.71346 6.53695 9.59302 7.13916 9.59302 7.82275V8.25732C9.59302 9.32829 9.85343 10.1714 10.3743 10.7866C10.8984 11.3986 11.6161 11.7046 12.5276 11.7046C13.3609 11.7046 14.0315 11.4849 14.5393 11.0454Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function CU(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49609 11.0454C8.00716 10.606 8.29037 10.0037 8.3457 9.23877H6.88086C6.84831 9.67171 6.71973 9.99235 6.49512 10.2007C6.27376 10.4058 5.93685 10.5083 5.48438 10.5083C4.98307 10.5083 4.61523 10.3309 4.38086 9.97607C4.14974 9.62126 4.03418 9.05973 4.03418 8.2915V7.75439C4.04069 7.01872 4.16439 6.47673 4.40527 6.12842C4.64941 5.77686 5.01562 5.60107 5.50391 5.60107C5.95312 5.60107 6.28678 5.70524 6.50488 5.91357C6.72624 6.11865 6.85482 6.45068 6.89062 6.90967H8.35547C8.27734 6.1154 7.98763 5.49854 7.48633 5.05908C6.98503 4.61963 6.32422 4.3999 5.50391 4.3999C4.91146 4.3999 4.39062 4.53988 3.94141 4.81982C3.49544 5.09652 3.15202 5.49528 2.91113 6.01611C2.67025 6.53695 2.5498 7.13916 2.5498 7.82275V8.25732C2.5498 9.32829 2.81022 10.1714 3.33105 10.7866C3.85514 11.3986 4.57292 11.7046 5.48438 11.7046C6.31771 11.7046 6.98828 11.4849 7.49609 11.0454Z" fill="white"/>\n<path d="M14.5391 11.0454C15.0501 10.606 15.3333 10.0037 15.3887 9.23877H13.9238C13.8913 9.67171 13.7627 9.99235 13.5381 10.2007C13.3167 10.4058 12.9798 10.5083 12.5273 10.5083C12.026 10.5083 11.6582 10.3309 11.4238 9.97607C11.1927 9.62126 11.0771 9.05973 11.0771 8.2915V7.75439C11.0837 7.01872 11.2074 6.47673 11.4482 6.12842C11.6924 5.77686 12.0586 5.60107 12.5469 5.60107C12.9961 5.60107 13.3298 5.70524 13.5479 5.91357C13.7692 6.11865 13.8978 6.45068 13.9336 6.90967H15.3984C15.3203 6.1154 15.0306 5.49854 14.5293 5.05908C14.028 4.61963 13.3672 4.3999 12.5469 4.3999C11.9544 4.3999 11.4336 4.53988 10.9844 4.81982C10.5384 5.09652 10.195 5.49528 9.9541 6.01611C9.71322 6.53695 9.59277 7.13916 9.59277 7.82275V8.25732C9.59277 9.32829 9.85319 10.1714 10.374 10.7866C10.8981 11.3986 11.6159 11.7046 12.5273 11.7046C13.3607 11.7046 14.0312 11.4849 14.5391 11.0454Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.5C0 1.39543 0.895431 0.5 2 0.5H16C17.1046 0.5 18 1.39543 18 2.5V13.5C18 14.6046 17.1046 15.5 16 15.5H2C0.89543 15.5 0 14.6046 0 13.5V2.5ZM2 2.3H16C16.1105 2.3 16.2 2.38954 16.2 2.5V13.5C16.2 13.6105 16.1105 13.7 16 13.7H2C1.88954 13.7 1.8 13.6105 1.8 13.5V2.5C1.8 2.38954 1.88954 2.3 2 2.3Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var EU=Qr.POSITIONS,xU="mobile"===Si.device,OU="text-close";function PU(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=-1;return e.map((function(e,n){e.id||e.language||(e.id=""+n),!e.url&&(e.url=e.src),!e.text&&(e.text=e.label),!e.language&&(e.language=e.srclang),void 0===e.isDefault&&(e.isDefault=e.default),(e.isDefault||e.default)&&(t<0?t=n:e.isDefault=e.default=!1)})),t}var LU=function(e){u(r,e);var n=v(r);function r(e){var t;a(this,r),(t=n.call(this,e)).isOpenState=!0,t.optionList=null,t.currentLang="",t.handlerClickSwitch=function(e,n){e.stopPropagation(),e.preventDefault(),t.subTitles&&(n.type===OU?t.switchOffSubtitle():t.switchSubTitle({language:n.language,id:n.id}))},t.onPlayerFocus=function(e){t.subTitles&&t.config.style.follow&&t.rePosition()},t.onPlayerBlur=function(e){t.subTitles&&t.config.style.follow&&!t.playerConfig.marginControls&&t.subTitles.root&&(t.subTitles.root.style.transform="translate(0, 0)")};var i=e.player;return e.config,i.config.isLive&&(e.config.updateMode="live",Si.os.isIos&&(e.config.mode="native")),t}return l(r,[{key:"afterCreate",value:function(){var e=this.config.list,t=void 0===e?[]:e;this.curIndex=-1,this.curItem=null;var n=PU(t);m(h(r.prototype),"afterCreate",this).call(this),"native"===this.config.mode?this._initNativeSubtitle(n):this._initExtSubTitle(n)}},{key:"_initNativeSubtitle",value:function(e){var t=this.player;t._subTitles||(t._subTitles=new TU(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),this._renderList(e)}},{key:"_initExtSubTitle",value:function(e){var t=this.config,n=t.list,i=void 0===n?[]:n,r=t.style,o=t.isDefaultOpen,a={subTitles:i,defaultOpen:o,debugger:!1,updateMode:t.updateMode};this.isOpenState=o,Object.keys(r).map((function(e){a[e]=r[e]})),!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(Ki,this.onPlayerFocus),this.on($i,this.onPlayerBlur));var s=this.player;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new wU(a),s._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=s._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),r.follow&&this.subTitles.root&&yi.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}},{key:"_renderList",value:function(e){var t=this.config,n=t.list,i=void 0===n?[]:n,r=t.isDefaultOpen;i.length&&(r&&e<0?(i[0].isDefault=!0,this.curIndex=0,this.curItem=i[0]):(this.curIndex=e,this.curItem=i[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?yi.addClass(this.root,"isOpen"):yi.addClass(this.root,"isClose")}},{key:"_onOff",value:function(){this.noShowSubtitle()}},{key:"_onChange",value:function(e){var t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)}},{key:"_onListReset",value:function(e){this.updateList(e)}},{key:"updateCurItem",value:function(e,n){this.curIndex=e,this.curItem=this.config.list[e-1],this.renderItemList(),this.emit("subtitle_change",t({off:!1,isListUpdate:!1,list:[]},n))}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showList.bind(this)),this.bind(["mouseleave"],this.hideList.bind(this)),this._delegates=[]}},{key:"handleButtonChange",value:function(e){e.preventDefault(),e.stopPropagation(),e.delegateTarget||(xU?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle())}},{key:"showList",value:function(){var e;!xU&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hideList",value:function(){var e;!xU&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"openSubtitle",value:function(){this.curIndex>-1&&this.curItem&&this.switchSubTitle(this.curItem)}},{key:"getSubTitleIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"",language:""},n=-1;return t&&(t.id||t.language)?(e.forEach((function(e,i){e.id!==t.id&&e.language!==t.language||(n=i)})),n):n}},{key:"registerIcons",value:function(){return{vttSubOpen:{icon:SU,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:CU,class:"xgplayer-vttsub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}},{key:"creatOptionList",value:function(){var e=this;if(!xU){var t={config:{data:this.getList(),className:"",onItemClick:function(t,n){e.handlerClickSwitch(t,null==n?void 0:n.to)}},root:this.root};this.optionList=new Xa(t)}}},{key:"getList",value:function(){var e=this;return this.config.list.map((function(t,n){return n===e.curIndex&&e.isOpenState?(t.isCurrent=!0,t.selected=!0):(t.isCurrent=!1,t.selected=!1),t.showText=e.getTextByLang(t),t}))}},{key:"renderOptionList",value:function(){this.optionList.renderItemList(this.getList())}},{key:"switchSubTitle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""},n=-1;if(t&&(t.id||t.language)&&(this.config.list.map((function(e,i){e.id+""==t.id+""&&e.language+""==t.language+""&&(n=i)})),!(n<0||this.isOpenState&&n===this.curIndex)))return this.subTitles.switch(t).then((function(i){0===i.code&&(t.off=!1,t.isListUpdate=!1,t.list=[],e.curIndex=n,e.curItem=e.config.list[n],e.isOpenState=!0,yi.removeClass(e.root,"isClose"),yi.addClass(e.root,"isOpen"),e.renderItemList(),e.changeTipText(),e.emit("subtitle_change",t))})).catch((function(e){return console.error("switch subtitle err: ",e)}))}},{key:"switchOffSubtitle",value:function(){this.subTitles.switchOff(),this.noShowSubtitle()}},{key:"noShowSubtitle",value:function(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,yi.addClass(this.root,"isClose"),yi.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null===(e=this.optionList)||void 0===e||e.hide()}},{key:"renderItemList",value:function(){xU?this.updatePanel():this.renderOptionList()}},{key:"updateSubtitles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this.updateList(),this.subTitles&&this.subTitles.setSubTitles(this.config.list,this.curIndex>-1,t))}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.list){var t=[];e.list.map((function(e){t.push(e)}));var n,i=PU(t);if(e.isOpen)this.isOpenState=!0,this.curIndex=i,this.curItem=i>-1?t[i]:null,yi.removeClass(this.root,"isClose"),yi.addClass(this.root,"isOpen");else this.isOpenState=!1,this.curIndex=-1,this.curItem=null,yi.removeClass(this.root,"isOpen"),yi.addClass(this.root,"isClose"),this.changeTipText(),null===(n=this.optionList)||void 0===n||n.hide();if(this.config.list=t,t.length>0){var r;if(!xU)null===(r=this.optionList)||void 0===r||r.hide()}else{var o,a;if(this.switchOffSubtitle(),xU?this.showMobilePanel():null===(o=this.optionList)||void 0===o||o.show(),!xU)null===(a=this.optionList)||void 0===a||a.hide();this.hide()}this.renderItemList()}}},{key:"changeTipText",value:function(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}},{key:"showMobilePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"renderPanel",value:function(){var e=this,n=b(this.config.list),i=yi.createDom("div","",{},"ai-panel-content");n.map((function(n,r){var o=t({language:n.language||n.srclang,"data-id":n.id,selected:e.isOpenState&&e.curIndex===r,showText:e.getTextByLang(n)},n),a=e.renderPanelItem(o);i.appendChild(a)}));var r={showText:this.langText.subClose,"data-type":OU,selected:!this.isOpenState};return i.appendChild(this.renderPanelItem(r)),i}},{key:"renderPanelItem",value:function(e){var t=this,n=e.showText,i=e.selected,r=yi.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item ".concat(i?"select-in":""));r.innerHTML=n;var o=xU?"touchend":"click",a=Qr.delegate(r,".panel-Item",o,(function(n){e["data-type"]===OU?(n.stopPropagation(),n.preventDefault(),t.switchOffSubtitle()):t.handlerClickSwitch(n,e)}));return this._delegates.push(a),r}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var r=this.config.list;return!n&&(n=this.player.lang),t=!t||yi.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=r[e]),"object"===i(e[t])?e[t][n]||e[t].zh:e[t]||""}},{key:"rePosition",value:function(){var e=this.config.style.fitVideo,t=0-this.player.controls.root.getBoundingClientRect().height;if(e){var n=this.player,i=n.video,r=n.root.getBoundingClientRect(),o=r.height,a=r.width,s=i.videoHeight,l=i.videoWidth,c=parseInt(s/l*100,10)*a/100;c>o&&(c=o);var u=(o-c)/2-t;u<0&&(this.subTitles.root.style.transform="translate(0, ".concat(u,"px)"))}else this.subTitles.root.style.transform="translate(0, ".concat(t,"px)")}},{key:"destroy",value:function(){var e;this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showList.bind(this)),this.unbind(["mouseleave"],this.hideList.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((function(e){Array.isArray(e)&&e.map((function(e){e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),m(h(r.prototype),"destroy",this).call(this)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"Subtitle"}},{key:"defaultConfig",get:function(){return{position:EU.CONTROLS_RIGHT,index:_M,list:[],isDefaultOpen:!0,style:{follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:4,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"},isShowIcon:!0,mode:"external",updateMode:"vod"}}}]),r}(Qr),IU=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).toastNumber=0,i.toastMaps={},i}return l(n,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"add",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.toastNumber+1;this.toastNumber=r;var o=this.renderToast(e,i,r);return this.root.appendChild(o),this.toastMaps[r]=o,n&&setTimeout((function(){t.remove(r)}),n),r}},{key:"remove",value:function(e){var t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}},{key:"renderToast",value:function(e,t,n){var i=this,r=yi.createDom("div","",void 0,"toast-container"),o=yi.checkIsObject(e)?e:yi.createDom("div",e,void 0,"toast-txt");if(r.appendChild(o),t){var a=yi.createDom("span","×",void 0,"toast-close-bt");a.addEventListener("click",(function(){i.remove(n)})),r.appendChild(a)}return r}},{key:"render",value:function(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}}],[{key:"pluginName",get:function(){return"sdkToastPlugin"}},{key:"defaultConfig",get:function(){return{index:5}}}]),n}(Qr);function DU(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function AU(e,t,n){return t&&DU(e.prototype,t),n&&DU(e,n),e}function MU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function NU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RU(Object(n),!0).forEach((function(t){MU(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jU="xgplayer_device_id",BU="xgplayer_user_id",UU=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),n=0,i=t.length;n<i;n++){var r=t[n];if(t[n].indexOf(e)>=0)return r.split("=")[1]||null}},HU=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},FU=function(){var e=UU(jU);if(e)return e;var t=HU(11);return document.cookie=jU+"="+t+";max-age=31536000;path=/",t},VU=function(){var e=UU(BU);if(e)return e;var t=HU(12);return document.cookie=BU+"="+t+";max-age=31536000;path=/",t};var zU={get device(){return zU.os.isPc?"pc":"mobile"},get browser(){var e=function(){var e=navigator.userAgent.toLowerCase(),t={},n={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var i in n)if(n[i]){var r="";if("IE"===i)r=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===i){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(i="360");var a=e.match(/chrome\/([\d.]+)/);r=a?a[1]:"-1"}else if("Firefox"===i){var s=e.match(/firefox\/([\d.]+)/);r=s?s[1]:"-1"}else if("Opera"===i){var l=e.match(/opera\/([\d.]+)/);r=l?l[1]:"-1"}else if("Safari"===i){var c=e.match(/version\/([\d.]+)/);r=c?c[1]:"-1"}else if("Edge"===i){var u=e.match(/edge\/([\d.]+)/);r=u?u[1]:"-1"}else if("QQBrowser"===i){var h=e.match(/qqbrowser\/([\d.]+)/);r=h?h[1]:"-1"}t.type=i,t.versions=parseInt(r)}return t}();return e.type+"_"+e.versions},get os(){var e=navigator.userAgent;navigator.platform.toLowerCase();var t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:i,isPc:!(a||i||n||o),isSymbian:n,isWindowsPhone:t,isFireFox:r}},get operation_os(){for(var e=navigator.userAgent,t=[{s:"windows",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1|Windows 8.1|Windows NT 6.3|Windows 8|Windows NT 6.2|Windows 7|Windows NT 6.1)/},{s:"android",r:/Android/},{s:"linux",r:/(Linux|X11)/},{s:"ios",r:/(iPhone|iPad|iPod)/},{s:"mac",r:/Mac OS X/},{s:"mac",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<t.length;n++){var i=t[n];if(i.r.test(e))return i.s}return"unknown"}};function GU(){return Date.now()}function WU(e){var t="unknown";return"string"!=typeof e?t:e.indexOf(".flv")>-1?"flv":e.indexOf(".m3u8")>-1?"m3u8":e.indexOf(".mp4")>-1?"mp4":e.indexOf(".sdp")>-1?"rts":t}function KU(e){if(e.plugins){if(e.plugins.flv)return e.plugins.flv;if(e.plugins.hls)return e.plugins.hls;if(e.plugins.rts)return e.plugins.rts;if(e.plugins.flvlive)return e.plugins.flvlive;if(e.plugins.hlslive)return e.plugins.hlslive;if(e.plugins.hlsvod)return e.plugins.hlsvod;if(e.plugins.hlslivemobile)return e.plugins.hlslivemobile;if(e.plugins.flvlivemobile)return e.plugins.flvlivemobile}return e.newHls||e.newFlv||e.__core__||e.flv}var $U={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},YU=function(){function e(e){var t=e.Tea;if(!t)throw new Error("lack Tea option");t.event?this.Tea=t.event.bind(t):this.Tea=t,this.logOptions=e,this._player=e.player}AU(e,[{key:"videoSize",get:function(){return this._player&&this._player.video?{width:this._player.video.videoWidth,height:this._player.video.videoHeight}:{width:0,height:0}}}]);var t=e.prototype;return t.push=function(e){var t=this._player.config.url;this._player.video&&(e.play_current_time=this._player.currentTime),e.cdn_play_url=t&&t.startsWith("//")?window.location.protocol+t:t,e.live_stream_session_id=function(e,t){return new URLSearchParams(e.split("?")[1]).get(t)}(t,"session_id"),e.play_format=WU(t),e.timestamp=GU();var n=function(){var e={cpu_core_number:-1,memory_usage:-1,network_downlink:-1};try{e.cpu_core_number=navigator.hardwareConcurrency||-1,e.memory_usage=navigator.deviceMemory||-1,e.network_downlink=navigator.connection&&navigator.connection.downlink,null==e.network_downlink&&(e.network_downlink=-1)}catch(hV){}return e}(),i=n.cpu_core_number,r=n.memory_usage,o=n.network_downlink;e.cpu_core_number=i,e.memory_usage=r,e.network_downlink=o,Object.assign(e,NU({},this.videoSize)),this.send(e)},t.send=function(e){e.event_key&&(this.logOptions.onReport&&this.logOptions.onReport(e.event_key,e),this.Tea(e.event_key,NU({},e)))},e}(),qU=function(){return void 0!==navigator.onLine?navigator.onLine?(e=navigator.connection)&&(e.effectiveType||e.type)||zU.device:"none":"unknown";var e},XU=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],JU=function(){function e(e){this.options=e,this.logger=new ZU(e),this.restart=this.restart.bind(this),this.bindUrlChange(),zU.browser.includes("Chrome")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new ZU(this.options),this.bindUrlChange(),this.logger.reportStartPlay(),this.logger.handlePlayerComlete()},t.bindUrlChange=function(){this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.on("urlchange",this.restart)},t.setNTP=function(e){this.logger.setNTP(e)},t.updateExt=function(e){this.options.ext=Object.assign(this.options.ext||{},e),this.logger&&this.logger.updateExt(e)},t.destroy=function(e){this.logger.destroy(e),this.logger=null,this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.off("urlchange",this.restart)},e}(),ZU=function(){function e(e){if(!e.player)throw new Error("option player is necessary");this.options=Object.assign({},e,function(e){return{device_id:e.device_id||FU(),user_id:e.user_id||VU(),error_report_stop:!!e.error_report_stop,project_key:e.project_key||"live",product_line:e.product_line||"live",onReport:e.onReport||function(){}}}(e)),this._player=this.options.player,this._url=this._player.config.url,this.project_key=e.project_key||"live",this.product_line=e.product_line||"live",this.ntpDelta=this.options.ntp?Date.now()-this.options.ntp:0,this.inWaitingStart=0,this.errorNumber=0,this.tempDroppedFrameCount=0,this.tempTotalFrameCount=0,this._logmanager=new YU(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}AU(e,[{key:"videoSize",get:function(){return this.player?{width:this.player.video.videoWidth,height:this.player.video.videoHeight}:{width:0,height:0}}},{key:"player",get:function(){return this._player}},{key:"logmanager",get:function(){return this._logmanager}},{key:"ntpTime",get:function(){return Date.now()-this.ntpDelta}}]);var t=e.prototype;return t.setNTP=function(e){this.options&&(this.options.ntp=e,this.ntpDelta=Date.now()-this.options.ntp)},t.init=function(){this.bindCtx(),this.initLog(),this.initEvt()},t.bindCtx=function(){this.handlePlayerComlete=this.handlePlayerComlete.bind(this),this.handlePlayerPlaying=this.handlePlayerPlaying.bind(this),this.destroyFunc=this.destroyFunc.bind(this),this.handleUserLeave=this.handleUserLeave.bind(this),this.handlePlayerError=this.handlePlayerError.bind(this),this.handlePlayerReady=this.handlePlayerReady.bind(this),this.handlePlayerWaiting=this.handlePlayerWaiting.bind(this),this.handleAVUnsync=this.handleAVUnsync.bind(this),this.handlePlayerPause=this.handlePlayerPause.bind(this),this.handleTTFB=this.handleTTFB.bind(this),this.handleUrlChange=this.handleUrlChange.bind(this),this.handleKeyframe=this.handleKeyframe.bind(this),this.handleSourceOpen=this.handleSourceOpen.bind(this),this.handleBufferAppend=this.handleBufferAppend.bind(this),this.handleCoreEvent=this.handleCoreEvent.bind(this),this.handleDegrade=this.handleDegrade.bind(this)},t.initLog=function(){var e=this,t=this.options,n=t.player,i=void 0!==n.hlsOps;this.commonParams=NU({os:zU.operation_os},function(e){var t=e.player,n=t.config.mediaType;return NU({project_key:e.project_key,live_sdk_version:KU(t)||t.hlsOps?"2":"-1",player_sdk_version:t.version,logger_version:"1.1.0-alpha.5",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:HU(12),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!n&&"video"!==n),review_is_live:t.config.isLive?2:1,aid:e.aid,live_id:e.live_id||e.aid+"-"+e.user_id+"-"+Date.now(),is_preview:e.is_preview?1:0,codec_type:e.codec_type||"h264",width:Math.floor(t.config.width),height:Math.floor(t.config.height),browser:zU.browser,ua:navigator.userAgent,href:window.location.href,timestamp:0,fps:-1,logger_init_time:Date.now(),play_current_time:0,cdn_play_url:t.config.url&&t.config.url.startsWith("//")?window.location.protocol+t.config.url:t.config.url,play_format:WU(t.config.url),codec_support:-1},e.ext)}(t)),this.log=Object.assign({},{start_play:{start_play_time:0,event_key:"start_play"},first_frame:{start:0,first_frame_view:0,event_key:"first_frame",first_sei_delay:0,ntp_sync:0,ntp_delta:0,ttfb:-1,ttdb:-1,ttfb_end:0},first_frame_failed:{code:void 0,msg:"",event_key:"first_frame_failed"},stall_start:{ready_state:-1,stall_start_time:0,event_key:"stall_start"},stalling:{event_key:"stalling"},stall:{reason:0,stall_start:0,stall_end:0,ready_state:0,event_key:"stall"},play_stop:{code:0,stop_time:0,drop_percent:0,is_stream_received:0,stall_count:0,stall_time:0,retry_count:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0,event_key:"play_stop",dns_parse_time:-1,redirect:-1,ttfb:-1,buffered:[],is_firstframe_received:0,meta:null},playing:{index:0,stall_count:0,stall_time:0,play_time:1e4,retry_count:0,is_last:0,video_buffer_time:0,audio_buffer_time:0,speed_switch_count:0,speed_switch_info:"none",download_speed:0,decode_fps:0,render_fps:0,drop_count:0,drop_percent:0,sei_source:"",sei_delay:0,ntp_sync:0,ntp_delta:0,event_key:"playing",stop_time:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0},play_error:{code:void 0,info:"",event_key:"play_error"},play_low_decode:{fps:-1,decode_fps:-1,bitrate:-1,url:-1,msg:"",event_key:"play_low_decode"},play_av_unsync:{aDts:-1,vDts:-1,frameLength:-1,currentTime:-1,duration:0,event_key:"play_av_unsync"},play_loadstream:{loadstream_url:"",event_key:"play_loadstream"},play_stream_loaded:{event_key:"play_stream_loaded"},play_metadata_loaded:{metadata_type:"",event_key:"play_metadata_loaded"},stream_exception:{event_key:"stream_exception"},pause:{event_key:"pause"},play_url_change:{event_key:"play_url_change"},source_opened:{event_key:"source_opened"},source_updateend:{event_key:"source_updateend"},play_result:{event_key:"play_result",result:0,threshold:15e3,is_threshold:0},degrade:{event_key:"degrade",payload:{}},rtcstatechange:{event_key:"rtcstatechange"}});var r=this;for(var o in this.log){var a=function(t){Object.defineProperty(e.log[o],t,{get:function(){return null==this["_"+t]?r.commonParams[t]:this["_"+t]},set:function(e){this["_"+t]=e},enumerable:!0})};for(var s in this.commonParams)a(s);i&&Object.defineProperty(this.log[o],"m3u8",{get:function(){if(n.__core__){var e=n.__core__.m3u8Text;return e?e.slice(0,25e4):""}return""},enumerable:!0}),Object.defineProperty(this.log[o],"volume",{get:function(){if(n&&n.video)return n.volume||0},enumerable:!0}),Object.defineProperty(this.log[o],"access",{get:function(){return qU()},enumerable:!0})}},t.updateExt=function(e){for(var t in this.log)for(var n in e)this.log[t][n]=e[n]},t.reportStartPlay=function(){this.started||(this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=GU(),this.logmanager.push(this.log.start_play,!0))},t.initWindowListener=function(){"pc"===zU.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===zU.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},t.removeWindowListener=function(){"pc"===zU.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===zU.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},t.initEvt=function(){var e=this,t=this.player;XU.forEach((function(t){e["handleVideo"+t+"Evt"]=function(){e["handleVideo"+t]&&e["handleVideo"+t]()},e.initWindowListener(),e.bindVideoEvt(t,e["handleVideo"+t+"Evt"])})),t.once("error",this.handlePlayerError),t.once("complete",this.handlePlayerComlete),t.once("playing",this.handlePlayerPlaying),t.once("timeupdate",this.handlePlayerPlaying),t.once("destroy",this.destroyFunc),t.on("ready",this.handlePlayerReady),t.on("waiting",this.handlePlayerWaiting),t.on("pause",this.handlePlayerPause),t.on("urlchange",this.handleUrlChange),t.once("sourceopen",this.handleSourceOpen),t.once("bufferappend",this.handleBufferAppend),t.on("core_event",this.handleCoreEvent),t.on("degrade",this.handleDegrade),this.hiJackPlayerStart()},t.handleCoreEvent=function(e){var t=e.eventName,n=e.headers,i=e.pts,r=e.type,o=e.meta,a=e.sei,s=e.decodeFps,l=e.url,c=e.state;switch(t){case"core.ttfb":this.handleTTFB(e);break;case"core.loadresponseheaders":var u=n.get("X-Server-Ip");void 0!==this.player.hlsOps&&(this.log.play_stop.review_ts_count+=1),u&&(this.commonParams.cdn_ip=u);break;case"core.loadretry":this.log.play_stop.retry_count++;break;case"core.keyframe":this.handleKeyframe(i);break;case"core.metadataparsed":this.handleMetaDataLoaded(r,o);break;case"core.sei":this.handleSEIParsed(a);break;case"core.lowdecode":this.commonParams.is_wasm&&(Object.assign(this.log.play_low_decode,e||{}),this.log.play_low_decode.decode_fps=s,this.log.play_low_decode.timestamp=GU(),this.logmanager.push(this.log.play_low_decode,!0),this.commonParams.is_wasm=0);break;case"core.largeavgap":this.handleAVUnsync(e);break;case"core.loadstart":this.handlePlayerLoadStream(e),this.reportStartPlay();break;case"core.loadcomplete":this.handlePlayerLoadedStream(e);break;case"core.streamexception":this.handleStreamException(e);break;case"core.rtcstatechange":this.logmanager.push(Object.assign({url:l,state:c},this.log.rtcstatechange))}},t.handleDegrade=function(e){this.log.degrade.payload=e,this.logmanager.push(this.log.degrade,!0)},t.hiJackPlayerStart=function(){var e=arguments,t=this;this.player._start=this.player.start;var n=this.player;n.start=function(){try{if(n._start)return n._start.apply(n,Array.prototype.slice.call(e,0))}catch(Hl){}t.destroyed||t.handlePlayerComlete()}},t.handleTTFB=function(e){var t=e||{},n=t.end,i=t.elapsed;this.log.first_frame.ttfb=i||-1,this.log.first_frame.ttfb_end=n||0},t.handleUrlChange=function(e){this.logmanager.push(Object.assign(this.log.play_url_change,{url:e,timestamp:GU()}))},t.handleKeyframe=function(e){this.log.play_stop.is_firstframe_received=1,this.log.play_stop.firstframe_pts=e},t.handleSourceOpen=function(){this.log.source_opened.timestamp=GU(),this.logmanager.push(this.log.source_opened)},t.handleBufferAppend=function(){this.log.source_updateend.timestamp=GU(),this.logmanager.push(this.log.source_updateend)},t.handlePlayerPause=function(){this.log.pause.timestamp=GU(),this.logmanager.push(this.log.pause,!0),this.stallEnd()},t.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,n=e.errorCode;Object.assign(this.log.play_error,NU({timestamp:GU(),code:e.httpCode||n||("parse"===t?31:21),info:e.message,detail:JSON.stringify(e)},this.videoSize)),this.logmanager.push(this.log.play_error,!0),this.destroyed||(0===this.log.first_frame.first_frame_view&&(Object.assign(this.log.first_frame_failed,{code:n||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=GU()),this.logmanager.push(this.log.first_frame_failed,!0),this.log.play_result.is_threshold||(this.clearPlayResultTimer(),this.log.play_result.reason=e.message||"first frame failed",this.log.play_result.code=this.log.play_error.code,this.logmanager.push(this.log.play_result,!0))),this.options.error_report_stop?this.handleUserLeave():this.updatePlayStopParams())},t.handlePlayerLoadStream=function(e){var t=e.url,n=e.offersdp,i=e.sessionId;if("string"==typeof t){var r=this.log.play_loadstream;r.timestamp=GU(),r.loadstream_url=t,r.offersdp=n,r.sessionId=i,this.logmanager.push(r)}},t.handlePlayerLoadedStream=function(e){var t=this.log.play_stream_loaded;t.timestamp=GU(),Object.assign(t,e),this.logmanager.push(t)},t.handleSEIParsed=function(e){var t=this.log,n=t.playing,i=t.first_frame;if(100===e.code){var r=function(e){var t,n,i,r,o,a;for(t="",i=e.length,n=0;n<i;)switch((r=e[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(r);break;case 12:case 13:o=e[n++],t+=String.fromCharCode((31&r)<<6|63&o);break;case 14:o=e[n++],a=e[n++],t+=String.fromCharCode((15&r)<<12|(63&o)<<6|(63&a)<<0)}return t}(e.content);r=r.slice(r.indexOf("{"),r.lastIndexOf("}")+1);try{var o=JSON.parse(r),a=this.getPlayerBuffer()+this.ntpTime-o.ts;n.sei_delay=a,n.sei_source=o.source,n.ntp_sync=this.options.ntp?1:0,n.ntp_delta=this.ntp_delta,i.first_sei_delay=a,i.ntp_sync=this.options.ntp?1:0,i.ntp_delta=this.ntp_delta}catch(Hl){}}},t.handleMetaDataLoaded=function(e,t){var n;this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=GU(),this.log.play_metadata_loaded.metadata_type=e,t&&(this.log.play_metadata_loaded.meta=t,this.log.play_metadata_loaded.codec=t.codec,"video"===e&&(this.commonParams.codec_type=t.codec,this.commonParams.codec_support=(n=t.codec,"undefined"!=typeof MediaSource?+MediaSource.isTypeSupported("video/mp4; codecs="+n):0))),t||(this.log.play_metadata_loaded.meta=void 0,this.log.play_metadata_loaded.codec=void 0,"video"===e&&(this.commonParams.codec_type="unknown")),this.logmanager.push(this.log.play_metadata_loaded)},t.handleAVUnsync=function(e){Object.assign(this.log.play_av_unsync,e||{}),this.log.play_av_unsync.timestamp=GU(),this.logmanager.push(this.log.play_av_unsync,!1)},t.handleStreamException=function(e){this.logmanager.push(Object.assign({},this.log.stream_exception,e))},t.handlePlayerComlete=function(){this.completed||(this.completed=!0,this.core=KU(this.player),this.core&&(this.commonParams.live_sdk_version="2"),(this.player.config.autoplay||this.player.config.videoInit)&&this.reportStartPlay())},t.getPlayerBuffer=function(){var e=this.player.video.buffered;if(e){var t=Math.max(0,e.length-1);try{var n=Number.parseInt(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=n,n}catch(Hl){return 0}}},t.getPlayerDownloadSpeed=function(){if(this.core&&this.core.core&&"function"==typeof this.core.core.speedInfo)return this.core.core.speedInfo().speed},t.getPlayerQuality=function(){var e=this.player.video;if(e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();this.log.playing.drop_count=t.droppedVideoFrames-this.tempDroppedFrameCount,this.log.playing.drop_percent=Number.parseFloat(this.tempTotalFrameCount/t.totalVideoFrames).toFixed(1),this.log.play_stop.drop_percent=Number.parseFloat(t.droppedVideoFrames/t.totalVideoFrames).toFixed(1),this.tempDroppedFrameCount=t.droppedVideoFrames,this.tempTotalFrameCount=t.totalVideoFrames}},t.getRtcStats=function(e,t){try{var n=this,i=n.player.plugins.rts||n.player.plugins.rtm,r=i&&i.pc,o={};return r?Promise.resolve(r.getStats()).then((function(t){return t.forEach((function(t){var i=t.type,r=t.mediaType,a=t.bytesReceived,s=t.packetsReceived,l=t.audioLevel,c=t.concealmentEvents,u=t.remoteTimestamp,h=t.timestamp,d=t.framesDropped,f=t.keyFramesDecoded,p=t.totalDecodeTime,g=t.framesDecoded,v=t.frameHeight,y=t.frameWidth,m=t.framesReceived,_=t.jitterBufferDelay,b=t.jitterBufferEmittedCount,k=t.jitter,w=t.nackCount,T=t.packetsLost,S=t.pliCount,C=t.totalSamplesReceived,E=t.concealedSamples,x=t.currentRoundTripTime,O=t.decoderImplementation,P=t.mimeType,L=t.freezeCount,I=t.totalFreezesDuration,D=t.totalPausesDuration;switch(i){case"inbound-rtp":"audio"===r?(o.audio_bytes_received=a-(n.cacheRtcStats.audioBytesReceived||0),n.cacheRtcStats.audioBytesReceived=a,o.audio_packets_lost=T-(n.cacheRtcStats.audioPacketsLost||0),o.audio_packets_received=s-(n.cacheRtcStats.audioPacketsReceived||0),n.cacheRtcStats.audioPacketsLost=T,n.cacheRtcStats.audioPacketsReceived=s,o.audio_level=l,o.concealment_event=c,o.audio_fraction_lost=o.audio_packets_lost/o.audio_packets_received,void 0!==n.cacheRtcStats.totalSamplesReceived&&(o.audio_rec_sample_rate=(C-n.cacheRtcStats.totalSamplesReceived)/e),n.cacheRtcStats.totalSamplesReceived=C,o.concealed_samples=E,o.total_samples_received=C):(o.frames_dropped=d,o.iframes_decoded=f,o.video_bytes_received=a-(n.cacheRtcStats.videoBytesReceived||0),n.cacheRtcStats.videoBytesReceived=a,o.video_dec_time=p,o.video_decoded_delay_ms=o.video_dec_elapse/g,o.video_frame_height=v,o.video_frame_width=y,void 0!==n.cacheRtcStats.framesDecoded&&(o.video_decode_framerate=(g-n.cacheRtcStats.framesDecoded)/e),n.cacheRtcStats.framesDecoded=g,void 0!==n.cacheRtcStats.framesReceived&&(o.video_recv_framerate=(m-n.cacheRtcStats.framesReceived)/e),void 0!==n.cacheRtcStats.freezeCount&&(o.freeze_count=L-n.cacheRtcStats.freezeCount,o.freeze_duration=I-n.cacheRtcStats.totalFreezesDuration),n.cacheRtcStats.freezeCount=L,n.cacheRtcStats.totalFreezesDuration=I,n.cacheRtcStats.framesReceived=m,o.total_pauses_duration=D,o.video_jb_delay=_/b*1e3,o.video_jitter=1e3*k,o.video_nack_count=w,o.video_packets_lost=T-(n.cacheRtcStats.videoPacketsLost||0),o.video_packets_received=s-(n.cacheRtcStats.videoPacketsReceived||0),o.video_fraction_lost=o.video_packets_lost/o.video_packets_received,n.cacheRtcStats.videoPacketsLost=T,n.cacheRtcStats.videoPacketsReceived=s,o.video_pli_count=S,o.decoder_name=O);break;case"remote-outbound-rtp":o.e2e_delay_ms=h-u;break;case"track":void 0!==y&&(o.video_frame_width=y,o.video_frame_height=v);break;case"candidate-pair":o.rtt=1e3*x;break;case"codec":P.includes("video")?o.video_codec=P:o.audio_codec=r}o.total_delay=o.e2e_delay_ms+(o.video_decoded_delay_ms||0)+(o.video_jb_delay||0)})),Object.assign(n.log.playing,{video_download_size:o.video_bytes_received,decode_fps:o.video_decode_framerate,sei_delay:o.total_delay,sei_network_delay:o.e2e_delay_ms,width:o.video_frame_width,height:o.video_frame_height,current_speed:(o.audio_bytes_received+o.video_bytes_received)/e}),o})):Promise.resolve(o)}catch(Hl){return Promise.reject(Hl)}},t.reportPlaying=function(e){try{var t=this;t.commonParams.is_wasm&&(t.commonParams.fps=t.player.video.fps,t.log.playing.render_fps=t.player.video.fps,t.log.playing.decode_fps=t.player.video.decodeFps),t.log.playing.index++;var n,i=t.log.playing.timestamp;t.inWaitingStart&&t.inWaitingStart<GU()&&(n=Math.min(t.options.playingInterval||t.log.playing.play_time,GU()-Math.max(t.inWaitingStart,i))),t.getPlayerQuality(),t.getPlayerBuffer(),t.options.downloadSpeedInterval||(t.log.playing.current_speed=t.getPlayerDownloadSpeed());var r=GU(),o=r-i,a=(n>200?n:0)+t.log.playing.stall_time,s=(n>200?1:0)+t.log.playing.stall_count;return t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=(n>t.options.aggregationDowngradeStallTime?n:0)+(t.log.playing.aggregation_downgrade_stall||0)),Object.assign(t.log.playing,NU({timestamp:r,stop_time:r,duration:e?0:o/1e3,stall_time_per_100sec:a/o*100,stall_count_per_100sec:1e3*s/o*100,stall_count:s,stall_time:a,play_current_time:t.player.currentTime},t.videoSize)),Promise.resolve(t.getRtcStats(o,e)).then((function(n){t.logmanager.push(Object.assign({},t.log.playing,NU({play_time:e?0:o},n)),!0),t.log.playing.download_speed_array=[],t.log.playing.stall_time=0,t.log.playing.stall_count=0,t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=0)}))}catch(Hl){return Promise.reject(Hl)}},t.handlePlayerPlaying=function(){try{var e=this;if(e.player&&e.player.video.readyState<3)return Promise.resolve();if(e.player.off("playing",e.handlePlayerPlaying),e.player.off("timeupdate",e.handlePlayerPlaying),e.core){var t=(e.core.getStats()||{}).fps;e.commonParams.fps=t}return Promise.resolve(e.reportPlaying(!0)).then((function(){e.clearPlayingInterval();var t=e.options.playingInterval||e.log.playing.play_time;e.intervalId=setInterval((function(){try{var n=function(){if(Math.abs(Date.now()-e.log.playing.timestamp-t)<100||Date.now()-e.log.playing.timestamp>=t){var n=function(){if(e.player.video){var t=function(){if(!e.player.paused)return Promise.resolve(e.reportPlaying()).then((function(){}));e.handleVideopause()}();if(t&&t.then)return t.then((function(){}))}else e.destroyFunc()}();if(n&&n.then)return n.then((function(){}))}}();return Promise.resolve(n&&n.then?n.then((function(){})):void 0)}catch(Hl){return Promise.reject(Hl)}}),1e3),e.clearStallTimer(),e.handleVideoplaying(),e.started||e.reportStartPlay(),e.saveBuffered()}))}catch(Hl){return Promise.reject(Hl)}},t.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=GU(),this.player.config.autoplay&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.log.play_result.start=GU(),this.playResultTimer=setTimeout((function(){e.log.play_result.timestamp>=e.log.play_result.start||(e.log.play_result.is_threshold=1,e.logmanager.push(e.log.play_result,!0))}),this.log.play_result.threshold)},t.handlePlayerWaiting=function(){var e=this;!this.inWaitingStart&&this.log.first_frame.timestamp&&(this.log.stall.timestamp=this.inWaitingStart=this.log.stall.stall_start=GU(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=GU(),this.log.stall_start.stall_start_time=GU(),this.log.stall_start.video_buffer_time=this.player.video.readyState,this.log.stall_start.play_current_time=this.player.currentTime,this.log.stall.play_current_time=this.player.currentTime,this.log.stall_start.buffered=this.getBuffered(),this.log.stall.buffered=this.log.stall_start.buffered,this.log.stall.current_speed=this.getPlayerDownloadSpeed(),Object.assign(this.log.stall_start,this.videoSize),this.clearStallTimer(),this.stallStartTimer=setTimeout((function(){e.logmanager.push(e.log.stall_start,!0)}),205))},t.handleVideoseeking=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.clearStallTimer())},t.handleVideoseeked=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.log.play_stop.stall_count>0&&this.log.play_stop.stall_count--)},t.handleVideoplay=function(){this.reportStartPlay(),this.removeVideoEvt("play",this.handleVideoplay)},t.handleVideotimeupdate=function(){Math.abs(this.player.currentTime-this.log.stall_start.play_current_time)>.2&&this.stallEnd(),this.saveBuffered()},t.handleVideocanplay=function(){this.stallEnd(),this.reportFirstframe()},t.handleVideoplaying=function(){this.stallEnd(),this.log.play_stop.is_stream_received=1;var e=GU();this.reportStartPlay(),this.log.first_frame.start=e},t.stallEnd=function(){this.clearStallTimer();var e=GU();if(this.inWaitingStart){var t=e-this.inWaitingStart;t>200&&(this.log.play_stop.stall_count++,this.log.play_stop.stall_time+=e-this.inWaitingStart,this.log.playing.stall_time+=e-Math.max(this.inWaitingStart,this.log.playing.timestamp),this.log.stall.stall_end=e,this.log.stall.timestamp=GU(),this.log.playing.stall_count++,Object.assign(this.log.stall,NU({},this.videoSize)),this.logmanager.push(this.log.stall,!0)),this.options.aggregationDowngradeStallTime&&t>this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(this.log.playing.aggregation_downgrade_stall||0)+(e-Math.max(this.inWaitingStart,this.log.playing.timestamp)))}this.inWaitingStart=0},t.handleVideoloadeddata=function(){this.reportFirstframe()},t.handleVideoratechange=function(){this.log.playing.speed_switch_count++,this.log.playing.speed_switch_info=this.player.video.playbackRate},t.handleVideoended=function(){this.clearPlayingInterval(),this.clearStallTimer(),Object.assign(this.log.playing,NU({timestamp:GU(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing)},t.handleVideoerror=function(){var e=this;this.errorNumber=1;var t=this.player.video.error;Object.assign(this.log.play_error,NU(NU({timestamp:GU()},this.videoSize),t&&{code:t.code,info:t.message})),this.logmanager.push(this.log.play_error,!0),0!==e.log.first_frame.first_frame_view||e.log.first_frame_failed.code||t&&(e.log.first_frame_failed.code=t.code,e.log.first_frame_failed.msg=$U[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=GU()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=$U[t.code]||"first frame failed",e.log.play_result.code=t.code,e.clearPlayResultTimer(),e.logmanager.push(e.log.play_result,!0))),e.options.error_report_stop?e.handleUserLeave():e.updatePlayStopParams()},t.handleVideopause=function(){this.stallEnd(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.player.once("playing",this.handlePlayerPlaying),this.player.once("timeupdate",this.handlePlayerPlaying)},t.destroyFunc=function(e){var t=this;this.destroyed||(e||this.handleUserLeave(),this.destroyed=!0,"pc"===zU.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===zU.device&&window.removeEventListener("pagehide",this.handleUserLeave),XU.forEach((function(e){t.removeVideoEvt(e,t["handleVideo"+e+"Evt"])})),this.player&&(this.player._start&&(this.player.start=this.player._start,delete this.player._start),this.player.off("destroy",this.destroyFunc),this.player.off("complete",this.handlePlayerComlete),this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),this.player.off("ready",this.handlePlayerReady),this.player.off("waiting",this.handlePlayerWaiting),this.player.off("largeavgap",this.handleAVUnsync),this.player.off("error",this.handlePlayerError),this.player.off("SEI_PARSED",this.handleSEIParsed),this.player.off("pause",this.handlePlayerPause),this.player.off("ttfb",this.handleTTFB),this.player.off("urlchange",this.handleUrlChange),this.player.off("isKeyframe",this.handleKeyframe),this.player.off("sourceopen",this.handleSourceOpen),this.player.off("bufferappend",this.handleBufferAppend),this.player.off("core_event",this.handleCoreEvent),this.player.off("degrade",this.handleDegrade),this.clearPlayingInterval(),this.clearStallTimer(),this.clearPlayResultTimer(),clearTimeout(this.collectDownloadSpeedTimer),this._player=null))},t.handleUserLeave=function(){!this.destroyed&&this.started&&(this.destroyed=!0,this.updatePlayStopParams(),this.reportPlayStop(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.removeWindowListener())},t.saveBuffered=function(){try{var e=this.getBuffered();e&&e.length&&(this.log.play_stop.buffered=e)}catch(hV){}},t.getBuffered=function(){try{for(var e=[],t=this.player.video,n=0;n<t.buffered.length;n++)e.push([t.buffered.start(n),t.buffered.end(n)]);return e}catch(hV){}},t.reportPlayStop=function(){this.log.play_stop.play_current_time=this.player.currentTime||this.log.playing.play_current_time,this.saveBuffered(),this.logmanager.push(this.log.play_stop,!0)},t.reportFirstframe=function(){if(!this.firstFrameViewed){if(this.core){var e=(this.core.getStats()||{}).fps;this.commonParams.fps=e}this.firstFrameViewed=!0;var t=GU();Object.assign(this.log.first_frame,NU({first_frame_view:t-this.log.start_play.start_play_time||t,timestamp:t},this.videoSize)),this.log.first_frame.ttfb_end&&(this.log.first_frame.ttdb=t-this.log.first_frame.ttfb_end),this.logmanager.push(this.log.first_frame,!0),this.clearPlayResultTimer(),this.log.play_result.result=1,this.logmanager.push(this.log.play_result,!0),this.log.play_stop.is_stream_received=1}},t.updatePlayStopParams=function(){var e=function(e){var t=performance.getEntriesByType("resource").filter((function(t){return t.name===e}));if(t.length){var n=t[0],i=t[t.length-1];return{dns_parse_time:Number.parseInt(n.domainLookupEnd-n.domainLookupStart),redirect:Number.parseInt(n.redirectEnd-n.redirectStart),ttfb:Number.parseInt(i.responseStart-i.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}}(this._url),t=GU();this.playedTime=t-this.log.start_play.start_play_time;var n=this.log.play_stop;Object.assign(n,NU({},0===n.stall_count&&{stall_time:0})),this.inWaitingStart&&t-this.inWaitingStart>200&&(n.stall_time+=t-this.inWaitingStart),this.inWaitingStart=0,Object.assign(n,NU({stall_time_per_100sec:n.stall_time/this.playedTime*100,stall_count_per_100sec:1e3*n.stall_count/this.playedTime*100},e)),0===this.log.play_stop.stall_count_per_100sec&&(this.log.play_stop.stall_time_per_100sec=0),this.log.play_stop.stall_time_per_100sec>100||this.log.play_stop.stall_time_per_100sec<0||(this.log.playing.index?(Object.assign(this.log.playing,NU({timestamp:GU(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing,!0)):(this.log.play_stop.error_code=this.log.play_error.code,this.log.play_stop.error_info=this.log.play_error.info),t=GU(),Object.assign(n,NU({timestamp:t,stop_time:t,duration:this.playedTime/1e3,play_time:this.playedTime/1e3},this.videoSize)),0===this.errorNumber&&(n.play_time_on_no_frame=n.stop_time-this.log.start_play.start_play_time))},t.clearPlayingInterval=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},t.clearStallTimer=function(){clearTimeout(this.stallStartTimer)},t.clearPlayResultTimer=function(){clearTimeout(this.playResultTimer)},t.destroy=function(e){this.destroyFunc(!e)},t.bindVideoEvt=function(e,t){this.player&&this.player.video.addEventListener(e,t,!1)},t.removeVideoEvt=function(e,t){this.player&&this.player.video&&this.player.video.removeEventListener(e,t,!1)},t.send=function(e,t){this.logmanager.send(e,t)},e}(),QU=function(){return QU=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},QU.apply(this,arguments)};function eH(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function tH(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(eH(arguments[t]));return e}var nH,iH,rH,oH,aH=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;e&&t&&"function"==typeof t&&this.on(e,(function i(r){t(r),n.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&tH(this._hooks[e]).forEach((function(e){try{e(t)}catch(n){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),sH=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},lH=(nH=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return nH+=1}),cH=function(e){var t=document.createElement("a");return t.href=e,t},uH=function(){function e(e){this.appid=e,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,i=n?cH(n).hostname:"";!function(e){var t={};try{var n=cH(e).search;(n=n.slice(1)).split("&").forEach((function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(o){t[n]=i}}))}catch(i){}}(window.location.href);var r=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web",o=this.browser(),a=this.os();return{browser:o.browser,browser_version:o.browser_version,platform:r,os_name:a.os_name,os_version:a.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(a.os_name),language:t,referrer:n,referrer_host:i}},e.prototype.browser=function(){var e,t,n="",i=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(n="Microsoft Internet Explorer",i=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(n="sougoubrowser",i=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(n="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),i=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),i=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(n="360browser",i=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),i=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),i=r.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(n="openlanguage xiaomi",i=r.substring(e+7,e+13)):(n="xiaomi",i=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(n="Firefox",i=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+3,e+8)):-1!==(e=r.indexOf("Opera"))&&(n="Opera",i=r.substring(e+6),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<n.length;i++){var r=n[i];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},l=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?n.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(r){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),hH=(iH=function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}return function t(n,i){function r(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({},i,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+a}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],i={},r=0;r<t.length;r++){var o=t[r].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(i[s]=n.read(a,s),e===s)break}catch(l){}}return e?i[e]:i}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},iH(rH={exports:{}}),rH.exports),dH=hH,fH=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e}(),pH={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(i){}return n||{}}catch(i){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(i){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){try{return dH.get(e,{domain:t||document.domain})}catch(n){return""}},setCookie:function(e,t,n,i){try{var r=i||document.domain,o=+new Date+n;dH.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(a){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(Hl){return!1}}()},gH={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(i){}return n||{}}catch(i){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(i){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(Hl){return!1}}()},vH=function(){function e(e,t){this._storage=t&&"session"===t?gH:!e&&pH.isSupportLS?pH:new fH}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,i){this._storage.setCookie(e,t,n,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),yH={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},mH=void 0,_H=(new Date).getTimezoneOffset(),bH=parseInt(""+-_H/60,10),kH=60*_H,wH=function(){function e(e,t){this.is_first_time=!0,this.initConfig=t,this.collect=e;var n=new uH(t.app_id).init(),i="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new vH(!1,"session"),this.localStorage=new vH(!1,"local");var r=this.localStorage.getItem(i);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:mH,user_type:mH,user_id:mH,user_is_auth:mH,user_is_login:mH,device_id:mH,web_id:mH,user_unique_id_type:mH},header:{app_id:mH,app_name:mH,app_install_id:mH,install_id:mH,app_package:mH,app_channel:mH,app_version:mH,ab_version:mH,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:mH,traffic_type:mH,client_ip:mH,device_brand:mH,os_api:mH,access:mH,language:n.language,region:mH,app_language:mH,app_region:mH,creative_id:mH,ad_id:mH,campaign_id:mH,log_type:mH,rnd:mH,platform:n.platform,sdk_version:"0.0.3-lite",sdk_lib:"js",province:mH,city:mH,timezone:bH,tz_offset:kH,tz_name:mH,sim_region:mH,carrier:mH,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:mH,utm_content:mH,utm_source:mH,utm_medium:mH,utm_campaign:mH,custom:{},wechat_unionid:mH,wechat_openid:mH}},this.evtParams={},this.reportErrorCallback=function(){},this.initDomain()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)}(yH[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||"/list";break;case"webid":t="/webid"}return""+this.getDomain()+t},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){"evtParams"===n?t.evtParams=QU({},t.evtParams||{},e.evtParams||{}):"_staging_flag"===n?t.evtParams=QU({},t.evtParams||{},{_staging_flag:e._staging_flag}):"reportErrorCallback"===n&&"function"==typeof e[n]?t.reportErrorCallback=e[n]:Object.hasOwnProperty.call(t.envInfo.user,n)?["user_id","web_id","user_unique_id"].indexOf(n)>-1&&(t.envInfo.user[n]=e[n]?String(e[n]):e[n]):Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(t){console.log("get config stringify error ")}},e}();!function(e){e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.TokenChange="token-change",e.TokenReset="token-reset",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event"}(oH||(oH={}));var TH=oH;function SH(e,t,n,i,r,o,a,s,l){try{var c=new XMLHttpRequest,u=s||"POST";c.open(u,""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),n&&(c.timeout=n,c.ontimeout=function(){o&&o(t,5005)}),c.onload=function(){if(r){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(n){e={}}r(e,t)}}},c.onerror=function(){c.abort(),o&&o(t,500)},l?c.send(t):c.send(JSON.stringify(t))}catch(h){}}var CH=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new vH(!0),this.localStorage=new vH(!1),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.collect.on(TH.Ready,(function(){n.reportAll(!1)})),this.collect.on(TH.Event,(function(e){n.event(e)})),this.collect.on(TH.BeconEvent,(function(e){n.beconEvent(e)})),this.linster()},e.prototype.linster=function(){var e,t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),e=function(){t.reportAll(!0)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var n=tH(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var i=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),i)}}catch(r){}},e.prototype.beconEvent=function(e){var t=tH(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);var r=this.split(this.merge(i));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.merge=function(e){var t=this,n=this.configManager.get(),i=n.header,r=n.user;i.custom=JSON.stringify(i.custom);var o=this.configManager.get("evtParams"),a=e.map((function(e){try{return Object.keys(o).length&&(e.params=QU({},o,e.params)),e.session_id=t.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(Hl){return e}})),s=[];if(!Object.keys(r).length)return console.warn("user info error,cant report"),s;var l=JSON.parse(JSON.stringify({events:a,user:r,header:i}));return l.local_time=Math.floor(Date.now()/1e3),l.verbose=1,s.push(l),s},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&e.forEach((function(e){try{if(!e.length)return;i=n.reportUrl,r=e,o=n.timeout,a=function(e,t){},s=function(e,t){n.configManager.get("reportErrorCallback")(e,t)},!1,t&&window.navigator&&window.navigator.sendBeacon?window.navigator.sendBeacon(i,JSON.stringify(r))||s(i,r):SH(i,r,o,0,a,s,0,"",false)}catch(l){console.warn("something error, "+JSON.stringify(l.stack))}var i,r,o,a,s}))},e}(),EH=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},xH=function(){return EH().replace(/-/g,"").slice(0,19)},OH=function(){function e(){this.cacheToken={}}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new vH(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.collect.on(TH.ConfigUuid,(function(e){n.setUuid(e)})),this.checkStorage()},e.prototype.checkStorage=function(){this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.check()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.remoteWebid()},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""},i=xH();SH(t,n,3e5,0,(function(t){var n;t&&0===t.e?n=t.web_id:(n=i,e.collect.configManager.set({localWebId:i}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})}),(function(){e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i}),e.collect.configManager.set({localWebId:i}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")}))},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;t||n?(e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(TH.TokenComplete)):console.warn("token error")},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(TH.TokenReset))},e.prototype.setStorage=function(e){e._type_="default",this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e}(),PH=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},LH=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new vH(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(TH.SessionReset,(function(){n.resetSessionId()})),this.collect.on(TH.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:PH(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:PH(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:PH(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:PH(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),IH=function(){function e(e){this.disableAutoPageView=!1,this.staging=!1,this.sended=!1,this.started=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new aH,this.Types=TH,this.adapters.fetch=SH,this.adapters.storage=vH}return e.prototype.init=function(e){var t,n=this;this.inited?console.log("init can be call only one time"):e&&sH(e)?e.app_id&&"number"==typeof(t=e.app_id)&&!isNaN(t)?e.app_key&&"string"!=typeof e.app_key?console.warn("app_key param is error, must be string, please check!"):(e.channel_domain||-1!==["cn","sg","va"].indexOf(e.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),e.channel="cn"),this.inited=!0,this.configManager=new wH(this,e),this.initConfig=e,e.disable_auto_pv&&(this.disableAutoPageView=!0),this.configManager.set({app_id:e.app_id}),this.eventManager=new CH,this.tokenManager=new OH,this.sessionManager=new LH,Promise.all([new Promise((function(e){n.once(TH.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){n.once(TH.Start,(function(){e(!0)}))}))]).then((function(){n.sdkReady=!0,n.emit(TH.Ready),console.info("appid: "+e.app_id+", userInfo:"+JSON.stringify(n.configManager.get("user"))),console.info("appid: "+e.app_id+", sdk is ready, version is 0.0.3-lite, you can report now !!!"),n.pageView()})),this.tokenManager.apply(this,e),this.eventManager.apply(this,e),this.sessionManager.apply(this,e),this.emit(TH.Init)):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&sH(e)){e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=QU({},e);t.user_unique_id;var n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(t,["user_unique_id"]);t.hasOwnProperty("user_unique_id")&&this.emit(TH.ConfigUuid,t.user_unique_id),this.configManager.set(n)}else console.warn("config params is error, please check");else console.warn("config must be use after function init")},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(TH.Start))},e.prototype.event=function(e,t){var n=this;try{var i=[];Array.isArray(e)?e.forEach((function(e){i.push(n.processEvent(e[0],e[1]||{}))})):i.push(this.processEvent(e,t)),i.length&&(this.emit(TH.Event,i),this.emit(TH.SessionResetTime))}catch(r){console.warn("something error, please check")}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var n=[];n.push(this.processEvent(e,t||{})),n.length&&(this.emit(TH.BeconEvent,n),this.emit(TH.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var n=e;/^event\./.test(e)&&(n=e.slice(6));var r=t;"object"!=i(r)&&(r={}),r.event_index=lH();var o=void 0;return r.local_ms?(o=r.local_ms,delete r.local_ms):o=+new Date,{event:n,params:r,local_time_ms:o}}catch(a){return{event:e,params:t}}},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){void 0===e&&(e={});var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time)},n=QU({},t,e);this.event("predefine_pageview",n)},e}(),DH=new IH("default");var AH={name:"@byted/veplayer",version:"1.6.4",main:"index.min.js",module:"index.min.js",typings:"index.d.ts",sideEffects:["*.css","*.less"],files:["dist"],unpkg:!0,unpkgFiles:["*"],scripts:{"test:e2e":"echo 'test'",lint:"npx lint-staged",dev:"NODE_ENV=development libd dev demo","dev:vod":"NODE_ENV=development libd dev demo/vod","dev:vod-row":"LUX_REGION=ROW libd dev demo/vod","dev:vod-b":"LUX_REGION=BYTEPLUS NODE_ENV=development libd dev demo/vod","dev:hth":"NODE_ENV=development libd dev fixtures/hth",build:"libd build",postbuild:"lux release commit","build-b":"LUX_REGION=BYTEPLUS libd build",release:"libd release","release-b":"LUX_REGION=BYTEPLUS libd release",doc:"docg","doc-b":"LUX_REGION=BYTEPLUS docg",changelog:"libd changelog -s","version:rc":"lux version --preid rc"},author:"",license:"BSD-3-Clause",devDependencies:{"@babel/runtime-corejs3":"7.20.13","@byted/docg":"0.5.1","@byted/docg-plugin-sdkhub":"0.3.1","@byted/libd":"1.1.21","@byted/lux-cli":"0.0.0-feat-sdkhub-sync-20230814073529","@byted/lux-core":"0.0.0-feat-sdkhub-sync-20230814073529","@changesets/cli":"2.26.2","@commitlint/cli":"16.2.1","@commitlint/config-conventional":"16.2.1","@types/lodash":"4.14.178","@types/lodash-es":"4.17.7","@typescript-eslint/eslint-plugin":"5.12.0","@typescript-eslint/parser":"5.12.0","cross-env":"7.0.3","dts-bundle-generator":"^8.0.1",eslint:"8.9.0","eslint-config-prettier":"6.7.0","eslint-plugin-jest":"23.20.0","eslint-plugin-prettier":"3.1.0","fs-extra":"11.1.1","git-cz":"4.7.6",husky:"8.0.1",less:"4.1.2","lint-staged":"11.1.2","node-fetch":"2.6.7","postcss-less":"6.0.0",prettier:"2.2.1","rollup-plugin-visualizer":"5.9.0",shelljs:"0.8.5",stylelint:"14.5.2","stylelint-config-standard":"24.0.0","stylelint-prettier":"2.0.0",typescript:"4.5.5"},dependencies:{"@byted/danmu-mask":"0.3.6","@byted/streamprobe":"1.0.2","@byted/xgplayer-app-logger":"^0.11.28","@byted/xgplayer-encrypt":"3.5.2","@byted/xgplayer-encrypt-hls":"4.1.6","@byted/xgplayer-encrypt-mp4":"3.0.0-alpha.43-15","@byted/xgplayer-live-logger":"1.1.0-alpha.5","@byted/xgplayer-rts":"0.2.0-alpha.3","@byted/xgplayer-vod-menu":"3.0.3","@byted/xgplayer-xgvideo":"0.1.16","@datarangers/sdk-javascript":"0.0.3-lite","@dp/byted-tea-sdk-oversea":"^5.1.5","byted-tea-sdk":"^5.1.3","danmu.js":"0.6.4",dayjs:"^1.11.6","dom-helpers":"^5.2.1",eventemitter3:"^4.0.7","globalthis-polyfill":"^1.0.0","js-cookie":"^3.0.1","lodash-es":"^4.17.21","proxy-polyfill":"^0.3.2",xgplayer:"3.0.9-alpha.0","xgplayer-flv":"3.0.9-alpha.0","xgplayer-hls":"3.0.9-alpha.0","xgplayer-service":"^0.4.2","xgplayer-subtitles":"^3.0.7"},"lint-staged":{"*.{less}":'stylelint --fix "src/**/*.less" --custom-syntax postcss-less',"*.{js,jsx,ts,tsx}":["eslint --fix"]},publishConfig:{directory:"dist"},browserslist:["iOS >= 10","android >= 5","Chrome > 40","ChromeAndroid >= 39","IE 11"]},MH=AH.dependencies||{},RH="veplayer_live_device_id",NH="veplayer_live_user_id",jH=function(e){return Math.floor((9*Math.random()+1)*Math.pow(10,e-1)).toString()},BH=function(e){u(i,e);var n=v(i);function i(){return a(this,i),n.apply(this,arguments)}return l(i,[{key:"afterCreate",value:function(){var e,t,n,i,r,o=this;this.config.enable&&(this.config.appId?(this._userId=(null===(e=this.config)||void 0===e?void 0:e.userId)||((i=localStorage.getItem(NH))||(i=jH(12),localStorage.setItem(NH,i),i)),this._deviceId=(null===(t=this.config)||void 0===t?void 0:t.deviceId)||((r=localStorage.getItem(RH))||(r=jH(11),localStorage.setItem(RH,r),r)),this.openLog(this.config),null===(n=this.player.plugins)||void 0===n||null===(n=n.sdkerrorplugin)||void 0===n||n.addErrDetail((function(){var e;if(o._liveLogger)return{label:"userId",value:null===(e=o._liveLogger)||void 0===e||null===(e=e.logger)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.user_id}}))):console.info("not found appid, logger is closed"))}},{key:"_createTea",value:function(e){DH.init({app_id:468759,channel:"cn"}),DH.start(),DH.config({user_unique_id:this._userId,device_id:this._deviceId})}},{key:"startLog",value:function(e){this._createTea(e),this._liveLogger=new JU({Tea:DH,player:this.player,aid:e.appId,project_key:e.appId,app_name:e.appId,user_id:this._userId,device_id:this._deviceId,ext:{veplayer_version:"1.6.4",flv_version:MH["xgplayer-flv"],hls_version:MH["xgplayer-hls"],rts_version:MH["@byted/xgplayer-rts"]}})}},{key:"closeLog",value:function(){this._liveLogger.destroy(),this._liveLogger=null}},{key:"openLog",value:function(e){!this._liveLogger&&this.startLog(t(t({},this.config),e))}}],[{key:"pluginName",get:function(){return"liveLogger"}},{key:"defaultConfig",get:function(){return{appId:"",enable:!0}}}]),i}(Qr),UH=AH.dependencies||{},HH={hls:{name:"HlsPlayer",packageName:"xgplayer-hls",devPath:"xgplayer-hls/".concat(UH["xgplayer-hls"],"/dist/index.min.js")},flv:{name:"FlvPlayer",packageName:"xgplayer-flv",devPath:"xgplayer-flv/".concat(UH["xgplayer-flv"],"/dist/index.min.js")},XGVideo:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:"byted/xgplayer-xgvideo/".concat(UH["@byted/xgplayer-xgvideo"],"/dist/index.min.js")},hlsEncrypt:{name:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:"byted/xgplayer-encrypt-hls/".concat(UH["@byted/xgplayer-encrypt-hls"],"/dist/index.min.js")},dash:{name:"DashPlugin",packageName:"@byted/xgplayer-encrypt",devPath:"byted/xgplayer-encrypt/".concat(UH["@byted/xgplayer-encrypt"],"/dist/index.min.js")},mp4Encrypt:{name:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:"byted/xgplayer-encrypt-mp4/".concat(UH["@byted/xgplayer-encrypt-mp4"],"/dist/index.min.js")},danmujs:{name:"danmu.js",packageName:"danmu.js",devPath:"danmu.js/".concat(UH["danmu.js"],"/dist/index.js")},danmuMask:{name:"DanmuMask",packageName:"@byted/danmu-mask",devPath:"byted/danmu-mask/".concat(UH["@byted/danmu-mask"],"/browser/index.js")},streamprobe:{name:"StreamProbe",packageName:"@byted/streamprobe",devPath:"byted/streamprobe/".concat(UH["@byted/streamprobe"],"/dist/index.min.js")}},FH=function(){function e(){a(this,e),this.umdMap=HH,this.backupUmdUrlMap={},this.jsLoadMap={}}return l(e,[{key:"updateBackupMap",value:function(e){this.backupUmdUrlMap=e}},{key:"loadExtraCdn",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(n,i){var r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),document.body.appendChild(r),r.onerror=function(){i("url: ".concat(e))},r.onload=r.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r.onload=r.onreadystatechange=null,n())}}))}},{key:"loadPlugins",value:function(e,t){var n=this;if(this.umdMap[e]){var i=this.umdMap[e],r="".concat(e,"_load");return new Promise((function(o){if(Reflect.get(n.jsLoadMap,r))o(n.jsLoadMap[r]);else{var a=function(t){n.failCallback&&"function"==typeof n.failCallback&&n.failCallback&&n.failCallback(e,t),o(null)};if(!i)return console.error("".concat(e," umd info not exit")),a(void 0);var s=i.name;if(i.devPath,s&&window[s])return n.jsLoadMap[r]=window[s],t&&t(),o(n.jsLoadMap[r]);var l="//lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/1.6.4/plugin/"+e+".js";dl((function(){return n.loadExtraCdn(l,!0)}),2).then((function(){s?(n.jsLoadMap[r]=window[s],t&&t(),o(window[s])):(n.jsLoadMap[r]=!0,t&&t(),o(null))})).catch((function(i){var l,c=n.backupUmdUrlMap[e];return c?(l=c)&&l.indexOf&&/^(?:http|data:|\/)/.test(l)?void n.loadExtraCdn(n.backupUmdUrlMap[e]).then((function(){n.jsLoadMap[r]=window[s],t&&t(),o(n.jsLoadMap[r])})).catch((function(t){console.error("load ".concat(e," error, ").concat(t)),a(void 0)})):(console.error("umdMap.".concat(e," isn't a valid url")),a(void 0)):(console.error("load ".concat(e," error, ").concat(i)),a(i))}))}}))}}}]),e}(),VH=new FH;function zH(e){return GH.apply(this,arguments)}function GH(){return GH=o(n().mark((function e(t){var i,r,a,s,l,c,u,h,d,f,p,g,v,y,m,k,w,T,S,C,E;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.isLive,a=void 0!==r&&r,s=t.type,l=t.isMobile,c=void 0!==l&&l,u=t.playerData,h=t.getSoftOptionTask,d=["default",WH(a)],f=u.openSoftDecoding,p=u.isMusic,g=u.configs,v=!(null===(i=u.playList)||void 0===i||null===(i=i[0])||void 0===i||!i.kid),y=ll(g,"EncryptHlsPlugin"),m=!!y||"hls"===s&&v,k=[],w=[],c?d.push(KH({isLive:a,playerData:u})):d.push($H({isLive:a,playerData:u})),e.t0=s,e.next="flv"===e.t0?12:"rtm"===e.t0?14:16;break;case 12:return w.push(o(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c){e.next=8;break}if(!fl()&&!f){e.next=6;break}return e.next=4,VH.loadPlugins("flv");case 4:t=e.sent,k.push(t);case 6:e.next=12;break;case 8:return e.next=10,VH.loadPlugins("flv");case 10:i=e.sent,k.push(i);case 12:case"end":return e.stop()}}),e)})))()),e.abrupt("break",17);case 14:return w.push(o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([VH.loadPlugins("hls"),VH.loadPlugins("flv")]);case 2:k.push(hM);case 3:case"end":return e.stop()}}),e)})))()),e.abrupt("break",17);case 16:return e.abrupt("break",17);case 17:return!p&&ll(u.options,"DanmuPlugin")&&w.push(o(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([VH.loadPlugins("danmujs"),VH.loadPlugins("danmuMask")]);case 2:(t=e.sent)[0]&&t[1]&&k.push(hN);case 4:case"end":return e.stop()}}),e)})))()),ll(u.options,"Subtitle")&&u.plugins.every((function(e){return"subtitle"!==e.pluginName.toLowerCase()}))&&k.push(LU),e.next=21,Promise.all([h(),YH({isMobile:c,isLive:a,openSoftDecoding:f,type:s,isHlsEncrypt:m,playerData:u,plugins:k})].concat(w));case 21:return T=e.sent,S=_(T,2),C=S[0],E=S[1],e.abrupt("return",{presets:d,softDecodingOption:C,plugins:[].concat(k,b(E)).filter(Boolean)});case 26:case"end":return e.stop()}}),e)}))),GH.apply(this,arguments)}function WH(e){var t=[XM,IU,IM];return e&&t.push(KM,BH),l((function e(){a(this,e),this.plugins=t,this.ignores=["error"]}))}function KH(e){var t,n=e.isLive,i=e.playerData,r=["error","playbackRate"],o=i.configs,s=ll(o,"EncryptHlsPlugin"),c=null==o||null===(t=o.autoBitrateOpts)||void 0===t?void 0:t.isOpenAutoDefi;null!=s&&s.playAuthToken||c||r.push("definition");var u=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue","PlaybackRateMobilePlugin"],h=[YM];return l((function e(){a(this,e),this.plugins=h,this.ignores=n?[].concat(u,r):[].concat(r)}))}function $H(e){var t,n=e.isLive,i=e.playerData,r=["cssfullscreen"],o=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue"],s=n?[bM]:[],c=i.configs,u=ll(c,"EncryptHlsPlugin"),h=null==c||null===(t=c.autoBitrateOpts)||void 0===t?void 0:t.isOpenAutoDefi;return null!=u&&u.playAuthToken||h||(r.push("definition"),s.push(kM)),l((function e(){a(this,e),this.plugins=s,this.ignores=n?[].concat(o,r):[].concat(r)}))}function YH(e){return qH.apply(this,arguments)}function qH(){return qH=o(n().mark((function e(t){var i,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,T,S,C,E,x;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.isMobile,a=t.isLive,s=t.openSoftDecoding,l=t.type,c=t.isHlsEncrypt,u=t.playerData,h=t.plugins,d=[],f=u.configs,p=u.options,g=u.useHlsPluginForSafari,v=!(null===(i=u.playList)||void 0===i||null===(i=i[0])||void 0===i||!i.kid)||Js(null==f?void 0:f.getVideoByToken),"hls"!==l){e.next=29;break}if(!c){e.next=12;break}return e.next=8,VH.loadPlugins("hlsEncrypt");case 8:y=e.sent,d.push(y),e.next=29;break;case 12:if(!o){e.next=24;break}if(m=ll(p,"Subtitle"),_=a&&m,b=(fl()||window.WebAssembly)&&s,k=f.enableHlsMSE,!(b||_||k)){e.next=22;break}return e.next=20,VH.loadPlugins("hls");case 20:w=e.sent,d.push(w);case 22:e.next=29;break;case 24:if(vl&&!g){e.next=29;break}return e.next=27,VH.loadPlugins("hls");case 27:T=e.sent,d.push(T);case 29:if(("dash"!==l||f.url)&&!ll(p,"DASHPlugin")){e.next=34;break}return e.next=32,VH.loadPlugins("dash");case 32:null!=(E=e.sent)&&null!==(S=E.encryptUtils)&&void 0!==S&&null!==(C=S.isSupported)&&void 0!==C&&C.call(S)&&h.push(E);case 34:if(ll(p,"vodLogOpts")&&d.push(tD),f.enableContextmenu&&d.push(bB),!(f.enableMp4MSE||ll(p,"Mp4EncryptPlayer")||["mp4","m4a"].includes(l)&&(v||null!=f&&null!==(r=f.autoBitrateOpts)&&void 0!==r&&r.isOpenAutoDefi||u.openSoftDecoding))){e.next=41;break}return e.next=39,VH.loadPlugins("mp4Encrypt");case 39:x=e.sent,d.push(x);case 41:return e.abrupt("return",d.filter((function(e){var t,n,i,r,o;return"encrypthlsplugin"===(null==e||null===(t=e.pluginName)||void 0===t?void 0:t.toLowerCase())?!(null==e||null===(i=e.isSupported)||void 0===i||!i.call(e))||(console.warn("当前浏览器环境不支持HLS格式视频的加密播放"),!1):"dashplugin"!==(null==e||null===(n=e.pluginName)||void 0===n?void 0:n.toLowerCase())||(!(null==e||null===(r=e.encryptUtils)||void 0===r||null===(o=r.isSupported)||void 0===o||!o.call(r))||(console.warn("当前浏览器环境不支持DASH格式视频播放"),!1))})));case 42:case"end":return e.stop()}}),e)}))),qH.apply(this,arguments)}function XH(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild}function JH(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function ZH(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function QH(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function eF(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var tF={startPlay:JH,play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.778H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="21" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.03 8.312a2 2 0 010 3.376l-7.642 4.858c-1.332.847-3.073-.11-3.073-1.687V5.14c0-1.577 1.741-2.534 3.073-1.687l7.642 4.858z" fill="#fff"/><path d="M13 3.5a.5.5 0 01.5-.5h1a.5.5 0 01.5.5v13a.5.5 0 01-.5.5h-1a.5.5 0 01-.5-.5v-13z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:XH,refresh:DM,danmuSetting:function(){return(new DOMParser).parseFromString('<svg width="22" height="19" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" opacity=".6"><path d="M-4-4h28v28H-4z"/><path d="M1 19a1 1 0 01-1-1V1a1 1 0 011-1h17.2a1 1 0 011 1v3.75h-.001l.001 1.475a.9.9 0 11-1.8 0V1.8H1.8v15.4h8.442l-.029.019h.296a.89.89 0 01.017 1.78h7.691L18.2 19H1z" fill="#FFF" fill-rule="nonzero"/><path d="M5.507 7.698L5.33 9.279h2.511c0 2.015-.075 3.362-.2 4.042-.151.68-.792 1.054-1.934 1.124-.327 0-.653-.023-1.005-.047l-.339-1.136c.327.035.678.059 1.03.059.628 0 .98-.188 1.067-.563.088-.374.138-1.183.138-2.424H4l.352-3.679h2.122V5.132H4.113V4.09h3.654v3.608h-2.26zm3.089-2.214h1.507A8.91 8.91 0 009.16 4.03l1.193-.375c.351.469.665.96.93 1.5l-.792.328h1.733a14.68 14.68 0 00.93-1.921l1.242.41a8.956 8.956 0 01-.854 1.51H15v4.933h-2.587v.902h2.446l-1.014 1.148h-1.432v2.097h-1.28v-2.097h-2.99v-1.148h2.99v-.902H8.595V5.484zm5.249 3.912v-.913h-1.432v.913h1.432zm-2.713 0v-.913H9.764v.913h1.368zm-1.368-1.92h1.368v-.961H9.764v.96zm2.65-.961v.96h1.43v-.96h-1.43z" fill="#FFF" fill-rule="nonzero"/><path d="M17.595 9.84l2.957 1.69a1.2 1.2 0 01.605 1.041v3.358c0 .43-.23.828-.605 1.041l-2.957 1.69a1.2 1.2 0 01-1.19 0l-2.957-1.69a1.2 1.2 0 01-.605-1.041V12.57c0-.43.23-.828.605-1.041l2.957-1.69a1.2 1.2 0 011.19 0zM17 12.47c-.994 0-1.8.797-1.8 1.781a1.79 1.79 0 001.8 1.781c.994 0 1.8-.797 1.8-1.781a1.79 1.79 0 00-1.8-1.781z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild},openDanmu:ZM,closeDanmu:JM,volumeLarge:ZH,volumeMuted:QH,volumeSmall:eF},nF={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:ul(),fitVideoSize:!1,inactive:2e3,playsinline:!0,keyShortcut:"off",closeVideoClick:!0,closeVideoDblclick:!0,closePlayerBlur:!1,closeControlsBlur:!1,closePlayVideoFocus:!0,leavePlayerTime:0,mini:!1,pip:{position:"controlsRight",index:2.5,showIcon:!0},volume:{index:2.6},miniscreen:{left:window.innerWidth-360,top:window.innerHeight-450},time:{index:3},icons:t({},tF),flv:{retryCount:0},hls:{retryCount:3},gapJump:{smallGapLimit:1}},iF={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},rF={isLive:!1,closeVideoClick:!1,defaultPlaybackRate:1,closeVideoStopPropagation:!0,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:{zh:"倍速",en:"Speed",jp:"Speed"}},.75,.5],start:{isShowPause:!0,isShowEnd:!1,mode:"hide",disableAnimate:!0},progresspreview:{isShowCoverPreview:!0},progress:{isPauseMoving:!0}};function oF(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t({},nF),i=t({},e?iF:rF);return t(t({},n),i)}var aF={startPlay:JH,play:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M19.77 11.619c1.768 1.094 1.768 3.668 0 4.762L8.653 23.257c-1.865 1.154-4.273-.188-4.273-2.381V7.125c0-2.194 2.408-3.536 4.273-2.382L19.77 11.62z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7.438" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/><rect x="16.188" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M4.77 4.124l8.358 5.07c.38.23.486.704.238 1.056a.807.807 0 01-.238.22L4.77 15.543c-.38.231-.889.132-1.137-.221a.723.723 0 01-.134-.417V4.762c0-.421.368-.762.822-.762.159 0 .316.042.449.124z" stroke="#fff" stroke-width="1.5"/><path d="M15.5 4.5A.5.5 0 0116 4h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H16a.5.5 0 01-.5-.5v-11z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:XH,refresh:function(){return(new DOMParser).parseFromString('<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h18v18H0z"/><path d="M10.875 7.5a.375.375 0 01-.375-.375v-.75c0-.207.168-.375.375-.375h2.434a5.25 5.25 0 10.723 4.5h1.55a6.75 6.75 0 11-1.332-5.743V2.626c0-.207.168-.375.375-.375h.75c.207 0 .375.168.375.375V6.75a.75.75 0 01-.694.748L15 7.5h-4.125z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild},danmuSetting:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.387 10.134a1 1 0 00-1 0l-1.887 1.09a1 1 0 00-.5.865v2.179a1 1 0 00.5.866l1.887 1.09a1 1 0 001 0l1.886-1.09a1 1 0 00.5-.866v-2.179a1 1 0 00-.5-.866l-1.886-1.089zm-.5 4.711a1.667 1.667 0 100-3.333 1.667 1.667 0 000 3.333z" fill="#fff"/></svg>',"image/svg+xml").firstChild},openDanmu:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="3.333" fill="#3370FF"/><path d="M15.591 12.011l-2.133 2.134-1.22-1.22" stroke="#fff" stroke-linecap="round" stroke-linejoin="round"/></svg>',"image/svg+xml").firstChild},closeDanmu:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="2.733" stroke="#fff" stroke-width="1.2"/><path fill="#fff" d="M12.833 10.77l3.473 3.472-1.063 1.064-3.474-3.473z"/></svg>',"image/svg+xml").firstChild},volumeLarge:ZH,volumeMuted:QH,volumeSmall:eF},sF={width:"100%",height:"100%",lang:ul(),playsinline:!0,closeVideoClick:!0,closeVideoTouch:!0,whitelist:[""],"x5-video-player-type":"h5-page","x5-video-player-fullscreen":!1,"x5-video-orientation":"landscape|portrait",enterTips:{background:"linear-gradient(90deg,#000,#49e6d3,#49e6d3,#138afc,#000)"},retainPlay:!0,start:{isShowPause:!0,isShowEnd:!0,disableAnimate:!1},fullscreen:{useCssFullscreen:!1},plugins:[],time:{mode:"pc",index:2.5},controls:{mode:"flex"},danmusettings:{index:"2"},danmuicon:{index:"3"},cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:t({},aF),flv:{innerDegrade:1,retryCount:0},hls:{innerDegrade:1,retryCount:3},gapJump:{smallGapLimit:1}},lF={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,start:{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"},retry:{count:0},longwaiting:{duration:3e4},mobile:{gestureY:!1,gestureX:!1,disableActive:!0}},cF={isLive:!1,closeVideoClick:!1,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:"倍速",en:"speed",jp:"speed"},.75,.5],defaultPlaybackRate:1,closeVideoStopPropagation:!0,mobile:{gestureY:!1},start:{isShowPause:!0,isShowEnd:!1,disableAnimate:!1,mode:"hide"}};function uF(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t({},sF),i=t({},e?lF:cF);return t(t({},n),i)}var hF=Qr.POSITIONS,dF=function(){function e(t){var n,i,r;a(this,e);var o=t.config,s=t.root,l=t.player;this.config=o,this.parent=s,this.player=l,this.mode=null!==(n=null==o?void 0:o.mode)&&void 0!==n?n:Us,this.isAutoChange=null!==(i=null==o?void 0:o.isAutoChange)&&void 0!==i&&i,this.isShow=!1,this.showCancelBtn=null!==(r=null==o?void 0:o.showCancelBtn)&&void 0!==r&&r,this.initEvents(),this.renderPanel()}var t;return l(e,[{key:"initEvents",value:function(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.on(ir,this.handleOrientationChange.bind(this)))}},{key:"handleOrientationChange",value:function(){var e,t,n,i=[90,-90,"90","-90"].includes(window.orientation);null!==(e=this.player)&&void 0!==e&&e.fullscreen&&i?this.changeMode(Hs):this.changeMode(null!==(t=null===(n=this.config)||void 0===n?void 0:n.mode)&&void 0!==t?t:Us)}},{key:"changeConfig",value:function(e){this.config=e}},{key:"changeMode",value:function(e){this.mode=e,this.player.emit(fM.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}},{key:"renderPanel",value:function(){var e="xg-mobile-panel panel-".concat(["normal","inner","fullscreen"][this.mode]);switch(this.root=yi.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case Bs:var t=yi.createDom("div","",{},"xg-mobile-panel-content ".concat(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(t),this.showCancelBtn){var n="zh-cn"===this.player.lang?"zh":this.player.lang,i=yi.createDom("div",Vs[n],{},"xg-mobile-panel-cancel");this.root.appendChild(i)}this.container=t,t.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}));break;case Us:this.container=this.root;break;case Hs:var r=yi.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(r),this.container=r,r.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}))}}},{key:"showPanel",value:(t=o(n().mark((function e(t){var i,r=this,o=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.length>1&&void 0!==o[1]?o[1]:"",o.length>2&&void 0!==o[2]&&o[2]&&yi.addClass(t,"item-list-panel-content"),this.setTitle(i),!this.children){e.next=9;break}return e.next=7,this.hide();case 7:return setTimeout((function(){r.children=t,r.container&&(r.title&&r.container.appendChild(r.title),r.container.appendChild(t)),r.show()})),e.abrupt("return");case 9:this.children=t,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(t)),this.show();case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updatePanel",value:function(e){this.children&&yi.hasClass(this.children,"item-list-panel-content")&&yi.addClass(e,"item-list-panel-content"),this.children=e,this.container&&(this.container.innerHTML="",this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}},{key:"setTitle",value:function(e){e&&this.mode!==Us?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}},{key:"renderTitle",value:function(e){return yi.createDom("div",e,{},"xg-mobile-panel-title")}},{key:"show",value:function(){this.isShow=!0,yi.removeClass(this.root,"hide"),yi.addClass(this.root,"active")}},{key:"hide",value:function(){this.isShow=!1,yi.removeClass(this.root,"active"),yi.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}},{key:"handleHide",value:function(e){e.stopPropagation(),e.preventDefault(),this.hide()}},{key:"bind",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"destroy",value:function(){var e;this.parent&&this.root&&this.parent.contains(this.root)&&(this.parent.removeChild(this.root),this.root=null),window.removeEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.off(ir,this.handleOrientationChange.bind(this))}}]),e}();function fF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}var pF=Qr.POSITIONS,gF=function(e){u(i,e);var n=v(i);function i(e){var t;return a(this,i),(t=n.call(this,e)).toastInfo={},t.playerData=null,t.playerData=e.player.config.playerData,t.dataMonitoring(),t}return l(i,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&Wn.subscribeProperty(this.playerData.current,"definition",(function(n,i){if(n!==i&&e.player){var r=e.playerData.current.lineId,o=e.playerData.getDefinitionListByLineId(r).find((function(e){return e.definition===i}));o&&o.url&&(e.player.changeDefinition(t(t({},o),{},{definition:i,url:o.url})),e.updatePanel(),e.player.emit(fM.INNER_DEFINITION_CHANGE,{from:n,to:i,url:o.url}),e.player.emit(fM.PlAY_URL_CHANGE,{url:o.url,from:fM.INNER_DEFINITION_CHANGE}),e.player.config.isLive&&setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3))}}))}},{key:"registerIcons",value:function(){return{definition:{icon:fF,class:"xgplayer-definition-svg"}}}},{key:"registerLanguageTexts",value:function(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"afterCreate",value:function(){this.toastInfo={},this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.current.lineId,n=this.playerData.getDefinitionListByLineId(t),i=yi.createDom("div","",{},"definition-panel-content");return n.forEach((function(t){var n=e.renderItem(t);i.appendChild(n)})),i}},{key:"renderItem",value:function(e){var t=this,n=this.playerData.current.definition,i=yi.createDom("div","",{},"panel-Item ".concat(n===e.definition?"select-in":""));return i.innerHTML=this.getShowText(this.i18n,e),i.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.showToast(e),t.playerData.current.definition=e.definition})),i}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return e[t.definitionTextKey]||t.definitionTextKey||t.definition}},{key:"showToast",value:function(e){var t,n=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i){var r=this.getShowText(this.i18n,e),o=i.add("".concat(this.langText.switching).concat(r,"..."),0,!0),a=Date.now();this.toastInfo[o]={showTime:a,delayClose:!1},this.toastInfo[o].timer=setTimeout((function(){var e;null!==(e=n.toastInfo[o])&&void 0!==e&&e.delayClose&&(i.remove(o),clearTimeout(n.toastInfo[o].timer),delete n.toastInfo[o])}),2e3),this.player.once(sr,(function(){var e;Date.now()-(null===(e=n.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?(i.remove(o),delete n.toastInfo[o]):n.toastInfo[o].delayClose=!0}))}}},{key:"renderPanel",value:function(e){var t;null===(t=this.player)||void 0===t||null===(t=t.panel)||void 0===t||t.showPanel(e,this.langText.definitionSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||null===(e=e.panel)||void 0===e||e.updatePanel(t)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"DefinitionMobilePlugin"}},{key:"textTips",get:function(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}},{key:"defaultConfig",get:function(){return{position:pF.CONTROLS_RIGHT,index:2.7}}}]),i}(Qr);function vF(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808 13.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}var yF=Qr.POSITIONS,mF=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.playerData=e.player.config.playerData,i.dataMonitoring(),i}return l(n,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&Wn.subscribeProperty(this.playerData.current,"definition",(function(t,n){if(t!==n&&e.player){var i=e.playerData.getCurrentUrl();e.player.changeDefinition({definition:n,url:i}),e.updatePanel(),setTimeout((function(){e.player.paused&&e.player.play()}),1e3)}}))}},{key:"registerIcons",value:function(){return{line:{icon:vF,class:"xgplayer-line-svg"}}}},{key:"registerLanguageTexts",value:function(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.getLineList(),n=yi.createDom("div","",{},"line-panel-content");return t.forEach((function(t){var i=e.renderItem(t);n.appendChild(i)})),n}},{key:"renderItem",value:function(e){var t=this,n=this.playerData.current.lineId,i=yi.createDom("div","",{},"panel-Item ".concat(n===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.player.emit(fM.LINE_CHANGE,{from:t.playerData.current.lineId,to:e.lineId}),t.playerData.current.lineId=e.lineId,t.player.emit(dM.PLAYER_REBUILD)})),i}},{key:"renderPanel",value:function(e){var t;null===(t=this.player)||void 0===t||null===(t=t.panel)||void 0===t||t.showPanel(e,this.langText.lineSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"LineMobilePlugin"}},{key:"textTips",get:function(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}},{key:"defaultConfig",get:function(){return{position:yF.CONTROLS_RIGHT,index:2.8}}}]),n}(Qr);function _F(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M14.6879 3.64579C14.7387 3.60575 14.7387 3.52868 14.6879 3.48864L13.3089 2.40296C13.2433 2.35132 13.147 2.39805 13.147 2.48153V4.6529C13.147 4.73639 13.2433 4.78312 13.3089 4.73147L14.6879 3.64579ZM4 2.61914H11.3001V3.91914H4C3.6134 3.91914 3.3 4.23254 3.3 4.61914V15.6191C3.3 16.0057 3.6134 16.3191 4 16.3191H16C16.3866 16.3191 16.7 16.0057 16.7 15.6191V6.75253H18V15.6191C18 16.7237 17.1046 17.6191 16 17.6191H4C2.89543 17.6191 2 16.7237 2 15.6191V4.61914C2 3.51457 2.89543 2.61914 4 2.61914ZM17.7879 3.48864C17.8388 3.52868 17.8388 3.60575 17.7879 3.64579L16.4089 4.73147C16.3433 4.78312 16.2471 4.73639 16.2471 4.6529V2.48153C16.2471 2.39805 16.3433 2.35132 16.4089 2.40296L17.7879 3.48864Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var bF=Qr.POSITIONS,kF=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.state={currentRate:1,isSupport:!0},i.playerData=e.player.config.playerData,i}return l(n,[{key:"registerIcons",value:function(){return{playbackRate:{icon:_F,class:"xgplayer-rate-svg"}}}},{key:"registerLanguageTexts",value:function(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){var e=this;this.bind(["click"],this.renderList.bind(this)),this.on(Vi,(function(){var t;e.state.currentRate!==e.player.playbackRate&&(e.state.currentRate=e.player.playbackRate,null!==(t=e.player)&&void 0!==t&&null!==(t=t.panel)&&void 0!==t&&t.isShow&&e.updatePanel(),e.changeIconText())}))}},{key:"renderList",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=yi.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((function(n){var i=e.renderItem(n);t.appendChild(i)})),t}},{key:"renderItem",value:function(e){var t=this,n=U(e)?e:{textKey:e+"X",value:e},i=yi.createDom("div","",{},"panel-Item ".concat(this.state.currentRate===n.value?"select-in":""));return i.innerHTML=this.i18n[n.textKey]||n.textKey,i.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault(),t.emit(Vi,{from:t.player.playbackRate,to:n.value}),t.state.currentRate=n.value,t.player.playbackRate=n.value,t.updatePanel(),t.changeIconText()})),i}},{key:"renderPanel",value:function(e){var t;null===(t=this.player)||void 0===t||null===(t=t.panel)||void 0===t||t.showPanel(e,this.langText.rateSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"changeIconText",value:function(){var e,t=this.state.currentRate,n=t%1==0?t.toFixed(1):t+"";switch(n.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}var i=this.find(".icon-text");i.style.transform="scale(".concat(e,")"),i.innerHTML=n}},{key:"destroy",value:function(){this.unbind(["click"],this.renderList.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-playBackRate">\n <div class="xgplayer-icon">\n <div class="icon-text"></div>\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"PlaybackRateMobilePlugin"}},{key:"textTips",get:function(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}},{key:"defaultConfig",get:function(){return{position:bF.CONTROLS_RIGHT,index:2.9,list:[2,1.5,1.25,1,.75,.5],default:1}}}]),n}(Qr),wF=function(){function e(t){a(this,e),this.__args=null,this.sdk=null,this.playerData=null,this.player=null,this._emitter=null,this.beforeCreate&&"function"==typeof this.beforeCreate&&this.beforeCreate(),this.__args=t,this.pluginName="",this.__init(t)}return l(e,[{key:"beforeCreate",value:function(){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerCreate",value:function(){}},{key:"afterPlayerCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(t){var n=this;e.defineGetterOrSetter(this,{sdk:{get:function(){return t.sdk},configurable:!0},player:{get:function(){return t.sdk.getPlayerInstance()},configurable:!0},playerData:{get:function(){return t.sdk.playerData},configurable:!0},pluginName:{get:function(){return t.pluginName?t.pluginName.toLowerCase():n.constructor.pluginName.toLowerCase()},configurable:!0},_emitter:{get:function(){return t.sdk._emitter},configurable:!0}})}},{key:"__destroy",value:function(){var e=this,t=this.sdk,n=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((function(t){Object.defineProperty(e,t,{writable:!0})})),Object.keys(this).map((function(t){e[t]=null,delete e[t]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete t._sdkPlugins[n]}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.defineProperty(e,n,t[n])}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),TF={playAuthToken:"",needDefinitionList:!0},SF=function(e){u(d,e);var i,r,s,c,h=v(d);function d(e){var t;return a(this,d),(t=h.call(this,e)).isPlayByToken=!1,t.isEncrypt=!1,t.config=null,t.useUnionInfoDRM=!0,t.retryCount=1,t.init(),t}return l(d,[{key:"beforePlayerCreate",value:(c=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPlayByToken){e.next=3;break}return e.next=3,this.getConfig();case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"getConfig",value:(s=o(n().mark((function e(){var i,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,k,w,T,S,C,E,x;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!Qs(this.tokenInfo)){e.next=8;break}return console.error("playAuthToken is expired, please check or update your playAuthToken"),this.sdk.emit(dM.TOKEN_EXPIRED,{type:"playAuthToken",token:this.tokenInfo}),o={errorType:"token",errorCode:9101,errorMessage:"playAuthToken has expired",ext:{token:this.tokenInfo,config:this.config},originError:void 0},null===(r=this.sdk)||void 0===r||r.delayError.push(o),e.abrupt("return");case 8:if(!this.keyTokenInfo){e.next=16;break}if(!Qs(this.keyTokenInfo)){e.next=16;break}return console.error("keyToken is expired, please check or update your keyToken"),this.sdk.emit(dM.TOKEN_EXPIRED,{type:"keyToken",token:this.keyTokenInfo}),s={errorType:"token",errorCode:9102,errorMessage:"keyToken for hls encrypt play has expired",ext:{token:this.keyTokenInfo,config:this.config},originError:void 0},null===(a=this.sdk)||void 0===a||a.delayError.push(s),e.abrupt("return");case 16:return this.playerData.codec=(null===(i=this.tokenInfo)||void 0===i||null===(i=i.Codec)||void 0===i?void 0:i.toLowerCase())||Fn.H264,e.next=19,this.getVideos();case 19:if(e.t0=e.sent,e.t0){e.next=22;break}e.t0={};case 22:return l=e.t0,c=l.playList,u=void 0===c?[]:c,h=l.type,d=l.poster,f=l.vid,p=l.dashOpts,g=l.thumbs,v=l.barrageMaskUrl,y=h||Zs(this.config),e.next=34,this.getPrivateDrmInfo(u,f,y);case 34:this.playerData.options.vid=f,this.config.needPoster&&d&&(this.playerData.options.poster=d),this.config.needThumbs&&g.length>0&&this.getThumbnailConfig(g),this.config.needBarrageMask&&v&&this.getBarrageMaskUrl(v),u.length>0?(m=b(u),("dash"===y||this.playerData.configs.DASHPlugin)&&(m=m.filter((function(e){return"video"===e.FileType}))),_=this.config.defaultDefinition||this.playerData.configs.defaultDefinition,k=m[0],_&&(w=m.find((function(e){return e.Definition.toLocaleLowerCase()===_.toLocaleLowerCase()})))&&(k=w),this.playerData.playList=this.config.needDefinitionList?m:[k],this.playerData.initCurrent(k),this.isEncrypt=!!u[0].kid,T={vid:f,playList:this.playerData.playList},"hls"===y&&this.isEncrypt&&this.getEncryptHlsConfig(T),("dash"===y||this.playerData.configs.DASHPlugin)&&this.getDashPluginConfig(t(t({},T),{},{dashOpts:p})),S=this.playerData.configs,C=S.autoBitrateOpts,E=S.Mp4EncryptPlayer,x=S.enableMp4MSE,(["mp4","m4a"].includes(y)&&this.isEncrypt||"mp4"===y&&null!=C&&C.isOpenAutoDefi||E||x)&&this.getMp4EncryptConfig(T)):console.error("get no video by playAuthToken"),e.next=44;break;case 41:e.prev=41,e.t1=e.catch(0),console.error(e.t1);case 44:case"end":return e.stop()}}),e,this,[[0,41]])}))),function(){return s.apply(this,arguments)})},{key:"getVideos",value:(r=o(n().mark((function e(){var i,r,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(e){var t,n;try{100006===Ln(JSON.parse(e.response),"ResponseMetadata.Error.CodeN")&&(console.error("playAuthToken is expired, please check or update your playAuthToken"),a.sdk.emit(dM.TOKEN_EXPIRED,e))}catch(r){console.log(r)}null===(t=a._emitter)||void 0===t||t.emit(fM.GET_PLAY_URL_ERR,e);var i={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",ext:{},originError:e};null===(n=a.sdk)||void 0===n||n.delayError.push(i)},r=function(){var e=o(n().mark((function e(r){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(502!==(null==r?void 0:r.status)||!a.playerData.apiMap.backupPlayDomain){e.next=7;break}return a.playerData.apiMap.playDomain=a.playerData.apiMap.backupPlayDomain,e.next=4,tl((function(){return el(t(t({},a.playerData.apiMap),a.config))}),a.retryCount,(function(e){return 502===e.status}),i);case 4:return e.abrupt("return",e.sent);case 7:i(r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=4,tl((function(){return el(t(t({},a.playerData.apiMap),a.config))}),this.retryCount,(function(e){return 502===e.status}),r);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getPrivateDrmInfo",value:(i=o(n().mark((function e(t,i,r){var o,a,s,l,c,u,h,d=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.getDrmAuthToken||"function"!=typeof this.config.getDrmAuthToken||!this.playerData.unionId){e.next=34;break}if(this.sessionId=(new Date).getTime().toString(),"hls"!==r){e.next=9;break}return e.next=5,VH.loadPlugins("hlsEncrypt");case 5:a=e.sent,o=a.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 9:if("dash"!==r){e.next=16;break}return e.next=12,VH.loadPlugins("dash");case 12:s=e.sent,o=s.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 16:if(!["mp4","m4a"].includes(r)){e.next=21;break}return e.next=19,VH.loadPlugins("mp4Encrypt");case 19:l=e.sent,o=l.updateUnionInfo(this.playerData.unionId,this.sessionId);case 21:if(o){e.next=23;break}return e.abrupt("return");case 23:return c=b(new Set(t.map((function(e){return e.kid})))).join(","),e.prev=24,e.next=27,hl(sl(this.config.getDrmAuthToken(c,i,o)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");case 27:(u=e.sent)&&"string"==typeof u&&(this.privateDrmAuthToken=u,null!=(h=Xs(u))&&h.DrmType&&(this.useUnionInfoDRM="webdevice"===(null==h?void 0:h.DrmType)),t.forEach((function(e){e.drmKeyToken=d.privateDrmAuthToken}))),e.next=34;break;case 31:e.prev=31,e.t0=e.catch(24),console.error("get privaterDrmToken fail");case 34:case"end":return e.stop()}}),e,this,[[24,31]])}))),function(e,t,n){return i.apply(this,arguments)})},{key:"getEncryptHlsConfig",value:function(e){var n,i=e||{},r=i.playList,o=i.vid,a=this.config,s=a.playDomain,l=a.keyToken,c=a.getKeyType;a.keyDomain;var u=t({},this.playerData.configs.EncryptHlsPlugin||{}),h=null==r||null===(n=r[0])||void 0===n?void 0:n.kid;if(l)this.playerData.options.EncryptHlsPlugin=t({keyToken:l,playDomain:s||this.playerData.apiMap.playDomain,getKeyType:c||"TOP"},u);else if(this.privateDrmAuthToken&&this.sessionId){var d=Xs(this.privateDrmAuthToken),f=parseInt(d["X-Expires"]),p=isNaN(f)?30:f;this.playerData.options.EncryptHlsPlugin=t({vid:o,kid:h,keyTokenExpiredDuration:p,drmKeyToken:this.privateDrmAuthToken,useUnionInfoDRM:this.useUnionInfoDRM,sessionId:this.sessionId,playDomain:s||this.playerData.apiMap.playDomain},u)}}},{key:"getThumbnailConfig",value:function(e){var n=e[0],i=t({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=t({pic_num:n.CaptureNum,urls:n.StoreUrls,width:n.CellWidth,height:n.CellHeight,col:n.ImgXLen,row:n.ImgYLen},i)}},{key:"getBarrageMaskUrl",value:function(e){var n,i=t({},(null===(n=this.playerData.configs)||void 0===n||null===(n=n.DanmuPlugin)||void 0===n?void 0:n.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.active=!0,this.playerData.options.DanmuPlugin.maskActive=!0,this.playerData.options.DanmuPlugin.maskConfig=t({maskUrl:e},i)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:t({maskUrl:e},i)}}},{key:"getDashPluginConfig",value:function(e){var n,i,r=e||{},o=r.vid,a=r.playList,s=r.dashOpts,l=this.config.playDomain,c=t({},(null===(n=this.playerData.configs)||void 0===n?void 0:n.DASHPlugin)||{}),u=null==a||null===(i=a[0])||void 0===i?void 0:i.kid;if(this.privateDrmAuthToken&&this.sessionId){var h=Xs(this.privateDrmAuthToken),d=parseInt(h["X-Expires"]),f=isNaN(d)?30:d;this.playerData.options.DASHPlugin=t({playInfoType:"TOP",vid:o,dashOpts:s,defaultFormat:"dash",definitionText:this.config.definitionMap,useUnionInfoDRM:this.useUnionInfoDRM,kid:u,keyTokenExpiredDuration:f,sessionId:this.sessionId,drmKeyToken:this.privateDrmAuthToken,playDomain:l||this.playerData.apiMap.playDomain},c)}}},{key:"getMp4EncryptConfig",value:function(e){var n,i,r=e.playList,o=e.vid,a=this.config.playDomain,s=null==r||null===(n=r[0])||void 0===n?void 0:n.kid,l=t({},(null===(i=this.playerData.configs)||void 0===i?void 0:i.Mp4EncryptPlayer)||{});if(this.isEncrypt){if(this.privateDrmAuthToken&&this.sessionId){var c=Xs(this.privateDrmAuthToken),u=parseInt(c["X-Expires"]),h=isNaN(u)?30:u;this.playerData.options.Mp4EncryptPlayer=t({vid:o,isEncrypt:!0,rangeMaxDuration:10,bitrate:null==r?void 0:r[0].Bitrate,kid:s,drmKeyToken:this.privateDrmAuthToken,useUnionInfoDRM:this.useUnionInfoDRM,keyTokenExpiredDuration:h,sessionId:this.sessionId,playDomain:a||this.playerData.apiMap.playDomain},l)}}else this.playerData.options.Mp4EncryptPlayer=t({vid:o,bitrate:null==r?void 0:r[0].Bitrate},l)}},{key:"init",value:function(){var e=this.playerData.configs.getVideoByToken,t=void 0===e?{}:e;this.initConfig(t)}},{key:"initConfig",value:function(e){if(this.isPlayByToken=!!e.playAuthToken,this.isPlayByToken){if(this.config=Object.assign(TF,e),this.tokenInfo=qs(e.playAuthToken),e.keyToken){var t=cl(e.keyToken)?window.atob(e.keyToken):e.keyToken;this.keyTokenInfo=Xs(t)}e.retryCount&&(this.retryCount=e.retryCount)}}},{key:"switchAuthToken",value:function(e){return this.initConfig(e),this.getConfig()}}],[{key:"pluginName",get:function(){return"AuthToken"}}]),d}(wF),CF={init:function(e){var t;if(e){var n=e.playerData.sdkPlugins;null!==(t=e.playerData)&&void 0!==t&&t.isLive?e.sdkPlugins=b(n):e.sdkPlugins=[SF].concat(b(n)),e._sdkPlugins={}}},registerPlugin:function(e,t){if(e&&t){var n=null,i=null;e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),i.sdk=t;var r=i.pluginName||n.pluginName;if(!r)throw new Error("The property pluginName is necessary");var o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);var a=new n(i);return o[r.toLowerCase()]=a,o[r.toLowerCase()].func=n,a&&"function"==typeof a.afterCreate&&a.afterCreate(),a}catch(s){console.error(s)}}},unRegister:function(e,t){if(e&&t){e=e.toLowerCase();try{var n=t._sdkPlugins[e];n&&(n.pluginName&&n.__destroy(),delete t._sdkPlugins[e])}catch(i){console.error(i)}}},beforePlayerCreate:function(e){if(e){e._sdkPlugins||this.init(e);for(var t=e._sdkPlugins,n=[],i=0,r=Object.keys(t);i<r.length;i++){var o=r[i];if(t[o]&&t[o].beforePlayerCreate)try{var a=t[o].beforePlayerCreate();n.push(sl(a))}catch(Hl){throw n.push(sl(null)),Hl}}return new Promise((function(e){Promise.all([].concat(n)).then((function(){e(null)})).catch((function(t){console.error(t),e(null)}))}))}},afterPlayerCreate:function(e){if(e)for(var t=e._sdkPlugins,n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];if(t[r]&&t[r].beforePlayerCreate)try{t[r].afterPlayerCreate()}catch(Hl){throw Hl}}},destroy:function(e){if(e){for(var t=e._sdkPlugins,n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];this.unRegister(r,e)}delete e._sdkPlugins}}},EF=[{LANG:"en",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported or no playable source found",GET_URL_ERR_BY_TOKEN:"Failed to get video url",PLAY_AUTH_TOKEN_EXPIRED:"Token has expired",HLS_KEY_TOKEN_EXPIRED:"Play certificate has expired",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"Video type cannot play",NETWORK_ERROR:"Network error",NETWORK_TIMEOUT:"Network timeout",VOD_LOG_NOT_CONFIGURED:"Log options not configured correctly"}},{LANG:"zh",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"音/视频格式不支持,或未找到可用资源",GET_URL_ERR_BY_TOKEN:"获取视频地址失败",PLAY_AUTH_TOKEN_EXPIRED:"token已过期",HLS_KEY_TOKEN_EXPIRED:"播放凭证已过期",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"不支持的视频格式",NETWORK_ERROR:"网络错误",NETWORK_TIMEOUT:"网络超时",VOD_LOG_NOT_CONFIGURED:"未正确配置质量日志参数"}},{LANG:"zh-hk",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"音/視頻格式不支持,或未找到可用資源",GET_URL_ERR_BY_TOKEN:"獲取視頻地址失敗",PLAY_AUTH_TOKEN_EXPIRED:"Token已過期",HLS_KEY_TOKEN_EXPIRED:"播放憑證已過期",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"不支持的視頻格式",NETWORK_ERROR:"網絡錯誤",NETWORK_TIMEOUT:"網絡超時",VOD_LOG_NOT_CONFIGURED:"未正確配置質量日誌參數"}},{LANG:"jp",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ形式がサポートされていないか、利用可能なリソースが見つかりませんでした",GET_URL_ERR_BY_TOKEN:"動画の URL を取得できませんでした",PLAY_AUTH_TOKEN_EXPIRED:"playAuthTokenは期限切れです",HLS_KEY_TOKEN_EXPIRED:"プレイ証明書の有効期限が切れています",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"サポートされていないビデオ形式",NETWORK_ERROR:"ネットワークエラー",NETWORK_TIMEOUT:"ネットワークタイムアウト",VOD_LOG_NOT_CONFIGURED:"品質ログパラメータが正しく構成されていません"}}],xF=function(){function e(t,n){a(this,e),this.url=t;var i=new window.XMLHttpRequest;i.target=this,i.responseType="arraybuffer",i.open("get",t),i.onload=function(){200!==i.status&&206!==i.status||n&&n instanceof Function&&n(i.response)},i.onerror=function(e){},this.xhr=i,this.run()}return l(e,[{key:"cancel",value:function(){this.xhr.abort()}},{key:"run",value:function(){1===this.xhr.readyState&&this.xhr.send()}}]),e}(),OF={ORDER:"order",SLOOP:"sloop",LOOP:"loop",RANDOM:"random"},PF="xgplayer-music";function LF(e,t,n){var i=Math.floor(Math.random()*(t-e)+e);return i===n?(i>t/2?t/=2:e=t/2,t-e>2?LF(e,t,n):i):i}var IF=function(e){u(i,e);var n=v(i);function i(){var e;return a(this,i),(e=n.apply(this,arguments))._onEnded=function(){if("order"===e.mode&&e.index+1>=e.list.length)return e.player.pause(),void(e.player.currentTime=0);if(e.mode===OF.SLOOP)e.change();else e.next()},e._onDurationChange=function(){var t=e.config.abCycle;e._initABCycle(t,e.player)},e._onTimeUpdate=function(){var t=p(e),n=t.config,i=t.player;if(!e.halfPass&&i.currentTime>i.duration/2&&e.confirmOrder(),n.abCycle){var r=n.abCycle,o=r.end>i.duration?i.duration:r.end;i.currentTime>=o?(r.loop||(i.pause(),e.emit("abCycle_ended")),i.currentTime=r.start||0):i.currentTime<r.start&&(i.currentTime=r.start||0)}},e}return l(i,[{key:"afterCreate",value:function(){var e,t,n,i,r,o,a=this.player,s=this.playerConfig;(yi.addClass(a.root,PF),this.halfPass=!1,this.list=this.config.list||[],this.emit(fM.MUSIC_LIST_CHANGE,this.list),this.nextIndex=-1,this.prevIndex=-1,this.history=[],this.disable=!(this.list.length>0),!s.url&&this.list.length>0)&&(s.url=null===(e=this.list)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.src);s.poster||(s.poster=null===(t=this.list)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.poster);s.title||(s.title=null!==(n=null===(i=this.list)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.title)&&void 0!==n?n:"");s.vid||(s.vid=null!==(r=null===(o=this.list)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.vid)&&void 0!==r?r:"");this._curInfo={src:s.url,poster:s.poster,title:s.title,vid:s.vid},this.index=0,this.on(Ni,this._onTimeUpdate),this.on(Ii,this._onEnded),this.on(Ui,this._onDurationChange),this.config.offline&&this.checkOffline(this._curInfo.src,this._curInfo.vid).then((function(e){0===e.code&&(s.url=e.url,a.state>=4&&(a.src=e.url))})).catch((function(e){console.error(e)}))}},{key:"destroy",value:function(){yi.removeClass(this.player.root,PF)}},{key:"_nextCompute",value:function(){if(!this.disable)switch(this.mode){case OF.SLOOP:this.nextIndex=this.index;break;case OF.ORDER:case OF.LOOP:this.index+1<this.list.length?this.nextIndex=this.index+1:this.nextIndex=0;break;default:this.nextIndex=LF(0,this.list.length,this.index)}}},{key:"_prevCompute",value:function(){if(!this.disable)switch(this.mode){case OF.SLOOP:this.nextIndex=this.index;break;case OF.ORDER:case OF.LOOP:this.index-1>=0?this.prevIndex=this.index-1:this.prevIndex=this.list.length-1;break;default:this.prevIndex=LF(0,this.list.length,this.index)}}},{key:"_emitChange",value:function(){this.emit(fM.MUSIC_CHANGE,this._curInfo)}},{key:"_initABCycle",value:function(e,t){var n=t.plugins.progresspreview;if(e&&t){var i=e.end>this.player.duration?this.player.duration:e.end,r=e.start>this.player.duration?0:e.start,o={id:t.playerId,time:e.start,duration:i-r,text:e.text,color:e.color};n.findDot(o.id)?n.updateDot(o):n.createDot(o)}else n.findDot(t.playerId)&&n.deleteDot(t.playerId)}},{key:"random",value:function(){if(this.list.length<0)return null;var e=LF(0,this.list.length,this.index);return this.list[e]}},{key:"next",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.index=this.nextIndex,this.change())}},{key:"prev",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.index=this.prevIndex,this.change())}},{key:"forward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime+t<e.duration?e.currentTime+t:e.duration-.1}},{key:"backward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime-t>0?e.currentTime-t:0}},{key:"add",value:function(e){this.list.push({src:e.src,title:e.title,vid:e.vid,poster:e.poster}),this.disable=!(this.list.length>0),this.emit(fM.MUSIC_LIST_CHANGE,this.list)}},{key:"remove",value:function(e){var t=-1;this.list.every((function(n,i){return n.vid!==e||(t=i,!1)})),t>-1&&(this.list.splice(t,1),this.emit(fM.MUSIC_LIST_CHANGE,this.list)),this.disable=!(this.list.length>0)}},{key:"setAbCycle",value:function(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e&&"Object"===yi.typeOf(e)?this.config.abCycle=t({},e):this.config.abCycle=t({start:e||0,end:n||this.player.duration,loop:i},r),this._initABCycle(this.config.abCycle,this.player)}},{key:"removeAbCycle",value:function(){this.config.abCycle=null,this._initABCycle(null,this.player)}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.removeAbCycle(),this.player.pause(),this.player.currentTime=0,this.list=e,this.nextIndex=0,this.index=0,this.change(),this.disable=!(this.list.length>0),this.emit(fM.MUSIC_LIST_CHANGE,this.list)}},{key:"setIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e<0||e>=this.list.length||(this.nextIndex=e,this.index=e,this.change())}},{key:"change",value:function(){var e=this;if(!this.disable){var t=this.player,n=this.list,i=this.index,r=n[i].vid;this.halfPass=!1,this.checkOffline(n[i].src,r).then((function(n){e._curInfo={title:e.list[e.index].title||"",vid:e.list[e.index].vid,poster:e.list[e.index].poster||"",src:n.url},t.playNext({url:n.url,vid:e.list[e.index].vid||0,poster:e.list[e.index].poster||"",autoplay:!0}),t.off("timeupdate",e._emitChange.bind(e)),t.once("timeupdate",e._emitChange.bind(e)),t.play()}))}}},{key:"checkOffline",value:function(e,t){var n=this;return new Promise((function(i,r){if(!n.config.offline||n.disable)return i({url:e,code:-1,vid:t});var o=n.player.database;o.openDB((function(){o.getDataByKey(o.myDB.ojstore.name,t,(function(n){setTimeout((function(){o.closeDB()}),5e3),i(n?{url:URL.createObjectURL(n.blob),code:0,vid:n.vid}:{url:e,code:-2,vid:t})}))}))}))}},{key:"confirmOrder",value:function(){this.halfPass=!0,this._nextCompute(),this._prevCompute(),this.config.preloadNext&&this.preload(this.nextIndex)}},{key:"preload",value:function(e){if(!(e<0||e>=this.list.length)){var t=this.list[e],n=this.player;this.checkOffline(t.src,t.vid).then((function(e){if(-2===e.code){var i=t.vid;new xF(t.src,(function(e){n.database.openDB((function(){n.database.addData(n.database.myDB.ojstore.name,[{vid:i,blob:new Blob([e],{type:'audio/mp4; codecs="mp4a.40.5"'})}]),setTimeout((function(){n.database.closeDB()}),5e3)}))}))}}))}}},{key:"timeScale",get:function(){return this.config.timeScale||15},set:function(e){this.config.timeScale=e,this.emit(fM.TIME_SCALE_CHANGE,e)}},{key:"mode",get:function(){return this.config.mode||OF.RANDOM},set:function(e){Object.values(OF).includes(e)&&(this.config.mode=e,this.emit(fM.MUSIC_MODE_CHANGE,e))}}],[{key:"pluginName",get:function(){return"music"}},{key:"defaultConfig",get:function(){return{offline:!1,preloadNext:!0,abCycle:null,timeScale:15,mode:OF.ORDER,list:[]}}},{key:"ModeType",get:function(){return Object.keys(OF).map((function(e){return OF[e]}))}}]),i}(Vr),DF=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e=this;this.on(fM.MUSIC_CHANGE,(function(t){if(t&&t.poster){var n=e.find("img");n?n.src=t.poster:e.root.innerHTML="<img src=".concat(t.poster,' alt=""/>'),e.show()}else e.hide()}))}},{key:"render",value:function(){var e,t,n=this.playerConfig;return n.poster||null!=n&&null!==(e=n.url)&&void 0!==e&&e[0].poster?'<xg-icon class="xgplayer-cover">\n <img src="'.concat(n.poster||(null==n||null===(t=n.url)||void 0===t?void 0:t[0].poster),'" alt="">\n </xg-icon>'):'<xg-icon class="xgplayer-cover"></xg-icon>'}}],[{key:"pluginName",get:function(){return"musiccover"}},{key:"defaultConfig",get:function(){return{index:0,position:Qr.POSITIONS.CONTROLS_LEFT}}}]),n}(Qr);function AF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2478 0C6.32662 0 2.94593 2.3143 1.39715 5.65152L0.558008 5.42701C0.321533 5.36365 0.0784664 5.50398 0.0151043 5.74046C-0.00971985 5.8331 -0.00382614 5.9313 0.0319023 6.02031L1.13271 8.76283C1.22391 8.99003 1.48202 9.10028 1.70921 9.00908C1.74819 8.99344 1.78475 8.97233 1.81779 8.94639L4.14238 7.12171C4.33496 6.97055 4.36853 6.69189 4.21737 6.49932C4.15815 6.42387 4.07605 6.36967 3.98341 6.34485L3.14176 6.1196C4.46348 3.53919 7.14942 1.77312 10.2478 1.77312C14.6545 1.77312 18.2269 5.34545 18.2269 9.75215C18.2269 14.1589 14.6545 17.7312 10.2478 17.7312C6.45067 17.7312 3.273 15.0787 2.4666 11.5256L0.656528 11.5254C1.49041 16.0647 5.46745 19.5043 10.2478 19.5043C15.6338 19.5043 20 15.1381 20 9.75215C20 4.36619 15.6338 0 10.2478 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var MF=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.backward()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(fM.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicBackward:{icon:AF,class:"xg-icon-mbackward"}}}},{key:"registerLanguageTexts",value:function(){return{backward:{jp:"あとずさりする",en:"MusicBackward",zh:"后退","zh-hk":"後退"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicBackward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-backward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="backward">').concat(this.langText.backward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicbackword"}},{key:"defaultConfig",get:function(){return{index:1,position:Qr.POSITIONS.CONTROLS_LEFT}}}]),n}(Qr),RF=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.prev()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(fM.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e;(null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.list)||void 0===e?void 0:e.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicPrev:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25783)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 1.20196V22.798C21.2 23.7867 20.0711 24.3511 19.28 23.7579L4.88002 12.9598C4.24002 12.4799 4.24002 11.5201 4.88002 11.0402L19.28 0.242135C20.0711 -0.35107 21.2 0.213286 21.2 1.20196Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.8 0.00219727C4.13137 0.00219727 4.4 0.270826 4.4 0.602197V23.3978C4.4 23.7292 4.13137 23.9978 3.8 23.9978H2.6C2.26863 23.9978 2 23.7292 2 23.3978V0.602197C2 0.270826 2.26863 0.00219727 2.6 0.00219727H3.8Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25783">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mprev"}}}},{key:"registerLanguageTexts",value:function(){return{musicPrev:{jp:"前の曲",en:"MusicPrev",zh:"上一首","zh-hk":"上一首"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicPrev)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="musicPrev">'.concat(this.langText.musicPrev,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicprev"}},{key:"defaultConfig",get:function(){return{index:2,position:Qr.POSITIONS.CONTROLS_LEFT}}}]),n}(Qr);function NF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.75215 0C13.6734 0 17.0541 2.3143 18.6029 5.65152L19.442 5.42701C19.6785 5.36365 19.9215 5.50398 19.9849 5.74046C20.0097 5.8331 20.0038 5.9313 19.9681 6.02031L18.8673 8.76283C18.7761 8.99003 18.518 9.10028 18.2908 9.00908C18.2518 8.99344 18.2152 8.97233 18.1822 8.94639L15.8576 7.12171C15.665 6.97055 15.6315 6.69189 15.7826 6.49932C15.8419 6.42387 15.9239 6.36967 16.0166 6.34485L16.8582 6.1196C15.5365 3.53919 12.8506 1.77312 9.75215 1.77312C5.34545 1.77312 1.77312 5.34545 1.77312 9.75215C1.77312 14.1589 5.34545 17.7312 9.75215 17.7312C13.5493 17.7312 16.727 15.0787 17.5334 11.5256L19.3435 11.5254C18.5096 16.0647 14.5325 19.5043 9.75215 19.5043C4.36619 19.5043 0 15.1381 0 9.75215C0 4.36619 4.36619 0 9.75215 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var jF=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.forward()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(fM.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicForward:{icon:NF,class:"xg-icon-mforward"}}}},{key:"registerLanguageTexts",value:function(){return{forward:{jp:"早送り",en:"MusicForward",zh:"快进","zh-hk":"快進"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicForward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-forward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="forward">').concat(this.langText.forward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicforward"}},{key:"defaultConfig",get:function(){return{index:5,position:Qr.POSITIONS.CONTROLS_LEFT}}}]),n}(Qr),BF=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.next()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(fM.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e;(null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.list)||void 0===e?void 0:e.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicNext:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25776)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.92 0.242135L18.32 11.0402C18.96 11.5201 18.96 12.4799 18.32 12.9598L3.92 23.7579C3.12892 24.3511 2 23.7867 2 22.798V1.20196C2 0.213286 3.12892 -0.35107 3.92 0.242135Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M20.6 0.00219727C20.9314 0.00219727 21.2 0.270826 21.2 0.602197V23.3978C21.2 23.7292 20.9314 23.9978 20.6 23.9978H19.4C19.0687 23.9978 18.8 23.7292 18.8 23.3978V0.602197C18.8 0.270826 19.0687 0.00219727 19.4 0.00219727H20.6Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25776">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mnext"}}}},{key:"registerLanguageTexts",value:function(){return{musicNext:{jp:"次の曲",en:"MusicNext",zh:"下一首","zh-hk":"下一首"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicNext)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicNext">'.concat(this.langText.musicNext,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicnext"}},{key:"defaultConfig",get:function(){return{index:4,position:Qr.POSITIONS.CONTROLS_LEFT}}}]),n}(Qr),UF=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e=this;this.on(fM.MUSIC_CHANGE,(function(t){t&&t.title?e.root.innerHTML="".concat(t.title):e.root.innerHTML=""}))}},{key:"render",value:function(){var e=this.playerConfig;return'<xg-title class="xgplayer-name">\n '.concat(e.title||"","\n </xg-title>")}}],[{key:"pluginName",get:function(){return"musicmeta"}},{key:"defaultConfig",get:function(){return{index:0,position:Qr.POSITIONS.CONTROLS_LEFT}}}]),n}(Qr);function HF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20779_14791)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M39 8C39.5523 8 40 8.44772 40 9V11C40 11.5523 39.5523 12 39 12H7C6.44772 12 6 11.5523 6 11V9C6 8.44772 6.44772 8 7 8H39ZM30 23C30 22.4477 29.5523 22 29 22H7C6.44772 22 6 22.4477 6 23V25C6 25.5523 6.44772 26 7 26H29C29.5523 26 30 25.5523 30 25V23ZM46.0725 31C46.0725 31.2113 46.0056 31.4173 45.8812 31.5882L39.845 39.888C39.5202 40.3346 38.8948 40.4334 38.4481 40.1086C38.3635 40.047 38.2891 39.9726 38.2275 39.888L32.1913 31.5882C31.8665 31.1415 31.9652 30.5161 32.4119 30.1913C32.5828 30.067 32.7887 30 33 30H37V19.5C37 19.2239 37.2239 19 37.5 19H40.5C40.7761 19 41 19.2239 41 19.5V30H45.0725C45.6248 30 46.0725 30.4477 46.0725 31ZM29 36C29.5523 36 30 36.4477 30 37V39C30 39.5523 29.5523 40 29 40H7C6.44772 40 6 39.5523 6 39V37C6 36.4477 6.44772 36 7 36H29Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20779_14791">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function FF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14771)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 23V29.024C42.0018 34.569 37.5247 39.064 32.0018 39.064H17.9999V42.6585C17.9999 43.2108 17.5522 43.6585 16.9999 43.6585C16.7991 43.6585 16.603 43.598 16.437 43.485L8.20729 37.8803C7.75081 37.5694 7.63278 36.9473 7.94366 36.4908C8.01331 36.3886 8.10134 36.3001 8.20327 36.23L16.433 30.5662C16.888 30.2531 17.5106 30.3681 17.8237 30.8231C17.9385 30.9899 17.9999 31.1875 17.9999 31.39V35.048H32.0018C35.3155 35.048 38.0018 32.351 38.0018 29.024V23H42.0018ZM31.0019 5.89087C31.2027 5.89087 31.3988 5.95132 31.5648 6.06434L39.7945 11.6691C40.251 11.98 40.369 12.602 40.0582 13.0585C39.9885 13.1608 39.9005 13.2492 39.7986 13.3194L31.5688 18.9831C31.1139 19.2962 30.4912 19.1812 30.1781 18.7263C30.0633 18.5595 30.0019 18.3618 30.0019 18.1593V14.5013H16C12.6863 14.5013 10 17.1984 10 20.5254V26.5494H6V20.5254C6 14.9804 10.4772 10.4853 16 10.4853H30.0019V6.89087C30.0019 6.33858 30.4496 5.89087 31.0019 5.89087Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14771">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function VF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14777)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0194 27.9598C35.2314 27.9598 35.4379 28.0272 35.6091 28.1522L41.8863 32.736C42.3323 33.0617 42.4298 33.6873 42.1041 34.1333C42.0419 34.2186 41.9665 34.2934 41.8809 34.3551L35.6037 38.875C35.1556 39.1977 34.5306 39.096 34.2079 38.6478C34.0853 38.4776 34.0194 38.2732 34.0194 38.0635V35.5556C30.1354 35.5195 27.7656 34.3892 25.642 31.7548C26.4304 30.621 27.1705 29.3627 27.8834 27.9788C29.5719 30.6143 31.112 31.5275 34.0194 31.5546V28.9598C34.0194 28.4075 34.4671 27.9598 35.0194 27.9598ZM35.0112 7.94434C35.2205 7.94434 35.4246 8.01001 35.5946 8.13211L41.8792 12.6458C42.3278 12.968 42.4303 13.5928 42.1081 14.0414C42.0464 14.1273 41.9715 14.2028 41.8861 14.2652L35.6015 18.8607C35.1557 19.1867 34.53 19.0895 34.204 18.6437C34.0787 18.4724 34.0112 18.2657 34.0112 18.0535V15.4606C29.9521 15.4984 28.443 17.234 25.7897 23.0253C25.4916 23.6778 25.333 24.0244 25.1845 24.3452C21.6243 32.0396 17.983 35.4364 10.0186 35.5591H6V31.5394L9.98762 31.5397C16.0421 31.4462 18.5555 29.1016 21.5376 22.6568C21.6818 22.3451 21.8361 22.0079 22.1364 21.3507C25.3774 14.2767 27.8951 11.4978 34.0112 11.4409V8.94434C34.0112 8.39205 34.4589 7.94434 35.0112 7.94434ZM10.0186 11.4409C14.8213 11.5149 18.0519 12.7794 20.6407 15.459C19.9655 16.6111 19.3108 17.8933 18.6522 19.3098C16.5567 16.6161 14.0817 15.5236 9.98762 15.4604L6 15.4606V11.4409H10.0186Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14777">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function zF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14784)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 22.1091V28.1331C42.0018 33.6781 37.5247 38.1732 32.0018 38.1732H17.9999V41.7676C17.9999 42.3199 17.5522 42.7676 16.9999 42.7676C16.7991 42.7676 16.603 42.7072 16.437 42.5941L8.20729 36.9894C7.75081 36.6785 7.63278 36.0564 7.94366 35.6C8.01331 35.4977 8.10134 35.4092 8.20327 35.3391L16.433 29.6754C16.888 29.3623 17.5106 29.4773 17.8237 29.9322C17.9385 30.099 17.9999 30.2967 17.9999 30.4991V34.1572H32.0018C35.3155 34.1572 38.0018 31.4601 38.0018 28.1331V22.1091H42.0018ZM26.05 18V29.664H23.19V21.08L21 22.852V19.772L23.19 18H26.05ZM31.0019 5C31.2027 5 31.3988 5.06045 31.5648 5.17347L39.7945 10.7782C40.251 11.0891 40.369 11.7112 40.0582 12.1677C39.9885 12.2699 39.9005 12.3584 39.7986 12.4285L31.5688 18.0922C31.1139 18.4054 30.4912 18.2904 30.1781 17.8354C30.0633 17.6686 30.0019 17.4709 30.0019 17.2685V13.6105H16C12.6863 13.6105 10 16.3075 10 19.6345V25.6585H6V19.6345C6 14.0895 10.4772 9.59443 16 9.59443H30.0019V6C30.0019 5.44772 30.4496 5 31.0019 5Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14784">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var GF=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e,t=this;if(m(h(n.prototype),"afterCreate",this).call(this),this.player.plugins.music&&!this.config.disable){this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(fM.MUSIC_MODE_CHANGE,(function(e){t.animate(e)}));var i=null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.mode;this.animate(i),this.updateVisible(),this.on(fM.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}}},{key:"updateVisible",value:function(){var e;(null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.list)||void 0===e?void 0:e.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{order:{icon:HF,class:"xg-icon-order"},loop:{icon:FF,class:"xg-icon-loop"},sloop:{icon:zF,class:"xg-icon-sloop"},random:{icon:VF,class:"xg-icon-random"}}}},{key:"registerLanguageTexts",value:function(){return{order:{jp:"順番に遊ぶ",en:"Play in order",zh:"顺序播放","zh-hk":"順序播放"},loop:{jp:"リストループ",en:"List loop",zh:"列表循环","zh-hk":"列表循環"},sloop:{jp:"シングルサイクル",en:"Single loop",zh:"单曲循环","zh-hk":"單曲循環"},random:{jp:"シャッフル再生",en:"Play in shuffle",zh:"随机播放","zh-hk":"隨機播放"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.order),this.appendChild(".xgplayer-icon",e.sloop),this.appendChild(".xgplayer-icon",e.loop),this.appendChild(".xgplayer-icon",e.random)}},{key:"btnClick",value:function(e){var t;e.preventDefault(),e.stopPropagation();var n=null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.mode,i=IF.ModeType.findIndex((function(e){return e===n})),r=0;i+1<IF.ModeType.length&&(r=i+1),this.player.plugins.music.mode=IF.ModeType[r]}},{key:"animate",value:function(e){switch(e){case OF.ORDER:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order");break;case OF.LOOP:this.setAttr("data-state","loop"),this.changeLangTextKey(this.find(".xg-tips"),"loop");break;case OF.SLOOP:this.setAttr("data-state","sloop"),this.changeLangTextKey(this.find(".xg-tips"),"sloop");break;case OF.RANDOM:this.setAttr("data-state","random"),this.changeLangTextKey(this.find(".xg-tips"),"random");break;default:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order")}}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-music-mode">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicMode">'.concat(this.langText.order,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"MusicMode"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.CONTROLS_RIGHT,index:9,disable:!1}}}]),n}(Qr);function WF(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20323_25753)">\n<g filter="url(#filter0_d_20323_25753)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3863 11.7091L37.5681 23.0728C38.9924 23.9629 38.9924 26.0372 37.5681 26.9273L19.3863 38.2909C17.8726 39.237 15.9091 38.1488 15.9091 36.3637V13.6364C15.9091 11.8513 17.8726 10.763 19.3863 11.7091Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20323_25753" x="-8" y="-6" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20323_25753"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20323_25753" result="shape"/>\n</filter>\n<clipPath id="clip0_20323_25753">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function KF(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20330_26170)">\n<g filter="url(#filter0_d_20330_26170)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20.75 11C21.4404 11 22 11.6044 22 12.35V36.65C22 37.3956 21.4404 38 20.75 38H18.25C17.5596 38 17 37.3956 17 36.65V12.35C17 11.6044 17.5596 11 18.25 11H20.75Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M31.75 11C32.4404 11 33 11.6044 33 12.35V36.65C33 37.3956 32.4404 38 31.75 38H29.25C28.5596 38 28 37.3956 28 36.65V12.35C28 11.6044 28.5596 11 29.25 11H31.75Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20330_26170" x="-8" y="-6" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20330_26170"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20330_26170" result="shape"/>\n</filter>\n<clipPath id="clip0_20330_26170">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var $F=l((function e(n,i){a(this,e),function(e){if("Object"!==yi.typeOf(e.controls))e.controls={mode:"flex",initShow:!0};else{var n=e.controls;e.controls=t({mode:"flex",initShow:!0},n)}var i=e.play||{};e.play=t({index:3},i),e.marginControls=!0,e.icons=t({play:WF,pause:KF},e.icons||{})}(i);var r="mobile"===Si.device;this.plugins=[IF,UF,DF].concat(b(r?[]:[MF,RF,jF,BF,GF])),this.ignores=["start","cssFullScreen","fullscreen","pip","enter","replay","pc","loading","poster","error","playbackrate","mobile"]}));window&&!window.Player&&(window.Player=As);var YF=function(){function e(t){a(this,e),this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this.isFirstEmitted=!0,this._init(t)}var r,s,h,d,f,p;return l(e,[{key:"_init",value:function(e){this.initUmdLoader(e),this.playerData=new bl(e),this._emitter=new hi,this.on(dM.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins(),this.renderDom(),this.createPlayer(),this._initI18N(this.playerData.languageData)}},{key:"_initSdkPlugins",value:function(){var e=this;CF.init(this),b(this.sdkPlugins).map((function(t){return CF.registerPlugin(t,e)}))}},{key:"initCheckExpire",value:function(){var e=this;this.checkExpireTimer=new ol,this.checkExpireTimer.repeat((function(){e.onRepeat()}),this.playerData.checkExpireInterval)}},{key:"initUmdLoader",value:function(e){var t=this;this.sdkUmdLoader=VH,this.sdkUmdLoader.failCallback=function(e,n){return t.umdLoadErr(e,n)},e.umdUrlMap&&"object"===i(e.umdUrlMap)&&this.sdkUmdLoader.updateBackupMap(e.umdUrlMap)}},{key:"checkVodLogOptions",value:function(){var e=this.playerData,t=e.isLive,n=e.configs,i=ll(n,"vodLogOpts");if(!(t||n.disableVodLogOptsCheck||null!=i&&i.line_app_id)){this.delayError.push({errorType:"log",errorCode:9999,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0})}}},{key:"umdLoadErr",value:function(e,t){this.emit(dM.UMD_LOAD_FAIL,{name:e,error:t})}},{key:"onRepeat",value:function(){var e,t=this,n=this.playerData.expireDetectType;n.indexOf("getUrlTime")>-1&&(this.getUrlTime&&null!==(e=this.player)&&void 0!==e&&e.duration&&(new Date).getTime()/1e3>this.getUrlTime+3300+this.player.duration+500&&(this.getUrlTime=0,this.emitExpireEvent()));n.indexOf("xhrStatus")>-1&&this._playOriginalUrl&&Math.random()<1/7.5&&new al({url:this._playOriginalUrl,method:"HEAD"}).catch((function(e){e&&void 0!==e.status&&(t.isFirstEmitted?(t.emitExpireEvent(),t.isFirstEmitted=!1):(t.expireCount=void 0===t.expireCount?1:t.expireCount+1,t.expireCount>3&&(t.expireCount=0,t.emitExpireEvent())))}))}},{key:"emitExpireEvent",value:function(){var e=this.player,t=(new Date).getTime()/1e3;e.emitExpireTimestamp?t-e.emitExpireTimestamp>300&&(e.emitExpireTimestamp=t,e.emit("MEDIA_EXPIRED")):(e.emitExpireTimestamp=t,e.emit("MEDIA_EXPIRED"))}},{key:"getUrlTimestamp",value:function(e){if(e){var t;e.startsWith("//")&&(e=location.protocol+e);try{var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=k(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(new URL(e).searchParams);try{for(i.s();!(n=i.n()).done;){var r=_(n.value,2),o=r[0],a=r[1];if("auth_key"===o||"sign"===o){var s=parseInt(a.split("-")[0]);if(!isNaN(s)){t=s;break}}}}catch(h){i.e(h)}finally{i.f()}}catch(h){console.error(h)}try{var l,c=null===(l=new URL(e).pathname.split("/"))||void 0===l?void 0:l[2];if(c){var u=parseInt(c,16);isNaN(u)||(t=u)}}catch(h){console.error(h)}this.getUrlTime=t||(new Date).getTime()/1e3}}},{key:"on",value:function(e,t){this._emitter.on(e,t)}},{key:"emit",value:function(e,t){this._emitter.emit(e,t)}},{key:"once",value:function(e,t){this._emitter.once(e,t)}},{key:"off",value:function(e,t){this._emitter.off(e,t)}},{key:"renderDom",value:function(){var e=this.playerData,t=e.id,n=e.root,i=document.createElement("div");this.playerContainer=i;var r=n||document.querySelector("#".concat(t));r&&(r.appendChild(i),this.mountingDom=r)}},{key:"renderPoster",value:function(){if(this.playerContainer){var e=this.playerData.options,t=e.poster,n=void 0===t?"":t,i=e.width,r=e.height;n&&(this.playerContainer.style.cssText='background: url("'.concat(n,'");\n background-size: cover;\n width:').concat(i?i+"px":"100%",";\n height:").concat(r?r+"px":"100%",";\n "))}}},{key:"createPlayer",value:(p=o(n().mark((function e(){var i,r,a,s,l,c,u,h,d,f,p,g,v,y,m,_,k,w,T,S,C,E,x,O,P,L,I,D,A,M,R,N,j,B,U,H=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:return e.next=4,this.beforePlayerCreate();case 4:return u=this.playerData,h=u.isLive,d=u.options,f=u.plugins,p=u.isMobile,g=u.openSoftDecoding,v=u.configs,y=u.isMusic,m=this.playerData.getCurrentUrl(),_=this.playerData.getCurrentStreamType()||Zs(null==v?void 0:v.getVideoByToken),ll(v,"EncryptHlsPlugin")||m&&_||y?(this._playOriginalUrl=m,this.getUrlTimestamp(m)):(console.warn("url is empty or streamType is empty: url:".concat(m,", streamType").concat(_)),this.renderPoster()),k={defaultDefinition:null===(i=this.playerData.playList[0])||void 0===i?void 0:i.definition,list:this.playerData.playList},w=function(){var e=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H.getSoftDecodingOption(g,m,_);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.next=13,zH({isLive:h,isMobile:p,type:_,playerData:this.playerData,getSoftOptionTask:w});case 13:return T=e.sent,S=T.presets,C=T.softDecodingOption,E=T.plugins,x=p?uF(h):oF(h),O=this._analyzeExtendPlugins(),P=O.basicPlugins,L=void 0===P?[]:P,I=O.iconPlugins,D=void 0===I?[]:I,A=this.playerData.getLineList(),M=this.playerData.current.lineId,R=this.playerData.getDefinitionListByLineId(M),N=t(t(t(t({},x),d),C||{}),{},{definition:k,icons:t(t(t({},x.icons),y?{play:WF,pause:KF}:{}),null!==(r=null==d?void 0:d.icons)&&void 0!==r?r:{}),MoreButtonPlugin:{iconPlugins:[].concat(b(null!==(a=null===(s=d.MoreButtonPlugin)||void 0===s?void 0:s.iconPlugins)&&void 0!==a?a:[]),b(D),[kF])},playerData:this.playerData}),A.length>1&&N.MoreButtonPlugin.iconPlugins.push(mF),R.length>1&&N.MoreButtonPlugin.iconPlugins.push(gF),this.setDefaultConfigOptions(N),j=[].concat(b(L),b(f),b(E)),B=(null!==(l=null==N?void 0:N.ignores)&&void 0!==l?l:[]).some((function(e){return"sdkunmuteplugin"!==(e+"").toLowerCase()})),N.ignores=[].concat(b(null!==(c=null==N?void 0:N.ignores)&&void 0!==c?c:[]),b(B?["AutoplayPlugin"]:[]),b(y?["sdkErrorPlugin","sdkToastPlugin","MoreButtonPlugin","DanmuPlugin","AutoplayPlugin"]:[])),this._isFirstCreated?this._isFirstCreated=!1:(N.autoplayMuted=!1,N.ignores=[].concat(b(null!==(U=null==N?void 0:N.ignores)&&void 0!==U?U:[]),["sdkUnmutePlugin"])),this.setPluginConfig(N),this.player=new As(t(t(y?{el:this.playerContainer,controls:{mode:"flex",initShow:!0},marginControls:!0,presets:[].concat(b(S),[$F]),mediaType:["mp4","m4a","hls"].includes(_)?"video":"audio",url:m}:{el:this.playerContainer,presets:S,url:m,isLive:h},N),{},{plugins:b(j)})),this.player.playerData=this.playerData,this._emitter.emit(dM.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),e.abrupt("return",this.player);case 36:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"setPluginConfig",value:function(e){var n,i=this.playerData,r=i.apiMap,o=i.configs,a=i.unionInfo,s=i.playList,l=i.useHlsPluginForSafari,c=i.isMobile,u=this.playerData.getCurrentStreamType()||Zs(null==o?void 0:o.getVideoByToken),h=ll(o,"EncryptHlsPlugin"),d=ll(o,"Mp4EncryptPlayer"),f=ll(o,"DASHPlugin"),p=ll(o,"vodLogOpts"),g=!(null==s||null===(n=s[0])||void 0===n||!n.kid)||!!h;h&&(e.EncryptHlsPlugin=t(t({playDomain:r.playDomain,getKeyType:"TOP"},c||!vl||l?{}:{useHls:!1}),h)),d&&(e.Mp4EncryptPlayer=t({playDomain:r.playDomain,getKeyType:"TOP"},d)),f&&(e.DASHPlugin=t({playDomain:r.playDomain,getKeyType:"TOP"},f)),o.privateDrmAuthToken&&o.kid&&a&&("hls"===u?e.EncryptHlsPlugin=t({kid:o.kid,drmKeyToken:o.privateDrmAuthToken,playDomain:r.playDomain},h||{}):"dash"===u?e.DASHPlugin=t({kid:o.kid,drmKeyToken:o.privateDrmAuthToken,playDomain:r.playDomain},f||{}):"mp4"===u&&(e.Mp4EncryptPlayer=t({kid:o.kid,drmKeyToken:o.privateDrmAuthToken,playDomain:r.playDomain},d||{}))),p&&(e.vodLogOpts=t({vtype:(u||"mp4").toUpperCase(),drm_type:g?1:0,playerVersion:"1.6.4",channel:"cn"},p))}},{key:"detectCodec",value:(f=o(n().mark((function e(t){var i,r,o,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,VH.loadPlugins("streamprobe");case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(i=e.t0,!(r=i.LoadProbe)){e.next=14;break}return e.next=11,null===(o=new r)||void 0===o?void 0:o.parseUrl(t);case 11:a=e.sent,"bytevc1"===(s=(a||{}).codec)?this.playerData.codec=Fn.H265:"avc"===s&&(this.playerData.codec=Fn.H264);case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),console.warn("detect codec error: ",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return f.apply(this,arguments)})},{key:"setDefaultConfigOptions",value:function(e){if(this._isFirstCreated){var n=this.playerData,i=n.defaultConfig,r=n.isHitDefault;if(i){var o=null!=i?i:{},a=o.volume,s=o.startTime,l=o.DanmuPlugin,c=o.LiveSubtitlesIconPlugin;if(a&&(e.volume=e.volume?t(t({},e.volume),{},{default:a}):a),r){var u,h;if(s&&(e.startTime=s),l)e.DanmuPlugin=t(t({},null!==(u=e.DanmuPlugin)&&void 0!==u?u:{}),l);if(c)e.LiveSubtitlesIconPlugin=t(t({},null!==(h=e.LiveSubtitlesIconPlugin)&&void 0!==h?h:{}),c)}}}}},{key:"getCurrentPlayerConfig",value:function(){var e,n,i=this.playerData,r=i.isLive,o=i.current,a=o.lineId,s={type:r?"live":"vod",isLive:r,definition:o.definition,lineId:a,volume:null!==(e=this.player.volume)&&void 0!==e?e:.6};r||(s.startTime=null!==(n=this.player.currentTime)&&void 0!==n?n:0);return t({},s)}},{key:"_analyzeExtendPlugins",value:function(){var e,t=this.playerData.options,n=t.extendPlugin||[],i=null!==(e=null==t?void 0:t.ignore)&&void 0!==e?e:[],r=[],o=[];return n.forEach((function(e){var t=function(e){var t="mobile"===Si.device,n=e.pluginName,i=void 0===n?"ExtendPlugin".concat(Math.random().toString().slice(-5)):n,r=e.type,o=void 0===r?t?"inner":"normal":r,s=e.position,h=void 0===s?hF.CONTROLS_LEFT:s,d=e.icon,f=void 0===d?ZM:d,p=e.index,g=void 0===p?1:p,y=e.hideAtFullScreen,m=void 0===y||y,_=e.tips,b=void 0===_?{jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}:_;return function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),m&&null!==(e=this.player)&&void 0!==e&&e.fullscreen&&this.handleFullScreenChange()}},{key:"registerIcons",value:function(){return c({},i,{icon:f,class:"xgplayer-extendicon-svg"})}},{key:"updateIcons",value:function(e){var t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}},{key:"registerLanguageTexts",value:function(){return c({},i,b)}},{key:"initEvents",value:function(){this.handleCallback=GM(this.handleCallback.bind(this),200);var e,t="mobile"===Si.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),m&&(null===(e=this.player)||void 0===e||e.on(ir,this.handleFullScreenChange.bind(this)))}},{key:"handleFullScreenChange",value:function(){var e,t=this.player;null===(e=this.player)||void 0===e||e.changePluginsIcon(i,!(null!=t&&t.fullscreen))}},{key:"handleCallback",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.emit(fM.PLAYER_EXTEND_BUTTON,i))}},{key:"destroy",value:function(){var e;this.unbind(["touchend","click"],this.handleCallback),m&&(null===(e=this.player)||void 0===e||e.off(ir,this.handleFullScreenChange.bind(this)))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(i,'">').concat(this.langText[i],"</div>\n </xg-icon>\n ")}}],[{key:"isExtendPlugin",get:function(){return!0}},{key:"type",get:function(){return o}},{key:"textTips",get:function(){return b}},{key:"pluginName",get:function(){return i}},{key:"defaultConfig",get:function(){return{position:h,index:g}}}]),n}(Qr)}(e);"inner"!==t.type||i[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}},{key:"beforePlayerCreate",value:(d=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CF.beforePlayerCreate(this);case 2:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"afterPlayerCreate",value:function(){var e=this.playerData.isMobile;this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),CF.afterPlayerCreate(this),this.emitDelayError()}},{key:"emitDelayError",value:function(){var e=this;setTimeout((function(){e.player&&e.delayError.forEach((function(t){var n=new Oi(e.player,t);e.player.emit("error",n)})),e.delayError=[]}),0)}},{key:"_setPlayerInfo",value:function(){var e;if(this.player){this.player.playerVersion="1.6.4";var t,n=this.playerData.getCurrentStreamType()||Zs(null===(e=this.playerData)||void 0===e||null===(e=e.configs)||void 0===e?void 0:e.getVideoByToken);if(!this.player.playerType)this.player.playerType=n,"hls"===(null==n?void 0:n.toLowerCase())&&null!==(t=this.player)&&void 0!==t&&t.vodLogger&&(this.player.vodLogger.vtype="HLS")}}},{key:"_mountingPlayerPanel",value:function(e){var t,n=this.playerData,i=n.options,r=n.isLive;this.player&&e&&(this.mobilePanel=new dF({config:null!==(t=i.panel)&&void 0!==t?t:{mode:r?Us:Bs,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}},{key:"_bindPlayerEvents",value:function(){this.player&&(this.player.on(dM.PLAYER_REBUILD,this.createPlayer.bind(this)),this.player.on(fM.MEDIA_EXPIRED,this.onMediaExpiredAction.bind(this)),this.player.once(Zi,this.emitDelayError.bind(this)))}},{key:"onMediaExpiredAction",value:function(){var e,t,n=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onMediaExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onMediaExpired)){var i=sl(this.playerData.onMediaExpired());null!=i&&i.then&&i.then((function(e){return n.playNext(e)}))}}},{key:"onTokenExpiredAction",value:function(){var e,t,n=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onTokenExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onTokenExpired)){var i=sl(this.playerData.onTokenExpired());null!=i&&i.then&&i.then((function(e){return n.updateAuthToken(e)}))}}},{key:"_bindSdkEvents",value:function(){var e=this;[].concat(b(Object.values(fM)),b(Object.values(dM)),b(Object.values(Tr))).forEach((function(t){"string"==typeof t&&e.player.on(t,(function(){for(var n,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];(n=e._emitter).emit.apply(n,[t].concat(r))}))}))}},{key:"_mountingExtendMethods",value:function(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}},{key:"_offPlayerEvents",value:function(){this.player&&this.player.off(dM.PLAYER_REBUILD,this.createPlayer.bind(this))}},{key:"changePluginsIcon",value:function(e,t){var n;if(this.player){var i=this.player.getPlugin(e);if(i&&null!=i&&i.root){var r=yi.hasClass(null==i?void 0:i.parent,"panel-icon-svg")?null==i||null===(n=i.parent)||void 0===n?void 0:n.parentNode:null==i?void 0:i.root;r&&(t?yi.show(r,"block"):yi.hide(r))}}}},{key:"getSdkPlugin",value:function(e){var t=this._sdkPlugins[e.toLowerCase()];return t&&t.pluginName?t:null}},{key:"switchAuthToken",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=i?0:this.player.currentTime,o=this.getSdkPlugin("AuthToken"),a=this.player.paused&&!this.player.isError,s=this.player.state,l=this.player.getPlugin("sdkDefinitionPlugin");return l&&(l.canChange=!1),new Promise((function(i,c){o?o.switchAuthToken(e).then((function(){var e,o=n.playerData.getCurrentUrl();n._playOriginalUrl=o;var u={defaultDefinition:null===(e=n.playerData.playList[0])||void 0===e?void 0:e.definition,list:n.playerData.playList};if(l&&(l.config=l.getConfig(n.player),l.renderItemList(),l.canChange=!0),n.player){var h=t(t({},n.playerData.options),{},{definition:u,startTime:r,url:o});if(n.player.playNext(h),6===s)n.player.once(Bi,(function(){a&&n.player.pause(),i()}));else{var d=h.autoplay||h.autoplayMuted;n.player.once(Bi,(function(){d?n.player.play():n.player.pause(),i()}))}}else console.error("no player created"),c()})):(console.error("current is not playAuthToken play"),c())}))}},{key:"updateAuthToken",value:function(e){var n=this,i=this.player.config,r=this.getSdkPlugin("AuthToken");return new Promise((function(o,a){r?r.switchAuthToken(e).then((function(){var e=n.playerData.getCurrentUrl();if(n._playOriginalUrl=e,n.getUrlTimestamp(e),n.player){n.player.resetState(),n.player.setConfig(t(t(t({},i),n.playerData.options),{},{url:e}));var r=n.player.start(e);r&&r.then?r.then((function(){return o()})):o()}else console.error("player not created"),a()})):(console.error("current is not playAuthToken play"),a())}))}},{key:"src",get:function(){var e;return null===(e=this.player)||void 0===e?void 0:e.src},set:function(e){this.player&&(this.player.src=e)}},{key:"switchURL",value:function(e){var t=this;this.resetUrlState(e);var n=this.player.switchURL(e,!1),i=this.player.currentTime;return n&&n.then?n:new Promise((function(e){var n=t.player.paused&&!t.player.isError,r=function(){t.player.currentTime=i,n&&t.player.once(Bi,(function(){t.player.pause()})),e()};Si.os.isAndroid?t.once(Ni,(function(){r()})):t.once(Bi,(function(){r()})),t.player.play()}))}},{key:"next",value:function(e){var n,i=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=r?0:this.player.currentTime,a=this.playerData.configs,s=t(t({},a),{},{startTime:o,autoplay:!0},e);return null!=e&&null!==(n=e.getVideoByToken)&&void 0!==n&&n.playAuthToken&&(s.streamType=Zs(null==e?void 0:e.getVideoByToken)||"mp4"),this.destroy().then((function(){return i._init(s)})).catch((function(e){console.error("next_error",e)}))}},{key:"playNext",value:function(e){var n,i=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return Promise.reject();var o=e.url,a=e.getVideoByToken,s=!(null===(n=this.player)||void 0===n||null===(n=n.plugins)||void 0===n||!n.dashplugin),l=this.player.paused&&!this.player.isError,c=r?0:this.player.currentTime;if(o){this.resetUrlState(o);var u=this.player.config,h=this.player.state,d=t(t({},u),{},{startTime:c},e);return this.setPluginConfig(d),this.player.playNext(d),new Promise((function(e,t){if(i.player.once(Ai,(function(e){t(e)})),6===h)i.player.once(Wi,(function(){i.player.once(Bi,(function(){l&&i.player.pause(),e(void 0)}))}));else{var n=d.autoplay||d.autoplayMuted;i.player.once(Wi,(function(){i.player.once(Bi,(function(){n?i.player.play():i.player.pause(),e(void 0)}))}))}}))}if(null!=a&&a.playAuthToken){var f,p=this.playerData.getCurrentStreamType()||Zs(null===(f=this.playerData.configs)||void 0===f?void 0:f.getVideoByToken),g=e.streamType||Zs(null==e?void 0:e.getVideoByToken)||"mp4";return p!==g?this.next(e,r):s?$s.url(null==a?void 0:a.playAuthToken,this.playerData.apiMap.playDomain).then((function(e){var t=ll(i.player.config,"DASHPlugin");t.dashOpts={Data:e},i.player.plugins.dashplugin.next(i.player.currentTime,"MEDIA_EXPIRED",t,!0)})):this.switchAuthToken(a,r)}return this.next(e,r)}},{key:"resetUrlState",value:function(e){this.playerData.playList=[],this.playerData.initPlayData(t(t({},this.playerData.configs),{},{url:e})),this._playOriginalUrl=e,this.getUrlTimestamp(e)}},{key:"_destroyPlayer",value:(h=o(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._offPlayerEvents(),e.next=3,null===(t=this.mobilePanel)||void 0===t?void 0:t.destroy();case 3:return e.next=5,null===(i=this.player)||void 0===i?void 0:i.destroy();case 5:this.player=null;case 6:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getPlayerInstance",value:function(){return this.player}},{key:"getSoftDecodingOption",value:(s=o(n().mark((function e(t,i,r){var o,a,s,l,c,u,h,d,f,p,g,v;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.playerData,s=a.enableH265Degrade,l=a.codec,c=a.configs,u=Js(null==c?void 0:c.getVideoByToken),h=!!(c.enableMp4MSE||ll(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===r&&(u||null!=c&&null!==(o=c.autoBitrateOpts)&&void 0!==o&&o.isOpenAutoDefi)),!t){e.next=20;break}return e.next=6,VH.loadPlugins("XGVideo");case 6:if(!(null==(d=e.sent)?void 0:d.isSupported())){e.next=14;break}return l&&d.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),e.abrupt("return",{mediaType:h?this.playerData.isCurrentH265()?"xg-video":"video":"xg-video",innerDegrade:1,codecType:null!=l?l:"h264"});case 14:this.emit(dM.NOT_SUPPORT_SOFT_DECODER),f={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(f),console.error("soft decode is not support by current browser");case 18:e.next=46;break;case 20:if(!s||l){e.next=23;break}return e.next=23,this.detectCodec(i);case 23:if(!this.playerData.isCurrentH265()||(n=void 0,y=void 0,m=void 0,n=window.navigator.userAgent.toLocaleLowerCase(),y=/(iphone)/.test(n)||/(ipad)/.test(n),m=/(quark)/.test(n),y&&!m||window.MediaSource&&window.MediaSource.isTypeSupported&&(window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')))){e.next=46;break}if(!s){e.next=42;break}return e.next=27,VH.loadPlugins("XGVideo");case 27:if(!(null==(p=e.sent)?void 0:p.isSupported())){e.next=36;break}return null==p||p.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,e.abrupt("return",{mediaType:h?this.playerData.isCurrentH265()?"xg-video":"video":"xg-video",innerDegrade:1,codecType:this.playerData.codec});case 36:this.emit(dM.NOT_SUPPORT_SOFT_DECODER),g={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(g),console.error("soft decode is not support by current browser");case 40:e.next=46;break;case 42:this.emit(dM.NOT_SUPPORT_HARDWARE_DECODER),v={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"},this.delayError.push(v),console.error("h265 hardware decode is not supported by this browser");case 46:return e.abrupt("return",{});case 47:case"end":return e.stop()}var n,y,m}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"setH265SoftPlayList",value:function(){if(this.playerData.isCurrentH265()){var e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((function(e){var t;return(null==e||null===(t=e.codec)||void 0===t?void 0:t.toLowerCase())===Fn.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}},{key:"_initI18N",value:function(e){var t=e.extraLangList,n=e.extendLangList;null==t||t.forEach((function(e){uo.use(e)})),uo.extend(EF),n&&uo.extend(n)}},{key:"musicMode",get:function(){var e;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e?void 0:e.mode},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.mode=e)}},{key:"musicTimeScale",get:function(){var e;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e?void 0:e.timeScale},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.timeScale=e)}},{key:"musicList",get:function(){var e;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e?void 0:e.list},set:function(e){var t;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||t.updateList(e)}},{key:"musicAdd",value:function(e){var t,n;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(n=t.add)||void 0===n||n.call(t,e)}},{key:"musicRandom",value:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.random)||void 0===t?void 0:t.call(e)}},{key:"musicNext",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.next)||void 0===t||t.call(e)}},{key:"musicPrev",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.prev)||void 0===t||t.call(e)}},{key:"musicSetIndex",value:function(e){var t,n;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(n=t.setIndex)||void 0===n||n.call(t,e)}},{key:"musicForward",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.forward)||void 0===t||t.call(e)}},{key:"musicBackward",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.backward)||void 0===t||t.call(e)}},{key:"musicRemove",value:function(e){var t,n;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(n=t.remove)||void 0===n||n.call(t,e)}},{key:"musicSetAbCycle",value:function(e,t,n,i){var r,o;null===(r=this.player.plugins)||void 0===r||null===(r=r.music)||void 0===r||null===(o=r.setAbCycle)||void 0===o||o.call(r,e,t,n,i)}},{key:"musicRemoveAbCycle",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.removeAbCycle)||void 0===t||t.call(e)}},{key:"getLogUserId",value:function(){var e,t=null===(e=this.player)||void 0===e?void 0:e.vodLogger;if(t){var n,i,r=(null==t||null===(n=t.tracker)||void 0===n?void 0:n.getConfig())||{};return null==r||null===(i=r.user)||void 0===i?void 0:i.user_unique_id}}},{key:"destroy",value:(r=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null),this.mountingDom&&this.mountingDom.removeChild(this.playerContainer),this._emitter.removeAllListeners(),this._emitter=null,CF.destroy(this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]),e}();YF.isMSESupported=fl,YF.isRTMSupported=hM.isSupported,YF.sdkVersion="1.6.4",YF.isRTMSupportCodec=function(e,t){if(e===Vn.H264)return hM.isSupportedH264(null==t?void 0:t.targetProfileLevel)};var qF=function(e){u(i,e);var n=v(i);function i(e){var t;return a(this,i),(t=n.call(this,e)).state={showLang:"",subTitleList:[],rtmpDtsGap:0,dtsBase:0,showingSubtitle:"",currentSub:null},t.clearLineTimer=null,t.showTimer=null,t.state.showLang=e.showLang,t}return l(i,[{key:"beforePlayerInit",value:function(){var e=this;this.on(Ni,this.handleVideoTimeupdate.bind(this)),this.on(Di,this.onPause.bind(this)),this.on(Pi,this.onPlay.bind(this)),this.on(er,this.destroy.bind(this)),this.on(tr,this.clearRtmpDtsGap.bind(this)),this.on(lr,this.handleSEIParsed.bind(this)),this.on("core_event",(function(t){"core.sei"===t.eventName&&e.handleSEIParsed(t.sei,t.originPts)}))}},{key:"onPause",value:function(){this.clearSubTitle(!1)}},{key:"onPlay",value:function(){this.clearSubTitle(!0)}},{key:"destroy",value:function(){this.clearSubTitle(!0),this.off(Ni,this.handleVideoTimeupdate.bind(this)),this.off(lr,this.handleSEIParsed.bind(this)),this.off(Di,this.onPause.bind(this)),this.off(Pi,this.onPlay.bind(this)),this.off(er,this.destroy.bind(this)),this.off(tr,this.clearRtmpDtsGap.bind(this))}},{key:"clearRtmpDtsGap",value:function(){this.state.rtmpDtsGap=0,this.state.dtsBase=0,this.clearSubTitle(!0)}},{key:"clearSubTitle",value:function(e){if(this.state.subTitleList=[],this.state.showingSubtitle="",this.state.currentSub=null,clearTimeout(this.showTimer),clearTimeout(this.clearLineTimer),e){var t=this.find(".xgplayer-subtitles-inner");t&&this.resetDom(t)}}},{key:"getIsSoft",value:function(){var e;return"LIVE-VIDEO"===(null!==(e=this.player.video)&&void 0!==e?e:{}).tagName}},{key:"handleVideoTimeupdate",value:function(e){var t,n,i=this.player.video.currentTime,r=this.getIsSoft(),o=(null==e||null===(t=e.detail)||void 0===t?void 0:t.pts)/1e3,a=r?o:i;if(this.state.showLang&&a&&this.player.isPlaying){var s=this.findSubTitleByTime(a);s&&s.text!==this.state.showingSubtitle&&null!==(n=s.wordpiece)&&void 0!==n&&n.length&&(this.renderSubtitle(s),this.player.emit(fM.AI_SUBTITLE_MATCH,{subTitle:s,lang:this.state.showLang}),this.state.subTitleList.length>1e3&&(this.state.subTitleList=this.state.subTitleList.filter((function(e){return e.timestamp+e.duration/1e3>=a}))))}}},{key:"renderSubtitle",value:function(e){var t=this,n=this.root,i=this.find(".xgplayer-subtitles-inner"),r=this.find(".xgplayer-subtitles-helper");if(i){this.clearLineTimer&&clearTimeout(this.clearLineTimer),this.showTimer&&(clearTimeout(this.showTimer),this.showSurplus());var o=this.createNewDom(i);this.state.showingSubtitle=e.text,this.state.currentSub={subObj:e,dom:o,index:0};var a=Date.now(),s="",l=0;!function c(){var u,h=e.wordpiece,d=void 0===h?[]:h,f=e.delimiter;if(l===d.length)return s="",t.showTimer=null,void(t.clearLineTimer=setTimeout((function(){t.resetDom(i),t.clearLineTimer=null}),1e3));var p=d[l].duration-(Date.now()-a-d[l].OffsetMs);if(p<0)for(;p<0&&l<d.length-1;)s=s+f+d[l+=1].text,p=d[l].duration-(Date.now()-a-d[l].OffsetMs);else s=s+f+d[l].text;r.textContent=s;var g=null!==(u=null==n?void 0:n.offsetWidth)&&void 0!==u?u:300;r.offsetWidth>g&&(o=t.createNewDom(i),t.state.currentSub.dom=o,s=d[l].text),o.textContent=s,t.showTimer=setTimeout(c,p),l+=1,t.state.currentSub.index=l}()}}},{key:"handleSEIParsed",value:function(e,t){var n,i,r=e.dts;if(5===e.code)try{var o="string"==typeof e.content?e.content:(n=e.content,(i=String.fromCharCode.apply(null,n)).slice(i.indexOf("{"),i.lastIndexOf("}")+1)),a=JSON.parse(o).rtmp_dts;if(a&&r){var s=t||r;this.state.rtmpDtsGap=a-s}}catch(Hl){}}},{key:"insertSubTitle",value:function(){for(var e,t=this,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];i.forEach((function(e){e.timestamp=t.adjustSubTitleTime(e.timestamp)})),(e=this.state.subTitleList).push.apply(e,i)}},{key:"setCurrentLang",value:function(e){this.state.showLang=e,this.player.emit(fM.AI_SUBTITLE_LANG_CHANGE,e)}},{key:"adjustSubTitleTime",value:function(e){var t,n,i,r;if(this.getIsSoft())return(e-this.state.rtmpDtsGap)/1e3;var o=(null===(t=this.player)||void 0===t||null===(t=t.plugins)||void 0===t?void 0:t.flvlive)||(null===(n=this.player)||void 0===n||null===(n=n.plugins)||void 0===n?void 0:n.hlslive);if(o){var a,s,l,c,u,h,d=null!==(a=null==o||null===(s=o._context)||void 0===s||null===(s=s.getInstance("COMPATIBILITY"))||void 0===s?void 0:s._videoLargeGap)&&void 0!==a?a:0,f=null==o||null===(l=o._context)||void 0===l?void 0:l.getInstance("MP4_REMUXER"),p=null!==(c=null!==(u=null===(h=f.remuxer)||void 0===h?void 0:h.videoDtsBase)&&void 0!==u?u:null==f?void 0:f.videoDtsBase)&&void 0!==c?c:0;return this.state.dtsBase=p-d,(e+d-p-this.state.rtmpDtsGap)/1e3}var g=(null===(i=this.player)||void 0===i||null===(i=i.plugins)||void 0===i?void 0:i.flv)||(null===(r=this.player)||void 0===r||null===(r=r.plugins)||void 0===r?void 0:r.hls);if(g){var v,y=null===(v=g.core._bufferService)||void 0===v||null===(v=v._demuxer)||void 0===v||null===(v=v._fixer)||void 0===v?void 0:v._baseDts;return this.state.dtsBase=y,(e-y-this.state.rtmpDtsGap)/1e3}return(e-this.state.rtmpDtsGap)/1e3}},{key:"findSubTitleByTime",value:function(e){var t=this,n=this.state.subTitleList,i=n.findIndex((function(n){var i=t.player,r=n.lang===t.state.showLang,o=((null==i?void 0:i.__curUrl)||i.config.url)===n.url,a=n.timestamp;return a+n.duration/1e3>=e&&a<=e&&o&&r}));if(!(i<0)){var r=n.splice(0,i+1),o=r[r.length-1];return this.splitSubTitle(o)}}},{key:"splitSubTitle",value:function(e){var n="en"===e.lang?" ":"",i=e.text.split(n);if(!e.wordpiece){var r=e.duration/i.length,o=i.map((function(e,t){return{text:e,OffsetMs:r*t,duration:r}}));return t(t({},e),{},{delimiter:n,textArr:i,wordpiece:o})}return t(t({},e),{},{delimiter:n,textArr:i})}},{key:"showSurplus",value:function(){var e,t=this;if(this.state.currentSub){var n=this.state.currentSub,i=n.index,r=n.subObj,o=n.dom,a=null!=r?r:{},s=a.wordpiece,l=a.delimiter;if(!(i>=s.length)){var c=this.find(".xgplayer-subtitles-helper"),u=this.find(".xgplayer-subtitles-inner"),h=this.root,d=null!==(e=null==h?void 0:h.offsetWidth)&&void 0!==e?e:300,f=s.length,p=o.textContent;s.slice(i,f).forEach((function(e){p=p+l+e.text,c.textContent=p,c.offsetWidth>d&&(t.state.currentSub.dom=t.createNewDom(u),p=e.text),t.state.currentSub.dom.textContent=p}))}}}},{key:"createNewDom",value:function(e){if(e){e.children.length>2&&e.firstElementChild&&e.removeChild(e.firstElementChild);var t=document.createElement("span");if(e.appendChild(t),e.children.length>2){var n=e.classList.contains("scroll-1"),i=e.classList.contains("scroll-2");n&&e.classList.replace("scroll-1","scroll-2"),i&&e.classList.replace("scroll-2","scroll-1"),n||i||e.classList.add("scroll-1")}return t}}},{key:"test",value:function(){var e=this,t=this.splitSubTitle({duration:1e4,lang:"zh",text:"你呼吸 已改变 停滞于某段流年 离别的你我 才明白挥霍有期限,逝去的人不曾走远 像 突如其来温暖我的晴天 像 倾盆大雨我躲避的屋檐",timestamp:0,url:"xxx"});this.renderSubtitle(t),setTimeout((function(){e.test()}),1e4)}},{key:"getPlayTime",value:function(){var e=this,t=this.getIsSoft();this.on(Ni,(function(n){if(t){var i,r={pts:null==n||null===(i=n.detail)||void 0===i?void 0:i.pts,rtmpDtsGap:e.state.rtmpDtsGap};r.timestamp=r.pts+r.rtmpDtsGap,console.log("直播当前时间戳:",r.timestamp,r)}else{var o={currentTime:1e3*e.player.video.currentTime,dtsBase:e.state.dtsBase,rtmpDtsGap:e.state.rtmpDtsGap};o.timestamp=o.currentTime+o.dtsBase+o.rtmpDtsGap,console.log("直播当前时间戳:",o.timestamp,o)}}))}},{key:"resetDom",value:function(e){e&&(this.state.currentSub=null,e&&(e.innerHTML="",e.classList.remove("scroll-1","scroll-2")))}},{key:"render",value:function(){return'<xg-subtitles class="xgplayer-subtitles"><xg-subtitles-inner class="xgplayer-subtitles-inner"></xg-subtitles-inner><xg-subtitles-helper class="xgplayer-subtitles-helper"></xg-helper></xg-subtitles>'}}],[{key:"pluginName",get:function(){return"LiveSubtitlesPlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.ROOT,showLang:""}}}]),i}(Qr),XF=Qr.POSITIONS,JF=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).isMobile="mobile"===Si.device,i.isOpenState=!0,i.optionList=null,i.currentLang="",i}return l(n,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.aiSubOpen),this.appendChild(".xgplayer-icon",this.icons.aiSubClose),this.renderOptionList(),this.initEvents(),this.currentLang=this.config.default,this.config.defaultOpen?this.open(!0):this.close()}},{key:"afterPlayerInit",value:function(){this.config.defaultOpen&&this.changeSubTitleLang(this.config.default,!0)}},{key:"registerIcons",value:function(){return{aiSubOpen:{icon:SU,class:"xgplayer-aisub-open-svg"},aiSubClose:{icon:CU,class:"xgplayer-aisub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"AI 字幕",en:"AI Subtitles",zh:"AI 字幕","zh-hk":"AI 字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}},{key:"children",value:function(){return{LiveSubTitlesPlugin:{plugin:qF,options:{root:this.player.root,showLang:this.currentLang}}}}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showPanel.bind(this)),this.bind(["mouseleave"],this.hidePanel.bind(this))}},{key:"handleButtonChange",value:function(){(this.close=this.close.bind(this),this.open=this.open.bind(this),this.isMobile)?this.showMobilePanel():(this.isOpenState?this.close:this.open)()}},{key:"showMobilePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"renderItemList",value:function(){var e=this,t=b(this.config.list),n=yi.createDom("div","",{},"ai-panel-content");return t.push({key:"",showText:this.langText.subClose}),t.forEach((function(t){var i=e.renderItem(t);n.appendChild(i)})),n}},{key:"renderItem",value:function(e){var t=this,n=""===e.key&&!this.isOpenState||this.currentLang===e.key&&this.isOpenState,i=yi.createDom("div","",{},"panel-Item ".concat(n?"select-in":""));return i.innerHTML=e.showText,i.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.changeSubTitleLang(e.key),t.updatePanel()})),i}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"showPanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hidePanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isOpenState=!0,yi.removeClass(this.root,"isClose"),yi.addClass(this.root,"isOpen"),!e&&this.showPanel(),this.toggleSubTitle()}},{key:"close",value:function(){var e;this.isOpenState=!1,yi.removeClass(this.root,"isOpen"),yi.addClass(this.root,"isClose"),null===(e=this.optionList)||void 0===e||e.hide(),this.toggleSubTitle()}},{key:"renderOptionList",value:function(){var e,t=this;if(!((null===(e=this.config.list)||void 0===e?void 0:e.length)<2||this.isMobile)){var n={config:{data:this.config.list.map((function(e){return e.key===t.config.default&&(e.isCurrent=!0,e.selected=!0),e})),className:"",onItemClick:function(e,n){var i;e.stopPropagation(),e.preventDefault(),t.changeSubTitleLang(null===(i=n.to)||void 0===i?void 0:i.key)}},root:this.root};this.optionList=new Xa(n)}}},{key:"changeSubTitleLang",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.currentLang=e,e?this.open(t):this.close()}},{key:"toggleSubTitle",value:function(){var e;null===(e=this.player.getPlugin("LiveSubtitlesPlugin"))||void 0===e||e.setCurrentLang(this.isOpenState?this.currentLang:"")}},{key:"destroy",value:function(){var e;this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showPanel.bind(this)),this.unbind(["mouseleave"],this.hidePanel.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy()}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-aisub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="subOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"LiveSubtitlesIconPlugin"}},{key:"defaultConfig",get:function(){return{position:XF.CONTROLS_RIGHT,index:2.7,defaultOpen:!0,default:"en",list:[{key:"zh",showText:"中文"},{key:"en",showText:"En"}]}}}]),n}(Qr),ZF=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).waitings=[],i.longWaitingEmitTime=0,i.waitingStartTime=0,i.playerData=null,i.isNeedShowTips=!0,i.playerData=i.playerConfig.playerData,i}return l(n,[{key:"registerLanguageTexts",value:function(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}},{key:"afterCreate",value:function(){this.bindCtx(),this.bindEvents()}},{key:"bindCtx",value:function(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this)}},{key:"bindEvents",value:function(){var e=this;this.on(ji,this._waiting),this.on(Li,this._clearTime),this.on(Di,this._clearTime),this.on(Ni,this._clearTime),this.on(Pi,this._clearTime),this.on(Bi,(function(){e.isNeedShowTips=!0})),this.config.isNeedAutoDemote&&this.player.on(fM.LONG_WAITING,this.demote.bind(this))}},{key:"_waiting",value:function(){this._count(),this._time()}},{key:"_count",value:function(){var e=Date.now();if(this.waitings.push(e),this.waitings.length===this.config.oftenWaitingCount){var t=this.waitings.shift();t&&e-t<=this.config.oftenWaitingTime&&(this.player.emit(fM.OFTEN_WAITING),this.clearState())}}},{key:"_time",value:function(){var e=this;if(this.timer)console.log("连续触发了waiting,距离上次waiting时间:",Date.now()-this.waitingStartTime);else{this.waitingStartTime=Date.now();var t=this.player.currentTime;this.timer=setTimeout((function(){e.player&&e.player.currentTime<=t+.1&&(console.log("waiting持续时间超过 ".concat(e.config.longWaitingTime," 秒")),e.player.emit(fM.LONG_WAITING),e.clearState())}),this.config.longWaitingTime)}}},{key:"_clearTime",value:function(){this.waitingStartTime&&console.log("waiting持续时长:",Date.now()-this.waitingStartTime),this.clearState()}},{key:"clearState",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}},{key:"demote",value:function(){if(this.playerData){var e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(t){var n=t.definition;if(n){var i=this.playerData.current.definition;if(this.player.emit(fM.DEFINITION_DEMOTE,{currentDef:i,willChangeDef:n,next:t}),"auto"===i){var r=t.url;this.changeUrl(r)}else n!==i&&this.showToast(t)}}}}},{key:"changeUrl",value:function(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(fM.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}},{key:"showToast",value:function(e){var t,n=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i&&this.isNeedShowTips){var r=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,o=yi.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),a=yi.createDom("span",r,void 0,"toast-txt-bt");o.appendChild(a);var s=i.add(o,5e3,!0);a.addEventListener("click",(function(){n.playerData&&(n.playerData.current.definition=e.definition,i.remove(s))})),this.isNeedShowTips=!1,setTimeout((function(){n.isNeedShowTips=!0}),3e4)}}},{key:"destroy",value:function(){this.clearState()}}],[{key:"pluginName",get:function(){return"DefinitionDemotePlugin"}},{key:"defaultConfig",get:function(){return{oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3,isNeedAutoDemote:!1,demotePriority:[]}}}]),n}(Qr),QF=Qr.POSITIONS,eV=604800,tV=function(e){u(i,e);var n=v(i);function i(){var e;return a(this,i),(e=n.apply(this,arguments)).isMobile="mobile"===Si.device,e.playedBar=null,e.cachedBar=null,e.innerBar=null,e.progressBtn=null,e.progressPoint=null,e.backLiveBt=null,e.cardDomList=[],e.initTime=0,e.liveGap=0,e.shiftTimeGap=0,e.isProgressMoving=!1,e.isPlayTimeShift=!1,e.liveUrl="",e.onBodyClick=function(e){e.preventDefault(),e.stopPropagation(),yi.event(e)},e}return l(i,[{key:"duration",get:function(){var e,t=this.liveGap+Math.floor(Date.now()/1e3-this.initTime),n=(null!==(e=this.config)&&void 0!==e?e:{}).maxMoveTime;return n&&t>n?n:t>eV?eV:t}},{key:"registerLanguageTexts",value:function(){return{BACKLIVE:{jp:"ライブに戻る",en:"Back to live",zh:"返回直播","zh-hk":"返回直播"}}}},{key:"updateLang",value:function(){this.backLiveBt&&(this.backLiveBt.innerHTML=this.langText.BACKLIVE)}},{key:"afterCreate",value:function(){this.liveUrl=this.player.config.url,this.playedBar=this.find(".xgplayer-progress-played"),this.cachedBar=this.find(".xgplayer-progress-cache"),this.progressBtn=this.find(".xgplayer-progress-btn"),this.progressPoint=this.find(".xgplayer-shift-progress-point"),this.innerBar=this.find(".xgplayer-progress-inner"),this.createBackLiveBtDom(),this.clacTime(),this.initEvents(),this.bindDomEvents(),this.isMobile||this.createTimeShiftCard()}},{key:"clacTime",value:function(){var e,t=null!==(e=this.config)&&void 0!==e?e:{},n=t.livingStartTime,i=t.currentTime;this.initTime=Math.floor(Date.now()/1e3),this.liveGap=Math.floor(i-n)}},{key:"initEvents",value:function(){this.on(Ni,this.handleTimeUpdate.bind(this))}},{key:"bindDomEvents",value:function(){if(this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.tipsUpdate=this.tipsUpdate.bind(this),this.isMobile){this.bind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.addEventListener("touchmove",yi.stopPropagation),e.center&&e.center.addEventListener("touchend",yi.stopPropagation))}else this.bind("mousedown",this.handleMouseDown),this.bind("mouseenter",this.handleMouseEnter)}},{key:"handleTimeUpdate",value:function(){this.isProgressMoving||this.progressUpdate()}},{key:"handleMouseDown",value:function(e){if(e.target!==this.backLiveBt){this.onBodyClick(e),this.focus(),yi.addClass(this.progressBtn,"active");var t=this.computeTime(e);this.updateShiftTime(t.percent),this.isProgressMoving=!0,this.isMobile?(this.bind("touchmove",this.handleMouseMove),this.bind("touchend",this.handleMouseUp)):(document.addEventListener("mousemove",this.handleMouseMove,!1),document.addEventListener("mouseup",this.handleMouseUp,!1))}}},{key:"handleMouseMove",value:function(e){this.onBodyClick(e);var t=this.computeTime(e);this.updateShiftTime(t.percent)}},{key:"handleMouseUp",value:function(e){this.onBodyClick(e),this.isProgressMoving=!1,yi.removeClass(this.progressBtn,"active"),this.changeTimeUrl(),this.isMobile?(this.unbind("touchmove",this.handleMouseMove),this.unbind("touchend",this.handleMouseUp)):(document.removeEventListener("mousemove",this.handleMouseMove,!1),document.removeEventListener("mouseup",this.handleMouseUp,!1))}},{key:"handleMouseEnter",value:function(e){this.bind("mouseleave",this.handleMouseLeave),this.bind("mousemove",this.tipsUpdate),this.tipsUpdate(e),this.focus()}},{key:"handleMouseLeave",value:function(){this.unbind("mouseleave",this.handleMouseLeave),this.unbind("mousemove",this.tipsUpdate),this.blur()}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),yi.addClass(this.root,"active")}},{key:"blur",value:function(){this.player.controls.recoverAutoHide(),yi.removeClass(this.root,"active")}},{key:"computeTime",value:function(e){var t,n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=yi.getEventPos(e,r.zoom);90===r.rotateDeg?(t=s,n=l,i=u.clientY):(t=a,n=c,i=u.clientX);var h=i-n,d=(h=h>t?t:h<0?0:h)/t;return{percent:d=d<0?0:d>1?1:d,offset:h,width:t,left:n,e:e}}},{key:"tipsUpdate",value:function(e){var t,n,i,r,o,a=this.computeTime(e),s=Math.floor(this.duration*(1-a.percent));this.progressPoint.style.left="".concat(100*a.percent,"%"),this.progressPoint.innerHTML="-".concat((t=s,n=Math.floor(t/3600),i=t%3600,r=Math.floor(i/60),o=Math.round(i%60),n>0?(r<10&&(r="0"+r),o<10&&(o="0"+o),"".concat(n,":").concat(r,":").concat(o)):(o<10&&(o="0"+o),"".concat(r,":").concat(o))))}},{key:"updateShiftTime",value:function(e){this.shiftTimeGap=Math.floor(this.duration*(1-e)),this.progressUpdate()}},{key:"getCurrentProgress",value:function(){return Math.floor(this.duration-this.shiftTimeGap)}},{key:"progressUpdate",value:function(){var e=this.getCurrentProgress()/this.duration;this.progressBtn.style.left="".concat(100*e,"%"),this.playedBar.style.width="".concat(100*e,"%"),this.cardProcessUpdate()}},{key:"changeTimeShift",value:function(e){var t=this.calcCardProcess(e);t<0||(this.updateShiftTime(t),this.changeTimeUrl())}},{key:"changeTimeUrl",value:function(){var e=this.config.timeShiftUrl,t="";this.isPlayTimeShift=!0,this.toggleBackButton();var n=this.shiftTimeGap<6?6:this.shiftTimeGap;t=e?e.replace("{}",n):function(e,t){if(!t)return e;var n=Object.entries(t).map((function(e){var t=_(e,2),n=t[0],i=t[1];return"".concat(n,"=").concat(null!=i?i:"")})).join("&");return e+(-1===e.indexOf("?")?"?":"&")+n}(this.liveUrl,{timeshift:n}),this.player.src=t,this.player.config.url=t,this.player.emit(fM.TIME_SHIFT_CHANGE,!0),this.player.emit(fM.PlAY_URL_CHANGE,{shiftUrl:t,from:fM.TIME_SHIFT_CHANGE})}},{key:"createBackLiveBtDom",value:function(){var e,t=this;if(this.backLiveBt)return this.backLiveBt;this.backLiveBt=yi.createDom("xg-back-live-bt",this.langText.BACKLIVE,void 0,"xgplayer-back-live-bt"),this.backLiveBt.addEventListener("click",(function(e){t.onBodyClick(e),t.backLive()})),null===(e=this.player.root)||void 0===e||e.appendChild(this.backLiveBt)}},{key:"backLive",value:function(){this.liveUrl&&(this.player.src=this.liveUrl,this.player.config.url=this.liveUrl,this.shiftTimeGap=0,this.isPlayTimeShift=!1,this.toggleBackButton(),this.player.emit(fM.TIME_SHIFT_CHANGE,!1),this.player.emit(fM.PlAY_URL_CHANGE,{url:this.liveUrl,from:fM.TIME_SHIFT_CHANGE}))}},{key:"toggleBackButton",value:function(){this.backLiveBt&&(this.backLiveBt.style.display=this.isPlayTimeShift?"flex":"none")}},{key:"updateCardList",value:function(e){this.config.cardList=b(e),this.clearCardDom(),this.createTimeShiftCard()}},{key:"clearCardDom",value:function(){var e=this;this.cardDomList.forEach((function(t){t.dom&&e.innerBar.contains(t.dom)&&e.innerBar.removeChild(t.dom)})),this.cardDomList=[]}},{key:"createTimeShiftCard",value:function(){var e,t=this;(null===(e=this.config.cardList)||void 0===e?void 0:e.length)<=0||this.config.cardList.forEach((function(e){t.renderCard(e)}))}},{key:"renderCard",value:function(e){if(e.img){var n=yi.createDom("xg-card","",void 0,"xgplayer-shift-progress-card"),i=yi.createDom("img","",{src:e.img},"xgplayer-shift-progress-card-img"),r=yi.createDom("div","",void 0,"xgplayer-shift-progress-card-point");n.appendChild(i),n.appendChild(r),this.cardDomList.push(t(t({},e),{},{dom:n}))}}},{key:"cardProcessUpdate",value:function(){var e=this;0!==this.cardDomList.length&&this.cardDomList.forEach((function(t){if(t.dom){var n=e.calcCardProcess(t.timestamp);if(!(n>1)){var i=e.innerBar.contains(t.dom);n<0?i&&e.innerBar.removeChild(t.dom):(i||e.innerBar.appendChild(t.dom),t.dom.style.left="".concat(100*n,"%"))}}}))}},{key:"calcCardProcess",value:function(e){var t,n=null!==(t=this.config)&&void 0!==t?t:{},i=n.maxMoveTime,r=n.livingStartTime,o=this.liveGap+Math.floor(Date.now()/1e3-this.initTime);return i&&o>i&&(r=o-i),e<r?-1:(e-r)/this.duration}},{key:"destroy",value:function(){if(this.off(Ni,this.handleTimeUpdate.bind(this)),this.isMobile){this.unbind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.removerEventListener("touchmove",yi.stopPropagation),e.center&&e.center.removerEventListener("touchend",yi.stopPropagation))}else this.unbind("mousedown",this.handleMouseDown),this.unbind("mouseenter",this.handleMouseEnter);var t;this.backLiveBt&&(null===(t=this.player.root)||void 0===t||t.removeChild(this.backLiveBt),this.backLiveBt=null)}},{key:"render",value:function(){if(this.config.disable)return"";var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",' xgplayer-shift">\n <xg-outer class="xgplayer-progress-outer">\n <xg-inners class="progress-list">\n <xg-inner class="xgplayer-progress-inner" style="flex: 1">\n <xg-cache class="xgplayer-progress-cache" style="width: 100%;"></xg-cache>\n <xg-played class="xgplayer-progress-played" style="width: 100%;"></xg-played>\n </xg-inner>\n </xg-inners>\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n <xg-point class="xgplayer-shift-progress-point">00:00</xg-point>\n </xg-outer>\n </xg-progress>\n ')}}],[{key:"pluginName",get:function(){return"TimeShiftPlugin"}},{key:"defaultConfig",get:function(){return{position:QF.CONTROLS_CENTER,livingStartTime:Date.now()/1e3,maxMoveTime:0,currentTime:Date.now()/1e3,timeShiftUrl:"",cardList:[]}}}]),i}(Qr);function nV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.199997C8.5 0.0895386 8.5896 0 8.69995 0H9.30005C9.4104 0 9.5 0.0895386 9.5 0.199997V1.8C9.5 1.91046 9.4104 2 9.30005 2H8.69995C8.5896 2 8.5 1.91046 8.5 1.8V0.199997Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0773926 1.76582 0.179443 1.75529L7.27954 1.02277C7.34546 1.01596 7.40649 1.04182 7.44751 1.08664C7.47998 1.12207 7.5 1.16936 7.5 1.22171V14.7783C7.5 14.8969 7.39746 14.9894 7.27954 14.9773L0.179443 14.2447C0.0773926 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12701L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18 1.95424C18 1.85173 17.9226 1.76582 17.8206 1.75529L10.7205 1.02277C10.6025 1.01059 10.5 1.10313 10.5 1.22171V14.7783C10.5 14.8969 10.6025 14.9894 10.7205 14.9773L17.8206 14.2447C17.9226 14.2342 18 14.1483 18 14.0458V1.95424ZM16.5 3.12701L12 2.66273V13.3373L16.5 12.873V3.12701Z" fill="white"/>\n <path d="M8.69995 3C8.5896 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.5896 5 8.69995 5H9.30005C9.32642 5 9.35156 4.9949 9.37451 4.98564C9.39111 4.97896 9.40674 4.97011 9.4209 4.95944C9.46899 4.92293 9.5 4.8651 9.5 4.8V3.2C9.5 3.14664 9.47925 3.09818 9.44507 3.06232C9.40869 3.02393 9.35718 3 9.30005 3H8.69995Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.5896 6 8.69995 6H9.30005C9.34277 6 9.38232 6.01344 9.41479 6.03635C9.46631 6.07254 9.5 6.13234 9.5 6.2V7.8C9.5 7.85072 9.48096 7.89703 9.44995 7.9323C9.41821 7.96826 9.37354 7.99272 9.32373 7.99861C9.31592 7.99953 9.30811 8 9.30005 8H8.69995C8.5896 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.53711 9.08395C8.51367 9.11667 8.5 9.15674 8.5 9.20001V10.8C8.5 10.9105 8.5896 11 8.69995 11H9.30005C9.4104 11 9.5 10.9105 9.5 10.8V9.20001C9.5 9.08954 9.4104 9 9.30005 9H8.69995C8.68384 9 8.66821 9.00189 8.65332 9.00546C8.60571 9.01688 8.5647 9.04529 8.53711 9.08395Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.1371 8.52905 12.081 8.57446 12.0443C8.60864 12.0166 8.65234 12 8.69995 12H9.30005C9.4104 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.8664 9.46753 13.9253 9.41772 13.9616C9.38477 13.9857 9.34399 14 9.30005 14H8.69995C8.5896 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.69995 15C8.5896 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.5896 16 8.69995 16H9.30005C9.4104 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.4104 15 9.30005 15H8.69995Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function iV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.2C8.5 0.0895431 8.58954 0 8.7 0H9.3C9.41046 0 9.5 0.0895431 9.5 0.2V1.8C9.5 1.91046 9.41046 2 9.3 2H8.7C8.58954 2 8.5 1.91046 8.5 1.8V0.2Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0775055 1.76582 0.179474 1.7553L7.27947 1.02276C7.39742 1.01059 7.5 1.10313 7.5 1.2217V14.7783C7.5 14.8969 7.39742 14.9894 7.27947 14.9773L0.179474 14.2447C0.0775053 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12702L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path d="M17.8205 1.7553C17.9225 1.76582 18 1.85173 18 1.95424V14.0458C18 14.1483 17.9225 14.2342 17.8205 14.2447L10.7205 14.9773C10.6026 14.9894 10.5 14.8969 10.5 14.7783V1.2217C10.5 1.10313 10.6026 1.01059 10.7205 1.02276L17.8205 1.7553Z" fill="white"/>\n <path d="M8.7 3C8.58954 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.58954 5 8.7 5H9.3C9.41046 5 9.5 4.91046 9.5 4.8V3.2C9.5 3.08954 9.41046 3 9.3 3H8.7Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.58954 6 8.7 6H9.3C9.41046 6 9.5 6.08954 9.5 6.2V7.8C9.5 7.91046 9.41046 8 9.3 8H8.7C8.58954 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.7 9C8.58954 9 8.5 9.08954 8.5 9.2V10.8C8.5 10.9105 8.58954 11 8.7 11H9.3C9.41046 11 9.5 10.9105 9.5 10.8V9.2C9.5 9.08954 9.41046 9 9.3 9H8.7Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.0895 8.58954 12 8.7 12H9.3C9.41046 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.9105 9.41046 14 9.3 14H8.7C8.58954 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.7 15C8.58954 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.58954 16 8.7 16H9.3C9.41046 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.41046 15 9.3 15H8.7Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var rV=Qr.POSITIONS,oV="getMirror",aV="exitMirror",sV=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).isEnableMirror=!0,i.isEnableMirror=i.config.defaultEnable,i}return l(n,[{key:"afterCreate",value:function(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}},{key:"registerIcons",value:function(){var e;return c(e={},oV,{icon:nV,class:"xg-get-mirror"}),c(e,aV,{icon:iV,class:"xg-exit-mirror"}),e}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e[oV]),t.appendChild(e[aV])}},{key:"registerLanguageTexts",value:function(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}},{key:"action",value:function(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(fM.MIRROR_CHANGE,this.isEnableMirror)}},{key:"updateMirrorState",value:function(e){var t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){this.changeLangTextKey(this.find(".xg-tips"),e?aV:oV)}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class=\'xgplayer-mirror-icon\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="mirror">'.concat(this.langText[oV],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"mirrorPlugin"}},{key:"defaultConfig",get:function(){return{position:rV.CONTROLS_RIGHT,index:mM,disable:!1,defaultEnable:!1}}}]),n}(Qr);var lV=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).memoryId="",i.canJump=!1,i.saveTimeFun=yi.checkIsFunction(i.config.saveTime)?i.config.saveTime:i.saveTimeByStorage,i.getTimeFun=yi.checkIsFunction(i.config.getTime)?i.config.getTime:i.getTimeByStorage,i.startTime=0,i.memoryId=i.config.memoryId,i.showToast=i.showToast.bind(p(i)),i}return l(n,[{key:"registerLanguageTexts",value:function(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}},{key:"children",value:function(){return{toast:IU}}},{key:"afterCreate",value:function(){this.once(Bi,this.showToast)}},{key:"beforePlayerInit",value:function(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}},{key:"destroy",value:function(){0!==this.player.currentTime&&this.player.currentTime!==this.player.duration&&this.saveTimeFun(this.memoryId,this.player.currentTime)}},{key:"getTime",value:function(){var e=this;return new Promise((function(t){var n,i=(n=e.getTimeFun(e.memoryId))&&n.then?n:new Promise((function(e){e(n)}));i.then((function(n){var i=parseFloat(n);isNaN(i)||0===i?console.warn("the time got is invalid",n):(e.startTime=i,e.canJump=!0,e.playerConfig.startTime=e.startTime,"mobile"===Si.device&&e.player.once("canplay",(function(){e.player.currentTime=e.startTime}))),t()})).catch((function(e){console.error("getTime function occur error",e),t()}))}))}},{key:"setSave",value:function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)})),document.addEventListener("pagehide",(function(){0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)})),window.addEventListener("beforeunload",(function(){0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)}))}},{key:"showToast",value:function(){if(this.canJump){var e,t=null===(e=this.player)||void 0===e?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;var n=yi.format(this.startTime);t.add("".concat(this.langText.preText).concat(n),4e3,!0)}}},{key:"saveTimeByStorage",value:function(e,t){localStorage.setItem(e,t)}},{key:"getTimeByStorage",value:function(e){return localStorage.getItem(e)}}],[{key:"pluginName",get:function(){return"memoryPlay"}},{key:"defaultConfig",get:function(){return{getTime:null,saveTime:null,memoryId:""}}}]),n}(Qr),cV=function(e){u(i,e);var n=v(i);function i(){var e;return a(this,i),(e=n.apply(this,arguments))._infoItems=[],e}return l(i,[{key:"streamType",get:function(){return this.playerConfig.playerData.getCurrentStreamType()}},{key:"afterCreate",value:function(){var e=this;["flv","hls"].includes(this.streamType)?(this.player.on("error",(function(){return e._handleError()})),this.player.on("loadeddata",(function(){return e._handleLoadedData()}))):this.close()}},{key:"registerLanguageTexts",value:function(){return{DECODEFPS:{en:"decodeFps",zh:"解码效率"},DECODECOST:{en:"decodeCost",zh:"解码消耗"},FORMAT:{en:"format",zh:"格式"},FPS:{en:"fps",zh:"帧率"},BITRATE:{en:"birate",zh:"码率"},GOP:{en:"GOP",zh:"GOP"},RESOLUTION:{en:"resolution",zh:"分辨率"},ENCODETYPE:{en:"encodeType",zh:"编码方式"},BUFFEREND:{en:"bufferEnd",zh:"buffer水位"},CURRENTTIME:{en:"currentTime",zh:"播放进度"}}}},{key:"_getDefaultInfo",value:function(e){var n={h265Title:{key:"h265Title",label:"H265解码",type:"title"},decodeEfficiency:{key:"decodeEfficiency",label:"解码效率",labelTextKey:"DECODEFPS",value:e.decodeFps,render:function(e){return e+"frames/s"}},decodeCost:{key:"decodeCost",label:"解码消耗",labelTextKey:"DECODECOST",value:e.decodeFps,render:function(e){return e?(1e3/e).toFixed()+"ms":""}}};return t({format:{key:"format",label:"格式",labelTextKey:"FORMAT",value:e.format},framerate:{key:"framerate",label:"帧率",labelTextKey:"FPS",value:e.fps,render:function(e){return"".concat(e," fps")}},bitrate:{key:"bitrate",label:"码率",labelTextKey:"BITRATE",value:e.bitrate,render:function(e){return"".concat(e/1e3," kbps")}},gop:{key:"gop",label:"GOP",labelTextKey:"GOP",value:e.gop,render:function(e){return"".concat(e," frames")}},resolution:{key:"resolution",label:"视频分辨率",labelTextKey:"RESOLUTION",value:{width:e.width,height:e.height},render:function(e){return"".concat(e.width," * ").concat(e.height)}},encodeType:{key:"encodeType",label:"编码方式",labelTextKey:"ENCODETYPE",value:e.encodeType},bufferEnd:{key:"bufferEnd",label:"buffer水位",labelTextKey:"BUFFEREND",value:e.bufferEnd},currentTime:{key:"currentTime",label:"播放进度",labelTextKey:"CURRENTTIME",value:e.currentTime,render:function(e){return e?e.toFixed(6)+"s":""}}},e.isOpenSoftDecoding&&this.config.showH265Info?n:{})}},{key:"_init",value:function(){var e=this,t=this._initDom(this._getInfoListData());this._infoItems=new Proxy(t,{set:function(t,n,i){return e._updateDom(t[n].dom,i),Reflect.set(t,n,i)}}),this._tick()}},{key:"_getStats",value:function(){var e,t;return"flv"===this.streamType?null===(e=this.player.plugins.flv)||void 0===e?void 0:e.getStats():"hls"===this.streamType?null===(t=this.player.plugins.hls)||void 0===t?void 0:t.getStats():{}}},{key:"_getInfoListData",value:function(){var e=this._getStats()||{};return this._getDefaultInfo(Object.assign(e,{format:"".concat(this.streamType,"_live"),isOpenSoftDecoding:"live-video"==this.playerConfig.mediaType}))}},{key:"_initDom",value:function(e){var t=this,n=this.find(".veplayer-livepanel-container");return n.innerHTML="",Object.values(e).forEach((function(e){var i=yi.createDom("veplayer-livepanel-div","",void 0,"veplayer-livepanel-container-row");"title"===e.type?t._updateTitle(i,e):t._updateDom(i,e),n.appendChild(i),e.dom=i})),e}},{key:"_updateTitle",value:function(e,t){e.innerHTML="";var n=yi.createDom("veplayer-livepanel-span",t.label,void 0,"veplayer-livepanel-container-row-title");e.appendChild(n)}},{key:"_updateDom",value:function(e,t){e.innerHTML="";var n=yi.createDom("veplayer-livepanel-span",this._renderLabel(t),void 0,"veplayer-livepanel-container-row-label");if(e.appendChild(n),"title"!==t.type){var i=yi.createDom("veplayer-livepanel-span",this._renderValue(t));e.appendChild(i)}}},{key:"_renderLabel",value:function(e){return e.labelTextKey&&this.langText[e.labelTextKey]}},{key:"_renderValue",value:function(e){return e.render?e.render(e.value):e.value}},{key:"_handleDataChange",value:function(){var e=this,n=this._getInfoListData();Object.values(this._infoItems).forEach((function(i){"title"!==i.type&&e._renderValue(i)!==e._renderValue(n[i.key])&&(e._infoItems[i.key]=t(t({},i),n[i.key]))}))}},{key:"_tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e._tick()}),500)}},{key:"_poll",value:function(){this._handleDataChange()}},{key:"destroy",value:function(){clearTimeout(this._pollTimer)}},{key:"_handleError",value:function(){this._close()}},{key:"_handleLoadedData",value:function(){this.config.visible&&this._open()}},{key:"_open",value:function(){var e=this.find(".veplayer-livepanel-container");yi.removeClass(e,"veplayer-livepanel-hidden"),this._init()}},{key:"_close",value:function(){var e=this.find(".veplayer-livepanel-container");yi.addClass(e,"veplayer-livepanel-hidden"),clearTimeout(this._pollTimer)}},{key:"open",value:function(){this._open(),this.config.visible=!0}},{key:"close",value:function(){this._close(),this.config.visible=!1}},{key:"render",value:function(){return'\n <xg-livepanel class="xgplayer-livepanel">\n <xg-livepanel-container class="veplayer-livepanel-container '.concat(!this.config.visible&&"veplayer-livepanel-hidden",'">\n </xg-livepanel-container></xg-livepanel>\n ')}}],[{key:"pluginName",get:function(){return"LiveInfoPanel"}},{key:"defaultConfig",get:function(){return{visible:!0,showH265Info:!1}}}]),i}(Qr),uV=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n)}(YF);return uV.Music=$F,uV.LiveSubtitlesIconPlugin=JF,uV.LiveSubtitlesPlugin=qF,uV.DefinitionDemotePlugin=ZF,uV.TimeShiftPlugin=tV,uV.MirrorPlugin=sV,uV.MemoryPlay=lV,uV.Subtitle=LU,uV.Service=$s,uV.LiveInfoPanel=cV,uV.Event=pM,uV.getI18N=function(){return uo},uV.BasePlugin=Vr,uV.Plugin=Qr,uV.Sniffer=Si,uV.Util=yi,uV.STATE_CLASS=io,uV.I18N=uo,uV.STATES=ho,uV.SdkPlugin=wF,uV}));
|