@byteplus/veplayer 1.8.1 → 2.3.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/LICENSE +18 -0
- package/README.md +6 -39
- package/esm/index.d.ts +3167 -0
- package/esm/veplayer.biz.live.development.css +41 -0
- package/esm/veplayer.biz.live.development.js +3400 -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 +6921 -0
- package/esm/veplayer.development.css +743 -0
- package/esm/veplayer.development.js +22032 -0
- package/esm/veplayer.live.d.ts +6923 -0
- package/esm/veplayer.live.development.css +743 -0
- package/esm/veplayer.live.development.js +22031 -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 +3167 -0
- package/esm/veplayer.vod.development.css +702 -0
- package/esm/veplayer.vod.development.js +13861 -0
- package/esm/veplayer.vod.production.css +1 -0
- package/esm/veplayer.vod.production.js +11 -0
- package/package.json +78 -8
- package/umd/index.d.ts +3167 -0
- package/umd/veplayer.biz.live.development.css +41 -0
- package/umd/veplayer.biz.live.development.js +3412 -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 +30 -0
- package/umd/veplayer.biz.vod.production.js +1 -0
- package/umd/veplayer.d.ts +6921 -0
- package/umd/veplayer.development.css +743 -0
- package/umd/veplayer.development.js +22035 -0
- package/umd/veplayer.live.d.ts +6923 -0
- package/umd/veplayer.live.development.css +743 -0
- package/umd/veplayer.live.development.js +22043 -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 +3167 -0
- package/umd/veplayer.vod.development.css +702 -0
- package/umd/veplayer.vod.development.js +13876 -0
- package/umd/veplayer.vod.production.css +1 -0
- package/umd/veplayer.vod.production.js +1 -0
- package/veplayer.d.ts +6921 -0
- package/veplayer.live.d.ts +6923 -0
- package/veplayer.vod.d.ts +3167 -0
- package/index.d.ts +0 -3974
- package/index.min.css +0 -1
- package/index.min.js +0 -2
package/index.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @byteplus/veplayer@1.8.1 Built @Wed, 31 Jan 2024 11:51:06 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 i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(){i=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,i){e[t]=i.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(D){u=function(e,t,i){return e[t]=i}}function h(e,t,i,n){var r=t&&t.prototype instanceof y?t:y,a=Object.create(r.prototype),s=new I(n||[]);return o(a,"_invoke",{value:x(e,i,s)}),a}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(n){return{type:"throw",arg:n}}}t.wrap=h;var f="suspendedStart",p="executing",g="completed",v={};function y(){}function m(){}function _(){}var b={};u(b,s,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(L([])));w&&w!==n&&r.call(w,s)&&(b=w);var T=_.prototype=y.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function i(n,o,a,s){var l=d(e[n],e,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var n;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,n){i(e,r,t,n)}))}return n=n?n.then(o,o):o()}})}function x(t,i,n){var r=f;return function(o,a){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=E(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=d(t,i,n);if("normal"===c.type){if(r=n.done?g:"suspendedYield",c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=g,n.method="throw",n.arg=c.arg)}}}function E(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,E(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=d(r,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,v;var a=o.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,v):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function P(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function L(t){if(t||""===t){var i=t[s];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function i(){for(;++n<t.length;)if(r.call(t,n))return i.value=t[n],i.done=!1,i;return i.value=e,i.done=!0,i};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=_,o(T,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:m,configurable:!0}),m.displayName=u(_,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,c,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},S(C.prototype),u(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,i,n,r,o){void 0===o&&(o=Promise);var a=new C(h(e,i,n,r),o);return t.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(T),u(T,c,"Generator"),u(T,s,(function(){return this})),u(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(n,r){return s.type="throw",s.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;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,v):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),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),O(i),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;O(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:L(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function n(e){return(n="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,i,n,r,o,a){try{var s=e[o](a),l=s.value}catch(c){return void i(c)}s.done?t(l):Promise.resolve(l).then(n,r)}function o(e){return function(){var t=this,i=arguments;return new Promise((function(n,o){var a=e.apply(t,i);function s(e){r(a,n,o,s,l,"next",e)}function l(e){r(a,n,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 i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T(n.key),n)}}function l(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,i){return(t=T(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,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 i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}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(Kl){return!1}}();return function(){var i,n=h(e);if(t){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return g(this,i)}}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,i){var n=y(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},m.apply(this,arguments)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,a,s=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&null!=i.return&&(a=i.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 i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function T(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;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 i=e.length;i--;)if(S(e[i][0],t))return i;return-1}var x=Array.prototype.splice;function E(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}E.prototype.clear=function(){this.__data__=[],this.size=0},E.prototype.delete=function(e){var t=this.__data__,i=C(t,e);return!(i<0)&&(i==t.length-1?t.pop():x.call(t,i,1),--this.size,!0)},E.prototype.get=function(e){var t=this.__data__,i=C(t,e);return i<0?void 0:t[i][1]},E.prototype.has=function(e){return C(this.__data__,e)>-1},E.prototype.set=function(e,t){var i=this.__data__,n=C(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var P="object"==("undefined"==typeof global?"undefined":n(global))&&global&&global.Object===Object&&global,O="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,I=P||O||Function("return this")(),L=I.Symbol,D=Object.prototype,A=D.hasOwnProperty,M=D.toString,R=L?L.toStringTag:void 0;var N=Object.prototype.toString;var j=L?L.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),i=e[R];try{e[R]=void 0;var n=!0}catch(Kl){}var r=M.call(e);return n&&(t?e[R]=i:delete e[R]),r}(e):function(e){return N.call(e)}(e)}function U(e){var t=n(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=I["__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(Kl){}try{return e+""}catch(Kl){}}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 i=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(i)?i:void 0}var ee=Q(I,"Map"),te=Q(Object,"create");var ie=Object.prototype.hasOwnProperty;var ne=Object.prototype.hasOwnProperty;function re(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function oe(e,t){var i,r,o=e.__data__;return("string"==(r=n(i=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?o["string"==typeof t?"string":"hash"]:o.map}function ae(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[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 i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return ie.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:ne.call(t,e)},re.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[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||E),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 i=oe(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function se(e){var t=this.__data__=new E(e);this.size=t.size}se.prototype.clear=function(){this.__data__=new E,this.size=0},se.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},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 i=this.__data__;if(i instanceof E){var n=i.__data__;if(!ee||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new ae(n)}return i.set(e,t),this.size=i.size,this};var le=function(){try{var e=Q(Object,"defineProperty");return e({},"",{}),e}catch(Kl){}}(),ce=le;function ue(e,t,i){"__proto__"==t&&ce?ce(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var he=Object.prototype.hasOwnProperty;function de(e,t,i){var n=e[t];he.call(e,t)&&S(n,i)&&(void 0!==i||t in e)||ue(e,t,i)}function fe(e,t,i,n){var r=!i;i||(i={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=n?n(i[s],e[s],s,i,e):void 0;void 0===l&&(l=e[s]),r?ue(i,s,l):de(i,s,l)}return i}function pe(e){return null!=e&&"object"==n(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":n(exports))&&exports&&!exports.nodeType&&exports,Te=we&&"object"==("undefined"==typeof module?"undefined":n(module))&&module&&!module.nodeType&&module,Se=Te&&Te.exports===we?I.Buffer:void 0,Ce=(Se?Se.isBuffer:void 0)||function(){return!1},xe=/^(?:0|[1-9]\d*)$/;function Ee(e,t){var i=n(e);return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&xe.test(e))&&e>-1&&e%1==0&&e<t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Oe={};function Ie(e){return function(t){return e(t)}}Oe["[object Float32Array]"]=Oe["[object Float64Array]"]=Oe["[object Int8Array]"]=Oe["[object Int16Array]"]=Oe["[object Int32Array]"]=Oe["[object Uint8Array]"]=Oe["[object Uint8ClampedArray]"]=Oe["[object Uint16Array]"]=Oe["[object Uint32Array]"]=!0,Oe["[object Arguments]"]=Oe["[object Array]"]=Oe["[object ArrayBuffer]"]=Oe["[object Boolean]"]=Oe["[object DataView]"]=Oe["[object Date]"]=Oe["[object Error]"]=Oe["[object Function]"]=Oe["[object Map]"]=Oe["[object Number]"]=Oe["[object Object]"]=Oe["[object RegExp]"]=Oe["[object Set]"]=Oe["[object String]"]=Oe["[object WeakMap]"]=!1;var Le="object"==("undefined"==typeof exports?"undefined":n(exports))&&exports&&!exports.nodeType&&exports,De=Le&&"object"==("undefined"==typeof module?"undefined":n(module))&&module&&!module.nodeType&&module,Ae=De&&De.exports===Le&&P.process,Me=function(){try{var e=De&&De.require&&De.require("util").types;return e||Ae&&Ae.binding&&Ae.binding("util")}catch(Kl){}}(),Re=Me&&Me.isTypedArray,Ne=Re?Ie(Re):function(e){return pe(e)&&Pe(e.length)&&!!Oe[B(e)]},je=Object.prototype.hasOwnProperty;function Be(e,t){var i=ke(e),n=!i&&be(e),r=!i&&!n&&Ce(e),o=!i&&!n&&!r&&Ne(e),a=i||n||r||o,s=a?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(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)||Ee(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(i){return e(t(i))}}var Ve=Fe(Object.keys,Object),ze=Object.prototype.hasOwnProperty;function Ge(e){return null!=e&&Pe(e.length)&&!H(e)}function We(e){return Ge(e)?Be(e):function(e){if(!He(e))return Ve(e);var t=[];for(var i in Object(e))ze.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ke=Object.prototype.hasOwnProperty;function $e(e){if(!U(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=He(e),i=[];for(var n in e)("constructor"!=n||!t&&Ke.call(e,n))&&i.push(n);return i}function Ye(e){return Ge(e)?Be(e,!0):$e(e)}var qe="object"==("undefined"==typeof exports?"undefined":n(exports))&&exports&&!exports.nodeType&&exports,Xe=qe&&"object"==("undefined"==typeof module?"undefined":n(module))&&module&&!module.nodeType&&module,Je=Xe&&Xe.exports===qe?I.Buffer:void 0,Ze=Je?Je.allocUnsafe:void 0;function Qe(){return[]}var et=Object.prototype.propertyIsEnumerable,tt=Object.getOwnPropertySymbols,it=tt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,o=[];++i<n;){var a=e[i];t(a,i,e)&&(o[r++]=a)}return o}(tt(e),(function(t){return et.call(e,t)})))}:Qe,nt=it;function rt(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}var ot=Fe(Object.getPrototypeOf,Object),at=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)rt(t,nt(e)),e=ot(e);return t}:Qe,st=at;function lt(e,t,i){var n=t(e);return ke(e)?n:rt(n,i(e))}function ct(e){return lt(e,We,nt)}function ut(e){return lt(e,Ye,st)}var ht=Q(I,"DataView"),dt=Q(I,"Promise"),ft=Q(I,"Set"),pt=Q(I,"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),i="[object Object]"==t?e.constructor:void 0,n=i?W(i):"";if(n)switch(n){case bt:return _t;case kt:return gt;case wt:return vt;case Tt:return yt;case St:return mt}return t});var xt=Ct,Et=Object.prototype.hasOwnProperty;var Pt=I.Uint8Array;function Ot(e){var t=new e.constructor(e.byteLength);return new Pt(t).set(new Pt(e)),t}var It=/\w*$/;var Lt=L?L.prototype:void 0,Dt=Lt?Lt.valueOf:void 0;function At(e,t,i){var n,r,o,a=e.constructor;switch(t){case"[object ArrayBuffer]":return Ot(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return function(e,t){var i=t?Ot(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);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 i=t?Ot(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(e,i);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,It.exec(r))).lastIndex=r.lastIndex,o;case"[object Symbol]":return n=e,Dt?Object(Dt.call(n)):{}}}var Mt=Object.create,Rt=function(){function e(){}return function(t){if(!U(t))return{};if(Mt)return Mt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}(),Nt=Rt;var jt=Me&&Me.isMap,Bt=jt?Ie(jt):function(e){return pe(e)&&"[object Map]"==xt(e)};var Ut=Me&&Me.isSet,Ht=Ut?Ie(Ut):function(e){return pe(e)&&"[object Set]"==xt(e)},Ft="[object Arguments]",Vt="[object Function]",zt="[object Object]",Gt={};function Wt(e,t,i,n,r,o){var a,s=1&t,l=2&t,c=4&t;if(i&&(a=r?i(e,n,r,o):i(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,i=new e.constructor(t);return t&&"string"==typeof e[0]&&Et.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return function(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}(e,a)}else{var h=xt(e),d=h==Vt||"[object GeneratorFunction]"==h;if(Ce(e))return function(e,t){if(t)return e.slice();var i=e.length,n=Ze?Ze(i):new e.constructor(i);return e.copy(n),n}(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,nt(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(n){a.add(Wt(n,t,i,n,e,o))})):Bt(e)&&e.forEach((function(n,r){a.set(r,Wt(n,t,i,r,e,o))}));var p=u?void 0:(c?l?ut:ct:l?Ye:We)(e);return function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););}(p||e,(function(n,r){p&&(n=e[r=n]),de(a,r,Wt(n,t,i,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,i=null==e?0:e.length;for(this.__data__=new ae;++t<i;)this.add(e[t])}function Yt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,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,i,n,r,o){var a=1&i,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&i?new $t:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var v=a?n(g,p,h,t,e,o):n(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,i,n,o)))return f.push(t)}))){d=!1;break}}else if(p!==g&&!r(p,g,i,n,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Jt(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Zt(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var Qt=L?L.prototype:void 0,ei=Qt?Qt.valueOf:void 0;var ti=Object.prototype.hasOwnProperty;var ii="[object Arguments]",ni="[object Array]",ri="[object Object]",oi=Object.prototype.hasOwnProperty;function ai(e,t,i,n,r,o){var a=ke(e),s=ke(t),l=a?ni:xt(e),c=s?ni:xt(t),u=(l=l==ii?ri:l)==ri,h=(c=c==ii?ri:c)==ri,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,i,n,r,o):function(e,t,i,n,r,o,a){switch(i){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 Pt(e),new Pt(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&n;if(s||(s=Zt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var u=Xt(s(e),s(t),n,r,o,a);return a.delete(e),u;case"[object Symbol]":if(ei)return ei.call(e)==ei.call(t)}return!1}(e,t,l,i,n,r,o);if(!(1&i)){var f=u&&oi.call(e,"__wrapped__"),p=h&&oi.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,i,n,o)}}return!!d&&(o||(o=new se),function(e,t,i,n,r,o){var a=1&i,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:ti.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(n)var y=a?n(v,g,u,t,e,o):n(g,v,u,e,t,o);if(!(void 0===y?g===v||r(g,v,i,n,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,i,n,r,o))}function si(e,t,i,n,r){return e===t||(null==e||null==t||!pe(e)&&!pe(t)?e!=e&&t!=t:ai(e,t,i,n,si,r))}function li(e){return e==e&&!U(e)}function ci(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function ui(e){var t=function(e){for(var t=We(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,li(r)]}return t}(e);return 1==t.length&&t[0][2]?ci(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,o=r,a=!n;if(null==e)return!o;for(e=Object(e);r--;){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var l=(s=i[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(n)var d=n(c,u,l,e,t,h);if(!(void 0===d?si(u,c,3,n,h):d))return!1}}return!0}(i,e,t)}}function hi(e){return"symbol"==n(e)||pe(e)&&"[object Symbol]"==B(e)}var di=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/;function pi(e,t){if(ke(e))return!1;var i=n(e);return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!hi(e))||(fi.test(e)||!di.test(e)||null!=t&&e in Object(t))}function gi(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function i(){var n=arguments,r=t?t.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var a=e.apply(this,n);return i.cache=o.set(r,a)||o,a};return i.cache=new(gi.Cache||ae),i}gi.Cache=ae;var vi,yi,mi,_i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bi=/\\(\\)?/g,ki=(vi=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_i,(function(e,i,n,r){t.push(n?r.replace(bi,"$1"):i||e)})),t},yi=gi(vi,(function(e){return 500===mi.size&&mi.clear(),e})),mi=yi.cache,yi),wi=ki;var Ti=L?L.prototype:void 0,Si=Ti?Ti.toString:void 0;function Ci(e){if("string"==typeof e)return e;if(ke(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}(e,Ci)+"";if(hi(e))return Si?Si.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function xi(e,t){return ke(e)?e:pi(e,t)?[e]:wi(function(e){return null==e?"":Ci(e)}(e))}function Ei(e){if("string"==typeof e||hi(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function Pi(e,t){for(var i=0,n=(t=xi(t,e)).length;null!=e&&i<n;)e=e[Ei(t[i++])];return i&&i==n?e:void 0}function Oi(e,t,i){var n=null==e?void 0:Pi(e,t);return void 0===n?i:n}function Ii(e,t){return null!=e&&t in Object(e)}function Li(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=xi(t,e)).length,o=!1;++n<r;){var a=Ei(t[n]);if(!(o=null!=e&&i(e,a)))break;e=e[a]}return o||++n!=r?o:!!(r=null==e?0:e.length)&&Pe(r)&&Ee(a,r)&&(ke(e)||be(e))}(e,t,Ii)}function Di(e){return e}function Ai(e){return pi(e)?(t=Ei(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Pi(t,e)}}(e);var t}function Mi(e){return"function"==typeof e?e:null==e?Di:"object"==n(e)?ke(e)?(t=e[0],i=e[1],pi(t)&&li(i)?ci(Ei(t),i):function(e){var n=Oi(e,t);return void 0===n&&n===i?Li(e,t):si(i,n,3)}):ui(e):Ai(e);var t,i}function Ri(e){return e!=e}function Ni(e,t){return!!(null==e?0:e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=i-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var r=e.length,o=i+(n?1:-1);n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}(e,Ri,i)}(e,t,0)>-1}function ji(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}var Bi=ft&&1/Zt(new ft([,-0]))[1]==1/0?function(e){return new ft(e)}:function(){};function Ui(e,t){return e&&e.length?function(e,t,i){var n=-1,r=Ni,o=e.length,a=!0,s=[],l=s;if(i)a=!1,r=ji;else if(o>=200){var c=t?null:Bi(e);if(c)return Zt(c);a=!1,r=qt,l=new $t}else l=t?[]:s;e:for(;++n<o;){var u=e[n],h=t?t(u):u;if(u=i||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,i)||(l!==s&&l.push(h),s.push(u))}return s}(e,Mi(t)):[]}var Hi=function(e){return e.H265="h265",e.H264="h264",e.UNKNOWN="unknown",e}(Hi||{}),Fi=function(e){return e.H264="h264",e}(Fi||{}),Vi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},zi=function(){var e,t=null;function i(e){return!!e&&("object"===n(e)||"function"==typeof e)}function r(e){if(null!==e&&!i(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 i(t)?t:null}:l);return e=function(n,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!i(n)||!i(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");var h=function(){};t=function(){n=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(n),v=!1,y=!1;"function"==typeof n?(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,n,t);if(!e&&u.apply)return u.apply(n,this,t);if(e){t.unshift(n);var i=n.bind.apply(n,t);return new i}return n.apply(this,t)},v=!0):n 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(n),k={};b.forEach((function(e){if(!v&&!y||!(e in p)){var t=o.getOwnPropertyDescriptor(n,e),i={enumerable:Boolean(t.enumerable),get:m.bind(n,e),set:_.bind(n,e)};o.defineProperty(p,e,i),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 n)k[S]||o.defineProperty(p,S,{get:m.bind(n,S)});return o.seal(n),o.seal(p),p},e.revocable=function(i,n){return{proxy:new e(i,n),revoke:t}},e}(),Gi=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,i=new zi(e,{set:function(e,n,r){var o=Reflect.get(e,n);Reflect.set(e,n,r);var a=t.watcherMap.get(i);return a&&(t.flushCallback(a),t.flushPropertyCallback(a,n,o,r)),!0}});return this.watcherMap.set(i,{pending:!1,queue:[],property:{}}),i}},{key:"subscribe",value:function(e,t){var i=this.watcherMap.get(e);if(i)return this.subscribeId++,i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}},{key:"unsubscribe",value:function(e,t){var i=this.watcherMap.get(e);if(i){var n=i.queue,r=n.findIndex((function(e){return e.id===t}));void 0!==r&&r>-1&&n.splice(r,1)}}},{key:"subscribeProperty",value:function(e,t,i){var n=this.watcherMap.get(e);n&&(this.subscribeId++,n.property[t]||(n.property[t]={pending:!1,timer:0,pre:null,queue:[]}),n.property[t].queue.push({id:this.subscribeId,callback:i}))}},{key:"unsubscribeProperty",value:function(e,t,i){var n=this.watcherMap.get(e);if(n){var r=n.property[t];if(r){var o=r.queue,a=o.findIndex((function(e){return e.id===i}));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,i,n){var r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=i),r.timer=setTimeout((function(){r.queue.forEach((function(e){return e.callback(r.pre,n)})),r.pending=!1}),0))}}]),e}());function Wi(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ki(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(i),!0).forEach((function(t){Ji(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wi(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return 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 Yi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qi(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cn(n.key),n)}}function Xi(e,t,i){return t&&qi(e.prototype,t),i&&qi(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ji(e,t,i){return(t=cn(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Zi(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&&en(e,t)}function Qi(e){return(Qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function en(e,t){return(en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function tn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nn(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return tn(e)}function rn(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(Kl){return!1}}();return function(){var i,n=Qi(e);if(t){var r=Qi(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return nn(this,i)}}function on(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Qi(e)););return e}function an(){return an="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=on(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},an.apply(this,arguments)}function sn(e){return function(e){if(Array.isArray(e))return ln(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 ln(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ln(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 ln(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function cn(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}var un={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),l=i?i+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 n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+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,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,o),!0;case 6:return u.fn.call(u.context,t,n,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,n);break;case 4:u[c].fn.call(u[c].context,t,n,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,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,r){var o=i?i+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||n&&s.context!==n||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||r&&!s[l].once||n&&s[l].context!==n)&&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=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(un);var hn=un.exports,dn="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,fn={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},pn="%c[xgplayer]",gn={config:{debug:dn?3:0},logInfo:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[pn,fn.info,e].concat(n))},logWarn:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[pn,fn.warn,e].concat(n))},logError:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console)[i].apply(t,[pn,fn.error,e].concat(r))}}};var vn=function(){function e(t){Yi(this,e),this.bufferedList=t}return Xi(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}(),yn={};function mn(e,t){for(var i=0,n=t.length;i<n;i++)if(e.indexOf(t[i])>-1)return!0;return!1}function _n(e){var t=$i(e);return null!==e&&("object"===t||"function"===t)}function bn(e,t,i){var n,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 i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}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 i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function m(){var e=Date.now();if(y(e))return _(e);s=g(m,function(e){var i=e-c,n=t-(e-l);return h?Math.min(n,o-i):n}(e))}function _(e){return s=void 0,d&&n?p(e):(n=r=void 0,a)}function b(){for(var e=Date.now(),i=y(e),o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];if(n=c,r=this,l=e,i){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,_n(i)&&(u=!!i.leading,o=(h="maxWait"in i)?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d),b.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,n=l=r=s=void 0},b.flush=function(){return void 0===s?a:_(Date.now())},b.pending=function(){return void 0!==s},b}yn.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r},yn.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var r=n.children;return n=null,r.length>0?(r=r[0],i&&yn.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return gn.logError("util.createDomFromHtml",o),null}},yn.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(Kl){var i=e.className&&"object"===$i(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},yn.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(Kl){yn.hasClass(e,t)||(e.className&&"object"===$i(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},yn.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(Kl){yn.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===$i(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},yn.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){yn.hasClass(e,t)?yn.removeClass(e,t):yn.addClass(e,t)}))},yn.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===yn.typeOf(e[i])?t.push(e[i]):"Object"===yn.typeOf(e[i])&&Object.keys(e[i]).map((function(n){e[i][n]&&t.push(n)}))},n=0;n<arguments.length;n++)i(n);return t.join(" ")},yn.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,i=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(i)}catch(Kl){gn.logError("util.findDom",Kl),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},yn.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},yn.padStart=function(e,t,i){for(var n=String(i),r=t>>0,o=Math.ceil(r/n.length),a=[],s=String(e);o--;)a.push(n);return a.join("").substring(0,r-s.length)+s},yn.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=yn.padStart(Math.floor(e/3600),2,0),i=yn.padStart(Math.floor((e-3600*t)/60),2,0),n=yn.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},yn.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},yn.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},yn.deepCopy=function(e,t){if("Object"===yn.typeOf(t)&&"Object"===yn.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==yn.typeOf(t[i])||t[i]instanceof Node?"Array"===yn.typeOf(t[i])?e[i]="Array"===yn.typeOf(e[i])?e[i].concat(t[i]):t[i]:e[i]=t[i]:void 0===e[i]||void 0===e[i]?e[i]=t[i]:yn.deepCopy(e[i],t[i])})),e},yn.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===yn.typeOf(t[i])&&"Array"===yn.typeOf(e[i])?"Array"===yn.typeOf(e[i])&&(n=e[i]).push.apply(n,sn(t[i])):yn.typeOf(e[i])!==yn.typeOf(t[i])||null===e[i]||"Object"!==yn.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):yn.deepMerge(e[i],t[i])})),e},yn.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var i=document.createElement("a");return i.href=t.replace(/url\("|"\)/g,""),i.href},yn.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""},yn.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},yn.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},yn.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),yn.clearTimeout(e,n)}),i);return e._timers.push(n),n},yn.clearTimeout=function(e,t){var i=e._timers;if("Array"===yn.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},yn.clearAllTimers=function(e){var t=e._timers;"Array"===yn.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},yn.createImgBtn=function(e,t,i,n){var r,o,a,s=yn.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),i&&n)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(i.indexOf(e)>-1&&n.indexOf(e)>-1)||(r=parseFloat(i.slice(0,i.indexOf(e)).trim()),o=parseFloat(n.slice(0,n.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},yn.Hex2RGBA=function(e,t){var i=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var n="#";e.replace(/[0-9A-F]/gi,(function(e){n+=e+e})),e=n}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){i.push(parseInt(e,16))})),"rgba(".concat(i.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},yn.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},yn.checkIsFunction=function(e){return e&&"function"==typeof e},yn.checkIsObject=function(e){return null!==e&&"object"===$i(e)},yn.hide=function(e){e.style.display="none"},yn.show=function(e,t){e.style.display=t||"block"},yn.isUndefined=function(e){if(null==e)return!0},yn.isNotNull=function(e){return!(null==e)},yn.setStyleFromCsstext=function(e,t){t&&("String"===yn.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var i=t.split(":");i.length>1&&(e.style[i[0]]=i[1])}})):Object.keys(t).map((function(i){e.style[i]=t[i]})))},yn.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"],i=e.style.cssText;if(!i)return{};var n=i.replace(/\s+/g,"").split(";"),r={},o={};return n.map((function(e){if(e){var i=e.split(":");i.length>1&&(mn(i[0],t)?r[i[0]]=i[1]:o[i[0]]=i[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},yn.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var i=t.replace(/\s+/g,"").split(";"),n={};return i.map((function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},yn.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,i&&i(e)},n.src=e}},yn.stopPropagation=function(e){e&&e.stopPropagation()},yn.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},yn.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},yn.checkTouchSupport=function(){return"ontouchstart"in window},yn.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=[],n=0;n<e.length;n++)i.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});i.sort((function(e,t){var i=e.start-t.start;return i||t.end-e.end}));var r=[];if(t)for(var o=0;o<i.length;o++){var a=r.length;if(a){var s=r[a-1].end;i[o].start-s<t?i[o].end>s&&(r[a-1].end=i[o].end):r.push(i[o])}else r.push(i[o])}else r=i;return new vn(r)},yn.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}},yn.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},yn.getHostFromUrl=function(e){if("String"!==yn.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},yn.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},yn.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},yn.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},yn.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(Kl){e=0}t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now()));var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}));return i},yn.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},yn.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},yn.createPositionBar=function(e,t){var i=yn.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},yn.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")},n=Object.keys(i);return n.forEach((function(e){var n=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(i[e],")");n.test(t)?(n.lastIndex=-1,t=t.replace(n,r)):t+="".concat(r," ")})),t},yn.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},yn.getIndexByTime=function(e,t){var i=t.length,n=-1;if(i<1)return n;if(e<=t[0].end||i<2)n=0;else if(e>t[i-1].end)n=i-1;else for(var r=1;r<i;r++)if(e>t[r-1].end&&e<=t[r].end){n=r;break}return n},yn.getOffsetCurrentTime=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=i>=0&&i<t.length?i:yn.getIndexByTime(e,t))<0)return-1;var r=t.length,o=t[n],a=o.start,s=o.end,l=o.cTime,c=o.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&n>=r-1?s:-1},yn.getCurrentTimeByOffset=function(e,t){var i=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){i=n;break}if(-1!==i){var r=t[i].start;return i-1<0?r+e:r+(e-t[i-1].duration)}return e};var kn=/(Android)\s([\d.]+)/,wn=/(Version)\/([\d.]+)/,Tn=["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"],Sn={get device(){return Sn.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(i){return t[i].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,a=o||n&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:s,isIpad:o,isIos:s||o,isAndroid:n,isPc:!(s||n||i||a),isSymbian:i,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?wn:kn)?t.exec(e):[];if(i&&i.length>=3){var n=i[2].split(".");return n.length>0?parseInt(n[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&&Tn.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),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 i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(Kl){return Promise.resolve(t)}}},Cn="3.0.12-alpha.5",xn={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},En={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Pn=Xi((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};Yi(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var r=i.mediaError?i.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=i.errorCode||r.code;En[f]&&(f=En[f]);var p={playerVersion:Cn,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:i.errorType,errorCode:f,message:i.errorMessage||r.message,mediaError:r,originError:i.originError?i.originError.stack:"",host:yn.getHostFromUrl(l||c)};return i.ext&&Object.keys(i.ext).map((function(e){p[e]=i.ext[e]})),p}if(arguments.length>1){for(var g={playerVersion:Cn,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=n?(n[arguments[0]]||{}).msg:"",g}})),On="play",In="playing",Ln="ended",Dn="pause",An="error",Mn="seeking",Rn="seeked",Nn="timeupdate",jn="waiting",Bn="canplay",Un="durationchange",Hn="volumechange",Fn="loadeddata",Vn="ratechange",zn="progress",Gn="loadstart",Wn="emptied",Kn="focus",$n="blur",Yn="ready",qn="urlNull",Xn="autoplay_started",Jn="autoplay_was_prevented",Zn="complete",Qn="replay",er="destroy",tr="urlchange",ir="download_speed_change",nr="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:Jn,AUTOPLAY_STARTED:Xn,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:Bn,CANPLAY_THROUGH:"canplaythrough",COMPLETE:Zn,CSS_FULLSCREEN_CHANGE:rr,DEFINITION_CHANGE:ar,DESTROY:er,DOWNLOAD_SPEED_CHANGE:ir,DURATION_CHANGE:Un,EMPTIED:Wn,ENDED:Ln,ERROR:An,FPS_STUCK:wr,FULLSCREEN_CHANGE:nr,LOADED_DATA:Fn,LOADED_METADATA:"loadedmetadata",LOAD_START:Gn,MINI_STATE_CHANGE:or,PAUSE:Dn,PIP_CHANGE:ur,PLAY:On,PLAYER_BLUR:$n,PLAYER_FOCUS:Kn,PLAYING:In,PLAYNEXT:fr,PROGRESS:zn,RATE_CHANGE:Vn,READY:Yn,REPLAY:Qn,RESET:yr,RETRY:"retry",ROTATE:hr,SCREEN_SHOT:dr,SEEKED:Rn,SEEKING:Mn,SEI_PARSED:lr,SHORTCUT:pr,SOURCE_ERROR:mr,SOURCE_SUCCESS:_r,STALLED:"stalled",STATS_EVENTS:kr,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:Nn,URL_CHANGE:tr,URL_NULL:qn,USER_ACTION:vr,VIDEO_EVENTS:br,VIDEO_RESIZE:cr,VOLUME_CHANGE:Hn,WAITING:jn,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(i,n){var r={player:t,eventName:e,originalEvent:i,detail:i.detail||{},timeStamp:i.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[i.type],muted:t.muted,volume:t.volume,host:yn.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(i.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=n||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 xr=function(e){Zi(i,e);var t=rn(i);function i(e){var n;Yi(this,i),(n=t.call(this,e))._hasStart=!1,n._currentTime=0,n._duration=0,n._internalOp={},n._lastMuted=!1,n.vtype="MP4",n._rate=-1,n.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 Sn.isWeixin&&Sn.os.isAndroid&&r&&(n.mediaConfig["x5-video-player-type"]=r,delete n.mediaConfig.playsinline,delete n.mediaConfig["webkit-playsinline"],delete n.mediaConfig["x5-playsinline"]),e.loop&&(n.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(n.mediaConfig,"muted")&&(n.mediaConfig.muted=!0),n.media=yn.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===yn.typeOf(e.volume)&&(n.volume=e.volume),e.autoplayMuted&&(n.media.muted=!0,n._lastMuted=!0),e.autoplay&&(n.media.autoplay=!0),n._interval={},n.mediaEventMiddleware={},n.attachVideoEvents(),n}return Xi(i,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(i){t.mediaEventMiddleware[i]=e[i]}))}},{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 i="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[i]&&e.on(t,e[i]),Ji({},t,Cr(t,e))}))),this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.addEventListener(i,e[i],!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 i=Object.keys(e)[0];t.removeEventListener(i,e[i],!1)})),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0],n="on".concat(i.charAt(0).toUpperCase()).concat(i.slice(1));"function"==typeof e[n]&&e.off(i,e[n])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var i=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){i.media.appendChild(yn.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var n=e.children;if(n){this._videoSourceCount=n.length,this._videoSourceIndex=n.length,this._vLoadeddata=function(e){i.emit(_r,{src:e.target.currentSrc,host:yn.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(i._videoSourceIndex--,0===i._videoSourceIndex||t>=i._videoSourceCount){var n={code:4,message:"sources_load_error"};r?r.error(e,n):i.errorHandler("error",n)}var o=xn[4];i.emit(mr,new Pn(i,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<n.length;a++)n[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 i=0;i<t.length;i++)t[i].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 i=this.media.error||t,n=i.code?xn[i.code]:"other";i.message;this.media.currentSrc||(i={code:6,message:"empty_src"}),this.emit(e,new Pn(this,{errorType:n,errorCode:i.code,errorMessage:i.message||"",mediaError:i}))}}},{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 i=this.media.currentTime;if(e)for(var n=0,r=e.length;n<r&&(t[0]=e.start(n),t[1]=e.end(n),!(t[0]<=i&&i<=t[1]));n++);return t[0]-i<=0&&i-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?yn.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 i=0;i<t.length;i++)if((t.start(i)<=this.currentTime||t.start(i)<.1)&&t.end(i)>=this.currentTime)return{start:t.start(i),end:t.end(i)};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(jn),this._currentTime=0,this._duration=0,yn.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===yn.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 n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=an(Qi(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=an(Qi(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=an(Qi(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=an(Qi(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){an(Qi(i.prototype),"removeAllListeners",this).call(this)}}]),i}(hn),Er=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"}};Yi(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return Xi(e,[{key:"openDB",value:function(e){var t=this,i=this,n=this.myDB.version||1,r=i.indexedDB.open(i.myDB.name,n);r.onerror=function(e){},r.onsuccess=function(n){t.myDB.db=n.target.result,e.call(i)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(i.myDB.ojstore.name)||t.createObjectStore(i.myDB.ojstore.name,{keyPath:i.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 i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.add(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.put(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,i){var n=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){i.call(n,null)},r.onsuccess=function(e){var t=e.target.result;i.call(n,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}(),Pr=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Or=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Ir=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Lr="data-xgplayerid";function Dr(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));i&&"function"==typeof i&&(a&&a.then?a.then((function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.call.apply(i,[e].concat(n))})):i.call.apply(i,[e].concat(r)))}function Ar(e,t){var i=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 n=arguments,r=this;if(i.pre)try{var o;(o=i.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(Kl){throw Kl.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(Kl.message),Kl}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,i.next].concat(sn(n)))})).catch((function(e){throw e})):Dr.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&Dr.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(Kl){throw Kl.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(Kl.message),Kl}else Dr.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function Mr(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(i&&(i[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function Rr(e,t){var i=this.__hooks;i&&delete i[e]}function Nr(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,n)}}function jr(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,n)}}}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,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return i.call.apply(i,[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:i.call.apply(i,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==s)return i.call.apply(i,[e,e].concat(r))}function Fr(e,t){gn.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var Vr=function(){function e(t){Yi(this,e),yn.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 Xi(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=yn.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 i=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){i.__events[e]=t,i.player.on(e,t)})):Fr(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(n){i.__onceEvents[n]=t,i.player.once(e,t)})):Fr(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(n){delete i.__events[e],i.player.off(n,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(i){e[t][i]&&e.off(i,e[t][i]),i&&delete e[t][i]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(n))}}},{key:"emitUserAction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=Ki(Ki({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{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 i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return Mr.call.apply(Mr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[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]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return i&&(t.pluginName=i),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,i=this.pluginName;this.offAll(),yn.clearAllTimers(this),yn.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),Ur(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&Object.defineProperty(e,i,t[i])}},{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,i,n,r){var o=Kr.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function Kr(e,t,i,n){return function(i){i.delegateTarget=Gr(i.target,t),i.delegateTarget&&n.call(e,i)}}var $r=function(e,t,i,n,r){return"function"==typeof e.addEventListener?Wr.apply(null,arguments):"function"==typeof i?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,i,n,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 i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=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 yn.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(Xr(e)||Xr(e.url))return n.src=Xr(e)?e:e.url||"",o=yn.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(yn.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(gn.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(Kl){return gn.logError("Plugin named [".concat(r,"]:createIcon"),Kl),null}return"string"==typeof e?yn.createDomFromHtml(e,n,i):(gn.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Zr(e,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(n){var r=e[n],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;i&&i[n]&&(o=function(e,t){return"object"===$i(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===$i(e)&&e.attr&&"object"===$i(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Jr(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Jr(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var Qr=function(e){Zi(i,e);var t=rn(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yi(this,i),(e=t.call(this,n)).__delegates=[],e}return Xi(i,[{key:"__init",value:function(e){if(an(Qi(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=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,i=o.i18n;return i[e]?i[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(Kl){throw gn.logError("Plugin:".concat(this.pluginName,":render"),Kl),new Error("Plugin:".concat(this.pluginName,":render:").concat(Kl.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=yn.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,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"===$i(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var n,r,o=i,a=t[o],s={root:e.root};"function"==typeof a?(n=e.config[o]||{},r=a):"object"===$i(a)&&"function"==typeof a.plugin&&(n=a.options?yn.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=n,void 0!==n.index&&(s.index=n.index),n.root&&(s.root=n.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,i=this.i18n,n=this.langText;t&&function e(t,i){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],i):i(t.children[n])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=i[r.toUpperCase()]||n[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]:"",i=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=i[t]||n[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]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=an(Qi(i.prototype),"registerPlugin",this).call(this,e,t,n);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,n){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=i.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===n){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var i=this;if(this.root)return"String"===yn.typeOf(e)?this.root.style[e]=t:void("Object"===yn.typeOf(e)&&Object.keys(e).map((function(t){i.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var i=this;if(this.root)return"String"===yn.typeOf(e)?this.root.setAttribute(e,t):void("Object"===yn.typeOf(e)&&Object.keys(e).map((function(t){i.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 i=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,i)}},{key:"unbindEL",value:function(e,t){var i=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,i)}},{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(i){return gn.logError("Plugin:appendChild",i),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)),an(Qi(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,r=Number(i),o=e instanceof window.Node;if(n){for(var a=0,s=null,l="";a<n;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,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof n)if(Array.isArray(i))i.forEach((function(i){var a=$r(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=$r(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return Yr}},{key:"POSITIONS",get:function(){return qr}}]),i}(Vr),eo=function(){function e(){var t=this;if(Yi(this,e),Ji(this,"__trigger",(function(e){var i=(new Date).getTime();t.timeStamp=i;for(var n=0;n<e.length;n++)t.__runHandler(e[n].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return _n(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),bn(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(Kl){console.error(Kl)}}return Xi(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=e.getAttribute(Lr),n=this.__handlers,r=-1,o=0;o<n.length;o++)n[o]&&e===n[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:i})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)}));try{this.observer&&this.observer.unobserve(e)}catch(Kl){}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,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){try{t[i].handler(e)}catch(n){console.error(n)}return!0}return!1}}]),e}(),to=null;var io={pluginGroup:{},init:function(e){var t,i,n=e._pluginInfoId;n||(n=(new Date).getTime(),e._pluginInfoId=n),!e.config.closeResizeObserver&&(t=e.root,i=function(){e.resize()},to||(to=new eo),to.addObserver(t,i)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[n]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),i=0;i<t.length;i++){var n=this.pluginGroup[t[i]]._player;if(n.root===e)return n}return null}return null},formatPluginInfo:function(e,t){var i=null,n=null;return e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),t&&(n.config=t||{}),{PLUFGIN:i,options:n}},checkPluginIfExits:function(e,t){for(var i=0;i<t.length;i++)if(e.toLowerCase()===t[i].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var i=Object.keys(t),n=null,r=0;r<i.length;r++)if(e.toLowerCase()===i[r].toLowerCase()){n=t[i[r]];break}return"Object"===yn.typeOf(n)?{root:n.root,position:n.position}:{}},lazyRegister:function(e,t){var i=this,n=t.timeout||1500;return Promise.race([t.loader().then((function(t){var n;n=t&&t.__esModule?t.default:t,i.register(e,n,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),n)}))])},register:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var n=e._pluginInfoId;if(n&&this.pluginGroup[n]){this.pluginGroup[n]._plugins||(this.pluginGroup[n]._plugins={});var r=this.pluginGroup[n]._plugins,o=this.pluginGroup[n]._originalOptions;i.player=this.pluginGroup[n]._player;var a=i.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){i.config||(i.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"===yn.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===yn.typeOf(c)&&(i.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===i.config[e]&&(i.config[e]=t.defaultConfig[e])})),i.root?"string"==typeof i.root&&(i.root=e[i.root]):i.root=e.root,i.index=i.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(n,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(i);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 i=this.pluginGroup[e]._plugins[t];i&&(i.pluginName&&i.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(Kl){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),Kl)}},deletePlugin:function(e,t){var i=e._pluginInfoId;i&&this.pluginGroup[i]&&this.pluginGroup[i]._plugins&&delete this.pluginGroup[i]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var i=e._pluginInfoId;if(!i||!this.pluginGroup[i])return null;var n=t.toLowerCase();return this.pluginGroup[i]._plugins[n]},beforeInit:function(e){var t=this;function i(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(n){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(i(t))}catch(Kl){throw a.push(i(null)),Kl}})),Promise.all([].concat(a)).then((function(){n()})).catch((function(e){console.error(e),n()}))}else n()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins;Object.keys(i).forEach((function(e){i[e]&&i[e].afterPlayerInit&&i[e].afterPlayerInit()}))}},setLang:function(e,t){var i=t._pluginInfoId;if(i&&this.pluginGroup[i]){var n=this.pluginGroup[i]._plugins;Object.keys(n).forEach((function(t){if(n[t].updateLang)n[t].updateLang(e);else try{n[t].lang=e}catch(i){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,i=e._pluginInfoId;if(i&&this.pluginGroup[i]){var n=[],r=this.pluginGroup[i]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(n.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(i,e))})),n.forEach((function(i){t.register(e,i.plugin,i.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins||{};Object.keys(i).forEach((function(e){i[e].onPluginsReady&&"function"==typeof i[e].onPluginsReady&&i[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var i=Object.keys(this.pluginGroup),n=0;n<i.length;n++){var r=this.pluginGroup[i[n]];r&&r._player&&(this.pluginGroup[i[n]]._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 i=this.pluginGroup[e[t]];if(i&&i._player&&i._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n;i=e.root,to.unObserver(i,n);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)}}}},no={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(){},preProcessUrl:null,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){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=tn(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),Ji(tn(e),"onMouseLeave",(function(t){tn(e).player.focus()})),e}return Xi(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Sn.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.disable,n=t.height,r=t.mode;if(!i){"flex"===r&&this.player.addClass(no.FLEX_CONTROLS);var o={height:"".concat(n,"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?yn.addClass(e.root,"mini-controls"):yn.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Sn.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&&yn.addClass(this.root,no.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){yn.removeClass(this.root,no.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]:{},n=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 an(Qi(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Sn.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,n=e.initShow;if(!e.disable){var r=yn.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},Ji({},no.CONTROLS_AUTOHIDE,i),{"xgplayer-controls-initshow":n||!i});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}}}]),i}(Qr),ao={lang:{},langKeys:[],textKeys:[]};function so(e,t){return Object.keys(t).forEach((function(i){var n,r=yn.typeOf(t[i]),o=yn.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,sn(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),so(e[i],t[i])):e[i]=t[i]})),e}function lo(){Object.keys(ao.lang.en).map((function(e){ao.textKeys[e]=e}))}function co(e,t){var i=e.LANG;if(t||(t=ao),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?so(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),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 i=[];if(t||(t=ao),t.lang){i="Array"!==yn.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var n=t.lang;i.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),n[e.LANG]?so(n[e.LANG]||{},e.TEXT||{}):co(e,t)})),lo()}},use:co,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return so(i.lang,ao.lang),(t=i.langKeys).push.apply(t,sn(ao.langKeys)),so(i.textKeys,ao.textKeys),i}},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){Zi(i,e);var t=rn(i);function i(e){var n;Yi(this,i);var r,o=yn.deepMerge(ro(),e);Ji(tn(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;gn.logInfo("player","canPlayFunc, startTime",n.__startTime),n.__startTime>0&&n.duration>0&&(n.currentTime=n.__startTime>n.duration?n.duration:n.__startTime,n.__startTime=-1),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(Bn,n.canPlayFunc),n.removeClass(no.ENTER)}})),Ji(tn(n),"onFullscreenChange",(function(e,t){var i=function(){yn.setTimeout(tn(n),(function(){n.resize()}),100)},r=yn.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(vr,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:n.currentTime,duration:n.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,i){if(e){var n=e.getAttribute(i);return!(!n||n!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,n.playerId,Lr);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,no.FULLSCREEN),n.emit(nr,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=tn(n),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),yn.setTimeout(tn(n),(function(){n.fullscreen=!1,n._fullScreenOffset=null}),100)):(!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!1,n._fullScreenOffset=null),n.cssfullscreen?n.removeClass(no.FULLSCREEN):n.recoverFullStyle(n.root,n._fullscreenEl,no.FULLSCREEN),n._fullscreenEl=null,n.emit(nr,!1)}})),Ji(tn(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),Ji(tn(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),Br(tn(n),po),n.config=o,n._pluginInfoId=yn.generateSessionId(),(r=tn(n)).logInfo=gn.logInfo.bind(r),r.logWarn=gn.logWarn.bind(r),r.logError=gn.logError.bind(r);var a=n.constructor.defaultPreset;if(n.config.presets.length){var s=n.config.presets.indexOf("default");s>=0&&a&&(n.config.presets[s]=a)}else a&&n.config.presets.push(a);if(n.userTimer=null,n.waitTimer=null,n._state=ho.INITIAL,n.isError=!1,n._hasStart=!1,n.isSeeking=!1,n.isCanplay=!1,n._useAutoplay=!1,n.__startTime=-1,n.rotateDeg=0,n.isActive=!1,n.fullscreen=!1,n.cssfullscreen=!1,n.isRotateFullscreen=!1,n._fullscreenEl=null,n.timeSegments=[],n._cssfullscreenEl=null,n.curDefinition=null,n._orgCss="",n._fullScreenOffset=null,n._videoHeight=0,n._videoWidth=0,n.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},n.sizeInfo={width:0,height:0,left:0,top:0},n._accPlayed={t:0,acc:0,loopAcc:0},n._offsetInfo={currentTime:-1,duration:0},n.innerContainer=null,n.controls=null,n.topBar=null,n.root=null,n.__i18n=uo.init(n._pluginInfoId),Sn.os.isAndroid&&Sn.osVersion>0&&Sn.osVersion<6&&(n.config.autoplay=!1),n.database=new Er,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},!n._initDOM())return console.error(new Error("can't find the dom which id is ".concat(n.config.id," or this.config.el does not exist"))),nn(n);var l=n.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]),n.config.url=h.url,n.curDefinition=h}return n._bindEvents(),n._registerPresets(),n._registerPlugins(),io.onPluginsReady(tn(n)),n.getInitDefinition(),n.setState(ho.READY),yn.setTimeout(tn(n),(function(){n.emit(Yn)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<ho.ATTACHED)&&n.start(),n}return Xi(i,[{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(An,new Pn("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 i=io.checkPlayerRoot(this.root);i&&(gn.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),i.destroy()),this.root.setAttribute(Lr,this.playerId),io.init(this),this._initBaseDoms();var n=this.constructor.XgVideoProxy;if(n&&this.mediaConfig.mediaType===n.mediaType){var r=this.innerContainer||this.root;this.detachVideoEvents(this.media);var o=new n(r,this.config,this.mediaConfig);this.attachVideoEvents(o),this.media=o}if(this.media.setAttribute(Lr,this.playerId),this.config.controls){var a=this.config.controls.root||null,s=io.register(this,oo,{root:a});this.controls=s}var l="mobile"===this.config.isMobileSimulateMode?"mobile":Sn.device;if(this.addClass("".concat(no.DEFAULT," ").concat(no.INACTIVE," xgplayer-").concat(l," ").concat(this.config.controls?"":no.NO_CONTROLS)),this.config.autoplay?this.addClass(no.ENTER):this.addClass(no.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=yn.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)])})),Pr.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Sn.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(Fn,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(On,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Pr.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(On,this.playFunc),this.off(Bn,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"!==yn.typeOf(e)||0!==e.length)||(e="",this.emit(qn),gn.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.media),"Array"===yn.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"===yn.typeOf(this.config.volume)&&(this.volume=this.config.volume);var i=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!i.contains(this.media)&&i.insertBefore(this.media,i.firstChild);var n=this.media.readyState;gn.logInfo("_startInit readyState",n),this.config.autoplay&&(!yn.isMSE(this.media)&&this.load(),(Sn.os.isIpad||Sn.os.isPhone)&&this.mediaPlay());var r=this.config.startTime;this.__startTime=r>0?r:-1,this.config.startTime=0,n>=2&&this.duration>0?this.canPlayFunc():this.on(Bn,this.canPlayFunc),(!this.hasStart||this.state<ho.ATTACHED)&&io.afterInit(this),this.hasStart=!0,this.setState(ho.ATTACHED),yn.setTimeout(this,(function(){t.emit(Zn)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var i=this.config.ignores||[],n=this.config.plugins||[],r=this.config.i18n||[];t&&uo.extend(r,this.__i18n);var o=i.join("||").toLowerCase().split("||"),a=this.plugins;n.forEach((function(i){try{var n=i.plugin?i.plugin.pluginName:i.pluginName;if(n&&o.indexOf(n.toLowerCase())>-1)return null;if(!t&&a[n.toLowerCase()])return;if(i.lazy&&i.loader){var r=io.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){gn.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(s){gn.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var i,n,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=[]),(i=e.config.plugins).push.apply(i,sn(a)),(n=e.config.ignores).push.apply(n,sn(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,sn(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=yn.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case qr.ROOT_LEFT:this.leftBar||(this.leftBar=yn.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case qr.ROOT_TOP:this.topBar||(this.topBar=yn.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&yn.addClass(this.topBar,no.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=io.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!io.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=io.getRootByConfig(n.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||n.defaultConfig&&n.defaultConfig.position;return!r.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(n,r,n.pluginName):(r.root||(r.root=this._getRootByPosition(s)),io.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?io.unRegister(this,e):e instanceof Vr&&io.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 i=this.config.plugins.length-1;i>-1;i--){if(this.config.plugins[i].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(i,1);break}}}},{key:"plugins",get:function(){return io.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=io.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(yn.hasClass(this.root,e)||yn.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&yn.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return yn.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),io.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var i=t.preProcessUrl(e);return t._startInit(i.url)}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",gn.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===yn.typeOf(e)&&(n=e.url),n=this.preProcessUrl(n).url;var r=this.currentTime;this.__startTime=r;var o=this.paused&&!this.isError;return this.src=n,new Promise((function(e,t){var r=function(e){i.off("timeupdate",a),i.off("canplay",a),t(e)},a=function(){i.duration>0&&i.__startTime>0&&(i.currentTime=i.__startTime,i.__startTime=-1),o&&i.pause(),i.off("error",r),e(!0)};i.once("error",r),n?(Sn.os.isAndroid?i.once("timeupdate",a):i.once("canplay",a),i.play()):i.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(no.NO_START),this.addClass(no.ENTER),this.start(),void(this._useAutoplay=!0);this.state<ho.RUNNING&&(this.removeClass(no.NO_START),!this.isCanplay&&this.addClass(no.ENTER));var t=an(Qi(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(no.NOT_ALLOW_AUTOPLAY),e.addClass(no.PLAYING),e.state<ho.RUNNING&&(gn.logInfo(">>>>playPromise.then"),e.setState(ho.RUNNING),e.emit(Xn))})).catch((function(t){if(gn.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(no.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=yn.setTimeout(e,(function(){e._errorTimer=null,e.emit(Jn),e.addClass(no.NOT_ALLOW_AUTOPLAY),e.removeClass(no.ENTER),e.pause(),e.setState(ho.NOTALLOW)}),0))})):(gn.logWarn("video.play not return promise"),this.state<ho.RUNNING&&(this.setState(ho.RUNNING),this.removeClass(no.NOT_ALLOW_AUTOPLAY),this.removeClass(no.NO_START),this.removeClass(no.ENTER),this.addClass(no.PLAYING),this.emit(Xn))),t}},{key:"mediaPause",value:function(){an(Qi(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){an(Qi(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(no.PAUSED),Hr(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;Hr(this,"pause",(function(){an(Qi(i.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var i=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var n=this.config,r=n.isSeekedPlay,o=n.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(Rn,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(no.ENTER),i.isSeeking=!1,a){case"play":i.play();break;case"pause":i.pause();break;default:i._isPauseBeforeSeek>1||i.paused?i.pause():i.play()}i._isPauseBeforeSeek=0,i._onceSeekCanplay=null},this.once(Rn,this._onceSeekCanplay),this.state<ho.RUNNING?(this.removeClass(no.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,i=t.definition;!t.url&&i&&i.list&&i.list.length>0&&i.defaultDefinition&&i.list.map((function(t){t.definition===i.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var i=this,n=this.config.definition;if(Array.isArray(null==n?void 0:n.list)&&n.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(i.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,Ki({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.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(Fn,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[no.NOT_ALLOW_AUTOPLAY,no.PLAYING,no.NO_START,no.PAUSED,no.REPLAY,no.ENTER,no.ENDED,no.ERROR,no.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(no.NO_START),this.emit(yr)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;this.resetState();var n=this.plugins;if(n&&(t.map((function(t){e.deregister(t)})),i)){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,n=this.root,r=this.media;if(n&&r){if(this.hasStart=!1,this._useAutoplay=!1,n.removeAttribute(Lr),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),yn.clearAllTimers(this),this.emit(er),io.destroy(this),Ur(this),an(Qi(i.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&&n.contains(r)&&n.removeChild(r),["topBar","leftBar","rightBar","innerContainer"].map((function(t){e[t]&&n.removeChild(e[t]),e[t]=null}));var s=n.className.split(" ");s.length>0?n.className=s.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):n.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(no.ENDED),this.currentTime=0,this.isSeeking=!1,Hr(this,"replay",(function(){e.once(Rn,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(Qn),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(no.ERROR),this.addClass(no.LOADING),Hr(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=yn.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(Bn,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=no.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=yn.filterStyleFromText(e)),yn.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=yn.filterStyleFromText(t),yn.addClass(t,n),t.setAttribute(Lr,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=no.PARENT_FULLSCREEN),this._orgCss&&(yn.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),yn.removeClass(e,i),t&&t!==e&&this._orgPCss&&(yn.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",yn.removeClass(t,n),t.removeAttribute(Lr))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;e||(e=t),this._fullScreenOffset={top:yn.scrollTop(),left:yn.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var n=yn.getFullScreenEl();if(n===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=0;r<Or.length;r++){var o=Or[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 i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.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||yn.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<Ir.length;i++){var n=Ir[i];if(document[n]){var r=document[n]();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(no.INNER_FULLSCREEN," ").concat(no.CSS_FULLSCREEN):no.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i,r=!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen();r&&(this.fullscreen=!0,this.emit(nr,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(rr,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(no.INNER_FULLSCREEN," ").concat(no.CSS_FULLSCREEN):no.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,i=void 0===t?{}:t;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(nr,!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(no.INNER_FULLSCREEN," ").concat(no.ROTATE_FULLSCREEN):no.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,no.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(nr,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(no.INNER_FULLSCREEN," ").concat(no.ROTATE_FULLSCREEN):no.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,no.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(nr,!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(Kn,Ki({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($n,Ki({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},i=this.innerStates;if(this.isActive=!0,this.removeClass(no.INACTIVE),this.userTimer&&(yn.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this.userTimer&&(yn.clearTimeout(this,this.userTimer),this.userTimer=null);else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=yn.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignorePaused,i=void 0!==t&&t;if(this.isActive&&!this.innerStates.isActiveLocked){var n=this.config.closePauseVideoFocus;this.isActive=!1,(i||n||!this.paused&&!this.ended)&&this.addClass(no.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(no.ENTER),this.removeClass(no.ERROR),this.removeClass(no.LOADING),this.isCanplay=!0,this.waitTimer&&yn.clearTimeout(this,this.waitTimer)}},{key:"onDurationchange",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime,this.__startTime=-1)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1}},{key:"onLoadstart",value:function(){this.removeClass(no.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===ho.ENDED&&this.setState(ho.RUNNING),this.removeClass(no.PAUSED),this.ended&&this.removeClass(no.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(no.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(yn.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(no.ENDED),this.setState(ho.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(no.NOT_ALLOW_AUTOPLAY),this.removeClass(no.NO_START),this.removeClass(no.ENTER),this.removeClass(no.LOADING),this.addClass(no.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(no.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&yn.clearTimeout(this,this.waitTimer),this.removeClass(no.LOADING),this.removeClass(no.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&yn.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=yn.setTimeout(this,(function(){e.addClass(no.LOADING),yn.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[no.NO_START,no.PAUSED,no.ENDED,no.ERROR,no.REPLAY,no.LOADING].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(no.LOADING))&&this.media.readyState>2&&(this.removeClass(no.LOADING),yn.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state<ho.RUNNING&&this.duration&&(this.setState(ho.RUNNING),this.emit(Xn)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===yn.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,i){if(this.media&&t&&e){var n="String"===yn.typeOf(e)?e:e.type||"";i.props&&"Array"!==yn.typeOf(i.props)&&(i.props=[i.props]),this.emit(vr,Ki({eventType:n,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},i))}}},{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 i=e||this.media.currentTime||.2,n=t.length,r=0;r<n;r++)if(t.start(r)<=i&&t.end(r)>i)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,i=e.vy,n=e.vx,r=e.h,o=e.w;if(!(t<0)||i||n){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=t<0?0: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=i>0?(100-r)/2-i:0,s.y=2===h?0-l:l,c=n>0?(100-o)/2-n: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+i/2:c-i/2,l=m/2/v*100,s.y=3===h?l+n/2:l-n/2,s.scale=u,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(v,"px")}var _=yn.getTransformStyle(s,this.media.style.transform||this.media.style.webkitTransform);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(i){if("plugins"!==i){t.config[i]=e[i];var n=t.plugins[i.toLowerCase()];n&&"Function"===yn.typeOf(n.setConfig)&&n.setConfig(e[i])}}))}},{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 i=this.media,n=i.videoWidth,r=i.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&n){this._videoHeight=r,this._videoWidth=n;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=t.width,u=t.height-l,h=parseInt(n/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){gn.logInfo("setState","state from:".concat(fo[this.state]," to:").concat(fo[e])),this._state=e}},{key:"preProcessUrl",value:function(e,t){var i=this.config.preProcessUrl;return!yn.isBlob(e)&&i&&"function"==typeof i?i(e,t):{url: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,i=this.config.definition,n=null,r=null;i.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&&(n=e),i.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),n?this.changeDefinition(n):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,io.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 Cn}},{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 an(Qi(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=an(Qi(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return an(Qi(i.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,i=e.t;return i?(new Date).getTime()-i+t:t}},{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=yn.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:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{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,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return Nr.call.apply(Nr,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;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),io.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return gn.config.debug},set:function(e){gn.config.debug=e}},{key:"getCurrentUserActivePlayerId",value:function(){return io.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){io.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return Sn.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Sn.probeConfigSupported(e)}},{key:"install",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=t)}},{key:"use",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]=t}}]),i}(xr);function mo(){return(new Date).getTime()}Ji(yo,"defaultPreset",null),Ji(yo,"XgVideoProxy",null);var _o="loadstart",bo="loadeddata",ko="firstFrame",wo="waitingStart",To="waitingEnd",So="seekStart",Co="seekEnd",xo=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(gn.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),Ji(tn(e),"_onAutoplayStart",(function(){gn.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Ji(tn(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&&yn.clearTimeout(tn(e),e._waitTimer),e._waittTimer&&yn.clearTimeout(tn(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Ji(tn(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=mo(),e.emitLog(So,{start:mo()}))})),Ji(tn(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),Ji(tn(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"}))})),Ji(tn(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=yn.setTimeout(tn(e),(function(){e._isWaiting&&(e.waitingStart=mo(),yn.clearTimeout(tn(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))})),Ji(tn(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Ji(tn(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return Xi(i,[{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(Gn,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=mo()-e.newPointTime,gn.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(i," isFFSend:").concat(n," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),n||(!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(Fn,(function(){e.vt=mo(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,i=t.isTimeUpdate,n=t.isFFSend,r=t.autoplayStart;gn.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(i||r)&&e._sendFF("loadedData"),n||e.emitLog(bo,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Mn,this._onSeeking),this.on(Rn,this._onSeeked),this.on(er,(function(){e.endState("destroy")})),this.on(tr,(function(){e.endState("urlChange"),gn.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([In,Bn],this._onPlaying),this.on(jn,this._onWaiting),this.on(An,this._onError),this.on(yr,(function(){gn.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(Xn,this._onAutoplayStart),this.off(Nn,this._onTimeupdate),this.once(Xn,this._onAutoplayStart),this.once(Nn,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=mo();var t=this._state,i=t.isFFLoading,n=t.isFFSend;gn.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(gn.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&&yn.clearTimeout(this,this._waittTimer),this._waittTimer=yn.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),yn.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(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(Co,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(yn.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(yn.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=mo(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(To,{fixedCostTime:n>r?r:n,costTime:i>r?r:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var i=this.player;this.emit(gr,Ki({t:mo(),host:yn.getHostFromUrl(i.currentSrc),vtype:i.vtype,eventType:e,currentTime:this.player.currentTime,readyState:i.video.readyState,networkState:i.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),i}(Qr);function Eo(){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 Po=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{key:"registerIcons",value:function(){return{replay:Eo}}},{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(Ln,(function(){if(e.playerConfig.loop||yn.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var i=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof i&&i.indexOf("none")>-1)return null;t.setAttribute("transform",i)}}})),this.on(On,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),yn.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}}}]),i}(Qr),Oo=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){yn.addClass(this.root,"hide")}},{key:"show",value:function(){yn.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(Ln,(function(){e.isEndedShow&&yn.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(Nn,(function(){e.onTimeUpdate()})),this.on(tr,(function(){yn.removeClass(e.root,"hide"),yn.addClass(e.root,"xg-showplay"),e.once(Nn,(function(){e.onTimeUpdate()}))}))):this.on(On,(function(){yn.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?yn.removeClass(this.root,"xg-showplay"):this.once(Nn,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"getBgSize",value:function(e){var t="";switch(e){case"cover":t="cover";break;case"container":t="container";break;case"fixHeight":t="auto 100%";break;default:t=""}return t?"background-size: ".concat(t,";"):""}},{key:"render",value:function(){var e=this.config,t=e.poster,i=e.hideCanplay,n=e.fillMode,r=e.notHidden,o=this.getBgSize(n),a=t?"background-image:url(".concat(t,");").concat(o):o;return'<xg-poster class="xgplayer-poster '.concat(r?"xg-not-hidden":i?"xg-showplay":"",'" style="').concat(a,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),i}(Qr);function Io(){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 Lo(){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){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),yn.removeClass(n.root,e),n.show()})),Ji(tn(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";yn.addClass(n.root,e),n.autoPlayStart=!0,n.onPlayPause("play")}})),n.autoPlayStart=!1,n}return Xi(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.playerConfig;this.initIcons(),this.once(Yn,(function(){i&&(i.lang&&"en"===i.lang?yn.addClass(t.root,"lang-is-en"):"jp"===i.lang&&yn.addClass(t.root,"lang-is-jp"))})),this.on(Xn,this.onAutoplayStart),i.autoplay||this.show(),this.on(Jn,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),yn.removeClass(e.root,t),e.show()})),this.on(On,(function(){e.onPlayPause("play")})),this.on(Dn,(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 i=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:i,to:!i})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Io,class:"xg-icon-play"},startPause:{icon:Lo,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(){yn.addClass(this.root,"hide")}},{key:"show",value:function(){yn.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){yn.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){yn.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 i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return Do[e]&&window.clearTimeout(Do[e].id),Do[e]={},i.start&&i.start(),Do[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(Do[e].id),delete Do[e]}),t),Do[e].id}("pauseplay",400,{start:function(){yn.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){yn.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){yn.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,i=this.player;if(i&&!(i.state<ho.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&i.paused&&!i.ended||t.isShowEnd&&i.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||i.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"}}}]),i}(Qr),Ro=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=yn.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 i="",n=1;n<=12;n++)i+='<div class="xgplayer-enter-bar'.concat(n,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(i,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),i}(Qr);function No(e,t,i){try{return' <div class="xg-tips '.concat(i?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(Kl){return'<div class="xg-tips hide"></div>'}}var jo=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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}}}]),i}(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"===$i(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 i={};i.width=e.offsetWidth,i.height=e.offsetHeight;for(var n=i.isBorderBox="border-box"===t.boxSizing,r=0;r<Ho;r++){var o=Uo[r],a=t[o],s=parseFloat(a);i[o]=Number.isNaN(s)?0:s}var l=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,u=i.marginLeft+i.marginRight,h=i.marginTop+i.marginBottom,d=i.borderLeftWidth+i.borderRightWidth,f=i.borderTopWidth+i.borderBottomWidth,p=n,g=Bo(t.width);!1!==g&&(i.width=g+(p?0:l+d));var v=Bo(t.height);return!1!==v&&(i.height=v+(p?0:c+f)),i.innerWidth=i.width-(l+d),i.innerHeight=i.height-(c+f),i.outerWidth=i.width+u,i.outerHeight=i.height+h,i}}function Vo(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var zo="dragStart",Go="dragMove",Wo="dragEnded",Ko={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},$o=function(e){Zi(i,e);var t=rn(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Yi(this,i),(n=t.call(this)).isEnabled=!0,n.isDragging=!1,n.isDown=!1,n.position={},n.downPoint={},n.dragPoint={x:0,y:0},n.startPos={x:0,y:0},n._root=e instanceof Element?e:document.querySelector(e),n._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),n._root&&n._handlerDom?(n._bindStartEvent(),n):nn(n)}return Xi(i,[{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 i=Ko[this._startKey];i.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=i}}},{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 i=Fo(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-i.height,this.startPos.maxX=window.innerWidth-i.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 i={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this.dragRealStart(e,t),i}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var i=this.startPos,n=i.x,r=i.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,n),s=this.checkContain("y",s,r),this.position.x=n+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,i){return t+i<0?0-i:"x"===e&&t+i>this.startPos.maxX?this.startPos.maxX-i:"y"===e&&t+i>this.startPos.maxY?this.startPos.maxY-i:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),i=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(i)?0:i,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var i=t.split(","),n=0===t.indexOf("matrix3d")?12:4,r=parseInt(i[n],10),o=parseInt(i[n+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var i=Fo(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(hn),Yo=function(e){Zi(i,e);var t=rn(i);function i(e){var n;Yi(this,i),Ji(tn(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),Ji(tn(n),"onCenterClick",(function(e){var t=tn(n).player;t.paused?t.play():t.pause()})),Ji(tn(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(yn.getCss(n.player.root,"height"));t+=n.config.scrollTop,n.pos.scrollY=window.scrollY,window.scrollY>t+5?!n.isMini&&!n.isClose&&n.getMini():window.scrollY<=t&&(n.isMini&&n.exitMini(),n.isClose=!1)}})),n.isMini=!1,n.isClose=!1;var r=tn(n).config;return n.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:n.config.height,width:n.config.width,scrollY:window.scrollY||0},n.lastStyle=null,n}return Xi(i,[{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(Dn,(function(){e.setAttr("data-state","pause")})),this.on(On,(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 i={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(jo,i,jo.pluginName)}var n=yn.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,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:Io,class:"xg-icon-play"},pause:{icon:Lo,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,i=this.playerConfig,n=this.config.target||this.player.root;this.lastStyle={},yn.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=n.style[t],n.style[t]="".concat(e.pos[t],"px")})),i.fluid&&(n.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,i=this.playerConfig,n=this.config.target||this.player.root;yn.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){n.style[t]=e.lastStyle[t]})),this.lastStyle=null,i.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*i.height/i.width,"%")),this.emit(or,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=yn.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}}}]),i}(Qr),qo={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Xo=["videoClick","videoDbClick"],Jo=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=tn(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),Ji(tn(e),"onMouseEnter",(function(t){var i=tn(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Ji(tn(e),"onMouseLeave",(function(t){var i=e.playerConfig,n=i.closePlayerBlur,r=i.leavePlayerTime,o=i.closeDelayBlur;n||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Ji(tn(e),"onVideoClick",(function(t){var i=tn(e),n=i.player,r=i.playerConfig;t.target&&r.closeVideoClick||t.target!==n.root&&t.target!==n.media&&t.target!==n.innerContainer&&t.target!==n.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(tn(e),Xo[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Ji(tn(e),"onVideoDblClick",(function(t){var i=tn(e),n=i.player,r=i.playerConfig;r.closeVideoDblclick||!t.target||t.target!==n.media&&t.target!==n.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(tn(e),Xo[1],(function(t,i){e.emitUserAction(i.e,"switch_fullscreen",{props:"fullscreen",from:n.fullscreen,to:!n.fullscreen}),n.fullscreen?n.exitFullscreen():n.getFullscreen()}),{e:t,fullscreen:n.fullscreen})))})),e}return Xi(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Xo.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Sn.device&&!Sn.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,i=t.media,n=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(qo).map((function(t){n.addEventListener(t,e[qo[t]],!1)})),!r&&i&&i.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,i=t.video,n=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),i.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(qo).map((function(t){n.removeEventListener(t,e[qo[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(Vr),Zo="press",Qo="pressend",ea="doubleclick",ta="click",ia="touchmove",na="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 i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Yi(this,e),Ji(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=sa(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,i.__setPress(e),n.addEventListener(i.events.end,i.onTouchEnd),n.addEventListener(i.events.cancel,i.onTouchCancel),n.addEventListener(i.events.move,i.onTouchMove),i.trigger(na,e)})),Ji(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),Ji(this,"onTouchEnd",(function(e){var t=i._pos,n=i.root;i.__clearPress(),n.removeEventListener(i.events.cancel,i.onTouchCancel),n.removeEventListener(i.events.end,i.onTouchEnd),n.removeEventListener(i.events.move,i.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&i.trigger(Qo,e),i.trigger(ra,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Ji(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=sa(e.touches),o=r?parseInt(r.pageX,10):e.pageX,a=r?parseInt(r.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<n.miniStep&&Math.abs(s)<n.miniStep||(i.__clearPress(),t.press&&i.trigger(Qo,e),t.press=!1,t.moving=!0,i.trigger(ia,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(n).map((function(e){i.config[e]=n[e]})),this.root=t,this.events="mouse"===n.eventType?aa:oa,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Xi(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,i=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(Zo,e),t._pos.press=!0,t.__clearPress()}),i.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,i=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)}),i.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 i=this.__handlers[e],n=-1,r=0;r<i.length;r++)if(i[r]===t){n=r;break}n>=0&&this.__handlers[e].splice(n,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(i){try{i(t)}catch(n){console.error("trigger>>:".concat(e),n)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(i){e.root.removeEventListener(i,e[t[i]])}))}}]),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){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"onTouchStart",(function(e){var t=tn(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=n.getTouche(e);if(s&&!r.disableGesture&&n.duration>0&&!i.ended){o.isStart=!0,yn.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=yn.format(n.duration);var l=n.root.getBoundingClientRect();90===i.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===i.rotateDeg?u:c,o.y=90===i.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}})),Ji(tn(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=tn(n),r=i.pos,o=i.config,a=i.player;if(t&&!o.disableGesture&&n.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=n.checkScope(h,d,f,p,r))&&(l?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*n.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),n.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),Ji(tn(n),"onTouchEnd",(function(e){var t=tn(n),i=t.player,r=t.pos,o=t.playerConfig;if(r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var a=n.config,s=a.disableGesture,l=a.gestureX;!s&&l?(n.endLastMove(r.scope),setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10)):r.time=0,r.scope=-1,n.resetPos(),yn.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(ua)}})),Ji(tn(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),Ji(tn(n),"onRootTouchEnd",(function(e){n.pos.isStart&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.onTouchEnd(e))})),n.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},n.timer=null,n}return Xi(i,[{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,i=this.config,n=this.player;!0===t.closeVideoDblclick&&(i.closedbClick=!0),this.resetPos(),yn.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=yn.createDom("xg-mask","",{},"xgmask"),n.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()})),n.root.addEventListener("touchmove",this.onRootTouchMove,!0),n.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(Un,(function(){var t=e.player,i=e.config;1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([Bn,Ln],(function(){var t=e.pos,i=t.time;!t.isStart&&i>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(i){e[o[t]](i)}))})),!i.disableActive){var a=n.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,i=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),i&&(this.find(".xg-bar").style.backgroundColor=i,this.find(".time-preview").style.color=i),this.config.disableTimeProgress&&yn.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 i=t.plugins.start;i&&i.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,i,n,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===n?Math.abs(i):Math.abs(i/n);return Math.abs(i)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(i)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,i,n,r){switch(i){case 0:this.updateTime(e/n*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:Sn.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,i=this.pos,n=this.player,r=this.config,o=(i.time-this.timeOffset)/1e3;if(0===e)n.seek(Number(o).toFixed(1)),r.hideControlsEnd?n.blur():n.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,i=this.config,n=this.playerConfig;t.state<ho.RUNNING?n.closeVideoClick||(this.sendUseAction(yn.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(yn.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=ho.RUNNING&&(this.sendUseAction(yn.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;Hr(this,fa[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;Hr(this,fa[1],(function(e,i){t.dbClickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onPress",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:n.playbackRate,to:i.pressRate}),n.playbackRate=i.pressRate,this.changeAction(da))}},{key:"onPressEnd",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:n.playbackRate,to:t.rate}),n.playbackRate=t.rate,t.rate=1,this.changeAction(ua))}},{key:"updateTime",value:function(e){var t=this.player,i=this.config,n=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*i.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*n?1e3*n-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),i.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,i=this.pos;if(e=parseInt(100*e,10),i.volume+=e,!(Math.abs(i.volume)<10)){var n=parseInt(10*t.volume,10)-parseInt(i.volume/10,10);n=n>10?10:n<1?0:n,t.volume=n/10,i.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,i=this.config,n=this.xgMask,r=t.light+.8*e;r=r>i.maxDarkness?i.maxDarkness:r<0?0:r,n&&(n.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],i=this.player,n=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!n.disableActive){e<0?e=0:e>i.duration&&(e=i.duration-.2),this.changeAction(ha);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=yn.format(this.duration),this.find(".xg-cur").innerHTML=yn.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?yn.removeClass(this.find(".xg-seek-show"),"xg-back"):yn.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}}}]),i}(Qr);function ga(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var va=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=tn(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||ga(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!ga(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),Ji(tn(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Ji(tn(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=tn(e)._keyState;if(!i.repeat){if(e.config.disable||e.config.disableRootTrigger||i.metaKey||i.altKey||i.ctrlKey)return;!i||37!==i.keyCode&&!e.checkCode(i.keyCode)||i.target!==e.player.root&&i.target!==e.player.video&&i.target!==e.player.controls.el||(n.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}n.isKeyDown&&e.handleKeyDown(i)}})),Ji(tn(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return Xi(i,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(i){e.keyCodeMap[i]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(n){t[i][n]&&(e.keyCodeMap[i][n]=t[i][n])})):e.keyCodeMap[i]=t[i]}))}},{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,i=e.top,n=e.bottom,r=window.innerHeight;return!(i<0&&i<0-.9*t||n>0&&n-r>.9*t)}},{key:"checkCode",value:function(e,t){var i=this,n=!1;return Object.keys(this.keyCodeMap).map((function(r){i.keyCodeMap[r]&&e===i.keyCodeMap[r].keyCode&&!i.keyCodeMap[r].disable&&(n=!t||t&&!i.keyCodeMap[r].noBodyTarget)})),n}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var i=parseFloat((t.volume-.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i>=0?i:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var i=parseFloat((t.volume+.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i<=1?i:1}}},{key:"seek",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.duration,o=t.offsetDuration,a=t.timeSegments,s=n>-1?n:i,l=o||r,c=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;s+c<=l?s+=c:s=l;var u=yn.getCurrentTimeByOffset(s,a),h={currentTime:{from:i,to:u}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=u}},{key:"seekBack",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.timeSegments,o=(n>-1?n:i)-(e.repeat?parseInt(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:i,to:o=yn.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.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,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}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,i){for(var n,r=Object.keys(this.keyCodeMap),o=0;o<r.length;o++){var a=this.keyCodeMap[r[o]],s=a.action,l=a.keyCode,c=a.disable,u=a.pressAction,h=a.disablePress;if(l===e){if(!(c||i&&h)){var d=i&&u||s;"function"==typeof d?s(t,this.player,i):"string"==typeof d&&"function"==typeof this[d]&&this[d](t,this.player,i),this.emit(pr,Ki({key:r[o],target:t.target,isPress:i},this.keyCodeMap[r[o]]))}(n=t).preventDefault(),n.returnValue=!1;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:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),i}(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){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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}}}]),i}(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){Yi(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 Xi(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var i=0,n=this.fragments;this.fragments=n.map((function(e){return e.start=parseInt(i,10),e.end=parseInt(i+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),i+=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},i=this.progressList,n=this.fragments;if(!(i.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&i.map((function(t,i){i<r?t[e].style.width="100%":i>r&&(t[e].style.width=0)}));var s=n[r],l=0===a?0:(a-s.start)/s.duration;i[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 i={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(i)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),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 i=this.playedIndex,n=this.cachedIndex;if("Undefined"!==yn.typeOf(e.played)){var r=this.findIndex(1e3*e.played,i);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==yn.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,n);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:n,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var i=this.fragments;if(!i||0===i.length)return-1;if(1===i.length)return 0;if(t>-1&&t<i.length&&e>i[t].start&&e<i[t].end)return t;if(e>i[i.length-1].start)return i.length-1;for(var n=0;n<i.length;n++)if(e>i[n].start&&e<=i[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(yn.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++)yn.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return yn.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(i){void 0!==e[i]&&(t.fragConfig[i]=e[i])})),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 i=this.root.children;i.length>0;)this.root.removeChild(i[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=yn.createDom("xg-inners","",{},"progress-list")),this.fragments){var i=this.fragConfig,n=i.fragClass,r=i.fragFocusClass;this.progressList=this.fragments.map((function(i){var o=yn.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(i.percent):"flex: ".concat(i.percent)},"".concat(i.isFocus?r:""," xgplayer-progress-inner ").concat(n));return e.root.appendChild(o),_a.forEach((function(t){o.appendChild(yn.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){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=tn(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){yn.event(e);var l=yn.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=n.computeTime(e,c)}n.triggerCallbacks("dragmove",s,e),n._updateInnerFocus(s)})),Ji(tn(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),Ji(tn(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),Ji(tn(n),"_mouseUpHandler",(function(e,t){tn(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),Ji(tn(n),"_mouseMoveHandler",(function(e,t){var i=tn(n),r=i._state,o=i.pos,a=i.config,s=i.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(),n.triggerCallbacks("dragstart",t,e),n.emitUserAction("drag","dragstart",t)),n.updateWidth(t.currentTime,t.seekTime,t.percent,1),n.triggerCallbacks("dragmove",t,e),n._updateInnerFocus(t)})),Ji(tn(n),"onMouseDown",(function(e){var t=tn(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=yn.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(),n.focus(),yn.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),yn.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),yn.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,yn.addClass(n.progressBtn,"active");var u=n.computeTime(e,c);return u.prePlayTime=i.prePlayTime,n._mouseDownHandlerHook(e,u),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}r.play()}})),Ji(tn(n),"onMouseUp",(function(e){var t=tn(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;e.stopPropagation(),e.preventDefault(),yn.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),yn.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),yn.event(e),yn.removeClass(n.progressBtn,"active");var l=n.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(n.triggerCallbacks("dragend",l,e),n.emitUserAction("drag","dragend",l)):(n.triggerCallbacks("click",l,e),n.emitUserAction("click","click",l)),n._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?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&n.bind("mousemove",n.onMoveOnly):n.onMouseLeave(e)),yn.setTimeout(tn(n),(function(){n.resetSeekState()}),10),i.focus()})),Ji(tn(n),"onMouseMove",(function(e){var t=tn(n),i=t._state,r=t.pos,o=t.player,a=t.config;yn.checkTouchSupport()&&e.preventDefault(),yn.event(e);var s=yn.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=n.computeTime(e,l);u.prePlayTime=i.prePlayTime,n._mouseMoveHandlerHook(e,u)}})),Ji(tn(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),Ji(tn(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),Ji(tn(n),"onMouseEnter",(function(e){var t=tn(n),i=t.player,r=t.pos;if(!(r.isDown||r.isEnter||i.isMini||!i.config.allowSeekAfterEnded&&i.ended)){r.isEnter=!0,n.bind("mousemove",n.onMoveOnly),n.bind("mouseleave",n.onMouseLeave),yn.event(e);var o=yn.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),Ji(tn(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),Ji(tn(n),"onVideoResize",(function(){var e=n.pos,t=e.x,i=e.isDown;if(e.isEnter&&!i){var r=n.computeTime(null,t);n.onMoveOnly(null,r)}})),n.useable=!1,n.isProgressMoving=!1,n.__dragCallBacks=[],n._state={now:-1,direc:0,time:0,prePlayTime:-1},n._disableBlur=!1,n}return Xi(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i+this.timeOffset}},{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]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var n=Ki(Ki({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new ba(n),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,i=t.fragFocusClass,n=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:i,fragAutoFocus:n,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===Sn.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(Un,(function(){e.onMouseLeave()})),this.on(Nn,(function(){e.onTimeupdate()})),this.on(Rn,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(zn,(function(){e.onCacheUpdate()})),this.on(Ln,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(Wn,(function(){e.onReset()})),this.on(cr,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,i=null;Object.keys(e).forEach((function(n){t.config[n]=e[n],"fragments"===n&&(i=e[n])})),i&&this._initInner(i,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===$i(e)&&Object.keys(e).map((function(i){t.style[i]=e[i]})))}},{key:"triggerCallbacks",value:function(e,t,i){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,i)}catch(r){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," 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 i=this.__dragCallBacks,n=-1;i.map((function(i,r){i&&i.type===e&&i.handler===t&&(n=r)})),n>-1&&i.splice(n,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,t.isLocked=!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,i=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",yn.stopPropagation),t.center&&t.center.addEventListener("touchend",yn.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==i.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(),yn.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),yn.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,i,n){var r=this.config,o=this.player;if(!r.isCloseClickSeek||0!==n){var a=t=t>=o.duration?o.duration-r.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==n||r.isDragingSeek&&"audio"!==o.config.mediaType)&&(this._state.now=a,this._state.direc=a>o.currentTime?0:1,o.seek(a))}}},{key:"computeTime",value:function(e,t){var i,n,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===r.rotateDeg?(i=s,n=l):(i=a,n=c);var h=u-n,d=(h=h>i?i:h<0?0:h)/i;d=d<0?0:d>1?1:d;var f=parseInt(d*this.offsetDuration*1e3,10)/1e3;return{percent:d,currentTime:f,seekTime:yn.getCurrentTimeByOffset(f,r.timeSegments),offset:h,width:i,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,i=this.duration;e>i?e=i:e<0&&(e=0);var n=t.plugins.time;n&&n.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.offsetDuration},this.offsetDuration);var i=this.player.plugins.miniprogress;i&&i.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,i=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(i.now>-1){var r=parseInt(1e3*i.now,10)-parseInt(1e3*t.currentTime,10);if(0===i.direc&&r>300||1===i.direc&&r>-300)return void(i.now=-1);i.now=-1}var o=this.currentTime;o=yn.adjustTimeByDuration(o,n,e),this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},n)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=yn.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i);var r=this.player.plugins.miniprogress;r&&r.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%";var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var i=this.domEventType;"touch"!==i&&"compatible"!==i||(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",yn.stopPropagation),t.center&&t.center.removeEventListener("touchend",yn.stopPropagation))),"mouse"!==i&&"compatible"!==i||(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}}]),i}(Qr),Ta=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Ji(tn(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return Xi(i,[{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)}}]),i}(Qr),Sa=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{key:"afterCreate",value:function(){var e=this;an(Qi(i.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([Dn,An,Wn],(function(){e.animate(t.paused)})),this.on(On,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:Io,class:"xg-icon-play"},pause:{icon:Lo,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,i=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),i&&this.changeLangTextKey(i,t.PLAY_TIPS)):(this.setAttr("data-state","play"),i&&this.changeLangTextKey(i,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){an(Qi(i.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}}}]),i}(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 xa=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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(){yn.addClass(this.root,"show")}},{key:"hide",value:function(){yn.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}}}]),i}(Qr);function Ea(){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 Pa(){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 Oa=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(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 Xi(i,[{key:"afterCreate",value:function(){var e=this;an(Qi(i.prototype),"afterCreate",this).call(this);var t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=yn.getFullScreenEl();n.fullscreenTarget===r&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var i=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:i,to:!i})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(nr,(function(t){var i=e.find(".xg-tips");i&&e.changeLangTextKey(i,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:xa,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Sn.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:Ea,class:"xg-get-fullscreen"},exitFullscreen:{icon:Pa,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){an(Qi(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Sn.device?"touchend":"click",this.handleFullscreen),"mobile"===Sn.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,i=this.config;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):i.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):i.switchCallback&&"function"==typeof i.switchCallback?i.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(){an(Qi(i.prototype),"show",this).call(this)}},{key:"hide",value:function(){an(Qi(i.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}}}]),i}(Ta),Ia=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),(n=t.call(this,e)).isActiving=!1,n}return Xi(i,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,i=e.duration;return this.playerConfig.customDuration||t||i}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{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([Un,Rn,Nn],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(Ln,(function(){e.onTimeUpdate(!0)})),this.on(Wn,(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,i=this.config,n=this.duration;if(!i.disable&&!this.isActiving&&t.hasStart){var r=this.currentTime+this.timeOffset;r=yn.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(yn.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=yn.format(n))):(this.timeDom.innerHTML=this.minWidthTime(yn.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=yn.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(yn.format(0)),this.centerDurDom.innerHTML=yn.format(0)):(this.timeDom.innerHTML=this.minWidthTime(yn.format(0)),this.durationDom.innerHTML=yn.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=yn.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=yn.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?(yn.hide(this.durationDom),yn.hide(this.timeDom),yn.hide(this.find(".time-separator")),yn.show(this.find(".time-live-tag"))):yn.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(yn.hide(this.durationDom),yn.hide(this.timeDom),yn.hide(this.find(".time-separator")),yn.show(this.find(".time-live-tag"))):(yn.hide(this.find(".time-live-tag")),yn.show(this.find(".time-separator")),yn.show(this.durationDom),yn.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(yn.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(yn.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,i=function(){e.isActiving=!1};this.off(Rn,i),t.isSeeking&&t.media.seeking?this.once(Rn,i):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}}}]),i}(Qr),La=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"_onDurationChange",(function(){e.updateSegments();var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=yn.getIndexByTime(i,n),o=yn.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),Ji(tn(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=yn.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),Ji(tn(e),"_onTimeupdate",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=n.length;e.lastCurrentTime=i;var o=yn.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=yn.getOffsetCurrentTime(i,n,o);if(e.player.offsetCurrentTime=a,e.curPos){var s=e.curPos,l=s.start,c=s.end;i<l?e.player.currentTime=l:i>c&&o>=r-1&&e.player.pause()}}})),Ji(tn(e),"_onSeeking",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n))if(i<n[0].start)e.player.currentTime=n[0].start;else if(i>n[n.length-1].end)e.player.currentTime=n[n.length-1].end;else{var r=yn.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),Ji(tn(e),"_onPlay",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;e._checkIfEnabled(n)&&i>=n[n.length-1].end&&(e.player.currentTime=n[0].start)})),e}return Xi(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(Un,this._onDurationChange),this.on(Fn,this._onLoadedData),this.on(Nn,this._onTimeupdate),this.on(Mn,this._onSeeking),this.on(On,this._onPlay)}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,t=e.disable,i=e.segments,n=this.player;if(t||!i||0===i.length)n.timeSegments=[],n.offsetDuration=0,n.offsetCurrentTime=-1;else{var r=this.formatTimeSegments(i,n.duration);n.timeSegments=r,n.offsetDuration=r.length>0?r[r.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,t){var i=[];return e?(e.sort((function(e,t){return e.start-t.start})),e.forEach((function(e,n){var r={};if(r.start=e.start<0?0:e.start,r.end=t>0&&e.end>t?t:e.end,!(t>0&&r.start>t)){i.push(r);var o=r.end-r.start;if(0===n)r.offset=e.start,r.cTime=0,r.segDuration=o,r.duration=o;else{var a=i[n-1];r.offset=a.offset+(r.start-a.end),r.cTime=a.duration+a.cTime,r.segDuration=o,r.duration=a.duration+o}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,n){var r=-1,o=n[i],a=o.start,s=o.end;if(e>=a&&e<=s)return r;var l=e-t;if(l<0&&e<a){var c=t>a?t-a:0;return r=i-1>=0?n[i-1].end+l+c:0}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),i}(Vr);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="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 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="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 Ma(){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 Ra=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=tn(e).player,n=e.find(".xgplayer-bar");yn.event(t);var r=n.getBoundingClientRect(),o=yn.getEventPos(t,i.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})),Ji(tn(e),"onBarMouseMove",(function(t){var i=tn(e)._d;if(i.isStart){var n=tn(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),yn.event(t);var a=yn.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),Ji(tn(e),"onBarMouseUp",(function(t){yn.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=tn(e)._d;i.isStart=!1,i.isMoving=!1})),Ji(tn(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Ji(tn(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Ji(tn(e),"onVolumeChange",(function(t){if(e.player){var i=e.player,n=i.muted,r=i.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=n||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(n,r)}})),e}return Xi(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:Aa,class:"xg-volume-small"},volumeLarge:{icon:Da,class:"xg-volume"},volumeMuted:{icon:Ma,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,i=t.commonStyle,n=t.volume;i.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=i.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"!==Sn.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(Hn,this.onVolumeChange),this.once(Fn,this.onVolumeChange),"Number"!==yn.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var i=this.player,n=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&n){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:i.volume,to:a}};i.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:s}),i.volume=Math.max(Math.min(o/1e3,1),0),i.muted&&(i.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,i=e.muted,n=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);n.innerText=i?0:Math.ceil(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(yn.clearTimeout(this,this._timerId),this._timerId=null),yn.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(yn.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=yn.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),yn.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(n)),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&&(yn.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"===Sn.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}}}]),i}(Qr);function Na(){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 ja=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return Xi(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){an(Qi(i.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&&yn.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(){an(Qi(i.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 i=this.player,n=this.rootWidth,r=this.rootHeight,o=i.root,a=i.innerContainer,s=i.media,l=o.offsetWidth,c=a&&t?a.offsetHeight:o.offsetHeight,u=n,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?i.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],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*i)%1,this.updateRotateDeg(this.rotateDeg,t),n.emit(hr,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:Na}}},{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}}}]),i}(Ta);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</svg>',"image/svg+xml").firstChild}function Ua(){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 Ha="picture-in-picture",Fa="inline",Va="fullscreen",za=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(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 Xi(i,[{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()&&(an(Qi(i.prototype),"afterCreate",this).call(this),this.pMode=Fa,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Zn,(function(){e.config.showIcon&&(yn.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:Ba,class:"xg-get-pip"},pipIconExit:{icon:Ua,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 i=t.paused;yn.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(ur,!1)},this.enterPIPCallback=function(i){t.emit(ur,!0),null!=i&&i.pictureInPictureWindow&&(e.pipWindow=i.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(i){var n=t.media.webkitPresentationMode;e.pMode===Va&&n!==Va&&t.onFullscreenChange(null,!1),e.pMode=n,n===Ha?e.enterPIPCallback(i):n===Fa&&e.leavePIPCallback(i)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=sn(document.styleSheets).map((function(t){try{return sn(t.cssRules).map((function(e){return e.cssText})).join("")}catch(Kl){var i=document.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media,i.href=t.href,e.document.head.appendChild(i)}return""})).filter(Boolean).join("\n"),i=document.createElement("style");i.textContent=t,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,n=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=n.poster;if(o&&(t.media.poster="String"===yn.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var a={};if(r.width&&r.height)a.width=r.width,a.height=r.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(i){var n=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var a=n||t.root,s=a.parentElement,l=a.previousSibling,c=a.nextSibling;e.copyStyleIntoPiPWindow(i);var u=document.createElement("style");if(u.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(r)),h&&u.append(h)}else a===t.root&&u.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(u),i.document.body.append(a),i.addEventListener("pagehide",(function(t){s&&(c?s.insertBefore(a,c):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else i.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(l){return console.error("requestPiP",l),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;if(this.isPIPAvailable()&&this.isPip)this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():i.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(n){return console.error("exitPIP",n),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===Ha}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return("Boolean"!==yn.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===yn.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===yn.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){an(Qi(i.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),i.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,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),i}(Ta);function Ga(){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 Wa=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"playNext",(function(e){var t=tn(n).player;e.preventDefault(),e.stopPropagation(),n.idx+1<n.config.urlList.length?(n.idx++,n.nextHandler(n.config.urlList[n.idx],n.idx),t.emit(fr,n.idx+1)):(n.nextHandler(),t.emit(fr))})),n.idx=-1,n}return Xi(i,[{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:Ga}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Sn.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:[]}}}]),i}(Qr),Ka={exports:{}};Ka.exports=function e(t,i,n){var r,o,a=window,s="application/octet-stream",l=n||s,c=t,u=!i&&!n&&c,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=i||"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(/[:;,]/),i=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=n.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=n.charCodeAt(o);return new f([a],{type:i})}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 i=document.createElement("iframe");document.body.appendChild(i),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),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 $a=Ka.exports;function Ya(){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 qa=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===yn.typeOf(t)?i=t:"Array"===yn.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);$a(r),n.isLock=!0,n.timer=window.setTimeout((function(){n.isLock=!1,window.clearTimeout(n.timer),n.timer=null}),300)}})),n.timer=null,n.isLock=!1,n}return Xi(i,[{key:"afterCreate",value:function(){an(Qi(i.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:Ya}}},{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(){an(Qi(i.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}}}]),i}(Ta),Xa=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){an(Qi(i.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 i=document.createElement("a");i.href=e,i.download=t;var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(n)}},{key:"createCanvas",value:function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d");this.canvasCtx=n,this.canvas=i,i.width=e||this.config.width,i.height=t||this.config.height,n.imageSmoothingEnabled=!0,n.imageSmoothingEnabled&&(n.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var i=this.config;this.shot(i.width,i.height).then((function(e){t.emit(dr,e),i.saveImg&&t.saveScreenShot(e,i.name+i.format)}))}},{key:"shot",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=n.quality||r.quality,s=n.type||r.type;return new Promise((function(n,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{i.canvas?(i.canvas.width=e||r.width,i.canvas.height=t||r.height):i.createCanvas(e,t),u=i.canvas,c=i.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");n(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){an(Qi(i.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,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(Ta),Ja=function(){function e(t){Yi(this,e),this.config=t.config,this.parent=t.root,this.root=yn.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var i=this.config.maxHeight;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="mobile"===Sn.device?"touchend":"click";this._delegates=Qr.delegate.call(this,this.root,"li",n,this.onItemClick)}return Xi(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"option-item selected":"option-item";e["data-index"]=i,t.root.appendChild(yn.createDom("li","<span>".concat(e.showText,"</span>"),e,n))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&yn.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");yn.addClass(t,"selected"),n&&yn.removeClass(n,"selected"),i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){yn.removeClass(this.root,"hide"),yn.addClass(this.root,"active")}},{key:"hide",value:function(){yn.removeClass(this.root,"active"),yn.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{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}(),Za="side",Qa="middle",es="click",ts="hover";var is="mobile"===Sn.device,ns=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),Ji(tn(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===es?n.toggle(!n.isActive):n.toggle(!0)})),Ji(tn(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==Za&&n.isActive&&n.toggle(!1)})),Ji(tn(n),"onListEnter",(function(e){n.enterType=2})),Ji(tn(n),"onListLeave",(function(e){n.enterType=0,n.isActive&&n.toggle(!1)})),n.isIcons=!1,n.isActive=!1,n.curValue=null,n.curIndex=0,n}return Xi(i,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),is&&t.listType!==Qa&&(t.listType=Za),t.hidePortrait&&yn.addClass(this.root,"portrait"),this.on([cr,nr],(function(){e._resizeList()})),this.once(Bn,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),is&&this.on(Kn,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),is?(t.toggleMode=es,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===es?"click":"mouseenter",t.toggleMode===es?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,i=Object.keys(t),n=!1;i.length>0&&(i.forEach((function(i){e.appendChild(".xgplayer-icon",t[i]),!n&&(n=t[i])})),this.isIcons=n),n||(this.appendChild(".xgplayer-icon",yn.createDom("span","",{},"icon-text")),yn.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||yn.addClass(this.root,"show")}},{key:"hide",value:function(){yn.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var n=this.config.list;!i&&(i=this.player.lang),t=!t||yn.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===$i(e[t])?e[t][i]||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,i=this.config.listType;e?(i===Za?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===Za?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var i=this.config,n=i.listType,r=i.list;this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||is||n===Za)&&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 i=this,n=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=n.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a,s,l={config:{data:e||[],className:(a=n.listType,s=n.position,a===Za?s===qr.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)}},root:n.listType===Za?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===Qa?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new Ja(l),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===Qa?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===es?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:ts,heightLimit:!0}}}]),i}(Qr),rs=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return Xi(i,[{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;an(Qi(i.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||yn.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,i=e.defaultDefinition;if(t.length>0){var n=null;t.map((function(e){e.definition===i&&(n=e)})),n||(n=t[0]),this.changeDefinition(n)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],n=arguments.length>1?arguments[1]:void 0,r=n&&n.definition?n.definition:this.config.defaultDefinition;n&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,i){var n=Ki(Ki({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));an(Qi(i.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 n=this.player.definitionList;an(Qi(i.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<n.length;r++)t.to&&n[r].definition===t.to.definition&&(t.to.url=n[r].url),t.from&&n[r].definition===t.from.definition&&(t.from.url=n[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return Ki(Ki({},ns.defaultConfig),{},{position:qr.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(ns),os=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),(n=t.call(this,e)).curRate=1,n}return Xi(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,i=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(i)&&(e.config.list=i.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;an(Qi(i.prototype),"afterCreate",this).call(this),this.on(Vn,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&an(Qi(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){an(Qi(i.prototype),"onItemClick",this).apply(this,arguments);var n=e.delegateTarget,r=Number(n.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 n=-1,r=this.config.list.map((function(i,r){var o={rate:i.rate};return o.rate===t&&(o.selected=!0,n=r),o.showText=e.getTextByLang(i),o}));an(Qi(i.prototype),"renderItemList",this).call(this,r,n)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],i="";i=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=i}}},{key:"destroy",value:function(){an(Qi(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return Ki(Ki({},ns.defaultConfig),{},{position:qr.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}(ns);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)" 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 ss(){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 ls=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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;an(Qi(i.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,i=this.find(".xg-tips");i&&this.changeLangTextKey(i,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:as,class:"xg-get-cssfull"},exitCssFullscreen:{icon:ss,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){an(Qi(i.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}}}]),i}(Ta),cs=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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(An,(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,i=e.errorType,n=t.errorNote?this.i18n[t.errorNote]:"";if(!n)switch(i){case"decoder":n=this.i18n.MEDIA_ERR_DECODE;break;case"network":n=this.i18n.MEDIA_ERR_NETWORK;break;default:n=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=n,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"}}]),i}(Qr),us=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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(i){t.root.style[i]=e[i]}))}},{key:"show",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=n;var r=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),yn.addClass(this.root,"show"),"arrow"===i.mode&&yn.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>"):""),i.style&&this.setStyle(i.style);var o="boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide;if(o){var a=i.interval||r;this.intervalId=setTimeout((function(){t.hide()}),a)}}}},{key:"hide",value:function(){yn.removeClass(this.root,"show"),yn.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(no.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(){}}}}]),i}(Qr),hs={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function ds(e){Object.keys(hs).map((function(t){void 0===e[t]&&(e[t]=hs[t])}))}var fs={_updateDotDom:function(e,t){if(t){var i=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(i.left,"%"),n.width="".concat(i.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),i.isMini?yn.addClass(t,"mini"):yn.removeClass(t,"mini"),Object.keys(n).map((function(e){t.style[e]=n[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],i=this.player.plugins.progress;if(i&&(t&&(ds(e),this._ispots.push(e)),this.ispotsInit||!t)){var n=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(n.left,"%"),r.width="".concat(n.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",s=yn.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]})),i.outer&&i.outer.appendChild(s),this.positionDot(s,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,i){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],i=this.player.plugins.progress;if(i){var n=this.findDot(e.id);if(n&&Object.keys(e).map((function(t){n[t]=e[t]})),this.ispotsInit){var r=i.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,i=this.player.plugins.progress;if(i){for(var n=[],r=0;r<t.length;r++)t[r].id===e&&n.push(r);for(var o=n.length-1;o>=0;o--)if(t.splice(n[o],1),this.ispotsInit){var a=i.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"),i=t.length-1;i>=0;i--)e.outer.removeChild(t[i]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.player.plugins.progress;if(i)if(this.ispotsInit){this._ispots=[];var n=i.root.getElementsByTagName("xg-spot"),r=n.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)i.outer.removeChild(n[o]);t.forEach((function(t,i){i<r?(n[i].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,i=this.playerSize,n=this.player.sizeInfo,r=this.player.plugins.progress;r&&n.width!==i.width&&(i.width=n.width,i.left=n.left,t.forEach((function(t){var i=r.find('xg-spot[data-id="'.concat(t.id,'"]'));i&&e.positionDot(i,t.id)})))},positionDot:function(e,t){var i=yn.findDom(e,".xgplayer-spot-pop");if(i){var n=this.playerSize,r=e.getBoundingClientRect(),o=i.getBoundingClientRect(),a=r.left-n.left,s=n.width-a-r.width/2;if(a<o.width/2||n.width<o.width){var l=o.width/2-a;i.style.left="".concat(l,"px")}else if(s<o.width/2){var c=s-o.width/2+r.width/2;i.style.left="".concat(c,"px")}else i.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(i){var n=t.find('xg-spot[data-id="'.concat(i.id,'"]'));e._updateDotDom(i,n)}))},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 ps={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},gs=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),Ji(tn(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(yn.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||yn.hasClass(e.target,"xg-spot-content"))&&(yn.event(e),e.stopPropagation()))})),Ji(tn(n),"onMousedown",(function(e){n.config.disable||(n._state.f||yn.hasClass(e.target,"xg-spot-content"))&&(yn.event(e),e.stopPropagation())})),Ji(tn(n),"onMouseup",(function(e){if(n.isDrag){var t=n.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Ji(tn(n),"onDotMouseLeave",(function(e){if(!n.config.disable){n._curDot.removeEventListener("mouseleave",n.onDotMouseLeave),n.blurDot(e.target),n._curDot=null;var t=n.player.plugins.progress;t&&t.enableBlur(),n.show()}})),Ji(tn(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&yn.hasClass(t.target,"xgplayer-spot")&&!n._curDot){n._curDot=t.target,n.focusDot(t.target),n._curDot.children.length>0&&n.hide();var i=n.player.plugins.progress;i&&i.disableBlur(),n._curDot.addEventListener("mouseleave",n.onDotMouseLeave)}})),n._ispots=[],n.videoPreview=null,n.videothumbnail=null,n.thumbnail=null,n.timeStr="",n._state={now:0,f:!1},n}return Xi(i,[{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,i){i.seekTime&&e.player.seek(i.seekTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(yn.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(fs).map((function(t){e[t]=fs[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return ds(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(Un,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(cr,(function(){e.positionDots()}))}(this),this.on(Un,(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(i){t.config[i]=e[i]}))}},{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(ps).map((function(i){e[ps[i]]=e[ps[i]].bind(e),t.addCallBack(i,e[ps[i]])})),"mobile"!==Sn.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 i=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),i(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&&yn.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&yn.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||yn.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(i){e[i]=t.target.getAttribute("data-".concat(i))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var i=this.root,n=this.previewLine,r=this.player,o=this.config,a="flex"===r.controls.mode,s=i.getBoundingClientRect().width;if(s||!this._hasThumnail){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&&(n.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,i=this.timePoint;t.innerHTML=e,!this.thumbnail&&(i.innerHTML=e)}},{key:"updatePosition",value:function(e,t,i,n){var r=this.root,o=this.config,a=this._state;if(r){a.now=i,this.transformTimeHook(i);var s=this.timeStr;n&&n.target&&yn.hasClass(n.target,"xgplayer-spot")?(this.showTips(n.target.getAttribute("data-text"),!1,s),this.focusDot(n.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(n.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,i=this.videoPreview,n=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,n.width,n.height);var o=i&&i.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"!==Sn.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){yn.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&yn.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=n.createThumbnail(r,"progress-thumbnail"),i.isShowCoverPreview&&(this.videoPreview=yn.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else yn.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var i=this.player.plugins.progress,n=this.player,r=i.root.getBoundingClientRect().width,o=n.duration/r*6;return e+t>n.duration&&(t=n.duration-e),n.duration,n.duration,{left:e/n.duration*100,width:t/n.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var i=this.root.getBoundingClientRect().width,n=t.time/this.player.duration*i;this.updatePosition(n,i,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),yn.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(yn.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";yn.addClass(this.root,"no-timepoint"),e&&(yn.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(yn.addClass(this.root,"product"),this.tipText.textContent=e):(yn.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){yn.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",yn.removeClass(this.find(".xg-spot-content"),"show-text"),yn.removeClass(this.root,"product")}},{key:"hide",value:function(){yn.addClass(this.root,"hide")}},{key:"show",value:function(){yn.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(ps).map((function(i){t.removeCallBack(i,e[ps[i]])})),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"===Sn.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}}}]),i}(Qr),vs=function(e){Zi(i,e);var t=rn(i);function i(e){var n;return Yi(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return Xi(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([Un],(function(){var t=e.config,i=t.pic_num,n=t.interval;e.usable&&(e.interval=n>0?n:Math.round(1e3*e.player.duration/i)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,i=e.pic_num;return t&&t.length>0&&i>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,i=e.height,n=e.pic_num,r=e.interval;this.ratio=t/i*100,this.interval=r||Math.round(this.player.duration/n),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 i=this.config.urls,n=i.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<n-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<n&&(t._preloadMark[e]=1,yn.preloadImg(i[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.config,r=n.pic_num,o=n.row,a=n.col,s=n.width,l=n.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&&i){var v=t/i;v<s/l?p=(g=i)*(s/l):g=(p=t)/(s/l)}else i?t||(p=(g=i||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 i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=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,i,n);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 i=yn.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(i),i}}],[{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}}}]),i}(Qr);function ys(e){return e?"background:".concat(e,";"):""}var ms=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{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){var e=this.playerConfig.commonStyle,t={cached:ys(e.cachedColor),played:ys(e.playedColor),progress:ys(e.progressColor)};return'<xg-mini-progress class="xg-mini-progress" style="'.concat(t.progress,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(t.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(t.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),i}(Qr),_s="realtime",bs="firstframe",ks="poster";function ws(){try{return parseInt(window.performance.now(),10)}catch(Kl){return(new Date).getTime()}}var Ts=null,Ss=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(Nn,e.renderOnTimeupdate),e.on(Nn,e.renderOnTimeupdate))})),Ji(tn(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Ji(tn(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(Nn,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),Ji(tn(e),"start",(function(t,i){var n=e.player.video,r=ws(),o=e.checkVideoIsSupport(n);o&&e.canvasCtx&&(i||(i=e.interval),e.stop(),n.videoWidth&&n.videoHeight&&(e.videoPI=n.videoHeight>0?parseInt(n.videoWidth/n.videoHeight*100,10):0,(e.config.mode===_s||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?yn.setTimeout(tn(e),e.start,i):yn.requestAnimationFrame(e.start))})),Ji(tn(e),"stop",(function(){e.frameId&&("timer"===e._loopType?yn.clearTimeout(tn(e),e.frameId):yn.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return Xi(i,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),i.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,r=t.mode,o=t.frameRate;n||(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._loopType=this.config.mode!==_s&&this.interval>=1e3?"timer":"animation",this.once(Zn,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==ks&&(r!==bs&&(this.on(Wn,(function(){e.stop()})),this.on(On,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Dn,(function(){e.stop()}))),this.on(Fn,this.onLoadedData),this.on(Gn,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){"root"===i&&e[i]!==t.config[i]?t.reRender(e[i]):"frameRate"===i?t.interval=parseInt(1e3/e[i],10):"disable"===i&&e[i]&&t.stop(),t.config[i]=e[i]}))}},{key:"init",value:function(e){var t=this.player,n=this.config;this.canvasFilter=i.supportCanvasFilter();try{var r=e||n.root;r||(r=n.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(Kl){gn.logError("plugin:DynamicBg",Kl)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var i=this.config.startInterval;this._checkIfCanStart()&&this.start(0,i)}else this.root=null}}},{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"!==Sn.browser||!yn.isMSE(t)))return t;var i=t?t.tagName.toLowerCase():"";return"canvas"===i||"img"===i?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===yn.typeOf(e)?e:"String"===yn.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==bs&&e!==ks}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var i=this.canvas.getBoundingClientRect(),n=i.width,r=i.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=n;var e=parseInt(n/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 i=this._pos,n=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==i.width||a!==i.height||i.pi!==t){var s=parseInt(o/a*100,10);i.pi=t,i.width!==o&&(i.width=this.canvas.width=o),i.height!==a&&(i.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)),i.rwidth=c*n.multiple,i.rheight=l*n.multiple,i.x=(o-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=n.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(Kl){gn.logError("plugin:DynamicBg",Kl)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),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,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof Ts?Ts:Ts=function(){try{return!!document.createElement("canvas").getContext}catch(Kl){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Sn.browser||"firefox"===Sn.browser)}}]),i}(Qr),Cs="info",xs=kr,Es=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var i=e._getTime(),n=Object.assign({},t,{msg:t.msg||t.action});e._stats.info.push(Ki(Ki({type:"userAction"},i),{},{payload:n}))})),Ji(tn(e),"_onReset",(function(){e.reset()})),Ji(tn(e),"_recordInfo",(function(t){e.info(t)})),Ji(tn(e),"_downloadStats",(function(){var t=e.getStats(),i=new Blob([JSON.stringify(t)],{type:"application/json"}),n=window.URL.createObjectURL(i),r=document.createElement("a");r.style.display="none",r.href=n,r.download="player.txt",r.disabled=!1,r.click()})),e}return Xi(i,[{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(xs.STATS_INFO,this._recordInfo),this.on(xs.STATS_DOWNLOAD,this._downloadStats),this.on(xs.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(Ki(Ki({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=Ki({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=(Ji(e={},Cs,[]),Ji(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],i=0;i<e.buffered.length;i++)t.push({start:e.buffered.start(i),end:e.buffered.end(i)});var n={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=n,{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,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(n){console.log("err",n)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{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{}}}]),i}(Vr),Ps=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=tn(e),n=t.player,r=t.config;if(n.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(n.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!n.media.paused||0===n.media.currentTime||!e.hasPlayed){var o=n.media.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,l=n.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>n.media.duration)){var h=u-l,d=h<=a;h<i.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(n.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",d," currentTime:",n.media.currentTime," jumpSize:",l-n.media.currentTime),.08!==u&&n&&n.emit("log",{type:"oneevent",end_type:"gap",vid:n.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return Xi(i,[{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(jn,this.onGapJump),this.on(On,(function(){e.hasPlayed=!0})),this.on(Mn,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,i){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var n=this._getBuffered(e),r=null,o=0;o<n.length;o++){if(n[o].start>t&&(0===o||n[o-1].end-t<=i)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),i}(Qr);Ps.BROWSER_GAP_TOLERANCE=.001;var Os=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=tn(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Ji(tn(e),"onJump",(function(){var t=tn(e),i=t.player,n=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>n.jumpCntMax||!1===n.useWaitingTimeoutJump||i.media.paused&&0!==i.media.currentTime&&e.hasPlayed)){e.jumpSize=n.jumpSize*(e.jumpCnt+1),e.jumpCnt===n.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=i.currentTime+e.jumpSize;r>i.media.duration||(console.log("waitintTimeout, currentTime:",i.currentTime,", jumpTo:",r),e.jumpCnt++,i.currentTime=r)}})),e}return Xi(i,[{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.useWaitingTimeoutJump,n=t.jumpSize;!1!==i&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=n,this.on(jn,this.onWaiting),this.on([In,Bn],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(On,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(Qr),Is="cdn",Ls=["cdn"],Ds=function(e){Zi(i,e);var t=rn(i);function i(){var e;Yi(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ji(tn(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Is;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var i=0;return e.speedListCache[t].map((function(e){i+=e})),Math.floor(i/e.speedListCache[t].length)})),Ji(tn(e),"startTimer",(function(){yn.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Ji(tn(e),"initSpeedList",(function(){e.speedListCache={},Ls.forEach((function(t){e.speedListCache[t]=[]}))})),Ji(tn(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||Is)})),Ji(tn(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,i=t.url,n=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=i+(i.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+"-"+(n+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,i=Math.round(1e3*t/(l-s));e.appendList(i),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(Kl){console.error(Kl)}}}})),Ji(tn(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Is;if(e.speedListCache&&e.speedListCache[i]){var n=e.config.saveSpeedMax;e.speedListCache[i].length>=n&&e.speedListCache[i].shift(),e.speedListCache[i].push(t);var r=tn(e),o=r.player;o&&(i===Is?o.realTimeSpeed=t:o[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),Ji(tn(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Is,i=e.getSpeed(t),n=tn(e),r=n.player;if(r)if(t===Is)r.avgSpeed&&i===r.avgSpeed||(r.avgSpeed=i,r.emit(ir,{speed:i,realTimeSpeed:r.realTimeSpeed}));else{var o=e.getSpeedName("avg",t);r[o]&&i===r[o]||(r[o]=i,r.emit(ir,{speed:i,realTimeSpeed:r.realTimeSpeed}))}})),e}return Xi(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&Ls.push.apply(Ls,sn(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([Fn,Qn],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([Fn,Qn],this.startTimer),Ls.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:[]}}}]),i}(Qr),As=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled)||t.media.getVideoPlaybackQuality&&(this.on(On,(function(){e._startTick()})),this.on(Dn,(function(){e._stopTick()})),this.on(Ln,(function(){e._stopTick()})),this.on(Wn,(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,i,n){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:i,checkInterval:n})):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,i=e.droppedVideoFrames,n=performance.now();if(t&&this._lastCheckPoint){var r=t-this._lastDecodedFrames,o=n-this._lastCheckPoint;this._checkStuck(r,t,i,o)}this._lastDecodedFrames=t,this._lastCheckPoint=n}}},{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}}}]),i}(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 Ms=Xi((function e(t,i){var n,r,o;Yi(this,e);var a=i&&"mobile"===i.isMobileSimulateMode,s=i.isLive,l=[].concat(s?[]:[La,wa,ms,gs,Ia],[Sa,Oa,ja,Wa,rs,os,qa,Xa,Ra,za]),c=[Po,Oo,Mo,ma,Ro,cs,us,vs,Yo];this.plugins=[Es,xo].concat(sn(l),c,[Ps,Os]);var u=a?"mobile":Sn.device;switch(u){case"pc":(n=this.plugins).push.apply(n,[va,Jo,ls,Ds,As]);break;case"mobile":(r=this.plugins).push.apply(r,[pa]);break;default:(o=this.plugins).push.apply(o,[va,Jo,ls])}(Sn.os.isIpad||"pc"===u)&&this.plugins.push(Ss),Sn.os.isIpad&&this.plugins.push(Jo),this.ignores=[],this.i18n=[]})),Rs=function(e){Zi(i,e);var t=rn(i);function i(){return Yi(this,i),t.apply(this,arguments)}return Xi(i)}(yo);Ji(Rs,"defaultPreset",Ms),Ji(Rs,"Util",yn),Ji(Rs,"Sniffer",Sn),Ji(Rs,"Errors",Pn),Ji(Rs,"Events",Tr),Ji(Rs,"Plugin",Qr),Ji(Rs,"BasePlugin",Vr),Ji(Rs,"I18N",uo),Ji(Rs,"STATE_CLASS",no);var Ns={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:"直播"}},js={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:"生放送"}},Bs={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"}},Us=["zh","en","jp","zh-hk"],Hs=0,Fs=1,Vs=2,zs=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}(zs||{}),Gs={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"},Ws="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,Ks={info:"color: #fff; background-color: #5f5f5f;",error:"color: #fff; background-color: #f53f3f;",warn:"color: #fff; background-color: #ff7d00;"},$s="color: #fff; background: #4281ff",Ys="%c VePlayer %c ".concat("1.8.1"," "),qs={config:{debug:Ws?3:1},log:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Ys,Ks.info,$s,e].concat(n))},warn:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Ys,Ks.warn,$s,e].concat(n))},error:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console)[i].apply(t,[Ys,Ks.error,$s,e].concat(r))}}},Xs={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,i=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"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},m=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},_={s:m,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+m(n,2,"0")+":"+m(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,u),o=i-r<0,a=t.clone().add(n+(o?-1:1),u);return+(-(n+(i-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 x},T=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var o=t.toLowerCase();k[o]&&(r=o),i&&(k[o]=i,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!n&&r&&(b=r),r||!n&&b},S=function(e,t){if(w(e))return e.clone();var i="object"==n(t)?t:{};return i.date=e,i.args=arguments,new x(i)},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 x=function(){function n(e){this.$L=T(e.locale,null,!0),this.parse(e)}var y=n.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,i=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 n=t.match(g);if(n){var r=n[2]-1||0,o=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[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 i=S(e);return this.startOf(t)<=i&&i<=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,i){return C.u(e)?this[t]:this.set(i,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var i=this,n=!!C.u(t)||t,r=C.p(e),h=function(e,t){var r=C.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(l)},p=function(e,t){return C.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},g=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(r){case d:return n?h(1,0):h(31,11);case u:return n?h(1,v):h(0,v+1);case c:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return h(n?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 i,n=C.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[l]=c+"Date",i[f]=c+"Date",i[u]=c+"Month",i[d]=c+"FullYear",i[s]=c+"Hours",i[a]=c+"Minutes",i[o]=c+"Seconds",i[r]=c+"Milliseconds",i)[n],p=n===l?this.$D+(t-this.$W):t;if(n===u||n===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(n,r){var h,f=this;n=Number(n);var p=C.p(r),g=function(e){var t=S(f);return C.w(t.date(t.date()+Math.round(e*n)),f)};if(p===u)return this.set(u,this.$M+n);if(p===d)return this.set(d,this.$y+n);if(p===l)return g(1);if(p===c)return g(7);var v=(h={},h[a]=t,h[s]=i,h[o]=e,h)[p]||1,y=this.$d.getTime()+n*v;return C.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||p;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=C.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].slice(0,o)},h=function(e){return C.s(o%12||12,e,"0")},d=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:C.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.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 n.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(n,r,f){var p,g=C.p(r),v=S(n),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/i,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 i=this.clone(),n=T(e,t,!0);return n&&(i.$L=n),i},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()},n}(),E=x.prototype;return S.prototype=E,[["$ms",r],["$s",o],["$m",a],["$H",s],["$W",l],["$M",u],["$y",d],["$D",f]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,x,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}()}(Xs);var Js=Xs.exports,Zs={exports:{}};!function(e,t){var i,n,r;e.exports=(i="minute",n=/[+-]\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(),i):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(n);if(!t)return null;var i=(""+t[0]).match(r)||["-",0,0],o=i[0],a=60*+i[1]+ +i[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,i)).$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,i){if(e&&this.$u===e.$u)return d.call(this,e,t,i);var n=this.local(),r=o(e).local();return d.call(n,r,t,i)}})}(Zs);var Qs=Zs.exports,el=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(r,o,function(t){return e[t]}.bind(null,o));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,i){var n=i(12)("wks"),r=i(13),o=i(0).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=n},function(e,t,i){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(e,t,i){var n=i(4);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,i){var r="function"==typeof Symbol&&"symbol"==n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,i){var n=i(6);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,i){e.exports=!i(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,i){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,i){var n=i(3),r=i(26),o=i(27),a=Object.defineProperty;t.f=i(7)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return a(e,t,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){e.exports=!1},function(e,t,i){var n=i(8),r=i(1)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(i){}}(t=Object(e),r))?i:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,i){var n=i(2),r=i(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:n.version,mode:i(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,i){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,i){var n=i(9),r=i(28);e.exports=i(7)?function(e,t,i){return n.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t,i){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,i){var n=i(4),r=i(0).document,o=n(r)&&n(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,i){var n=i(0),r=i(14),o=i(18),a=i(13)("src"),s=i(29),l=(""+s).split("toString");i(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,i,s){var c="function"==typeof i;c&&(o(i,"name")||r(i,"name",t)),e[t]!==i&&(c&&(o(i,a)||r(i,a,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=i:s?e[t]?e[t]=i:r(e,t,i):(delete e[t],r(e,t,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,i){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,i){e.exports={}},function(e,t,i){var n,r,o,a=i(5),s=i(38),l=i(39),c=i(16),u=i(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=[],i=1;arguments.length>i;)t.push(arguments[i++]);return y[++v]=function(){s("function"==typeof e?e:Function(e),t)},n(v),v},f=function(e){delete y[e]},"process"==i(8)(h)?n=function(e){h.nextTick(a(m,e,1))}:g&&g.now?n=function(e){g.now(a(m,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,n=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):n="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,i){var n=i(6);function r(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},function(e,t,i){e.exports=i(23)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(24);var n,r=(n=i(48))&&n.__esModule?n:{default:n};t.default={url:r.default},e.exports=t.default},function(e,t,i){var n,r,o,a,s=i(10),l=i(0),c=i(5),u=i(11),h=i(25),d=i(4),f=i(6),p=i(30),g=i(31),v=i(37),y=i(20).set,m=i(40)(),_=i(21),b=i(41),k=i(42),w=i(43),T=l.TypeError,S=l.process,C=S&&S.versions,x=C&&C.v8||"",E=l.Promise,P="process"==u(S),O=function(){},I=r=_.f,L=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(O,O)};return(P||"function"==typeof PromiseRejectionEvent)&&e.then(O)instanceof t&&0!==x.indexOf("6.6")&&-1===k.indexOf("Chrome/66")}catch(n){}}(),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 i=e._c;m((function(){for(var n=e._v,r=1==e._s,o=0,a=function(t){var i,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?i=n:(u&&u.enter(),i=s(n),u&&(u.exit(),a=!0)),i===t.promise?c(T("Promise-chain cycle")):(o=D(i))?o.call(i,l,c):l(i)):c(n)}catch(h){u&&!a&&u.exit(),c(h)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&M(e)}))}},M=function(e){y.call(l,(function(){var t,i,n,r=e._v,o=R(e);if(o&&(t=b((function(){P?S.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)})),e._h=P||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;P?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 i,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw T("Promise can't be resolved itself");(i=D(t))?m((function(){var r={_w:n,_d:!1};try{i.call(t,c(e,r,1),c(j,r,1))}catch(o){j.call(r,o)}})):(n._v=t,n._s=1,A(n,!1))}catch(r){j.call({_w:n,_d:!1},r)}}};L||(E=function(e){p(this,E,"Promise","_h"),f(e),n.call(this);try{e(c(B,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(n=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=i(44)(E.prototype,{then:function(e,t){var i=I(v(this,E));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=P?S.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&A(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(B,e,1),this.reject=c(j,e,1)},_.f=I=function(e){return e===E||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!L,{Promise:E}),i(45)(E,"Promise"),i(46)("Promise"),a=i(2).Promise,h(h.S+h.F*!L,"Promise",{reject:function(e){var t=I(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!L),"Promise",{resolve:function(e){return w(s&&this===a?E:this,e)}}),h(h.S+h.F*!(L&&i(47)((function(e){E.all(e).catch(O)}))),"Promise",{all:function(e){var t=this,i=I(t),n=i.resolve,r=i.reject,o=b((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;i.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,i[s]=e,--a||n(i))}),r)})),--a||n(i)}));return o.e&&r(o.v),i.promise},race:function(e){var t=this,i=I(t),n=i.reject,r=b((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,n)}))}));return r.e&&n(r.v),i.promise}})},function(e,t,i){var n=i(0),r=i(2),o=i(14),a=i(17),s=i(5),l=function e(t,i,l){var c,u,h,d,f=t&e.F,p=t&e.G,g=t&e.P,v=t&e.B,y=p?n:t&e.S?n[i]||(n[i]={}):(n[i]||{}).prototype,m=p?r:r[i]||(r[i]={}),_=m.prototype||(m.prototype={});for(c in p&&(l=i),l)h=((u=!f&&y&&void 0!==y[c])?y:l)[c],d=v&&u?s(h,n):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)};n.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,i){e.exports=!i(7)&&!i(15)((function(){return 7!=Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var n=i(4);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,i){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,i){e.exports=i(12)("native-function-to-string",Function.toString)},function(e,t,i){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(5),r=i(32),o=i(33),a=i(3),s=i(34),l=i(36),c={},u={},h=e.exports=function(e,t,i,h,d){var f,p,g,v,y=d?function(){return e}:l(e),m=n(i,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,i){var n=i(3);e.exports=function(e,t,i,r){try{return r?t(n(i)[0],i[1]):t(i)}catch(a){var o=e.return;throw void 0!==o&&n(o.call(e)),a}}},function(e,t,i){var n=i(19),r=i(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[r]===e)}},function(e,t,i){var n=i(35),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},function(e,t,i){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,i){var n=i(11),r=i(1)("iterator"),o=i(19);e.exports=i(2).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[n(e)]}},function(e,t,i){var n=i(3),r=i(6),o=i(1)("species");e.exports=function(e,t){var i,a=n(e).constructor;return void 0===a||null==(i=n(a)[o])?t:r(i)}},function(e,t,i){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var n=i(0).document;e.exports=n&&n.documentElement},function(e,t,i){var n=i(0),r=i(20).set,o=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,l="process"==i(8)(a);e.exports=function(){var e,t,i,c=function(){var n,r;for(l&&(n=a.domain)&&n.exit();e;){r=e.fn,e=e.next;try{r()}catch(o){throw e?i():t=void 0,o}}t=void 0,n&&n.enter()};if(l)i=function(){a.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},function(e,t,i){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,i){var n=i(0).navigator;e.exports=n&&n.userAgent||""},function(e,t,i){var n=i(3),r=i(4),o=i(21);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},function(e,t,i){var n=i(17);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},function(e,t,i){var n=i(9).f,r=i(18),o=i(1)("toStringTag");e.exports=function(e,t,i){e&&!r(e=i?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,i){var n=i(0),r=i(9),o=i(7),a=i(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,i){var n=i(1)("iterator"),r=!1;try{var o=[7][n]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o=[7],a=o[n]();a.next=function(){return{done:i=!0}},o[n]=function(){return a},e(o)}catch(s){}return i}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)};t.default=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var o=void 0;try{o=(0,a.getUri)(e,t,i,n)}catch(u){return Promise.reject(u.message)}var l=new s.default({type:"json",method:"GET",url:o}),c=l.then((function(e){var t=void 0;if(e&&e.response)switch(r(e.response)){case"string":t=JSON.parse(e.response).Result;break;case"object":t=e.response.Result;break;default:t=e.response}else t=e;return t}));return c};var o,a=i(49),s=(o=i(51))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3];try{e=JSON.parse((0,n.decode)(e))}catch(c){throw new Error("base64 decode error: "+c.message)}!1===a.jointSsl||r(i,"ssl")||r(i,"Ssl")||(i.Ssl=1);var s=/^http/.test(t)?t:"//"+t,l=s+"?"+e.GetPlayInfoToken+o(i);return l};var n=i(50),r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function o(e){var t=[];for(var i in e)r(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t=void 0,i=void 0,n=void 0,r=void 0,o=void 0,a=void 0,s=[-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],l=e.length;for(o=0,a="";o<l;){do{t=s[255&e.charCodeAt(o++)]}while(o<l&&-1===t);if(-1===t)break;do{i=s[255&e.charCodeAt(o++)]}while(o<l&&-1===i);if(-1===i)break;a+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(n=255&e.charCodeAt(o++)))return a;n=s[n]}while(o<l&&-1===n);if(-1===n)break;a+=String.fromCharCode((15&i)<<4|(60&n)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return a;r=s[r]}while(o<l&&-1===r);if(-1===r)break;a+=String.fromCharCode((3&n)<<6|r)}return a}},function(e,t,i){function n(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(this,e);var i=t.url,r=t.method,o=void 0===r?"GET":r,a=t.data,s=void 0===a?{}:a,l=t.headers,c=void 0===l?{}:l;return new Promise((function(e,t){var n=new window.XMLHttpRequest,r=o.toUpperCase(),a=[];if("GET"!==r)throw new Error("xhr "+r+" is not supported");for(var l in s)a.push(l+"="+s[l]);for(var u in n.open(r,""+i,!0),n.responseType="",c)Object.prototype.hasOwnProperty.call(c,u)&&n.setRequestHeader(u,""+c[u]);n.onload=function(){200===n.status||206===n.status?e(n):t(n)},n.onerror=n.ontimeout=function(){return t(n)},n.send()}))},e.exports=t.default}]);Js.extend(Qs);var tl=function(e){return e.VIDEO="video",e.EVIDEO="evideo",e}(tl||{}),il=function(e){if(e){var t={},i=function(e){try{return JSON.parse(e)}catch(Kl){return qs.warn("[utils/json] decode fail: ".concat(e),Kl),null}}(vl(e)?window.atob(e):e);if(i&&"string"==typeof i.GetPlayInfoToken)i.GetPlayInfoToken.split("&").map((function(e){var i=e.split("=");i[0]&&i[1]&&(t[i[0]]=i[1])}));return t}},nl=function(e){var t={};return e.split("&").map((function(e){var i=e.split("=");i[0]&&i[1]&&(t[i[0]]=i[1])})),t},rl=function(e){var t,i;if(null==e||!e.playAuthToken)return!1;var n=il(null==e?void 0:e.playAuthToken),r=null!==(t=null==n||null===(i=n.FileType)||void 0===i?void 0:i.toLowerCase())&&void 0!==t?t:"video";return!!n&&("evideo"===r||"eaudio"===r)},ol=function(e){var t,i,n;if(null==e||!e.playAuthToken)return"";var r=il(null==e?void 0:e.playAuthToken),o=null!==(t=null==r||null===(i=r.FileType)||void 0===i?void 0:i.toLowerCase())&&void 0!==t?t:"video",a=null==r||null===(n=r.Format)||void 0===n?void 0:n.toLowerCase();return a||(Object.values(tl).includes(o)?"mp4":"m4a")},al=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;var t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;var i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),n=Js.utc(i,"YYYYMMDD hhmmss");return!!n.isValid()&&n.add(t,"seconds").isBefore(Js())};function sl(e){var i=e.playAuthToken,n=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(i){var h=t(t({},o),{},{NeedThumbs:l?1:0,NeedBarrageMask:u?1:0});return new Promise((function(e,r){el.url(i,n,h).then((function(i){var n=i.Data||i,r=n.Status,o=n.PlayInfoList,s=void 0===o?[]:o,l=n.PosterUrl,c=n.Vid,u=n.Duration,h=n.BarrageMaskUrl,d=n.ThumbInfoList,f=void 0===d?[]:d;if(r===zs.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),hl(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:i.Data?i:{Data:i},thumbs:f,barrageMaskUrl:h})}else e({playList:[],poster:l,vid:c,duration:u,dashOpts:i.Data?i:{Data:i},thumbs:f,barrageMaskUrl:h}),qs.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((function(e){qs.log("err",e),r(e)}))}))}return Promise.resolve()}function ll(e,t,i,n){return cl.apply(this,arguments)}function cl(){return(cl=o(i().mark((function e(t,n,r,o){return i().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),!--n||!r(e.t0)){e.next=12;break}return e.abrupt("return",ll(t,n,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 ul=function(e){return(null==e?void 0:e.length)&&e.reduce((function(t,i,n){return t[i]={next:n+1>=e.length?null:e[n+1],pre:0===n?null:e[n-1]},t}),{})},hl=function(e,i){if(!e||!e.Definition&&!e.Quality)return{definition:"240P"};var n=e.Definition||e.Quality;if(i){var r=i[n];return r?"string"==typeof r?{definition:r}:t({definition:n},r||{}):{definition:n}}return{definition:n}},dl=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 i=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(),i.repeatInterval(e,t)}),t)))}},{key:"clear",value:function(){clearTimeout(this.timeID),this.timeID=null}}]),e}(),fl=l((function e(t){var i=t.url,n=t.method,r=void 0===n?"GET":n,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 n=new window.XMLHttpRequest,a=r.toUpperCase();if("GET"!==a&&"POST"!==a&&"HEAD"!==a)throw new Error("XHR ".concat(a," is not allowed"));if(o&&(n.responseType=o),l&&(n.timeout=l),n.onload=function(){200===n.status||206===n.status?e(n):t(n)},n.onerror=function(){t(n)},n.ontimeout=function(){t(n)},n.onabort=function(){t(n)},"GET"===a&&!d){var s=/\?/gi.test(i)?"&":"?";i+="".concat(s,"_=").concat((new Date).getTime())}if(n.open(a,"".concat(i),!0),u)try{u(n,i)}catch(Kl){console.error("xhr setup failure: ".concat(Kl.stack||Kl.message))}switch(a){case"POST":"text"===o&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(c);break;case"GET":case"HEAD":n.send()}}))})),pl=function(e){return e&&e.then?e:new Promise((function(e){e(null)}))},gl=function(e,t){var i;if(t&&e)return Object.keys(e).map((function(n){n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function vl(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 yl(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function ml(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=setTimeout((function(){i&&qs.warn(i),n=null}),t);return e.then?e.then((function(){return clearTimeout(n)})):(clearTimeout(n),n=null),e}function _l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(n,r){e().then(n).catch((function(o){setTimeout((function(){1!==t?_l(e,t-1,i).then(n,r):r(o)}),i)}))}))}function bl(){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 qs.error("mse error",t),!1}}var kl="undefined"!=typeof window,wl=kl&&navigator.userAgent.toLocaleLowerCase(),Tl=kl&&/^((?!chrome|android).)*safari/.test(wl);function Sl(e){var t={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com",__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.8.1/plugin"}};return e&&t[e]||t.sg}function Cl(e){var t=[];return e.forEach((function(e){t.find((function(t){var i,n;return(null==t||null===(i=t.pluginName)||void 0===i?void 0:i.toLowerCase())===(null==e||null===(n=e.pluginName)||void 0===n?void 0:n.toLowerCase())}))||t.push(e)})),t}var xl=/["'&<>]/;var El=function(){return(El=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Pl(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function Ol(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){r={error:s}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function Il(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ol(arguments[t]));return e}var Ll,Dl=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 i=this;e&&t&&"function"==typeof t&&this.on(e,(function n(r){t(r),i.off(e,n)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var i=this._hooks[e].indexOf(t);-1!==i&&this._hooks[e].splice(i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,i){if(i){if(!e)return;-1!==this._cache.indexOf(i)?this._emit(e,t):(this._hooksCache.hasOwnProperty(i)||(this._hooksCache[i]={}),this._hooksCache[i].hasOwnProperty(e)||(this._hooksCache[i][e]=[]),this._hooksCache[i][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&Il(this._hooks[e]).forEach((function(e){try{e(t)}catch(i){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),Al=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},Ml=function(e){return Array.isArray(e)},Rl=(Ll=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return Ll+=1}),Nl=function(e){return function(e,t,i){if("string"==typeof e&&"number"==typeof i){var n,r=[];i=i<=25?i:i%25;var o=String.fromCharCode(i+97);n=e.split(o);for(var a=0;a<n.length;a++){var s=parseInt(n[a],i);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)},jl=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},Bl=function(e,t,i){var n=document.createElement("script");n.src=e,n.onerror=function(){i(e)},n.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(n)},Ul=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach((function(t){void 0!==document[t]&&(e=1)})),e},Hl=function(e){var t=document.createElement("a");return t.href=e,t},Fl=function(e){var t={};try{var i=Hl(e).search;(i=i.slice(1)).split("&").forEach((function(e){var i,n,r=e.split("=");r.length&&(i=r[0],n=r[1]);try{t[i]=decodeURIComponent(void 0===n?"":n)}catch(o){t[i]=n}}))}catch(n){}return t},Vl=function(e){for(var t=0,i=0,n=(e+="").length,r=0;r<n;r++)((t=31*t+e.charCodeAt(i++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t};function zl(e,t){return e(t={exports:{}},t.exports),t.exports}var Gl,Wl,Kl,$l=zl((function(e,t){var i;i=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function i(n){function r(){}function o(t,i,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(i);/^[\{\[]/.test(a)&&(i=a)}catch(c){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).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+"="+i+s}}function a(e,i){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("=");i||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=t(s[0]);if(l=(n.read||n)(l,c)||t(l),i)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,i){o(t,"",e(i,{expires:-1}))},r.defaults={},r.withConverter=i,r}((function(){}))},e.exports=i()})),Yl=function(e,t){try{return $l.get(e,{domain:t||document.domain})}catch(i){return""}},ql=function(e,t,i,n){try{var r=n||document.domain,o=+new Date+(i||6048e5);$l.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(a){}},Xl=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 Yl(e,t)},e.prototype.setCookie=function(e,t,i,n){ql(e,t,i,n)},e}(),Jl={getItem:function(e){try{var t=localStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(n){}return i||{}}catch(n){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,i)}catch(n){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){return Yl(e,t)},setCookie:function(e,t,i,n){ql(e,t,i,n)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(Kl){return!1}}()},Zl={getItem:function(e){try{var t=sessionStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(n){}return i||{}}catch(n){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,i)}catch(n){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){return Yl(e,t)},setCookie:function(e,t,i,n){ql(e,t,i,n)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(Kl){return!1}}()},Ql=function(){function e(e,t){this._storage=t&&"session"===t?Zl:!e&&Jl.isSupportLS?Jl:new Xl}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,i,n){this._storage.setCookie(e,t,i,n)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),ec=function(){function e(e,t,i){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=i}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,i=document.referrer,n=i?Hl(i).hostname:"",r=Fl(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,i,n){var r=new Ql(!1),o=new Ql(!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),n,i);else{var f=r.getCookie(a,i);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:i,referrer_host:n,utm:this.utm,latest_data:this.last(i,n)}},e.prototype.last=function(e,t){var i="",n="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){i=e,n=t,a=!0;var s=Fl(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:i,$latest_referrer_host:n,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,i="",n=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(i="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),n=r.substring(e+5)):(e=r.indexOf("Edg"),n=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(i="Microsoft Internet Explorer",n=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(i="Lark",n=r.substring(e+5,e+11)):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("TTWebView"))?(i="TTWebView",n=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(i="Chrome",n=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("Safari"))&&(i="Safari",n=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(n=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))&&(i="Firefox",n=r.substring(e+8)),-1!==(t=n.indexOf(";"))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(" "))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(")"))&&(n=n.substring(0,t)),{browser:i,browser_version:n}},e.prototype.os=function(){for(var e="",t="",i=[{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)/}],n=0;n<i.length;n++){var r=i[n];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 i=e.exec(t);return i&&i[1]?i[1]:""},l=function(e,t){var i=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return i?i.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 i=navigator.userAgent.replace("Mozilla/5.0 (",""),n=i.indexOf(";");t=i.slice(0,n)}}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}(),tc={sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},ic={va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},nc={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z21z1ez4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z49z23z21z1cz18z21z22z4ez18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k"},rc={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az23z21z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az23z21z4az22z1gz1iz22z1mz1iz4az1az1mz1k"},oc="5.1.5_oversea",ac=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 i=e[0];if(!i)return!1;var n=i.events,r=i.header;if(!n||!n.length)return!1;var o=!0;return n.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 i in t)return!(!this.calculate(i,"params")||"string"==typeof t[i]&&t[i].length>1024&&(console.warn("params: "+i+" 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}();(Kl=Gl||(Gl={})).Init="init",Kl.Config="config",Kl.Start="start",Kl.Ready="ready",Kl.TokenComplete="token-complete",Kl.TokenStorage="token-storage",Kl.TokenFetch="token-fetch",Kl.TokenError="token-error",Kl.ConfigUuid="config-uuid",Kl.ConfigWebId="config-webid",Kl.ConfigDomain="config-domain",Kl.CustomWebId="custom-webid",Kl.TokenChange="token-change",Kl.TokenReset="token-reset",Kl.ConfigTransform="config-transform",Kl.EnvTransform="env-transform",Kl.SessionReset="session-reset",Kl.SessionResetTime="session-reset-time",Kl.Event="event",Kl.Events="events",Kl.EventNow="event-now",Kl.CleanEvents="clean-events",Kl.BeconEvent="becon-event",Kl.SubmitBefore="submit-before",Kl.SubmitScuess="submit-scuess",Kl.SubmitAfter="submit-after",Kl.SubmitError="submit-error",Kl.SubmitVerify="submit-verify",Kl.DestoryInstance="destory-instance",Kl.Stay="stay",Kl.ResetStay="reset-stay",Kl.StayReady="stay-ready",Kl.SetStay="set-stay",Kl.RouteChange="route-change",Kl.RouteReady="route-ready",Kl.Ab="ab",Kl.AbVar="ab-var",Kl.AbAllVars="ab-all-vars",Kl.AbConfig="ab-config",Kl.AbExternalVersion="ab-external-version",Kl.AbVersionChangeOn="ab-version-change-on",Kl.AbVersionChangeOff="ab-version-change-off",Kl.AbOpenLayer="ab-open-layer",Kl.AbCloseLayer="ab-close-layer",Kl.AbReady="ab-ready",Kl.AbComplete="ab-complete",Kl.AbTimeout="ab-timeout",Kl.Profile="profile",Kl.ProfileSet="profile-set",Kl.ProfileSetOnce="profile-set-once",Kl.ProfileUnset="profile-unset",Kl.ProfileIncrement="profile-increment",Kl.ProfileAppend="profile-append",Kl.ProfileClear="profile-clear",Kl.Autotrack="autotrack",Kl.AutotrackReady="autotrack-ready",Kl.CepReady="cep-ready",Kl.TracerReady="tracer-ready",Kl.sessionRecord="session-record",Kl.SessionRecordStart="session-record-start",Kl.SessionRecordPause="session-record-pause",Kl.SessionRecordEnd="session-record-end",Kl.SessionRecordReport="session-record-report",Kl.VisualCollectReady="visual-collect-ready",Kl.VisualApiReady="visual-api-ready",Kl.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"}(Wl||(Wl={}));var sc=Gl,lc=void 0,cc=(new Date).getTimezoneOffset(),uc=parseInt(""+-cc/60,10),hc=60*cc,dc=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var i=new ec(t.app_id,t.cookie_domain||"",t.cookie_expire||6048e5).init();this.eventCheck=new ac(e,t);var n="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new Ql(!1,"session"),this.localStorage=new Ql(!1,"local"),this.channelUrl="tcpy"===t.channel_type||"ttp"===t.channel_type?{WEBID_URL:"/v1/user/webid",TOB_URL:"",REPORT_URL:"/v1/list"}:{WEBID_URL:"/webid",TOB_URL:"/tobid",REPORT_URL:"/list"},t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var r=this.localStorage.getItem(n);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(n,"1")),this.envInfo={user:{user_unique_id:lc,user_type:lc,user_id:lc,user_is_auth:lc,user_is_login:lc,device_id:lc,web_id:lc,ip_addr_id:lc,user_unique_id_type:lc},header:{app_id:lc,app_name:lc,app_install_id:lc,install_id:lc,app_package:lc,app_channel:lc,app_version:lc,ab_version:lc,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:lc,traffic_type:lc,client_ip:lc,device_brand:lc,os_api:lc,access:lc,language:i.language,region:lc,app_language:lc,app_region:lc,creative_id:i.utm.creative_id,ad_id:i.utm.ad_id,campaign_id:i.utm.campaign_id,log_type:lc,rnd:lc,platform:i.platform,sdk_version:oc,sdk_lib:"js",province:lc,city:lc,timezone:uc,tz_offset:hc,tz_name:lc,sim_region:lc,carrier:lc,resolution:i.screen_width+"x"+i.screen_height,browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:i.utm.utm_term,utm_content:i.utm.utm_content,utm_source:i.utm.utm_source,utm_medium:i.utm.utm_medium,utm_campaign:i.utm.utm_campaign,tracer_data:JSON.stringify(i.utm.tracer_data),custom:{},wechat_unionid:lc,wechat_openid:lc}},this.ab_version="",this.ab_uuid_cache={},this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(i),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(e){var t=this.initConfig.channel_domain;if(t)this.domain=t;else{var i=e||this.initConfig.channel,n=this.initConfig&&this.initConfig.channel_type?"tcpy"===this.initConfig.channel_type?nc[i]:rc[i]:tc[i];this.domain=Nl(n)}},e.prototype.setDomain=function(e){this.customDomain=!0,this.domain=e},e.prototype.getDomain=function(e){return this.customDomain||e&&this.initDomain(e),this.domain},e.prototype.initABData=function(){var e="__tea_sdk_ab_version_"+this.initConfig.app_id,t=null;if(this.initConfig.ab_cross){var i=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=i?JSON.parse(i):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.clearAbCache=function(){this.ab_cache={},this.ab_version=""},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.setAbUuidCache=function(e,t){var i=t||this.envInfo.user.user_unique_id;this.ab_uuid_cache[""+i]||(this.ab_uuid_cache[""+i]=[]),-1===this.ab_uuid_cache[""+i].indexOf(e)&&this.ab_uuid_cache[""+i].push(e)},e.prototype.getAbUuidCache=function(e){return this.ab_uuid_cache[""+e]},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.channelUrl.REPORT_URL;break;case"webid":t=this.channelUrl.WEBID_URL;break;case"tobid":t=this.channelUrl.TOB_URL}var i="";return this.initConfig.caller&&(i="?sdk_version="+oc+"&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+i},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.setAppid=function(e){this.envInfo.header.app_id=e},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(i){void 0!==e[i]&&null!==e[i]||t.delete(i);try{t.eventCheck.calculate(i,"config")}catch(Kl){}if("traffic_type"===i&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[i]),"evtParams"===i)t.evtParams=El({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===i)t.evtParams=El({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===i&&"function"==typeof e[i])t.reportErrorCallback=e[i];else{var n="",r="";if(i.indexOf(".")>-1){var o=i.split(".");n=o[0],r=o[1]}n?"user"===n||"header"===n?t.envInfo[n][r]=e[i]:t.envInfo.header.custom[r]=e[i]:Object.hasOwnProperty.call(t.envInfo.user,i)?["user_type","ip_addr_id"].indexOf(i)>-1?t.envInfo.user[i]=e[i]?Number(e[i]):e[i]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(i)>-1?t.envInfo.user[i]=e[i]?String(e[i]):e[i]:["user_is_auth","user_is_login"].indexOf(i)>-1?t.envInfo.user[i]=Boolean(e[i]):"device_id"===i&&(t.envInfo.user[i]=e[i]):Object.hasOwnProperty.call(t.envInfo.header,i)?t.envInfo.header[i]=e[i]:t.envInfo.header.custom[i]=e[i]}}))},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(Wl.DEBUGGER_MESSAGE,{type:Wl.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 i=Object.assign(e,t);this.storage.setItem(this.configKey,i)}}catch(n){console.log("setStore error"),this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.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(Wl.DEBUGGER_MESSAGE,{type:Wl.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(i){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message}),console.log("delete error")}},e}(),fc=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;","[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),pc=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 i=!1;return this.spiderBot.forEach((function(e){-1!==t.indexOf(e)&&(i=!0)})),i},e}(),gc=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,i){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):i(!1)})):i(!1)}catch(n){console.log("AppLogBridge, error:"+JSON.stringify(n.stack)),i(!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(i){"user_unique_id"===i?t.setUserUniqueId(e[i]):e[i]?t.addHeaderInfo(i,e[i]):t.removeHeaderInfo(i)}))}catch(i){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(i){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(i){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}(),vc=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.eventCheck=new ac(e,t),this.cacheStorgae=new Ql(!0),this.localStorage=new Ql(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||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.collect.on(sc.Ready,(function(){i.reportAll(!1)})),this.collect.on(sc.ConfigDomain,(function(){i.reportUrl=i.configManager.getUrl("event")})),this.collect.on(sc.Event,(function(e){i.event(e)})),this.collect.on(sc.BeconEvent,(function(e){i.beconEvent(e)})),this.collect.on(sc.CleanEvents,(function(){i.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),jl((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 i=Il(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),n)}}catch(r){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.beconEvent=function(e){var t=Il(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroy||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.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.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 i=0;i<e.length;i+=this.eventLimit){var n;n=e.slice(i,i+this.eventLimit);var r=this.split(this.merge(n));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(i){e=document.referrer}return e},e.prototype.merge=function(e,t){var i=this,n=this.configManager.get(),r=n.header,o=n.user;r.custom=JSON.stringify(r.custom),r.referrer=this.handleRefer();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=El({},a,e.params)),s&&(e.params.$user_unique_id_type=s);var n=i.configManager.getAbCache(),r=i.configManager.getAbUuidCache(o.user_unique_id);if(n&&n.uuid&&n.uuid===o.user_unique_id){var l=i.configManager.getAbVersion();if(i.config.enable_ab_uuid){if(r&&r.length){var c=r.join(",");l&&l.includes(c)&&(e.ab_sdk_version=l)}}else l&&(e.ab_sdk_version=l)}return e.session_id=i.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(Kl){return i.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:Kl.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 i=this;e.length&&(this.config.disable_track_event||e.forEach((function(e){try{var n=JSON.parse(JSON.stringify(e));i.config.filter&&((n=i.config.filter(n))||console.warn("filter must return data !!")),i.collect.eventFilter&&n&&((n=i.collect.eventFilter(n))||console.warn("filterEvent api must return data !!"));var r=n||e,o=JSON.parse(JSON.stringify(r));if(i.eventCheck.checkVerify(o),!r.length)return;i.collect.emit(sc.SubmitBefore,r),i.collect.emit(sc.SubmitVerify,r),i.collect.requestManager.useRequest({url:i.reportUrl,data:r,success:function(e,t){e&&0!==e.e?(i.collect.emit(sc.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),i.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:o,code:e.e,failType:"数据异常失败",status:"fail"})):(i.collect.emit(sc.SubmitScuess,{eventData:t,res:e}),i.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:o,code:200,status:"success"}))},fail:function(e,t){i.configManager.get("reportErrorCallback")(e,t),i.collect.emit(sc.SubmitError,{type:"f_net",eventData:e,errorCode:t}),i.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:o,code:t,failType:"网络异常失败",status:"fail"})},timeout:i.timeout,useBeacon:!i.config.disable_sendbeacon&&t,withCredentials:i.enable_ttwebid}),i.collect.emit(sc.SubmitAfter,r)}catch(a){console.warn("something error, "+JSON.stringify(a.stack)),i.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}})))},e}(),yc=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)},mc=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new Ql(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(sc.ConfigUuid,(function(e){i.setUuid(e)})),this.collect.on(sc.ConfigWebId,(function(e){i.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(sc.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(sc.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:yc(),user_unique_id:this.configManager.get("user_unique_id")||yc()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=Fl(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"),i={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(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:i});var n=yc();this.collect.requestManager.useRequest({url:t,data:i,success:function(t){var i;t&&0===t.e?(i=t.web_id,e.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})):(i=n,e.collect.configManager.set({localWebId:n}),e.collect.emit(sc.TokenError),e.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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")||i,user_unique_id:e.configManager.get("user_unique_id")||i})},fail:function(){e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n}),e.collect.configManager.set({localWebId:n}),e.collect.emit(sc.TokenError),e.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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,i=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:i}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(sc.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",i=this.configManager.get("user_unique_id");(i||t)&&this.configManager.set({user_unique_id:i||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(sc.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),i=this.configManager.get("user_unique_id"),n=this.cacheToken&&this.cacheToken.user_unique_id;if(t===i&&t===n)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(sc.TokenChange,"uuid"),this.collect.emit(sc.SessionReset)}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(sc.TokenReset))},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"),i=this.configManager.get("user_unique_id");i&&i!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(sc.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(sc.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){"tcpy"!==e.config.channel_type&&"ttp"!==e.config.channel_type?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}):t("")}))},e}(),_c=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)}))},bc=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.storage=new Ql(!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(sc.SessionReset,(function(){i.resetSessionId()})),this.collect.on(sc.SessionResetTime,(function(){i.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:_c(),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:_c(),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:_c(),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:_c(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),kc=500,wc=5005,Tc=function(e,t,i,n){try{var r,o=e.match(/\/v\d\//);r=o?o[0]:-1!==e.indexOf("/v1/")?"/v1/":"/v2/";var a=e.split(r)[0];if(!a)return void n(e,t,4001);t.forEach((function(r){var o=function(e){var t="";for(var i in e)e.hasOwnProperty(i)&&void 0!==e[i]&&(t+="&"+i+"="+encodeURIComponent(JSON.stringify(e[i])));return"&"===t[0]?t.slice(1):t}(r),s=new Image(1,1);s.onload=function(){s=null,i&&i()},s.onerror=function(){s=null,n&&n(e,t,4e3)},s.src=a+"/gif?"+o}))}catch(s){n&&n(e,t,4002,s.message)}},Sc=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,i=e.data,n=e.method,r=e.success,o=e.fail;window.fetch?fetch(t,{method:n||"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(i)}).then((function(e){return e.json()})).then((function(e){r&&r(e)})).catch((function(e){o&&o(i,e)})):(this.requestType="xhr",console.log("your brwoser not support fetch, use xhr"),this.useRequest({url:t,data:i,method:n,success:r,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,i=e.data,n=e.success,r=e.fail;window.navigator.sendBeacon(t,JSON.stringify(i))?n&&n():r&&r(i,this.errorCode.BEACON_FALSE)},e.prototype.useRequest=function(e){var t=this,i=e.url,n=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:i,data:n,method:r,success:o,fail:a});else if("fetch"!==this.requestType||h)try{var d=new XMLHttpRequest,f=r||"POST";d.open(f,""+i,!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(n,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,n)}}},d.onerror=function(){d.abort(),a&&a(n,t.errorCode.XHR_ON)},d.send(JSON.stringify(n))}catch(p){}else this.useFetch({url:i,data:n,method:r,success:o,fail:a})},e}(),Cc=function(){function e(e,t){if(this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,t.enable_debug){this.collect=e,this.config=t,this.app_id=t.app_id;var i=e.adapters.storage;this.cacheStorgae=new i(!1,"session"),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(i){console.log("devTool load fail, "+i.message)}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach((function(t){var i=t.split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}))}catch(i){}return e},e.prototype.load=function(){try{var e=this.parseUrl();if(e.open_devtool_web&&e.app_id){if(parseInt(e.app_id)!==this.app_id)return}else if(!this.getStorage())return;this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(t){console.log("debug fail, "+t.message)}},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://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/devtool/debug-web.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版本":oc,"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("os_version"),"来源":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(sc.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||Nl(ic[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.on(Wl.DEBUGGER_MESSAGE,(function(t){switch(t.type){case Wl.DEBUGGER_MESSAGE_SDK:var i={time:t.time,type:t.logType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(i.desc={content:JSON.stringify(t.data)}),e.updateLog(i),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 Wl.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var n=t.data[0],r=n.events;if(!r.length)return;r.forEach((function(i){i.checkShow=!0,i.searchShow=!0,i.success=t.status,i.type=-1!==e.filterEvent.indexOf(i.event)?"sdk":"cus",i.type=e.collect.bridgeReport?"bridge":i.type,i.info="","fail"===t.status&&(i.info={message:"code: "+t.code+", msg: "+t.failType})})),e.updateEvent(n)}return}}))},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;console.log("inittttt"),e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event}),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()}))}}))},e.prototype.sendData=function(e,t){try{var i={type:e,payload:t};(window.opener||window.parent).postMessage(i,this.devToolOrigin)}catch(n){}},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.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: absolute;\n width: 90px;\n height: 30px;\n background: #23c243;\n border-radius: 6px;\n color: #fff;\n font-size: 12px;\n bottom: 5%;\n right: 10%;\n text-align: center;\n line-height: 30px;\n cursor: pointer;\n z-index:100;\n }")),e.appendChild(t);var i=document.createElement("div");i.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web">AppLog调试</div>';var n=document.createElement("div");n.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(i),document.getElementsByTagName("body")[0].appendChild(n),document.getElementById("debugger-applog-web").addEventListener("click",(function(){(window.opener||window.parent).postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),xc={autotrack:{src:{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:{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:{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:{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:{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:{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:{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:{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"}},Ec=["ab","autotrack","Stay","store","et","profile","cep","heartbeat","monitor","route","tracer"],Pc=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.name=e,this.hook=new Dl,this.remotePlugin=new Map,this.Types=sc,this.adapters.storage=Ql,this.loadType="full"}return e.usePlugin=function(t,i,n){if(i){for(var r=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===i){e.plugins[o].plugin=t,e.plugins[o].options=n||{},r=!0;break}r||e.plugins.push({name:i,plugin:t,options:n})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,i){e&&("full"===this.loadType&&Ec.includes(e)?console.info("your sdk version has "+e+" already ~"):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:i}):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 i,n,r=this;try{i=JSON.parse(JSON.stringify(t))}catch(a){i=t}if(this.logger=new fc(this.name,i.log),this.inited)this.logger.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!");else if(i&&Al(i))if(i.app_id&&"number"==typeof(n=i.app_id)&&!isNaN(n))if(i.app_key&&"string"!=typeof i.app_key)this.logger.warn("app_key param is error, must be string, please check!");else{var o=i.channel_type&&"tcpy"===i.channel_type?["sg","va","in"]:["sg","va"];i.channel_domain||-1!==o.indexOf(i.channel)||(this.logger.warn("channel must "+o.join(" ,")+"!!!"),i.channel="sg"),this.spider=new pc,this.spider.checkSpider(i)?this.logger.warn("The current environment may be a spider, can not report!"):(this.appBridge=new gc(this,i.enable_native),this.requestManager=new Sc(this,i),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new dc(this,i),this.debugger=new Cc(this,i),this.initConfig=i,this.emit(sc.Init),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:i,level:"info",time:Date.now()}),i.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.setAppid(i.app_id),this.eventManager=new vc,this.tokenManager=new mc,this.sessionManager=new bc,Promise.all([new Promise((function(e){r.once(sc.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){r.once(sc.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var i=t.plugin,n=t.options,o=Object.assign(r.initConfig,n),a=new i;return a.apply(r,o),e.push(a),e}),r.pluginInstances)}catch(t){console.warn("load plugin error, "+t.message),r.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}r.sdkReady=!0,r.emit(sc.Ready),r.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:r.configManager.get("user")}),r.logger.info("appid: "+i.app_id+", userInfo:"+JSON.stringify(r.configManager.get("user"))),r.logger.info("appid: "+i.app_id+", sdk is ready, version is "+oc+", you can report now !!!"),i.disable_auto_pv&&(r.disableAutoPageView=!0);try{("full"===r.loadType&&i.enable_ab_test||i.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(t){r.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}r.pageView(),r.on(sc.TokenChange,(function(e){"webid"===e&&r.pageView(),r.logger.info("appid: "+i.app_id+" token change, new userInfo:"+JSON.stringify(r.configManager.get("user"))),r.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(sc.TokenReset,(function(){r.logger.info("appid: "+i.app_id+" token reset, new userInfo:"+JSON.stringify(r.configManager.get("user"))),r.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user")})})),r.on(sc.RouteChange,(function(e){e.init||i.disable_route_report||r.pageView()}))})),this.tokenManager.apply(this,i),this.eventManager.apply(this,i),this.sessionManager.apply(this,i)),this.inited=!0)}else this.logger.warn("app_id param is error, must be number, please check!");else this.logger.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&Al(e)){var t;try{t=JSON.parse(JSON.stringify(t))}catch(Kl){t=e}if(this.bridgeReport)this.appBridge.setConfig(t);else{t._staging_flag&&1===t._staging_flag&&(this.staging=!0),t.disable_auto_pv&&(this.disableAutoPageView=!0,delete t.disable_auto_pv);var i=El({},t);if(this.initConfig&&this.initConfig.configPersist){var n=this.configManager.getStore();n&&(i=Object.assign(n,t)),this.configManager.setStore(t)}i.web_id,i.user_unique_id;var r=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&(i[n[r]]=e[n[r]])}return i}(i,["web_id","user_unique_id"]);i.hasOwnProperty("web_id")&&this.emit(sc.ConfigWebId,i.web_id),i.hasOwnProperty("user_unique_id")&&this.emit(sc.ConfigUuid,i.user_unique_id),this.configManager.set(r),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:i})}}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(sc.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.emit(sc.Start),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(sc.Ready)))},e.prototype.event=function(e,t){var i=this;try{var n=[];if(Array.isArray(e))e.forEach((function(e){var t=i.processEvent(e[0],e[1]||{});t&&n.push(t)}));else{var r=this.processEvent(e,t);if(!r)return;n.push(r)}this.bridgeReport?n.forEach((function(e){var t=e.event,n=e.params;i.appBridge.onEventV3(t,JSON.stringify(n))})):n.length&&(this.emit(sc.Event,n),this.emit(sc.SessionResetTime))}catch(o){this.logger.warn("something error, please check"),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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 i=[],n=this.processEvent(e,t||{});n&&(i.push(n),i.length&&(this.emit(sc.BeconEvent,i),this.emit(sc.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 i=e;/^event\./.test(e)&&(i=e.slice(6));var r=t;"object"!=n(r)&&(r={}),r.profile?delete r.profile:r.event_index=Rl();var o=void 0;return r.local_ms?(o=r.local_ms,delete r.local_ms):o=+new Date,{event:i,params:r,local_time_ms:o,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(a){return this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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,i){this.hook.emit(e,t,i)},e.prototype.set=function(e){this.hook.set(e)},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)},i=El({},t,e);this.event("predefine_pageview",i)}else this.logger.warn("predefinePageView should call after init")},e.prototype.clearEventCache=function(){this.emit(sc.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=Vl(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(sc.CustomWebId)}},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=Vl(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(sc.CustomWebId)}},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.resetStayDuration=function(e,t,i){this.emit(sc.ResetStay,{url_path:e,title:t,url:i},sc.Stay)},e.prototype.resetStayParams=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.emit(sc.SetStay,{url_path:e,title:t,url:i},sc.Stay)},e.prototype.getToken=function(e,t){var i=this;if(this.inited){var n=!1,r=function(t){if(!n){n=!0;var r=i.configManager.get().user;return t&&(r.tobid=t,r["diss".split("").reverse().join("")]=t),e(El({},r))}},o=function(){i.tokenManager.getTobId().then((function(e){r(e)}))};this.sdkReady?o():(t&&setTimeout((function(){r()}),t),this.on(sc.Ready,(function(){o()})))}else this.logger.warn("predefinePageView should call after init")},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(sc.ProfileSet,e,sc.Profile),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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(sc.ProfileSetOnce,e,sc.Profile),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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(sc.ProfileIncrement,e,sc.Profile),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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(sc.ProfileUnset,e,sc.Profile),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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(sc.ProfileAppend,e,sc.Profile),this.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit(sc.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,sc.Ab)},e.prototype.getVar=function(e,t,i,n){this.emit(sc.AbVar,{name:e,defaultValue:t,callback:i,uuid:n},sc.Ab)},e.prototype.getABconfig=function(e,t){this.emit(sc.AbConfig,{params:e,callback:t},sc.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(sc.AbVersionChangeOn,e,sc.Ab),function(){t.emit(sc.AbVersionChangeOff,e,sc.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(sc.AbVersionChangeOff,e,sc.Ab)},e.prototype.openOverlayer=function(){this.emit(sc.AbOpenLayer,"",sc.Ab)},e.prototype.closeOverlayer=function(){this.emit(sc.AbCloseLayer,"",sc.Ab)},e.prototype.getAllVars=function(e){this.emit(sc.AbAllVars,e,sc.Ab)},e.prototype.autoInitializationRangers=function(e){var t,i,n,r,o,a,s,l;i=(t=e).app_id,n=t.channel,r=t.onTokenReady,o=tc[n]+"/webid",a=new Ql(!1),s="__tea_cache_tokens_"+i,(l=a.getItem(s))&&l.web_id?r(l.web_id):function(e,t,i,n,r,o,a,s){var l=window.navigator.userAgent;if(-1===window.navigator.appName.indexOf("Microsoft Internet Explorer")||-1===l.indexOf("MSIE 8.0")&&-1===l.indexOf("MSIE 9.0")){if(a)return window.navigator&&window.navigator.sendBeacon?void(window.navigator.sendBeacon(e,JSON.stringify(t))?r():o(e,t,4003)):void Tc(e,t,r,o)}else Tc(e,t,r,o);!function(e,t,i,n,r,o,a,s,l){try{var c=new XMLHttpRequest;c.open("POST",""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),n&&(c.withCredentials=!0),c.onload=function(){if(r){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(i){e={}}r(e,t)}}},i&&(c.timeout=i,c.ontimeout=function(){o&&o(t,wc)}),c.onerror=function(){c.abort(),o&&o(t,kc)},l?c.send(t):c.send(JSON.stringify(t))}catch(u){}}(e,t,i,n,r,o,0,0,s)}(o,{app_key:"",app_id:i,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer},3e3,!1,(function(e){if(e&&0===e.e){r(e.web_id);var t={web_id:e.web_id,user_unique_id:e.web_id,timestamp:Date.now()};a.setItem(s,t)}else r("")}),(function(){r("")}),!0)},e.prototype.destoryInstace=function(){this.destroy||(this.destroy=!0,this.off(sc.TokenComplete),this.emit(sc.DestoryInstance))},e.prototype.destroyInstance=function(){this.destroy||(this.destroy=!0,this.off(sc.TokenComplete),this.emit(sc.DestoryInstance))},e.plugins=[],e}(),Oc="__rangers_ab_style__",Ic={},Lc=[],Dc=function(e){e.length&&e.forEach((function(e){Lc.push(e)}))};function Ac(e,t,i,n){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||n||"*",a={type:t,payload:i};r.postMessage(JSON.stringify(a),o)}function Mc(e,t){Ic[e]=Ic[e]||[],Ic[e].push(t)}function Rc(e){if(Lc.some((function(e){return"*"===e}))||Lc.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 i=t.type,n=t.payload;Ic[i]&&Ic[i].forEach((function(t){"function"==typeof t&&t(e,n)}))}}function Nc(e,t){var i=El({},e);delete i.filter,(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:i,version:t},"*"),window.addEventListener("message",Rc,!1)}var jc,Bc="",Uc=!1;function Hc(e){var t=e.event,i=e.editorUrl;e.collectInstance,e.fromSession,Uc||(Uc=!0,Bl(i,(function(){Ac(t,"abEditorScriptloadSuccess")}),(function(){t&&Ac(t,"abEditorScriptloadError"),Uc=!1})))}!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(jc||(jc={}));var Fc=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="no",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data={},this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[]}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,this.config.enable_ab_test){var n=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||Nl(ic[t.channel||"sg"]),u=e.adapters.storage;this.cacheStorgae=new u(!1),this.timeout=l||3e3,this.enable_multilink=n,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=this.collect.configManager.getUrl("event"),this.exposureLimit=t.exposure_limit||20,this.ab_batch_time=t.ab_batch_time||500;var h=this.collect.Types;this.types=h,this.collect.on(h.TokenChange,(function(e){"uuid"===e&&i.readyStatus&&(i.clearCache(),i.fetchAB())})),this.collect.on(h.AbVar,(function(e){var t=e.name,n=e.defaultValue,r=e.callback;i.getVar(t,n,r)})),this.collect.on(h.AbAllVars,(function(e){i.getAllVars(e)})),this.collect.on(h.AbConfig,(function(e){var t=e.params,n=e.callback;i.getABconfig(t,n)})),this.collect.on(h.AbExternalVersion,(function(e){i.setExternalAbVersion(e)})),this.collect.on(h.AbOpenLayer,(function(){i.openOverlayer()})),this.collect.on(h.AbCloseLayer,(function(){i.closeOverlayer()})),this.collect.on(h.AbVersionChangeOn,(function(e){i.changeListener.set(e,e)})),this.collect.on(h.AbVersionChangeOff,(function(e){i.changeListener.get(e)&&i.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 i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach((function(i){t.collect.hook.emit(e,i)}))};for(var r in i)n(r)}},e.prototype.loadMode=function(){var e,t,i=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e){return}}(),n="";if(i){var r=i.scenario,o=i.href;r?(this.editMode=!0,n=r):!o||-1===o.indexOf("datatester")&&-1===o.indexOf("visual-editor")||(this.editMode=!0,n="visual-editor")}this.enable_ab_visual&&(function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},Dc(["*"]);var i,n="";Nc(t,oc);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&&(i=r.split("/"))&&i.length)){n="https:/";for(var a=2;a<i.length&&a!==i.length-1;a++)n=n+"/"+i[a];n+="/visual-ab-core"}}catch(s){}Mc("tea:openVisualABEditor",(function(i){var r=i.data;if("string"==typeof i.data)try{r=JSON.parse(i.data)}catch(s){r=void 0}if(r){var o=r.lang;if(r.appId!==t.app_id)return Ac(i,"appIdError"),void console.error("abtest appid is not belong the page appid please check");var a=r.version;Bc=a&&n?n+(a?"."+a:".1.0.1")+".js?query="+Date.now():"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/visual-ab-core.js?query="+Date.now(),window.TEAVisualEditor.lang=o,window.TEAVisualEditor.__ab_domin=t.channel_domain||"",Hc({event:i,editorUrl:Bc,collectInstance:e})}}))}(this.collect,this.config),"visual-editor"===n)?this.collect.destoryInstace():this.enable_multilink&&(e=this.collect,t=this.config,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id,Mc("tea:openTesterEventInspector",(function(t){var i=t.data;if("string"==typeof t.data)try{i=JSON.parse(t.data)}catch(a){i=void 0}if(i){var n=i.referrer,r=i.lang,o=i.appId;window.TEAVisualEditor.__editor_ajax_domain=n||"",window.TEAVisualEditor.__ab_appId=o||"",window.TEAVisualEditor.lang=r||"",Hc({event:t,editorUrl:"https://lf16-data.bytepluscdn.com/obj/data-static-sg/log-sdk/collect/tester-event-inspector.js?query="+Date.now(),collectInstance:e})}})))},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,i=e.ab_ext_version,n=e.ab_version_multilink,r=(e.data,this.checkFromUrl());r?this.mulilinkVersions.push(r):this.mulilinkVersions=n||[],this.extVersions=i||[],this.versions=t||[];var o=this.versions.concat(this.extVersions);this.enable_multilink&&(o=o.concat(this.mulilinkVersions))},e.prototype.checkFromUrl=function(){var e=Fl(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,i,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 i)throw new Error("callback must be a function");var r={name:e,defaultValue:t,callback:i,type:jc.Var};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(r,e,n):this.callbacks.push(r)},e.prototype.setAbUuid=function(e,t){this.collect.configManager.setAbUuidCache(e,t)},e.prototype.getRealVar=function(e,t,i){var n=e.name,r=e.defaultValue,o=e.callback,a=this.data;if(a){if(Al(a[n])){var s=a[n].vid;return"$ab_url"===t?this.mulilinkVersions.includes(s)||this.mulilinkVersions.push(s):this.versions.includes(s)||this.versions.push(s),this.setAbUuid(s,i),this.updateVersions(),this.fechEvent(s,t,r),o(a[n].val),void this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 曝光了实验"+n,level:"info",time:Date.now(),data:a[n]})}this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getVar",level:"info",time:Date.now(),data:r}),o(r)}else o(r)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:jc.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(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getAllVars",level:"info",time:Date.now(),data:this.data})},e.prototype.fechEvent=function(e,t,i){try{if(this.config.disable_track_event)return;if(!e)return;var n=this.collect.configManager.get(),r=n.header,o=n.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?i:window.location.href,data:this.data}),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(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:c.message})}},e.prototype.reportExposure=function(e,t){var i=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report(t):this.reportTimeout=setTimeout((function(){i.report(t),clearTimeout(i.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(Wl.DEBUGGER_MESSAGE,{type:Wl.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 i=Object.keys(e);i&&i.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),this.collect.event("abtest_cache",{env_uuid:this.collect.configManager.get("user").user_unique_id||"",cache:JSON.stringify(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(Oc)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.id=Oc,i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(),e)var i=setTimeout((function(){t.closeOverlayer(),clearTimeout(i)}),e)},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById(Oc))&&e.parentElement.removeChild(e)},e.prototype.fetchComplete=function(e,t){var i=this;try{if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var n=[];Object.keys(e).forEach((function(t){var i=e[t].vid;i&&n.push(i)})),this.versions=this.versions.filter((function(e){return n.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,Bl("https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/visual-ab-loader.js?query="+Date.now(),(function(){console.log("load visual render success")}),(function(){console.log("load visual render fail")})),i.closeOverlayer()}))}else if(r&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return n.includes(e)}));var a=r.val,s=r.vid;a&&s&&this.getVar("$ab_url",a,(function(){i.editMode||(a!==window.location.href?setTimeout((function(){if(!i.collect.destroy){var e=""+a;e=-1===e.indexOf("http")?"https://"+e:e,Hl(e).host!==location.host?e=e+"&vid="+s:window.history.replaceState("","",e),window.location.href=e}}),100):i.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(e){return i[e.type===jc.Var?"getRealVar":"getRealAllVars"](e,"")})),this.callbacks=[]}catch(l){}},e.prototype.fetchAB=function(e){var t=this,i=this.collect.configManager.get(),n={header:El({aid:this.config.app_id},i.user||{},i.header||{},{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})},r=i.user.user_unique_id;this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 发起AB实验请求",level:"info",logType:"fetch",time:Date.now(),data:n}),this.collect.requestManager.useRequest({url:this.fetchUrl,data:n,success:function(i){t.fetchStatus="complete",t.refreshFetchStatus="complete";var n=i.data;"success"===i.message?(t.fetchComplete(n,r),e&&e(n)):(t.fetchComplete(null,r),e&&e(null)),t.collect.emit(t.types.AbComplete,n),t.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求成功",level:"info",logType:"fetch",time:Date.now(),data:n})},fail:function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,i.user.user_unique_id),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求网络异常",level:"error",logType:"fetch",time:Date.now()})},timeout:this.timeout})},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true[\0-ÿ]*":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true[\0-ÿ]*");var i=new RegExp(t,"g");e=e.replace(i,"")}catch(n){}return e},e}(),Vc=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var n=e.Types;e.on(n.SubmitBefore,(function(t){e.requestManager.useBeacon({url:i.url,data:t})}))}}else console.log("please use correct et_test url")},e}(),zc=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,Al(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration))}return e.prototype.setParams=function(e,t,i){this.set_path=e,this.set_url=i,this.set_title=t},e.prototype.enable=function(e,t,i){this.url_path=e,this.url=i,this.title=t,this.disableCallback=this.enablePageAlive()},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var i=t?this.aliveDTime:Date.now()-this.sessionStartTime;i<0||i>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||t&&"hidden"===document.visibilityState||(this.collect.beconEvent(this.options.aliveName,El({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:i,is_support_visibility_change:Ul(),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),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),jl(i),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",i)}},e}(),Gc=function(){function e(e,t){var i=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.visibilitychange=function(){"hidden"===document.visibilityState?i.activeEndTime=Date.now():"visible"===document.visibilityState&&(i.activeEndTime&&(i.totalTime+=i.activeEndTime-i.activeStartTime,i.activeTimes+=1),i.activeEndTime=void 0,i.activeStartTime=Date.now())},this.beforeunload=function(){if(i.totalTime+=(i.activeEndTime||Date.now())-i.activeStartTime,i.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:i.totalTime,page_title:document.title||location.pathname}))}catch(e){}i.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),Al(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.resetData()}return e.prototype.setParams=function(e,t,i){this.set_path=e,this.set_url=i,this.set_title=t},e.prototype.resetParams=function(e,t,i){this.url_path=e,this.url=i,this.title=t},e.prototype.enable=function(e,t,i){this.url_path=e,this.url=i,this.title=t,this.disableCallback=this.enablePageClose()},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.collect.beconEvent(this.options.closeName,El({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:Ul()},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),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),jl(i),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",i)}},e}(),Wc=function(){function e(){}return e.prototype.apply=function(e,t){var i=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 zc(e,t),this.pageClose=new Gc(e,t);var n=this.collect.Types;this.collect.on(n.ResetStay,(function(e){var t=e.url_path,n=e.title,r=e.url;i.resetStayDuration(t,n,r)})),this.collect.on(n.RouteChange,(function(e){e.init||t.disable_route_report||i.resetStayDuration()})),this.collect.on(n.SetStay,(function(e){var t=e.url_path,n=e.title,r=e.url;i.setStayParmas(t,n,r)})),this.enable(this.url_path,this.title,this.url),this.ready(n.Stay),this.collect.emit(n.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach((function(i){t.collect.hook.emit(e,i)}))};for(var r in i)n(r)}},e.prototype.enable=function(e,t,i){this.pageAlive.enable(e,t,i),this.pageClose.enable(e,t,i)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.pageAlive.setParams(e,t,i),this.pageClose.setParams(e,t,i),this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:i}})},e.prototype.reset=function(e,t,i){this.disable(),this.enable(e,t,i)},e.prototype.resetStayDuration=function(e,t,i){this.reset(e,t,i),this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:i}})},e}(),Kc=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var n=e.Types;this.eventCheck=new ac(e,t),this.cache={},this.collect.on(n.ProfileSet,(function(e){i.setProfile(e)})),this.collect.on(n.ProfileSetOnce,(function(e){i.setOnceProfile(e)})),this.collect.on(n.ProfileUnset,(function(e){i.unsetProfile(e)})),this.collect.on(n.ProfileIncrement,(function(e){i.incrementProfile(e)})),this.collect.on(n.ProfileAppend,(function(e){i.appendProfile(e)})),this.collect.on(n.ProfileClear,(function(){i.cache={}})),this.ready(n.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach((function(i){t.collect.hook.emit(e,i)}))};for(var r in i)n(r)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var i=[];i.push(this.collect.processEvent(e,t));var n=this.collect.eventManager.merge(i);this.collect.requestManager.useRequest({url:this.reportUrl,data:n}),this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:n,code:200,status:"success"})}catch(r){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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",El({},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",El({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",El({},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",El({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var i in e)"string"==typeof e[i]||"Array"===Object.prototype.toString.call(e[i]).slice(8,-1)?t[i]=e[i]:console.warn("please check the value of param: "+i+", must be string or array !!!");Object.keys(t).length&&this.report("__profile_append",El({},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(i){t.cache[i]={val:t.clone(e[i]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var i=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 n={};for(var r in e)"string"==typeof e[r]||"number"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1)?n[r]=e[r]:console.warn("please check the value of params:"+r+", must be string,number,Array !!!");var o=Object.keys(n);if(!o.length)return;if(!this.eventCheck.checkEventParams(n))return;var a=Date.now();return o.filter((function(n){var r=i.cache[n];return t?!r:!(r&&i.compare(r.val,e[n])&&a-r.timestamp<i.duration)})).reduce((function(e,t){return e[t]=n[t],e}),{})}catch(s){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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(i){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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}(),$c=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 i,n=Date.now()+t;return i=window.setTimeout((function r(){var o=Date.now()-n;e(),n+=t,i=window.setTimeout(r,Math.max(0,t-o))}),t),function(){window.clearTimeout(i)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var n=this.collect.Types;this.collect.on(n.SessionReset,(function(){i.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}(),Yc=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var n=this.collect.Types;this.collect.on(n.Ready,(function(){i.sdkOnload()})),this.collect.on(n.SubmitError,(function(e){var t=e.type,n=e.eventData,r=e.errorCode;"f_data"===t&&i.sdkError(n,r)}))}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),i=t.header,n=t.user,r=i.app_id,o=i.app_name,a=i.sdk_version,s=n.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_OVERSEA"}),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 i=this;try{var n=e[0],r=n.user,o=n.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(){i.collect.requestManager.useRequest({url:i.url,data:[s],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(l){}},e}();function qc(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 Xc(e){for(var t=e;t&&!qc(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function Jc(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")||e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}var Zc=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},Qc=function(e,t){if("string"==typeof t)return Zc(e,t);if(Ml(t)){for(var i=!1,n=0;n<t.length;n++)if(Zc(e,t[n])){i=!0;break}return i}},eu=function(){function e(e,t,i){var n=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,i=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,i=!0):t=t.parentElement;return i}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var i=e;return!("none"===i.style.display||!qc(i,"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}(i)&&!t.svg)})(e.target,n.options)&&n.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){n.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){n.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&n.eventHandel({eventType:"dom",eventName:"beat"},El({beat_type:0},e)),n.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){n.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=i.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat}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&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv){this.collect.on("route-change",(function(e){var i=e.config,n=e.name;t.getPageViewEvent(i,n),t.pageView=!0}));var i=setTimeout((function(){t.pageView||(t.getPageViewEvent(t.getDefaultConfig()),t.pageView=!0,clearTimeout(i))}),2e3)}if(this.config.beat){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var n=0,r=null;window.addEventListener("scroll",(function(){clearTimeout(r),r=setTimeout(o,500),n=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==n&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(s){}try{var a=window.performance&&window.performance.getEntriesByType("paint");a&&a.length?(new PerformanceObserver((function(e){var i=e.getEntries(),n=i[i.length-1],r=n.renderTime||n.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(a[0].startTime||0),t.statistics=!0)}),2e3)):this.getPageLoadEvent(0)}catch(s){this.getPageLoadEvent(0)}}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var i;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(i=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),jl((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(i)}))}catch(n){}},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}(),tu={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},iu=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 nu(e,t,i,n){var r,o,a={},s=function(e){if(e){var t=e.getBoundingClientRect(),i=t.width,n=t.height;return{left:t.left,top:t.top,element_width:i,element_height:n}}}(t),l=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var i=e.clientX,n=e.clientY,r=t.left,o=t.top,a=i-r>=0?i-r:0,s=n-o>=0?n-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){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var i=[],n=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,i=e.parentElement;if(i)for(var n=i.children,r=0;r<n.length&&n[r]!==e;r++)n[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),qc(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,o=t.index;i.unshift(r),n.unshift(o)})),{element_path:"/"+i.join("/"),positions:n}}(t),p=f.element_path,g=f.positions,v=(r=Xc(t),o=[],function e(t){var i=Jc(t);if(i&&-1===o.indexOf(i)&&o.push(i),t.childNodes.length>0)for(var n=t.childNodes,r=0;r<n.length;r++)8!==n[r].nodeType&&e(n[r])}(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||_,n&&!n.text&&(a.texts=v,a.element_title=function(e){var t=Xc(e),i="";return function e(t){var n=Jc(t);if(n&&(i+=n),t.childNodes.length>0)for(var r=t.childNodes,o=0;o<r.length;o++)3===r[o].nodeType&&e(r[o])}(t),i}(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,i.track_attr&&function(e,t){return!!Qc(e,t)}(t,i.track_attr)){var k=function(e,t){var i={};if("string"==typeof t)Zc(e,t)&&(i.attrs=e.getAttribute(t));else if(Ml(t))for(var n=0;n<t.length;n++)Zc(e,t[n])&&(i[t[n]]=e.getAttribute(t[n]));return i}(t,i.track_attr);for(var w in k)a[w]=k[w]}var T=Xc(t);return"A"===T.tagName&&(a.href=T.getAttribute("href")),"IMG"===t.tagName&&(a.src=t.getAttribute("src")),a}var ru=function(e,t,i,n,r){return El({event:e},nu(t,i,n,r),{is_html:1,page_key:window.location.href,page_title:document.title})},ou=function(){function e(e,t){this.ignore={text:!0},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&&!0===t.text&&(this.ignore.text=!1),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 i="bav2b_click";switch(t){case"click":return i=this.eventName.click,ru(i,e,e.target,this.options,this.ignore);case"exposure":return i=this.eventName.exposure,ru(i,e,e.target,this.options,this.ignore);case"change":return El({},ru(i="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(i){return{}}}(i,e.target));case"submit":return ru(i="bav2b_submit",e,e.target,this.options)}}catch(Kl){return console.error(Kl),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 i=JSON.parse(t);e.refer_page_duration_ms=i?i.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(n){console.log("page event error "+JSON.stringify(n))}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 i=e.lcp,n=window.performance.timing,r=n.loadEventEnd-n.navigationStart;t.page_init_cost_ms=parseInt(i||(r>0?r:0)),t.page_start_ms=n.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}(),au=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 i=e.eventSend,n=t.event;delete t.event,i&&"becon"===i?this.collect.beconEvent(n,t):this.collect.event(n,t)},e.prototype.get=function(e,t){var i=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,i)},e.prototype.post=function(e,t){var i=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,i)},e}(),su="_TEA_VE_OPEN",lu="_TEA_VE_APIHOST",cu="lang",uu="_VISUAL_EDITOR_V",hu="_VISUAL_EDITOR_U";function du(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||$l.get(cu),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||$l.get(lu),i=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||$l.get(uu),n=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||$l.get(hu),r=+new Date,o=new Date(r+18e5);$l.set(su,"1",{expires:o}),$l.set(lu,t,{expires:o}),$l.set(hu,n,{expires:o}),$l.set(cu,e,{expires:o}),$l.set(uu,i||"",{expires:o})}catch(a){console.log("set cookie err")}}var fu=!1;function pu(e){var t=e.event,i=e.editorUrl,n=e.autoTrackInstance;fu||(fu=!0,Bl(i,(function(){Ac(t,"editorScriptloadSuccess"),n.destroy()}),(function(){t&&Ac(t,"editorScriptloadError"),fu=!1})))}var gu,vu=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 i=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),i.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}(),yu=function(){function e(t,i){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=i}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 i=e;"mutation"===t&&(i=e.target);var n=i._observeId;if(n||this.observeMap.has(n)){if(!1===i.visible){var r=i.getBoundingClientRect(),o=r.top,a=r.left,s=r.right,l=r.bottom;o>=0&&l<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(i.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else i._observeId=this.count,i.visible=!1,this.observeMap.set(this.count,i),this.observe(i),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}(),mu=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new yu(e,t),this._observer=new vu(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}(),_u={hashTag:!1,impr:!1},bu=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var i=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(i.Autotrack),this.collect.emit(i.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==n(t)?t:{},t=Object.assign(_u,t),this.destroyed=!1,this.options=t,this.Config=new iu(tu,this.options),this.Exposure=new mu(this.config,this.handle.bind(this)),this.Listener=new eu(t,this.collect,this.Config),this.EventHandle=new ou(this.config,t),this.Request=new au(this.collect),this.autoTrackStart=!0,this.init(),function(t,i){window.TEAVisualEditor=window.TEAVisualEditor||{};var n="",r="https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/visual-editor-rangers.js?query="+Date.now();window.TEAVisualEditor.appId=i.app_id;var o=i.channel_domain,a="";if(Dc(["*"]),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(Nc(i,oc),"1"===$l.get(su)){var d=function(){var e=$l.get(lu);try{e=JSON.parse(e)}catch(t){}return e}(),f="";d&&(window.TEAVisualEditor.__editor_ajax_domain=d,f=$l.get(hu)),pu({event:null,editorUrl:f||r,autoTrackInstance:t}),du()}else try{Mc("tea:openVisualEditor",(function(i){var s=i.data;if("string"==typeof i.data)try{s=JSON.parse(i.data)}catch(e){s=void 0}if(s){var l=s.referrer,c=s.lang;if(l&&(window.TEAVisualEditor.__editor_ajax_domain=l),n=r,o){var u=s.version;n=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=n,window.TEAVisualEditor.lang=c,pu({event:i,editorUrl:n,autoTrackInstance:t}),du()}})),window.TEAVisualEditor.openAutotrackEditor=function(){pu({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:t})}}catch(e){console.log("receive message error")}try{Mc("tea:openHeatMapCore",(function(e){var n=e.data.app_id;n&&n!==i.app_id||pu({event:e,editorUrl:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/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)),"base"===this.collect.loadType&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var i=e.eventName;if("click"===i||"exposure"===i||"change"===i||"submit"===i){var n=this.EventHandle.handleEvent(t,i);null!==n&&this.Request.send({eventType:"custom",eventName:"report_"+i+"_event",extra:{methods:"GET"}},n)}else if("page_view"===i||"page_statistics"===i){var r;r="page_view"===i?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},r)}else if("beat"===i){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"}(gu||(gu={}));var ku={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"]},wu=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){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 n=this.collect.Types;e.adapters.fetch,this.collect.on(n.Event,(function(e){Ml(e)?e.forEach((function(e){i.addCount("log")})):i.addCount("log")})),this.collect.on(n.SubmitError,(function(e){var t=e.type,n=e.eventDate,r=e.errorCode,o=e.response;i.addErrorCount(n,t,r,o)})),this.listener(),this.collect.emit(n.TracerReady)}},e.prototype.addCount=function(e,t,i){void 0===t&&(t="net"),void 0===i&&(i=1);try{this.tracerCache||(this.tracerCache=new Map);var n=void 0;if(this.tracerCache.has(e))(r=this.tracerCache.get(e)).has(t)?(n=r.get(t).params.count,n++,r.set(t,this.processTracer(n,e,t))):(n=i,r.set(t,this.processTracer(i,e,t)));else{var r=new Map;n=i,r.set(t,this.processTracer(i,e,t)),this.tracerCache.set(e,r)}"net"===t&&n>=this.limit[e]&&this.report(!1)}catch(o){console.log(o)}},e.prototype.addErrorCount=function(e,t,i,n){var r=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(n&&n.hasOwnProperty("sc")?this.addCount("log",t,o.length-n.sc):this.addCount("log",t,o.length),this.errorCode[t]=i):o.forEach((function(e){var n="log";for(var o in ku)if(-1!==ku[o].indexOf(e.event)){n=o;break}r.addCount(n,t,1),r.errorCode[t]=i})))}}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 i=this.collect.eventManager.merge(e);this.collect.requestManager.useRequest({url:this.reportUrl,data:i,useBeacon:t}),this.tracerCache=null}catch(n){}},e.prototype.processTracer=function(e,t,i){try{var n={count:e,state:i,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:oc};"f_net"!==i&&"f_data"!==i||(n.errorCode=this.errorCode[i]);var r=this.collect.processEvent("applog_trace",n);if(r&&r.event)return delete r.is_bav,r}catch(o){console.warn("something error")}},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),jl((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),Tu=zl((function(e,t){e.exports=function(){var e="millisecond",t="second",i="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,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},v={s:g,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,s),o=i-r<0,a=t.clone().add(n+(o?-1:1),s);return+(-(n+(i-r)/(o?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(n){return{M:s,y:c,w:a,d:o,D:u,h:r,m:i,s:t,ms:e,Q:l}[n]||String(n||"").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,i){var n;if(!e)return y;if("string"==typeof e)m[e]&&(n=e),t&&(m[e]=t,n=e);else{var r=e.name;m[r]=e,n=r}return!i&&n&&(y=n),n||!i&&y},k=function(e,t){if(_(e))return e.clone();var i="object"==n(t)?t:{};return i.date=e,i.args=arguments,new T(i)},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 n(e){this.$L=b(e.locale,null,!0),this.parse(e)}var p=n.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=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 n=t.match(d);if(n){var r=n[2]-1||0,o=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[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 i=k(e);return this.startOf(t)<=i&&i<=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,i){return w.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,n){var l=this,h=!!w.u(n)||n,d=w.p(e),f=function(e,t){var i=w.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return h?i:i.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 i: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(n,a){var l,h=w.p(n),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[i]=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,n){var l,u=this;e=Number(e);var h=w.p(n),d=function(t){var i=k(u);return w.w(i.date(i.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[i]=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,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=w.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].substr(0,o)},d=function(e){return w.s(o%12||12,e,"0")},p=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:w.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:w.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.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 n.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,n,u){var h,d=w.p(n),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[i]=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 i=this.clone(),n=b(e,t,!0);return n&&(i.$L=n),i},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()},n}(),S=T.prototype;return k.prototype=S,[["$ms",e],["$s",t],["$m",i],["$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}()})),Su=zl((function(e,t){var i,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,i){return new _(e,i,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,i){var r=this;if(this.$d={},this.$l=i,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"==n(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,i){return t+(e.$d[i]||0)*h[i]}),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"),i=+this.$d.days||0;this.$d.weeks&&(i+=7*this.$d.weeks);var n=m(i,"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||n.negative||r.negative||o.negative||s.negative,c=r.format||o.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+n.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",i={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(i[e])}))},t.as=function(e){return this.$ms/h[p(e)]},t.get=function(e){var t=this.$ms,i=p(e);return"milliseconds"===i?t%=1e3:t="weeks"===i?v(t/h[i]):this.$d[i],0===t?0:t},t.add=function(e,t,i){var n;return n=t?e*h[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+n*(i?-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 i().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,n){i=n,r=n().$utils(),n.duration=function(e,t){var i=n.locale();return f(e,{$l:i},t)},n.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)}})}));Tu.extend(Su);var Cu=["__cep_sdk_onboard","__cep_trigger_sdk","_be_active"],xu=["and","or","not"],Eu=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 i=this;if(this.collect=e,this.config=t,this.config.cep){var n=e.adapters.storage,r=e.Types;this.types=r,this.storage=new n(!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){i.matchEvent(e)})),this.init()}},e.prototype.init=function(){var e=this,t=!0,i=0,n=0,r=0,o=!1,a=this.storage.getItem(this.key)||{};if(a&&Object.keys(a).length&&(o=!0,i=a.last_update_time,n=a.fetch_interval,r=a.config_version||0,t=Date.now()-i>1e3*n),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 i=new Map;if(e.pattern&&e.pattern.events){var n=1===e.pattern.events.length;e.pattern.events.forEach((function(e){i.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:n})})),t.stateArray.set(e.plan_id,{patternState:i,singleRule:n,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,!(oc<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(i){e.matchEvent(i),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],i=t.header,n=t.user,r=t.events;r.length&&r.reverse();for(var o=0;o<r.length;o++){var a=r[o].event;if(-1!==Cu.indexOf(a))return!1;this.matchRule(i,n,r[o])}}catch(s){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),void console.log(s.message)}},e.prototype.matchRule=function(e,t,i){try{for(var n=0;n<this.planData.length;n++){var r=this.planData[n],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,i,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,i),this.publish([i],o,a[s].id);break}if(!c.isMatch){c.after&&l.get(c.after).isMatch?this.changeStatus(o,a[s].id,i):c.after||this.changeStatus(o,a[s].id,i);break}}}this.statusCheck()}catch(u){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:u.message}),void console.log(u.message)}},e.prototype.changeStatus=function(e,t,i){var n=this.stateArray.get(e),r=n.patternState.get(t);r.isMatch=!0,r.event=i,r.matchTime=i.local_time_ms||Date.now(),n.patternState.set(t,r),this.stateArray.set(e,n)},e.prototype.statusCheck=function(){var e,t,i,n;try{for(var r=Pl(this.stateArray),o=r.next();!o.done;o=r.next()){var a=Ol(o.value,2),s=a[0],l=a[1],c=l.patternState;if(l.isSingle)break;try{for(var u=Pl(c),h=u.next();!h.done;h=u.next()){var d=Ol(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){i={error:g}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.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,i){var n=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=n.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>i.window?((a=n.waitArray.get(e).get(t)).triggerWait=!0,n.waitArray.set(e,n.waitArray.get(e).set(t,a)),n.publish([r.get(o.after).event],e,t)):n.reset(e,t);else if("FOLLOWED_BY"===o.connection){var a;o.isMatch&&r.get(o.after).isMatch?((a=n.waitArray.get(e).get(t)).triggerWait=!0,n.waitArray.set(e,n.waitArray.get(e).set(t,a)),n.publish([r.get(o.after).event],e,t)):n.reset(e,t)}}),i.window);r.set(t,{waitFn:o,triggerWait:!1}),this.waitArray.set(e,r)}}catch(a){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message}),console.log(a.message,a.stack)}},e.prototype.rule=function(e,t,i,n){var r=this;try{var o=i.event,a=i.params;if(a=JSON.parse(a),-1!==xu.indexOf(n.op)){if(n.conditions&&n.conditions.length){var s=n.conditions,l=0,c=new Map;c.set(l,{op:n.op,result:void 0,resultList:[],resultKey:[],resultLength:s.length}),function i(n,s){for(var u=0;u<n.length;u++)if(l++,-1!==xu.indexOf(n[u].op)&&n[u].hasOwnProperty("conditions"))c.set(l,{op:n[u].op,result:void 0,fatherKey:s,resultList:[],resultKey:[],resultLength:n[u].conditions.length}),i(n[u].conditions,l);else{var h=r.scope(n[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(n[u].op,g,n[u].value);c.set(l,{op:n[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 i=c.get(e.fatherKey);i.resultList.length<i.resultLength&&-1===i.resultKey.indexOf(t)&&(i.resultKey.push(t),i.resultList.push(e.result),c.set(e.fatherKey,i))}})),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(n.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(n.op,g,n.value)}catch(v){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:v.message}),console.log(v.message),!1}},e.prototype.publish=function(e,t,i){try{var n=this.configManager.get().user,r={biz_id:this.stateArray.get(t).pattern.biz_id,plan_id:t,uid:n.user_id||"",did:n.device_id||"",uuid:n.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,i),console.log(this.stateArray)}catch(o){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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 i=this.storage.getItem(this.quotasKey)||{};i[e]||(i[e]={value:0,lastTime:Date.now()});var n=i[e].value;0===n&&(i[e].lastTime=Date.now()),i[e].value=n+1,this.storage.setItem(this.quotasKey,i)}},e.prototype.checkQuotas=function(e){var t=this.stateArray.get(e).quotas,i=this.storage.getItem(this.quotasKey)||{};if(i[e]||(i[e]={value:0,lastTime:Date.now()}),t&&t.length){var n=t[0].granularity,r=t[0].value;if("per_keyid"!==t[0].type)return!0;var o=this.release(n);return"all"===o?!(i[e].value>=r&&(console.log("plan:"+e+" limit"),1)):Date.now()-i[e].lastTime>=o?(i[e].value=0,i[e].lastTime=Date.now(),this.storage.setItem(this.quotasKey,i),!0):!(i[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=Tu.duration(e);return t?t.asMilliseconds():"all"},e.prototype.reset=function(e,t){var i=this.stateArray.get(e);if(i.singleRule){var n=i.patternState.get(t);n.isMatch=!1,n.event=null,n.matchTime=0,n.initTime=Date.now(),i.patternState.set(t,n)}else i.patternState.forEach((function(e){e.isMatch=!1,e.event=null,e.matchTime=0,e.initTime=Date.now()}));this.stateArray.set(e,i);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 i={event:e,params:JSON.stringify({plan_id:t||"",biz_id:this.stateArray.get(t).pattern.biz_id}),local_time_ms:Date.now()},n=this.configManager.get(),r=n.header,o=n.user;r.custom=JSON.stringify(r.custom);var a={events:[i],user:o,header:r};this.collect.requestManager.useRequest({url:this.reportUrl,data:[a]})}catch(s){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),void console.log(s.message)}},e.prototype.scope=function(e){var t="",i="";if(e.indexOf(".")>-1){var n=e.split(".");t=n[0],e=n[1],"header"===t&&"custom"===e&&(e=n[2],i=n[1])}return{scope:t,key:e,key2:i}},e.prototype.calculate=function(e,t,i){try{if("="===e)return t===i;if(-1!==["=","<",">",">=","<=","!="].indexOf(e))switch(e){case"=":return t===i;case"<":return t<i;case">":return t>i;case">=":return t>=i;case"<=":return t<=i;case"!=":return t!==i}else{if(-1!==["in","contains"].indexOf(e))return-1!==i.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(i);var n=t.length-i.length;return t.substr(n,i.length)===i}}}catch(r){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),console.log(r.message),!1}},e}(),Pu="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,Ou=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,i){if("sdk"===t)if(xc.hasOwnProperty(i)){var r=xc[i].object,o=""+xc[i].src[e.channel];e.exist(i,r,o)}else console.warn("your "+i+" is not exist,please check plugin name");else"object"==n(t)&&(t.src?e.exist(i,t.call,t.src):e.process(i,t.instance,"INSTANCE"))}))}catch(t){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,i){var n=this;Pu[t]?(this.process(e,Pu[t]),console.log("已有"+e+"插件,避免重复加载~")):this.loadPlugin(e,i,(function(){n.process(e,Pu[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,i){try{if(i){var n=new t;n.apply&&n.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(r){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.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,i,n){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(i),o.onerror=function(){n(t)},o.onload=function(){r._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(a){this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}},e}(),Iu=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 i=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(i.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"==n(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(i){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"function"==typeof history.onpushstate&&history.onpushstate({state:i});var o=t.call.apply(t,Il([history,i],n));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a,"pushState"),o}};var i=history.replaceState;history.replaceState=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var o=i.call.apply(i,Il([history,t],n));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(i){if(e.lastLocation!==window.location.href&&(clearTimeout(t),e.allowHash)){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var n=e.getPopStateChangeEventData();e.sendPv(n)}})),window.addEventListener("popstate",(function(i){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)||{},i=this.storage.getItem("__tea_cache_first_"+this.appid);return e=!i||1!=i,{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(n){return this.collect.emit(Wl.DEBUGGER_MESSAGE,{type:Wl.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.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(i){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}();Pc.usePlugin(Ou,"extend"),Pc.usePlugin(wu,"tracer"),Pc.usePlugin(Fc,"ab"),Pc.usePlugin(Wc,"stay"),Pc.usePlugin(bu,"autotrack"),Pc.usePlugin(Vc,"et"),Pc.usePlugin(Kc,"profile"),Pc.usePlugin(Eu,"cep"),Pc.usePlugin($c,"heartbeat"),Pc.usePlugin(Yc,"monitor"),Pc.usePlugin(Iu,"route"),Pc.usePlugin(wu,"tracer"),new Pc("default");var Lu=Pc;function Du(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Au(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(i),!0).forEach((function(t){Bu(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Du(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Mu(e){return(Mu="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 Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nu(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hu(n.key),n)}}function ju(e,t,i){return t&&Nu(e.prototype,t),i&&Nu(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bu(e,t,i){return(t=Hu(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Uu(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function Hu(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;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 Fu=function(e){return e&&e.Math==Math&&e},Vu=Fu("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||Fu("object"==("undefined"==typeof window?"undefined":n(window))&&window)||Fu("object"==("undefined"==typeof self?"undefined":n(self))&&self)||Fu("object"==n(Vi)&&Vi)||function(){return this}()||Vi||Function("return this")(),zu={},Gu=function(e){try{return!!e()}catch(t){return!0}},Wu=!Gu((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Ku=!Gu((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),$u=Ku,Yu=Function.prototype.call,qu=$u?Yu.bind(Yu):function(){return Yu.apply(Yu,arguments)},Xu={},Ju={}.propertyIsEnumerable,Zu=Object.getOwnPropertyDescriptor,Qu=Zu&&!Ju.call({1:2},1);Xu.f=Qu?function(e){var t=Zu(this,e);return!!t&&t.enumerable}:Ju;var eh,th,ih=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},nh=Ku,rh=Function.prototype,oh=rh.call,ah=nh&&rh.bind.bind(oh,oh),sh=nh?ah:function(e){return function(){return oh.apply(e,arguments)}},lh=sh,ch=lh({}.toString),uh=lh("".slice),hh=function(e){return uh(ch(e),8,-1)},dh=Gu,fh=hh,ph=Object,gh=sh("".split),vh=dh((function(){return!ph("z").propertyIsEnumerable(0)}))?function(e){return"String"==fh(e)?gh(e,""):ph(e)}:ph,yh=function(e){return null==e},mh=yh,_h=TypeError,bh=function(e){if(mh(e))throw _h("Can't call method on "+e);return e},kh=vh,wh=bh,Th=function(e){return kh(wh(e))},Sh="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,Ch={all:Sh,IS_HTMLDDA:void 0===Sh&&void 0!==Sh},xh=Ch.all,Eh=Ch.IS_HTMLDDA?function(e){return"function"==typeof e||e===xh}:function(e){return"function"==typeof e},Ph=Eh,Oh=Ch.all,Ih=Ch.IS_HTMLDDA?function(e){return"object"==n(e)?null!==e:Ph(e)||e===Oh}:function(e){return"object"==n(e)?null!==e:Ph(e)},Lh=Vu,Dh=Eh,Ah=function(e){return Dh(e)?e:void 0},Mh=function(e,t){return arguments.length<2?Ah(Lh[e]):Lh[e]&&Lh[e][t]},Rh=sh({}.isPrototypeOf),Nh="undefined"!=typeof navigator&&String(navigator.userAgent)||"",jh=Vu,Bh=Nh,Uh=jh.process,Hh=jh.Deno,Fh=Uh&&Uh.versions||Hh&&Hh.version,Vh=Fh&&Fh.v8;Vh&&(th=(eh=Vh.split("."))[0]>0&&eh[0]<4?1:+(eh[0]+eh[1])),!th&&Bh&&(!(eh=Bh.match(/Edge\/(\d+)/))||eh[1]>=74)&&(eh=Bh.match(/Chrome\/(\d+)/))&&(th=+eh[1]);var zh=th,Gh=zh,Wh=Gu,Kh=Vu.String,$h=!!Object.getOwnPropertySymbols&&!Wh((function(){var e=Symbol();return!Kh(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Gh&&Gh<41})),Yh=$h&&!Symbol.sham&&"symbol"==n(Symbol.iterator),qh=Mh,Xh=Eh,Jh=Rh,Zh=Object,Qh=Yh?function(e){return"symbol"==n(e)}:function(e){var t=qh("Symbol");return Xh(t)&&Jh(t.prototype,Zh(e))},ed=String,td=function(e){try{return ed(e)}catch(t){return"Object"}},id=Eh,nd=td,rd=TypeError,od=function(e){if(id(e))return e;throw rd(nd(e)+" is not a function")},ad=od,sd=yh,ld=function(e,t){var i=e[t];return sd(i)?void 0:ad(i)},cd=qu,ud=Eh,hd=Ih,dd=TypeError,fd={exports:{}},pd=Vu,gd=Object.defineProperty,vd=function(e,t){try{gd(pd,e,{value:t,configurable:!0,writable:!0})}catch(i){pd[e]=t}return t},yd=vd,md="__core-js_shared__",_d=Vu[md]||yd(md,{}),bd=_d;(fd.exports=function(e,t){return bd[e]||(bd[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 kd=bh,wd=Object,Td=function(e){return wd(kd(e))},Sd=Td,Cd=sh({}.hasOwnProperty),xd=Object.hasOwn||function(e,t){return Cd(Sd(e),t)},Ed=sh,Pd=0,Od=Math.random(),Id=Ed(1..toString),Ld=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Id(++Pd+Od,36)},Dd=Vu,Ad=fd.exports,Md=xd,Rd=Ld,Nd=$h,jd=Yh,Bd=Dd.Symbol,Ud=Ad("wks"),Hd=jd?Bd.for||Bd:Bd&&Bd.withoutSetter||Rd,Fd=function(e){return Md(Ud,e)||(Ud[e]=Nd&&Md(Bd,e)?Bd[e]:Hd("Symbol."+e)),Ud[e]},Vd=qu,zd=Ih,Gd=Qh,Wd=ld,Kd=function(e,t){var i,n;if("string"===t&&ud(i=e.toString)&&!hd(n=cd(i,e)))return n;if(ud(i=e.valueOf)&&!hd(n=cd(i,e)))return n;if("string"!==t&&ud(i=e.toString)&&!hd(n=cd(i,e)))return n;throw dd("Can't convert object to primitive value")},$d=TypeError,Yd=Fd("toPrimitive"),qd=function(e,t){if(!zd(e)||Gd(e))return e;var i,n=Wd(e,Yd);if(n){if(void 0===t&&(t="default"),i=Vd(n,e,t),!zd(i)||Gd(i))return i;throw $d("Can't convert object to primitive value")}return void 0===t&&(t="number"),Kd(e,t)},Xd=qd,Jd=Qh,Zd=function(e){var t=Xd(e,"string");return Jd(t)?t:t+""},Qd=Ih,ef=Vu.document,tf=Qd(ef)&&Qd(ef.createElement),nf=function(e){return tf?ef.createElement(e):{}},rf=nf,of=!Wu&&!Gu((function(){return 7!=Object.defineProperty(rf("div"),"a",{get:function(){return 7}}).a})),af=Wu,sf=qu,lf=Xu,cf=ih,uf=Th,hf=Zd,df=xd,ff=of,pf=Object.getOwnPropertyDescriptor;zu.f=af?pf:function(e,t){if(e=uf(e),t=hf(t),ff)try{return pf(e,t)}catch(i){}if(df(e,t))return cf(!sf(lf.f,e,t),e[t])};var gf={},vf=Wu&&Gu((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),yf=Ih,mf=String,_f=TypeError,bf=function(e){if(yf(e))return e;throw _f(mf(e)+" is not an object")},kf=Wu,wf=of,Tf=vf,Sf=bf,Cf=Zd,xf=TypeError,Ef=Object.defineProperty,Pf=Object.getOwnPropertyDescriptor,Of="enumerable",If="configurable",Lf="writable";gf.f=kf?Tf?function(e,t,i){if(Sf(e),t=Cf(t),Sf(i),"function"==typeof e&&"prototype"===t&&"value"in i&&Lf in i&&!i.writable){var n=Pf(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:If in i?i.configurable:n.configurable,enumerable:Of in i?i.enumerable:n.enumerable,writable:!1})}return Ef(e,t,i)}:Ef:function(e,t,i){if(Sf(e),t=Cf(t),Sf(i),wf)try{return Ef(e,t,i)}catch(n){}if("get"in i||"set"in i)throw xf("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var Df=gf,Af=ih,Mf=Wu?function(e,t,i){return Df.f(e,t,Af(1,i))}:function(e,t,i){return e[t]=i,e},Rf={exports:{}},Nf=Wu,jf=xd,Bf=Function.prototype,Uf=Nf&&Object.getOwnPropertyDescriptor,Hf=jf(Bf,"name"),Ff={EXISTS:Hf,PROPER:Hf&&"something"===function(){}.name,CONFIGURABLE:Hf&&(!Nf||Nf&&Uf(Bf,"name").configurable)},Vf=Eh,zf=_d,Gf=sh(Function.toString);Vf(zf.inspectSource)||(zf.inspectSource=function(e){return Gf(e)});var Wf,Kf,$f,Yf=zf.inspectSource,qf=Eh,Xf=Vu.WeakMap,Jf=qf(Xf)&&/native code/.test(String(Xf)),Zf=fd.exports,Qf=Ld,ep=Zf("keys"),tp=function(e){return ep[e]||(ep[e]=Qf(e))},ip={},np=Jf,rp=Vu,op=Ih,ap=Mf,sp=xd,lp=_d,cp=tp,up=ip,hp="Object already initialized",dp=rp.TypeError,fp=rp.WeakMap;if(np||lp.state){var pp=lp.state||(lp.state=new fp);pp.get=pp.get,pp.has=pp.has,pp.set=pp.set,Wf=function(e,t){if(pp.has(e))throw dp(hp);return t.facade=e,pp.set(e,t),t},Kf=function(e){return pp.get(e)||{}},$f=function(e){return pp.has(e)}}else{var gp=cp("state");up[gp]=!0,Wf=function(e,t){if(sp(e,gp))throw dp(hp);return t.facade=e,ap(e,gp,t),t},Kf=function(e){return sp(e,gp)?e[gp]:{}},$f=function(e){return sp(e,gp)}}var vp={set:Wf,get:Kf,has:$f,enforce:function(e){return $f(e)?Kf(e):Wf(e,{})},getterFor:function(e){return function(t){var i;if(!op(t)||(i=Kf(t)).type!==e)throw dp("Incompatible receiver, "+e+" required");return i}}},yp=sh,mp=Gu,_p=Eh,bp=xd,kp=Wu,wp=Ff.CONFIGURABLE,Tp=Yf,Sp=vp.enforce,Cp=vp.get,xp=String,Ep=Object.defineProperty,Pp=yp("".slice),Op=yp("".replace),Ip=yp([].join),Lp=kp&&!mp((function(){return 8!==Ep((function(){}),"length",{value:8}).length})),Dp=String(String).split("String"),Ap=Rf.exports=function(e,t,i){"Symbol("===Pp(xp(t),0,7)&&(t="["+Op(xp(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!bp(e,"name")||wp&&e.name!==t)&&(kp?Ep(e,"name",{value:t,configurable:!0}):e.name=t),Lp&&i&&bp(i,"arity")&&e.length!==i.arity&&Ep(e,"length",{value:i.arity});try{i&&bp(i,"constructor")&&i.constructor?kp&&Ep(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=Sp(e);return bp(n,"source")||(n.source=Ip(Dp,"string"==typeof t?t:"")),e};Function.prototype.toString=Ap((function(){return _p(this)&&Cp(this).source||Tp(this)}),"toString");var Mp=Eh,Rp=gf,Np=Rf.exports,jp=vd,Bp=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(Mp(i)&&Np(i,o,n),n.global)r?e[t]=i:jp(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=i:Rp.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Up={},Hp=Math.ceil,Fp=Math.floor,Vp=Math.trunc||function(e){var t=+e;return(t>0?Fp:Hp)(t)},zp=function(e){var t=+e;return t!=t||0===t?0:Vp(t)},Gp=zp,Wp=Math.max,Kp=Math.min,$p=function(e,t){var i=Gp(e);return i<0?Wp(i+t,0):Kp(i,t)},Yp=zp,qp=Math.min,Xp=function(e){return e>0?qp(Yp(e),9007199254740991):0},Jp=Xp,Zp=function(e){return Jp(e.length)},Qp=Th,eg=$p,tg=Zp,ig=function(e){return function(t,i,n){var r,o=Qp(t),a=tg(o),s=eg(n,a);if(e&&i!=i){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===i)return e||s||0;return!e&&-1}},ng={includes:ig(!0),indexOf:ig(!1)},rg=xd,og=Th,ag=ng.indexOf,sg=ip,lg=sh([].push),cg=function(e,t){var i,n=og(e),r=0,o=[];for(i in n)!rg(sg,i)&&rg(n,i)&&lg(o,i);for(;t.length>r;)rg(n,i=t[r++])&&(~ag(o,i)||lg(o,i));return o},ug=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hg=cg,dg=ug.concat("length","prototype");Up.f=Object.getOwnPropertyNames||function(e){return hg(e,dg)};var fg={};fg.f=Object.getOwnPropertySymbols;var pg=Mh,gg=Up,vg=fg,yg=bf,mg=sh([].concat),_g=pg("Reflect","ownKeys")||function(e){var t=gg.f(yg(e)),i=vg.f;return i?mg(t,i(e)):t},bg=xd,kg=_g,wg=zu,Tg=gf,Sg=function(e,t,i){for(var n=kg(t),r=Tg.f,o=wg.f,a=0;a<n.length;a++){var s=n[a];bg(e,s)||i&&bg(i,s)||r(e,s,o(t,s))}},Cg=Gu,xg=Eh,Eg=/#|\.prototype\./,Pg=function(e,t){var i=Ig[Og(e)];return i==Dg||i!=Lg&&(xg(t)?Cg(t):!!t)},Og=Pg.normalize=function(e){return String(e).replace(Eg,".").toLowerCase()},Ig=Pg.data={},Lg=Pg.NATIVE="N",Dg=Pg.POLYFILL="P",Ag=Pg,Mg=Vu,Rg=zu.f,Ng=Mf,jg=Bp,Bg=vd,Ug=Sg,Hg=Ag,Fg=function(e,t){var i,r,o,a,s,l=e.target,c=e.global,u=e.stat;if(i=c?Mg:u?Mg[l]||Bg(l,{}):(Mg[l]||{}).prototype)for(r in t){if(a=t[r],o=e.dontCallGetSet?(s=Rg(i,r))&&s.value:i[r],!Hg(c?r:l+(u?".":"#")+r,e.forced)&&void 0!==o){if(n(a)==n(o))continue;Ug(a,o)}(e.sham||o&&o.sham)&&Ng(a,"sham",!0),jg(i,r,a,e)}},Vg=hh,zg=Array.isArray||function(e){return"Array"==Vg(e)},Gg=TypeError,Wg=function(e){if(e>9007199254740991)throw Gg("Maximum allowed index exceeded");return e},Kg=Zd,$g=gf,Yg=ih,qg=function(e,t,i){var n=Kg(t);n in e?$g.f(e,n,Yg(0,i)):e[n]=i},Xg={};Xg[Fd("toStringTag")]="z";var Jg="[object z]"===String(Xg),Zg=Jg,Qg=Eh,ev=hh,tv=Fd("toStringTag"),iv=Object,nv="Arguments"==ev(function(){return arguments}()),rv=Zg?ev:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(i){}}(t=iv(e),tv))?i:nv?ev(t):"Object"==(n=ev(t))&&Qg(t.callee)?"Arguments":n},ov=sh,av=Gu,sv=Eh,lv=rv,cv=Yf,uv=function(){},hv=[],dv=Mh("Reflect","construct"),fv=/^\s*(?:class|function)\b/,pv=ov(fv.exec),gv=!fv.exec(uv),vv=function(e){if(!sv(e))return!1;try{return dv(uv,hv,e),!0}catch(t){return!1}},yv=function(e){if(!sv(e))return!1;switch(lv(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return gv||!!pv(fv,cv(e))}catch(t){return!0}};yv.sham=!0;var mv=!dv||av((function(){var e;return vv(vv.call)||!vv(Object)||!vv((function(){e=!0}))||e}))?yv:vv,_v=zg,bv=mv,kv=Ih,wv=Fd("species"),Tv=Array,Sv=function(e){var t;return _v(e)&&(t=e.constructor,(bv(t)&&(t===Tv||_v(t.prototype))||kv(t)&&null===(t=t[wv]))&&(t=void 0)),void 0===t?Tv:t},Cv=function(e,t){return new(Sv(e))(0===t?0:t)},xv=Gu,Ev=zh,Pv=Fd("species"),Ov=function(e){return Ev>=51||!xv((function(){var t=[];return(t.constructor={})[Pv]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Iv=Fg,Lv=Gu,Dv=zg,Av=Ih,Mv=Td,Rv=Zp,Nv=Wg,jv=qg,Bv=Cv,Uv=Ov,Hv=zh,Fv=Fd("isConcatSpreadable"),Vv=Hv>=51||!Lv((function(){var e=[];return e[Fv]=!1,e.concat()[0]!==e})),zv=function(e){if(!Av(e))return!1;var t=e[Fv];return void 0!==t?!!t:Dv(e)};Iv({target:"Array",proto:!0,arity:1,forced:!Vv||!Uv("concat")},{concat:function(e){var t,i,n,r,o,a=Mv(this),s=Bv(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(zv(o=-1===t?a:arguments[t]))for(r=Rv(o),Nv(l+r),i=0;i<r;i++,l++)i in o&&jv(s,l,o[i]);else Nv(l+1),jv(s,l++,o);return s.length=l,s}});var Gv=hh,Wv=sh,Kv=function(e){if("Function"===Gv(e))return Wv(e)},$v=od,Yv=Ku,qv=Kv(Kv.bind),Xv=function(e,t){return $v(e),void 0===t?e:Yv?qv(e,t):function(){return e.apply(t,arguments)}},Jv=Xv,Zv=vh,Qv=Td,ey=Zp,ty=Cv,iy=sh([].push),ny=function(e){var t=1==e,i=2==e,n=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=Qv(l),g=Zv(p),v=Jv(c,u),y=ey(g),m=0,_=h||ty,b=t?_(l,y):i||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:iy(b,d)}else switch(e){case 4:return!1;case 7:iy(b,d)}return o?-1:n||r?r:b}},ry={forEach:ny(0),map:ny(1),filter:ny(2),some:ny(3),every:ny(4),find:ny(5),findIndex:ny(6),filterReject:ny(7)},oy=ry.map;Fg({target:"Array",proto:!0,forced:!Ov("map")},{map:function(e){return oy(this,e,arguments.length>1?arguments[1]:void 0)}});var ay=cg,sy=ug,ly=Object.keys||function(e){return ay(e,sy)},cy=Td,uy=ly;Fg({target:"Object",stat:!0,forced:Gu((function(){uy(1)}))},{keys:function(e){return uy(cy(e))}});var hy=rv,dy=String,fy=function(e){if("Symbol"===hy(e))throw TypeError("Cannot convert a Symbol value to a string");return dy(e)},py=sh,gy=zp,vy=fy,yy=bh,my=py("".charAt),_y=py("".charCodeAt),by=py("".slice),ky=function(e){return function(t,i){var n,r,o=vy(yy(t)),a=gy(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=_y(o,a))<55296||n>56319||a+1===s||(r=_y(o,a+1))<56320||r>57343?e?my(o,a):n:e?by(o,a,a+2):r-56320+(n-55296<<10)+65536}},wy={codeAt:ky(!1),charAt:ky(!0)},Ty=wy.charAt,Sy=bh,Cy=zp,xy=fy;Fg({target:"String",proto:!0,forced:!0},{at:function(e){var t=xy(Sy(this)),i=t.length,n=Cy(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:Ty(t,r)}});var Ey=rv,Py=Jg?{}.toString:function(){return"[object "+Ey(this)+"]"};Jg||Bp(Object.prototype,"toString",Py,{unsafe:!0});var Oy=bf,Iy=function(){var e=Oy(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},Ly=qu,Dy=xd,Ay=Rh,My=Iy,Ry=RegExp.prototype,Ny=function(e){var t=e.flags;return void 0!==t||"flags"in Ry||Dy(e,"flags")||!Ay(Ry,e)?t:Ly(My,e)},jy=Ff.PROPER,By=Bp,Uy=bf,Hy=fy,Fy=Gu,Vy=Ny,zy="toString",Gy=RegExp.prototype.toString,Wy=Fy((function(){return"/a/b"!=Gy.call({source:"a",flags:"b"})})),Ky=jy&&Gy.name!=zy;(Wy||Ky)&&By(RegExp.prototype,zy,(function(){var e=Uy(this);return"/"+Hy(e.source)+"/"+Hy(Vy(e))}),{unsafe:!0});var $y=nf("span").classList,Yy=$y&&$y.constructor&&$y.constructor.prototype,qy=Yy===Object.prototype?void 0:Yy,Xy=Gu,Jy=function(e,t){var i=[][e];return!!i&&Xy((function(){i.call(null,t||function(){return 1},1)}))},Zy=ry.forEach,Qy=Jy("forEach")?[].forEach:function(e){return Zy(this,e,arguments.length>1?arguments[1]:void 0)},em=Vu,tm={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},im=qy,nm=Qy,rm=Mf,om=function(e){if(e&&e.forEach!==nm)try{rm(e,"forEach",nm)}catch(t){e.forEach=nm}};for(var am in tm)tm[am]&&om(em[am]&&em[am].prototype);om(im);var sm=Vu,lm=sh,cm=od,um=Eh,hm=String,dm=TypeError,fm=function(e,t,i){try{return lm(cm(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(n){}},pm=bf,gm=function(e){if("object"==n(e)||um(e))return e;throw dm("Can't set "+hm(e)+" as a prototype")},vm=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=fm(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return pm(i),gm(n),t?e(i,n):i.__proto__=n,i}}():void 0),ym=Eh,mm=Ih,_m=vm,bm=function(e,t,i){var n,r;return _m&&ym(n=t.constructor)&&n!==i&&mm(r=n.prototype)&&r!==i.prototype&&_m(e,r),e},km=sh(1..valueOf),wm="\t\n\v\f\r \u2028\u2029\ufeff",Tm=bh,Sm=fy,Cm=wm,xm=sh("".replace),Em=RegExp("^["+Cm+"]+"),Pm=RegExp("(^|[^"+Cm+"])["+Cm+"]+$"),Om=function(e){return function(t){var i=Sm(Tm(t));return 1&e&&(i=xm(i,Em,"")),2&e&&(i=xm(i,Pm,"$1")),i}},Im={start:Om(1),end:Om(2),trim:Om(3)},Lm=Fg,Dm=Wu,Am=Vu,Mm=sm,Rm=sh,Nm=Ag,jm=xd,Bm=bm,Um=Rh,Hm=Qh,Fm=qd,Vm=Gu,zm=Up.f,Gm=zu.f,Wm=gf.f,Km=km,$m=Im.trim,Ym="Number",qm=Am.Number;Mm.Number;var Xm=qm.prototype,Jm=Am.TypeError,Zm=Rm("".slice),Qm=Rm("".charCodeAt),e_=function(e){var t=Fm(e,"number");return"bigint"==typeof t?t:t_(t)},t_=function(e){var t,i,n,r,o,a,s,l,c=Fm(e,"number");if(Hm(c))throw Jm("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=$m(c),43===(t=Qm(c,0))||45===t){if(88===(i=Qm(c,2))||120===i)return NaN}else if(48===t){switch(Qm(c,1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+c}for(a=(o=Zm(c,2)).length,s=0;s<a;s++)if((l=Qm(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c},i_=Nm(Ym,!qm(" 0o1")||!qm("0b1")||qm("+0x1")),n_=function(e){return Um(Xm,e)&&Vm((function(){Km(e)}))},r_=function(e){var t=arguments.length<1?0:qm(e_(e));return n_(this)?Bm(Object(t),this,r_):t};r_.prototype=Xm,i_&&(Xm.constructor=r_),Lm({global:!0,constructor:!0,wrap:!0,forced:i_},{Number:r_});i_&&function(e,t){for(var i,n=Dm?zm(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;n.length>r;r++)jm(t,i=n[r])&&!jm(e,i)&&Wm(e,i,Gm(t,i))}(Mm.Number,qm);var o_=Rf.exports,a_=gf,s_=function(e,t,i){return i.get&&o_(i.get,t,{getter:!0}),i.set&&o_(i.set,t,{setter:!0}),a_.f(e,t,i)},l_=Wu,c_=Ff.EXISTS,u_=sh,h_=s_,d_=Function.prototype,f_=u_(d_.toString),p_=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,g_=u_(p_.exec);l_&&!c_&&h_(d_,"name",{configurable:!0,get:function(){try{return g_(p_,f_(this))[1]}catch(e){return""}}});var v_=Fg,y_=vh,m_=Th,__=Jy,b_=sh([].join);v_({target:"Array",proto:!0,forced:y_!=Object||!__("join",",")},{join:function(e){return b_(m_(this),void 0===e?",":e)}});var k_,w_,T_,S_,C_="undefined"!=typeof process&&"process"==hh(process),x_=gf.f,E_=xd,P_=Fd("toStringTag"),O_=function(e,t,i){e&&!i&&(e=e.prototype),e&&!E_(e,P_)&&x_(e,P_,{configurable:!0,value:t})},I_=Mh,L_=s_,D_=Wu,A_=Fd("species"),M_=function(e){var t=I_(e);D_&&t&&!t[A_]&&L_(t,A_,{configurable:!0,get:function(){return this}})},R_=Rh,N_=TypeError,j_=mv,B_=td,U_=TypeError,H_=bf,F_=function(e){if(j_(e))return e;throw U_(B_(e)+" is not a constructor")},V_=yh,z_=Fd("species"),G_=function(e,t){var i,n=H_(e).constructor;return void 0===n||V_(i=H_(n)[z_])?t:F_(i)},W_=Ku,K_=Function.prototype,$_=K_.apply,Y_=K_.call,q_="object"==("undefined"==typeof Reflect?"undefined":n(Reflect))&&Reflect.apply||(W_?Y_.bind($_):function(){return Y_.apply($_,arguments)}),X_=Mh("document","documentElement"),J_=sh([].slice),Z_=TypeError,Q_=function(e,t){if(e<t)throw Z_("Not enough arguments");return e},eb=/(?:ipad|iphone|ipod).*applewebkit/i.test(Nh),tb=Vu,ib=q_,nb=Xv,rb=Eh,ob=xd,ab=Gu,sb=X_,lb=J_,cb=nf,ub=Q_,hb=eb,db=C_,fb=tb.setImmediate,pb=tb.clearImmediate,gb=tb.process,vb=tb.Dispatch,yb=tb.Function,mb=tb.MessageChannel,_b=tb.String,bb=0,kb={},wb="onreadystatechange";ab((function(){k_=tb.location}));var Tb=function(e){if(ob(kb,e)){var t=kb[e];delete kb[e],t()}},Sb=function(e){return function(){Tb(e)}},Cb=function(e){Tb(e.data)},xb=function(e){tb.postMessage(_b(e),k_.protocol+"//"+k_.host)};fb&&pb||(fb=function(e){ub(arguments.length,1);var t=rb(e)?e:yb(e),i=lb(arguments,1);return kb[++bb]=function(){ib(t,void 0,i)},w_(bb),bb},pb=function(e){delete kb[e]},db?w_=function(e){gb.nextTick(Sb(e))}:vb&&vb.now?w_=function(e){vb.now(Sb(e))}:mb&&!hb?(S_=(T_=new mb).port2,T_.port1.onmessage=Cb,w_=nb(S_.postMessage,S_)):tb.addEventListener&&rb(tb.postMessage)&&!tb.importScripts&&k_&&"file:"!==k_.protocol&&!ab(xb)?(w_=xb,tb.addEventListener("message",Cb,!1)):w_=wb in cb("script")?function(e){sb.appendChild(cb("script")).onreadystatechange=function(){sb.removeChild(this),Tb(e)}}:function(e){setTimeout(Sb(e),0)});var Eb={set:fb,clear:pb},Pb=function(){this.head=null,this.tail=null};Pb.prototype={add:function(e){var t={item:e,next:null},i=this.tail;i?i.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 Ob,Ib,Lb,Db,Ab,Mb=Pb,Rb=/ipad|iphone|ipod/i.test(Nh)&&"undefined"!=typeof Pebble,Nb=/web0s(?!.*chrome)/i.test(Nh),jb=Vu,Bb=Xv,Ub=zu.f,Hb=Eb.set,Fb=Mb,Vb=eb,zb=Rb,Gb=Nb,Wb=C_,Kb=jb.MutationObserver||jb.WebKitMutationObserver,$b=jb.document,Yb=jb.process,qb=jb.Promise,Xb=Ub(jb,"queueMicrotask"),Jb=Xb&&Xb.value;if(!Jb){var Zb=new Fb,Qb=function(){var e,t;for(Wb&&(e=Yb.domain)&&e.exit();t=Zb.get();)try{t()}catch(i){throw Zb.head&&Ob(),i}e&&e.enter()};Vb||Wb||Gb||!Kb||!$b?!zb&&qb&&qb.resolve?((Db=qb.resolve(void 0)).constructor=qb,Ab=Bb(Db.then,Db),Ob=function(){Ab(Qb)}):Wb?Ob=function(){Yb.nextTick(Qb)}:(Hb=Bb(Hb,jb),Ob=function(){Hb(Qb)}):(Ib=!0,Lb=$b.createTextNode(""),new Kb(Qb).observe(Lb,{characterData:!0}),Ob=function(){Lb.data=Ib=!Ib}),Jb=function(e){Zb.head||Ob(),Zb.add(e)}}var ek=Jb,tk=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},ik=Vu.Promise,nk="object"==("undefined"==typeof Deno?"undefined":n(Deno))&&Deno&&"object"==n(Deno.version),rk=!nk&&!C_&&"object"==("undefined"==typeof window?"undefined":n(window))&&"object"==("undefined"==typeof document?"undefined":n(document)),ok=Vu,ak=ik,sk=Eh,lk=Ag,ck=Yf,uk=Fd,hk=rk,dk=nk,fk=zh;ak&&ak.prototype;var pk=uk("species"),gk=!1,vk=sk(ok.PromiseRejectionEvent),yk={CONSTRUCTOR:lk("Promise",(function(){var e=ck(ak),t=e!==String(ak);if(!t&&66===fk)return!0;if(!fk||fk<51||!/native code/.test(e)){var i=new ak((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[pk]=n,!(gk=i.then((function(){}))instanceof n))return!0}return!t&&(hk||dk)&&!vk})),REJECTION_EVENT:vk,SUBCLASSING:gk},mk={},_k=od,bk=TypeError,kk=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw bk("Bad Promise constructor");t=e,i=n})),this.resolve=_k(t),this.reject=_k(i)};mk.f=function(e){return new kk(e)};var wk,Tk,Sk,Ck=Fg,xk=C_,Ek=Vu,Pk=qu,Ok=Bp,Ik=vm,Lk=O_,Dk=M_,Ak=od,Mk=Eh,Rk=Ih,Nk=function(e,t){if(R_(t,e))return e;throw N_("Incorrect invocation")},jk=G_,Bk=Eb.set,Uk=ek,Hk=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(i){}},Fk=tk,Vk=Mb,zk=vp,Gk=ik,Wk=mk,Kk="Promise",$k=yk.CONSTRUCTOR,Yk=yk.REJECTION_EVENT,qk=yk.SUBCLASSING,Xk=zk.getterFor(Kk),Jk=zk.set,Zk=Gk&&Gk.prototype,Qk=Gk,ew=Zk,tw=Ek.TypeError,iw=Ek.document,nw=Ek.process,rw=Wk.f,ow=rw,aw=!!(iw&&iw.createEvent&&Ek.dispatchEvent),sw="unhandledrejection",lw=function(e){var t;return!(!Rk(e)||!Mk(t=e.then))&&t},cw=function(e,t){var i,n,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&&pw(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(tw("Promise-chain cycle")):(n=lw(i))?Pk(n,i,l,c):l(i)):c(o)}catch(h){u&&!r&&u.exit(),c(h)}},uw=function(e,t){e.notified||(e.notified=!0,Uk((function(){for(var i,n=e.reactions;i=n.get();)cw(i,e);e.notified=!1,t&&!e.rejection&&dw(e)})))},hw=function(e,t,i){var n,r;aw?((n=iw.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),Ek.dispatchEvent(n)):n={promise:t,reason:i},!Yk&&(r=Ek["on"+e])?r(n):e===sw&&Hk("Unhandled promise rejection",i)},dw=function(e){Pk(Bk,Ek,(function(){var t,i=e.facade,n=e.value;if(fw(e)&&(t=Fk((function(){xk?nw.emit("unhandledRejection",n,i):hw(sw,i,n)})),e.rejection=xk||fw(e)?2:1,t.error))throw t.value}))},fw=function(e){return 1!==e.rejection&&!e.parent},pw=function(e){Pk(Bk,Ek,(function(){var t=e.facade;xk?nw.emit("rejectionHandled",t):hw("rejectionhandled",t,e.value)}))},gw=function(e,t,i){return function(n){e(t,n,i)}},vw=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,uw(e,!0))},yw=function e(t,i,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===i)throw tw("Promise can't be resolved itself");var r=lw(i);r?Uk((function(){var n={done:!1};try{Pk(r,i,gw(e,n,t),gw(vw,n,t))}catch(o){vw(n,o,t)}})):(t.value=i,t.state=1,uw(t,!1))}catch(o){vw({done:!1},o,t)}}};if($k&&(ew=(Qk=function(e){Nk(this,ew),Ak(e),Pk(wk,this);var t=Xk(this);try{e(gw(yw,t),gw(vw,t))}catch(i){vw(t,i)}}).prototype,(wk=function(e){Jk(this,{type:Kk,done:!1,notified:!1,parent:!1,reactions:new Vk,rejection:!1,state:0,value:void 0})}).prototype=Ok(ew,"then",(function(e,t){var i=Xk(this),n=rw(jk(this,Qk));return i.parent=!0,n.ok=!Mk(e)||e,n.fail=Mk(t)&&t,n.domain=xk?nw.domain:void 0,0==i.state?i.reactions.add(n):Uk((function(){cw(n,i)})),n.promise})),Tk=function(){var e=new wk,t=Xk(e);this.promise=e,this.resolve=gw(yw,t),this.reject=gw(vw,t)},Wk.f=rw=function(e){return e===Qk||undefined===e?new Tk(e):ow(e)},Mk(Gk)&&Zk!==Object.prototype)){Sk=Zk.then,qk||Ok(Zk,"then",(function(e,t){var i=this;return new Qk((function(e,t){Pk(Sk,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete Zk.constructor}catch(aV){}Ik&&Ik(Zk,ew)}Ck({global:!0,constructor:!0,wrap:!0,forced:$k},{Promise:Qk}),Lk(Qk,Kk,!1),Dk(Kk);var mw={},_w=mw,bw=Fd("iterator"),kw=Array.prototype,ww=rv,Tw=ld,Sw=yh,Cw=mw,xw=Fd("iterator"),Ew=function(e){if(!Sw(e))return Tw(e,xw)||Tw(e,"@@iterator")||Cw[ww(e)]},Pw=qu,Ow=od,Iw=bf,Lw=td,Dw=Ew,Aw=TypeError,Mw=qu,Rw=bf,Nw=ld,jw=Xv,Bw=qu,Uw=bf,Hw=td,Fw=function(e){return void 0!==e&&(_w.Array===e||kw[bw]===e)},Vw=Zp,zw=Rh,Gw=function(e,t){var i=arguments.length<2?Dw(e):t;if(Ow(i))return Iw(Pw(i,e));throw Aw(Lw(e)+" is not iterable")},Ww=Ew,Kw=function(e,t,i){var n,r;Rw(e);try{if(!(n=Nw(e,"return"))){if("throw"===t)throw i;return i}n=Mw(n,e)}catch(aV){r=!0,n=aV}if("throw"===t)throw i;if(r)throw n;return Rw(n),i},$w=TypeError,Yw=function(e,t){this.stopped=e,this.result=t},qw=Yw.prototype,Xw=function(e,t,i){var r,o,a,s,l,c,u,h=i&&i.that,d=!(!i||!i.AS_ENTRIES),f=!(!i||!i.IS_RECORD),p=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),v=jw(t,h),y=function(e){return r&&Kw(r,"normal",e),new Yw(!0,e)},m=function(e){return d?(Uw(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=Ww(e)))throw $w(Hw(e)+" is not iterable");if(Fw(o)){for(a=0,s=Vw(e);s>a;a++)if((l=m(e[a]))&&zw(qw,l))return l;return new Yw(!1)}r=Gw(e,o)}for(c=f?e.next:r.next;!(u=Bw(c,r)).done;){try{l=m(u.value)}catch(aV){Kw(r,"throw",aV)}if("object"==n(l)&&l&&zw(qw,l))return l}return new Yw(!1)},Jw=Fd("iterator"),Zw=!1;try{var Qw=0,eT={next:function(){return{done:!!Qw++}},return:function(){Zw=!0}};eT[Jw]=function(){return this},Array.from(eT,(function(){throw 2}))}catch(aV){}var tT=ik,iT=yk.CONSTRUCTOR||!function(e,t){if(!t&&!Zw)return!1;var i=!1;try{var n={};n[Jw]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(aV){}return i}((function(e){tT.all(e).then(void 0,(function(){}))})),nT=qu,rT=od,oT=mk,aT=tk,sT=Xw;Fg({target:"Promise",stat:!0,forced:iT},{all:function(e){var t=this,i=oT.f(t),n=i.resolve,r=i.reject,o=aT((function(){var i=rT(t.resolve),o=[],a=0,s=1;sT(e,(function(e){var l=a++,c=!1;s++,nT(i,t,e).then((function(e){c||(c=!0,o[l]=e,--s||n(o))}),r)})),--s||n(o)}));return o.error&&r(o.value),i.promise}});var lT=Fg,cT=yk.CONSTRUCTOR,uT=ik,hT=Mh,dT=Eh,fT=Bp,pT=uT&&uT.prototype;if(lT({target:"Promise",proto:!0,forced:cT,real:!0},{catch:function(e){return this.then(void 0,e)}}),dT(uT)){var gT=hT("Promise").prototype.catch;pT.catch!==gT&&fT(pT,"catch",gT,{unsafe:!0})}var vT=qu,yT=od,mT=mk,_T=tk,bT=Xw;Fg({target:"Promise",stat:!0,forced:iT},{race:function(e){var t=this,i=mT.f(t),n=i.reject,r=_T((function(){var r=yT(t.resolve);bT(e,(function(e){vT(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var kT=qu,wT=mk;Fg({target:"Promise",stat:!0,forced:yk.CONSTRUCTOR},{reject:function(e){var t=wT.f(this);return kT(t.reject,void 0,e),t.promise}});var TT=bf,ST=Ih,CT=mk,xT=function(e,t){if(TT(e),ST(t)&&t.constructor===e)return t;var i=CT.f(e);return(0,i.resolve)(t),i.promise},ET=Fg,PT=yk.CONSTRUCTOR,OT=xT;Mh("Promise"),ET({target:"Promise",stat:!0,forced:PT},{resolve:function(e){return OT(this,e)}});var IT=Fg,LT=ik,DT=Gu,AT=Mh,MT=Eh,RT=G_,NT=xT,jT=Bp,BT=LT&<.prototype;if(IT({target:"Promise",proto:!0,real:!0,forced:!!LT&&DT((function(){BT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=RT(this,AT("Promise")),i=MT(e);return this.then(i?function(i){return NT(t,e()).then((function(){return i}))}:e,i?function(i){return NT(t,e()).then((function(){throw i}))}:e)}}),MT(LT)){var UT=AT("Promise").prototype.finally;BT.finally!==UT&&jT(BT,"finally",UT,{unsafe:!0})}var HT=Wu,FT=zg,VT=TypeError,zT=Object.getOwnPropertyDescriptor,GT=HT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(aV){return aV instanceof TypeError}}(),WT=td,KT=TypeError,$T=Fg,YT=Td,qT=$p,XT=zp,JT=Zp,ZT=GT?function(e,t){if(FT(e)&&!zT(e,"length").writable)throw VT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},QT=Wg,eS=Cv,tS=qg,iS=function(e,t){if(!delete e[t])throw KT("Cannot delete property "+WT(t)+" of "+WT(e))},nS=Ov("splice"),rS=Math.max,oS=Math.min;$T({target:"Array",proto:!0,forced:!nS},{splice:function(e,t){var i,n,r,o,a,s,l=YT(this),c=JT(l),u=qT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=oS(rS(XT(t),0),c-u)),QT(c+i-n),r=eS(l,n),o=0;o<n;o++)(a=u+o)in l&&tS(r,o,l[a]);if(r.length=n,i<n){for(o=u;o<c-n;o++)s=o+i,(a=o+n)in l?l[s]=l[a]:iS(l,s);for(o=c;o>c-n+i;o--)iS(l,o-1)}else if(i>n)for(o=c-n;o>u;o--)s=o+i-1,(a=o+n-1)in l?l[s]=l[a]:iS(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return ZT(l,c-n+i),r}});var aS=zp,sS=fy,lS=bh,cS=RangeError,uS=Fg,hS=sh,dS=zp,fS=km,pS=function(e){var t=sS(lS(this)),i="",n=aS(e);if(n<0||n==1/0)throw cS("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},gS=Gu,vS=RangeError,yS=String,mS=Math.floor,_S=hS(pS),bS=hS("".slice),kS=hS(1..toFixed),wS=function e(t,i,n){return 0===i?n:i%2==1?e(t,i-1,n*t):e(t*t,i/2,n)},TS=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=mS(r/1e7)},SS=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=mS(n/t),n=n%t*1e7},CS=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=yS(e[t]);i=""===i?n:i+_S("0",7-n.length)+n}return i};uS({target:"Number",proto:!0,forced:gS((function(){return"0.000"!==kS(8e-5,3)||"1"!==kS(.9,0)||"1.25"!==kS(1.255,2)||"1000000000000000128"!==kS(0xde0b6b3a7640080,0)}))||!gS((function(){kS({})}))},{toFixed:function(e){var t,i,n,r,o=fS(this),a=dS(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw vS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return yS(o);if(o<0&&(l="-",o=-o),o>1e-21)if(i=(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(o*wS(2,69,1))-69)<0?o*wS(2,-t,1):o/wS(2,t,1),i*=4503599627370496,(t=52-t)>0){for(TS(s,0,i),n=a;n>=7;)TS(s,1e7,0),n-=7;for(TS(s,wS(10,n,1),0),n=t-1;n>=23;)SS(s,1<<23),n-=23;SS(s,1<<n),TS(s,1,1),SS(s,2),c=CS(s)}else TS(s,0,i),TS(s,1<<-t,0),c=CS(s)+_S("0",a);return c=a>0?l+((r=c.length)<=a?"0."+_S("0",a-r)+c:bS(c,0,r-a)+"."+bS(c,r-a)):l+c}}),Fg({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var xS=Gu,ES=Vu.RegExp,PS=xS((function(){var e=ES("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),OS=PS||xS((function(){return!ES("a","y").sticky})),IS={BROKEN_CARET:PS||xS((function(){var e=ES("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:OS,UNSUPPORTED_Y:PS},LS={},DS=Wu,AS=vf,MS=gf,RS=bf,NS=Th,jS=ly;LS.f=DS&&!AS?Object.defineProperties:function(e,t){RS(e);for(var i,n=NS(t),r=jS(t),o=r.length,a=0;o>a;)MS.f(e,i=r[a++],n[i]);return e};var BS,US=bf,HS=LS,FS=ug,VS=ip,zS=X_,GS=nf,WS=tp("IE_PROTO"),KS=function(){},$S=function(e){return"<script>"+e+"</"+"script>"},YS=function(e){e.write($S("")),e.close();var t=e.parentWindow.Object;return e=null,t},qS=function(){try{BS=new ActiveXObject("htmlfile")}catch(aV){}var e,t;qS="undefined"!=typeof document?document.domain&&BS?YS(BS):((t=GS("iframe")).style.display="none",zS.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write($S("document.F=Object")),e.close(),e.F):YS(BS);for(var i=FS.length;i--;)delete qS.prototype[FS[i]];return qS()};VS[WS]=!0;var XS,JS,ZS=Object.create||function(e,t){var i;return null!==e?(KS.prototype=US(e),i=new KS,KS.prototype=null,i[WS]=e):i=qS(),void 0===t?i:HS.f(i,t)},QS=Gu,eC=Vu.RegExp,tC=QS((function(){var e=eC(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),iC=Gu,nC=Vu.RegExp,rC=iC((function(){var e=nC("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),oC=qu,aC=sh,sC=fy,lC=Iy,cC=IS,uC=fd.exports,hC=ZS,dC=vp.get,fC=tC,pC=rC,gC=uC("native-string-replace",String.prototype.replace),vC=RegExp.prototype.exec,yC=vC,mC=aC("".charAt),_C=aC("".indexOf),bC=aC("".replace),kC=aC("".slice),wC=(JS=/b*/g,oC(vC,XS=/a/,"a"),oC(vC,JS,"a"),0!==XS.lastIndex||0!==JS.lastIndex),TC=cC.BROKEN_CARET,SC=void 0!==/()??/.exec("")[1];(wC||SC||TC||fC||pC)&&(yC=function(e){var t,i,n,r,o,a,s,l=this,c=dC(l),u=sC(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=oC(yC,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=TC&&l.sticky,p=oC(lC,l),g=l.source,v=0,y=u;if(f&&(p=bC(p,"y",""),-1===_C(p,"g")&&(p+="g"),y=kC(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==mC(u,l.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),i=new RegExp("^(?:"+g+")",p)),SC&&(i=new RegExp("^"+g+"$(?!\\s)",p)),wC&&(n=l.lastIndex),r=oC(vC,f?i:l,y),f?r?(r.input=kC(r.input,v),r[0]=kC(r[0],v),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:wC&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),SC&&r&&r.length>1&&oC(gC,r[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&d)for(r.groups=a=hC(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var CC=yC;Fg({target:"RegExp",proto:!0,forced:/./.exec!==CC},{exec:CC});var xC=Kv,EC=Bp,PC=CC,OC=Gu,IC=Fd,LC=Mf,DC=IC("species"),AC=RegExp.prototype,MC=function(e,t,i,n){var r=IC(e),o=!OC((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!OC((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[DC]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=xC(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=xC(e),l=t.exec;return l===PC||l===AC.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));EC(String.prototype,e,l[0]),EC(AC,r,l[1])}n&&LC(AC[r],"sham",!0)},RC=wy.charAt,NC=function(e,t,i){return t+(i?RC(e,t).length:1)},jC=sh,BC=Td,UC=Math.floor,HC=jC("".charAt),FC=jC("".replace),VC=jC("".slice),zC=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,GC=/\$([$&'`]|\d{1,2})/g,WC=qu,KC=bf,$C=Eh,YC=hh,qC=CC,XC=TypeError,JC=function(e,t){var i=e.exec;if($C(i)){var n=WC(i,e,t);return null!==n&&KC(n),n}if("RegExp"===YC(e))return WC(qC,e,t);throw XC("RegExp#exec called on incompatible receiver")},ZC=q_,QC=qu,ex=sh,tx=MC,ix=Gu,nx=bf,rx=Eh,ox=yh,ax=zp,sx=Xp,lx=fy,cx=bh,ux=NC,hx=ld,dx=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=GC;return void 0!==r&&(r=BC(r),l=zC),FC(o,l,(function(o,l){var c;switch(HC(l,0)){case"$":return"$";case"&":return e;case"`":return VC(t,0,i);case"'":return VC(t,a);case"<":c=r[VC(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=UC(u/10);return 0===h?o:h<=s?void 0===n[h-1]?HC(l,1):n[h-1]+HC(l,1):o}c=n[u-1]}return void 0===c?"":c}))},fx=JC,px=Fd("replace"),gx=Math.max,vx=Math.min,yx=ex([].concat),mx=ex([].push),_x=ex("".indexOf),bx=ex("".slice),kx="$0"==="a".replace(/./,"$0"),wx=!!/./[px]&&""===/./[px]("a","$0"),Tx=!ix((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));tx("replace",(function(e,t,i){var n=wx?"$":"$0";return[function(e,i){var n=cx(this),r=ox(e)?void 0:hx(e,px);return r?QC(r,e,n,i):QC(t,lx(n),e,i)},function(e,r){var o=nx(this),a=lx(e);if("string"==typeof r&&-1===_x(r,n)&&-1===_x(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=rx(r);l||(r=lx(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=fx(o,a);if(null===d)break;if(mx(h,d),!c)break;""===lx(d[0])&&(o.lastIndex=ux(a,sx(o.lastIndex),u))}for(var f,p="",g=0,v=0;v<h.length;v++){for(var y=lx((d=h[v])[0]),m=gx(vx(ax(d.index),a.length),0),_=[],b=1;b<d.length;b++)mx(_,void 0===(f=d[b])?f:String(f));var k=d.groups;if(l){var w=yx([y],_,m,a);void 0!==k&&mx(w,k);var T=lx(ZC(r,void 0,w))}else T=dx(y,a,m,_,k,r);m>=g&&(p+=bx(a,g,m)+T,g=m+y.length)}return p+bx(a,g)}]}),!Tx||!kx||wx);var Sx=Ih,Cx=hh,xx=Fd("match"),Ex=function(e){var t;return Sx(e)&&(void 0!==(t=e[xx])?!!t:"RegExp"==Cx(e))},Px=$p,Ox=Zp,Ix=qg,Lx=Array,Dx=Math.max,Ax=function(e,t,i){for(var n=Ox(e),r=Px(t,n),o=Px(void 0===i?n:i,n),a=Lx(Dx(o-r,0)),s=0;r<o;r++,s++)Ix(a,s,e[r]);return a.length=s,a},Mx=q_,Rx=qu,Nx=sh,jx=MC,Bx=bf,Ux=yh,Hx=Ex,Fx=bh,Vx=G_,zx=NC,Gx=Xp,Wx=fy,Kx=ld,$x=Ax,Yx=JC,qx=CC,Xx=Gu,Jx=IS.UNSUPPORTED_Y,Zx=4294967295,Qx=Math.min,eE=[].push,tE=Nx(/./.exec),iE=Nx(eE),nE=Nx("".slice),rE=!Xx((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}));jx("split",(function(e,t,i){var n;return n="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,i){var n=Wx(Fx(this)),r=void 0===i?Zx:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!Hx(e))return Rx(t,n,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=Rx(qx,h,n))&&!((a=h.lastIndex)>u&&(iE(l,nE(n,u,o.index)),o.length>1&&o.index<n.length&&Mx(eE,l,$x(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&tE(h,"")||iE(l,""):iE(l,nE(n,u)),l.length>r?$x(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:Rx(t,this,e,i)}:t,[function(t,i){var r=Fx(this),o=Ux(t)?void 0:Kx(t,e);return o?Rx(o,t,r,i):Rx(n,Wx(r),t,i)},function(e,r){var o=Bx(this),a=Wx(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=Vx(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Jx?"g":"y"),h=new l(Jx?"^(?:"+o.source+")":o,u),d=void 0===r?Zx:r>>>0;if(0===d)return[];if(0===a.length)return null===Yx(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=Jx?0:p;var v,y=Yx(h,Jx?nE(a,p):a);if(null===y||(v=Qx(Gx(h.lastIndex+(Jx?p:0)),a.length))===f)p=zx(a,p,c);else{if(iE(g,nE(a,f,p)),g.length===d)return g;for(var m=1;m<=y.length-1;m++)if(iE(g,y[m]),g.length===d)return g;p=f=v}}return iE(g,nE(a,f)),g}]}),!rE,Jx);var oE=Ff.PROPER,aE=Gu,sE=wm,lE=Im.trim;Fg({target:"String",proto:!0,forced:function(e){return aE((function(){return!!sE[e]()||"
"!=="
"[e]()||oE&&sE[e].name!==e}))}("trim")},{trim:function(){return lE(this)}});var cE=ry.filter;Fg({target:"Array",proto:!0,forced:!Ov("filter")},{filter:function(e){return cE(this,e,arguments.length>1?arguments[1]:void 0)}});var uE=qu,hE=bf,dE=yh,fE=Xp,pE=fy,gE=bh,vE=ld,yE=NC,mE=JC;MC("match",(function(e,t,i){return[function(t){var i=gE(this),n=dE(t)?void 0:vE(t,e);return n?uE(n,t,i):new RegExp(t)[e](pE(i))},function(e){var n=hE(this),r=pE(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return mE(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=mE(n,r));){var u=pE(s[0]);l[c]=u,""===u&&(n.lastIndex=yE(r,fE(n.lastIndex),a)),c++}return 0===c?null:l}]}));var _E=gf.f,bE=Wu,kE=Vu,wE=sh,TE=Ag,SE=bm,CE=Mf,xE=Up.f,EE=Rh,PE=Ex,OE=fy,IE=Ny,LE=IS,DE=function(e,t,i){i in e||_E(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},AE=Bp,ME=Gu,RE=xd,NE=vp.enforce,jE=M_,BE=tC,UE=rC,HE=Fd("match"),FE=kE.RegExp,VE=FE.prototype,zE=kE.SyntaxError,GE=wE(VE.exec),WE=wE("".charAt),KE=wE("".replace),$E=wE("".indexOf),YE=wE("".slice),qE=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,XE=/a/g,JE=/a/g,ZE=new FE(XE)!==XE,QE=LE.MISSED_STICKY,eP=LE.UNSUPPORTED_Y,tP=bE&&(!ZE||QE||BE||UE||ME((function(){return JE[HE]=!1,FE(XE)!=XE||FE(JE)==JE||"/a/i"!=FE(XE,"i")})));if(TE("RegExp",tP)){for(var iP=function(e,t){var i,n,r,o,a,s,l=EE(VE,this),c=PE(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===iP)return e;if((c||EE(VE,e))&&(e=e.source,u&&(t=IE(d))),e=void 0===e?"":OE(e),t=void 0===t?"":OE(t),d=e,BE&&"dotAll"in XE&&(n=!!t&&$E(t,"s")>-1)&&(t=KE(t,/s/g,"")),i=t,QE&&"sticky"in XE&&(r=!!t&&$E(t,"y")>-1)&&eP&&(t=KE(t,/y/g,"")),UE&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],a={},s=!1,l=!1,c=0,u="";n<=i;n++){if("\\"===(t=WE(e,n)))t+=WE(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:GE(qE,YE(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||RE(a,u))throw new zE("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=SE(FE(e,t),l?this:VE,iP),(n||r||h.length)&&(s=NE(a),n&&(s.dotAll=!0,s.raw=iP(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=WE(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+WE(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{CE(a,"source",""===d?"(?:)":d)}catch(aV){}return a},nP=xE(FE),rP=0;nP.length>rP;)DE(iP,FE,nP[rP++]);VE.constructor=iP,iP.prototype=VE,AE(kE,"RegExp",iP,{constructor:!0})}jE("RegExp");var oP="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function aP(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,i=0;i<e.length;i++){var n=e[i].end,r=e[i].begin;Number.isNaN(Number(n))||Number.isNaN(Number(r))||r<0||n<0||n<r||(t+=e[i].end-e[i].begin)}return t=parseInt(1e3*t,10)}function sP(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i}function lP(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var i=e.split(": "),n=i.shift(),r=i.join(": ");t[n]=r}))}catch(aV){return t}return t}function cP(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];oP&&(t=console).log.apply(t,["[logger]",e].concat(n))}function uP(){try{return Math.round(window.performance.now())}catch(aV){return(new Date).getTime()}}function hP(){return(new Date).getTime()}function dP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,n){try{e||n(new Error("url is undefined"));var r=uP(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=lP(s),a.connectTime=uP()-o,a.status=s.status,a.statusText=s.statusText,r=uP())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=uP()-r;t=parseInt(e.loaded/1e3/(i/1e3),10),a.speed=0|t,a.costTime=i},s.onerror=function(){a.status||(a.status=-1,a.costTime=uP()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=uP()-r),i(a)},s.onabort=function(){i(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(Kl){n(Kl)}}))}function fP(e){return!e||window.location.href.indexOf(e)>-1}function pP(e){return!!e&&/^blob:/.test(e)}var gP={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function vP(e){if(!e)return{};var t={};return Object.keys(gP).map((function(i){if(e[i]||"string"!=typeof gP[i]){if(!e[i]&&gP[i]instanceof Array){var n=gP[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[gP[i]]||""})),t}function yP(e,t){return e&&("string"==typeof t||"number"==typeof t)?"".concat(e," ").concat(t):t}function mP(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function _P(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(Kl){var i=e.className&&"object"===Mu(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function bP(e){return"String"===mP(e)?e.replace("P","p"):e?"Number"===mP(e)?"".concat(e):void 0:""}function kP(e){try{return JSON.stringify(e)}catch(Kl){return""}}var wP=0,TP=1,SP=2;function CP(e){if(!e||"String"!==mP(e))return 0;var t=0;try{var i=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),n=e.match(i);if(null!==n)t=parseInt(n[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)?TP:SP:wP}catch(Kl){return wP}}var xP=[];function EP(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=xP||[],n=function(n){if(i[n].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(i[n][e])})),t.url=i[n].name,t.duration=Math.round(i[n].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},r=i.length-1;r>=0;r--){if("break"===n(r))break}return t}catch(Kl){return t}}"undefined"!=typeof window&&function(){try{new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");xP.length>30&&xP.splice(0,xP.length-30);for(var i=0;i<t.length;i++)xP.push(t[i])})).observe({entryTypes:["resource"]})}catch(Kl){console.warn("PerformanceObserver not support",Kl)}}();var PP="videoplayer_oneplay",OP="videoplayer_oneopera",IP="videoplayer_oneerror",LP="videoplayer_oneevent",DP="videoplayer_onetemp",AP={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},MP={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},RP=0,NP=1,jP=2,BP=3,UP=4,HP=0,FP=1,VP=2,zP=3,GP=1,WP=2,KP=3,$P=4,YP=5,qP=6,XP=7,JP="error_retry",ZP="oneerror",QP="oneevent",eO="onetemp",tO=0,iO=1,nO=432e5,rO=36e5,oO=["tag","subtag","device_type"],aO={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var sO=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(Kl){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(Kl){return!0}}()?window.localStorage:{},lO="__xgplayerlogkey",cO={set:function(e){try{var t=this.get();t.push(e),sO.setItem(lO,JSON.stringify(t))}catch(aV){}},get:function(){try{var e=sO.getItem(lO);return e=e?JSON.parse(e):[]}catch(aV){return[]}},remove:function(){try{sO.removeItem(lO)}catch(aV){}},clear:function(){try{sO.clear()}catch(aV){}}},uO={},hO=hh,dO=Th,fO=Up.f,pO=Ax,gO="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];uO.f=function(e){return gO&&"Window"==hO(e)?function(e){try{return fO(e)}catch(aV){return pO(gO)}}(e):fO(dO(e))};var vO={},yO=Fd;vO.f=yO;var mO=sm,_O=xd,bO=vO,kO=gf.f,wO=qu,TO=Mh,SO=Fd,CO=Bp,xO=Fg,EO=Vu,PO=qu,OO=sh,IO=Wu,LO=$h,DO=Gu,AO=xd,MO=Rh,RO=bf,NO=Th,jO=Zd,BO=fy,UO=ih,HO=ZS,FO=ly,VO=Up,zO=uO,GO=fg,WO=zu,KO=gf,$O=LS,YO=Xu,qO=Bp,XO=s_,JO=fd.exports,ZO=ip,QO=Ld,eI=Fd,tI=vO,iI=function(e){var t=mO.Symbol||(mO.Symbol={});_O(t,e)||kO(t,e,{value:bO.f(e)})},nI=function(){var e=TO("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=SO("toPrimitive");t&&!t[n]&&CO(t,n,(function(e){return wO(i,this)}),{arity:1})},rI=O_,oI=vp,aI=ry.forEach,sI=tp("hidden"),lI="Symbol",cI=oI.set,uI=oI.getterFor(lI),hI=Object.prototype,dI=EO.Symbol,fI=dI&&dI.prototype,pI=EO.TypeError,gI=EO.QObject,vI=WO.f,yI=KO.f,mI=zO.f,_I=YO.f,bI=OO([].push),kI=JO("symbols"),wI=JO("op-symbols"),TI=JO("wks"),SI=!gI||!gI.prototype||!gI.prototype.findChild,CI=IO&&DO((function(){return 7!=HO(yI({},"a",{get:function(){return yI(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=vI(hI,t);n&&delete hI[t],yI(e,t,i),n&&e!==hI&&yI(hI,t,n)}:yI,xI=function(e,t){var i=kI[e]=HO(fI);return cI(i,{type:lI,tag:e,description:t}),IO||(i.description=t),i},EI=function(e,t,i){e===hI&&EI(wI,t,i),RO(e);var n=jO(t);return RO(i),AO(kI,n)?(i.enumerable?(AO(e,sI)&&e[sI][n]&&(e[sI][n]=!1),i=HO(i,{enumerable:UO(0,!1)})):(AO(e,sI)||yI(e,sI,UO(1,{})),e[sI][n]=!0),CI(e,n,i)):yI(e,n,i)},PI=function(e,t){RO(e);var i=NO(t),n=FO(i).concat(DI(i));return aI(n,(function(t){IO&&!PO(OI,i,t)||EI(e,t,i[t])})),e},OI=function(e){var t=jO(e),i=PO(_I,this,t);return!(this===hI&&AO(kI,t)&&!AO(wI,t))&&(!(i||!AO(this,t)||!AO(kI,t)||AO(this,sI)&&this[sI][t])||i)},II=function(e,t){var i=NO(e),n=jO(t);if(i!==hI||!AO(kI,n)||AO(wI,n)){var r=vI(i,n);return!r||!AO(kI,n)||AO(i,sI)&&i[sI][n]||(r.enumerable=!0),r}},LI=function(e){var t=mI(NO(e)),i=[];return aI(t,(function(e){AO(kI,e)||AO(ZO,e)||bI(i,e)})),i},DI=function(e){var t=e===hI,i=mI(t?wI:NO(e)),n=[];return aI(i,(function(e){!AO(kI,e)||t&&!AO(hI,e)||bI(n,kI[e])})),n};LO||(dI=function(){if(MO(fI,this))throw pI("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?BO(arguments[0]):void 0,t=QO(e),i=function e(i){this===hI&&PO(e,wI,i),AO(this,sI)&&AO(this[sI],t)&&(this[sI][t]=!1),CI(this,t,UO(1,i))};return IO&&SI&&CI(hI,t,{configurable:!0,set:i}),xI(t,e)},qO(fI=dI.prototype,"toString",(function(){return uI(this).tag})),qO(dI,"withoutSetter",(function(e){return xI(QO(e),e)})),YO.f=OI,KO.f=EI,$O.f=PI,WO.f=II,VO.f=zO.f=LI,GO.f=DI,tI.f=function(e){return xI(eI(e),e)},IO&&(XO(fI,"description",{configurable:!0,get:function(){return uI(this).description}}),qO(hI,"propertyIsEnumerable",OI,{unsafe:!0}))),xO({global:!0,constructor:!0,wrap:!0,forced:!LO,sham:!LO},{Symbol:dI}),aI(FO(TI),(function(e){iI(e)})),xO({target:lI,stat:!0,forced:!LO},{useSetter:function(){SI=!0},useSimple:function(){SI=!1}}),xO({target:"Object",stat:!0,forced:!LO,sham:!IO},{create:function(e,t){return void 0===t?HO(e):PI(HO(e),t)},defineProperty:EI,defineProperties:PI,getOwnPropertyDescriptor:II}),xO({target:"Object",stat:!0,forced:!LO},{getOwnPropertyNames:LI}),nI(),rI(dI,lI),ZO[sI]=!0;var AI=$h&&!!Symbol.for&&!!Symbol.keyFor,MI=Fg,RI=Mh,NI=xd,jI=fy,BI=fd.exports,UI=AI,HI=BI("string-to-symbol-registry"),FI=BI("symbol-to-string-registry");MI({target:"Symbol",stat:!0,forced:!UI},{for:function(e){var t=jI(e);if(NI(HI,t))return HI[t];var i=RI("Symbol")(t);return HI[t]=i,FI[i]=t,i}});var VI=Fg,zI=xd,GI=Qh,WI=td,KI=AI,$I=(0,fd.exports)("symbol-to-string-registry");VI({target:"Symbol",stat:!0,forced:!KI},{keyFor:function(e){if(!GI(e))throw TypeError(WI(e)+" is not a symbol");if(zI($I,e))return $I[e]}});var YI=zg,qI=Eh,XI=hh,JI=fy,ZI=sh([].push),QI=Fg,eL=Mh,tL=q_,iL=qu,nL=sh,rL=Gu,oL=Eh,aL=Qh,sL=J_,lL=function(e){if(qI(e))return e;if(YI(e)){for(var t=e.length,i=[],n=0;n<t;n++){var r=e[n];"string"==typeof r?ZI(i,r):"number"!=typeof r&&"Number"!=XI(r)&&"String"!=XI(r)||ZI(i,JI(r))}var o=i.length,a=!0;return function(e,t){if(a)return a=!1,t;if(YI(this))return t;for(var n=0;n<o;n++)if(i[n]===e)return t}}},cL=$h,uL=String,hL=eL("JSON","stringify"),dL=nL(/./.exec),fL=nL("".charAt),pL=nL("".charCodeAt),gL=nL("".replace),vL=nL(1..toString),yL=/[\uD800-\uDFFF]/g,mL=/^[\uD800-\uDBFF]$/,_L=/^[\uDC00-\uDFFF]$/,bL=!cL||rL((function(){var e=eL("Symbol")();return"[null]"!=hL([e])||"{}"!=hL({a:e})||"{}"!=hL(Object(e))})),kL=rL((function(){return'"\\udf06\\ud834"'!==hL("\udf06\ud834")||'"\\udead"'!==hL("\udead")})),wL=function(e,t){var i=sL(arguments),n=lL(t);if(oL(n)||void 0!==e&&!aL(e))return i[1]=function(e,t){if(oL(n)&&(t=iL(n,this,uL(e),t)),!aL(t))return t},tL(hL,null,i)},TL=function(e,t,i){var n=fL(i,t-1),r=fL(i,t+1);return dL(mL,e)&&!dL(_L,r)||dL(_L,e)&&!dL(mL,n)?"\\u"+vL(pL(e,0),16):e};hL&&QI({target:"JSON",stat:!0,arity:3,forced:bL||kL},{stringify:function(e,t,i){var n=sL(arguments),r=tL(bL?wL:hL,null,n);return kL&&"string"==typeof r?gL(r,yL,TL):r}});var SL=fg,CL=Td;Fg({target:"Object",stat:!0,forced:!$h||Gu((function(){SL.f(1)}))},{getOwnPropertySymbols:function(e){var t=SL.f;return t?t(CL(e)):[]}});var xL=Fg,EL=Wu,PL=sh,OL=xd,IL=Eh,LL=Rh,DL=fy,AL=s_,ML=Sg,RL=Vu.Symbol,NL=RL&&RL.prototype;if(EL&&IL(RL)&&(!("description"in NL)||void 0!==RL().description)){var jL={},BL=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:DL(arguments[0]),t=LL(NL,this)?new RL(e):void 0===e?RL():RL(e);return""===e&&(jL[t]=!0),t};ML(BL,RL),BL.prototype=NL,NL.constructor=BL;var UL="Symbol(test)"==String(RL("test")),HL=PL(NL.valueOf),FL=PL(NL.toString),VL=/^Symbol\((.*)\)[^)]+$/,zL=PL("".replace),GL=PL("".slice);AL(NL,"description",{configurable:!0,get:function(){var e=HL(this);if(OL(jL,e))return"";var t=FL(e),i=UL?GL(t,7,-1):zL(t,VL,"$1");return""===i?void 0:i}}),xL({global:!0,constructor:!0,forced:!0},{Symbol:BL})}var WL=[{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)/}],KL=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}];function $L(){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(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}var YL=["Baiduspider","YandexBot"];function qL(e,t){var i=!1;return YL.map((function(t){t===e&&(i=!0)})),/spider/.test(t)&&(i=!0),i}function XL(){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 JL="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),i=/(android)/.test(e),n=/(windows phone)/.test(e),r=t||i||n,o={isIOS:t,isAndroid:i,isMobile:r,isPC:!r,isPad:/(ipad)/.test(e)},a=$L();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=WL;/trident/.test(e)&&(u=KL);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=XL();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=qL(o.name,e),o}(navigator.userAgent);var ZL=[1,1,1,1,1];function QL(){return parseInt(ZL.join(""),10)}ZL[0]=JL.isSupportMP4?ZL[1]+1:ZL[1],ZL[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"'))?ZL[1]+1:ZL[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 i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(Kl){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?ZL[2]=ZL[2]+1:ZL[2]=1})).catch((function(){ZL[2]=ZL[2]-1}));var eD={range:"0-1048576",timer:6e4,timeout:15e3},tD=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ru(this,e),Object.keys(eD).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=eD[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 ju(e,[{key:"setData",value:function(e){var t=this;if(Object.keys(e).map((function(i){"headers"!==i&&(t._data[i]=e[i])})),e.headers&&Object.keys(e.headers).length>0){this._headers=vP(e.headers),e.headers["content-type"]&&(this._data.contentType=e.headers["content-type"]);var i=(e.headers["content-range"]||"").split("/");i&&i.length>1&&(this._data.contentLength=parseInt(i[1]))}}},{key:"contentLength",get:function(){return this._data.length||0}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",n=this.options;this.url=e,!this.url||"start"!==i&&(this.ishangUp||this.intervalId)?cP("task>>cant`t trigger url",this.ishangUp,this.intervalId):(cP("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),dP(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){cP("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){cP("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}(),iD="ProgressInfo";var nD=function(){function e(){Ru(this,e),this._init()}return ju(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.file={audio:0,video:0},this.lastBitrate=null,this.curBitrate={vBitrate:0,aBitrate:0,cdnSize:0,pcdnSize:0,definition:"",fileid:""},this.nextBitrate={start:-1},this.currentTime=0,this.buffered=[],this.cachedTime=0,this.duration=0}},{key:"reset",value:function(){this._init()}},{key:"getFileSize",value:function(e){var t=this.curBitrate,i=t.vBitrate,n=t.aBitrate;return{audio:Math.round(e*n/8),video:Math.round(e*i/8),total:Math.round(e*(i+n)/8)}}},{key:"updatePlayed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.played,n=i.length;if(0===t||n<1){var r=n>0?i[n-1]:null,o=this.curBitrate,a=o.vBitrate,s=o.aBitrate;r&&(r.end<0||r.end-r.start<1)?(r.end<0?r.start=e:r.end=e,r.vBitrate=a,r.aBitrate=s):i.push({start:e,end:-1,vBitrate:a,aBitrate:s})}else i[n-1].end=e}},{key:"calculatePlaySize",value:function(){var e=this.played,t=this.curBitrate,i=function(e){for(var t=0,i=0;i<e.length;i++){var n=e[i];n.end<0||(t+=n.end-n.start)}return t}(e),n=Math.round((t.aBitrate+t.vBitrate)*i/8);return this.playedSize+=n,cP(iD,"calculatePlaySize","duration: ".concat(i," playedSize:").concat(this.playedSize),this.played),this.played=[],this.playedSize}},{key:"copyBitrateInfo",value:function(e,t){return["aBitrate","vBitrate","definition","fileid","cdnSize","pcdnSize"].forEach((function(i){e[i]&&(t[i]=e[i])})),t.cdnSize=e.cdnSize,t.pcdnSize=e.pcdnSize,t}},{key:"checkNextBitrate",value:function(e){var t=this.nextBitrate;if(t.start>-1&&e>=t.start){var i=this.curBitrate;this.calculatePlaySize(),cP(iD,"checkNextBitrate",e,t.start,this.cachedSize),this.copyBitrateInfo(t,i),this.updatePlayed(e,0),t.start=-1,t.fileid="",["vBitrate","aBitrate","cdnSize","pcdnSize"].forEach((function(e){t[e]=0}))}}},{key:"updateLastDefInfo",value:function(){var e=this.curBitrate;if(e.vBitrate>0){var t={};this.copyBitrateInfo(e,t),this.lastBitrate=t}}},{key:"updateDefInfo",value:function(e,t){cP(iD,"updateDefInfo",t,this.curBitrate.vBitrate,e);var i=e.mediaType,n=e.start,r=e.bitrate,o=e.definition,a=e.fileid,s={cdnSize:0,pcdnSize:0};"audio"===i?s.aBitrate=r:(s.vBitrate=r,s.definition=o,s.fileid=a,this.updateLastDefInfo()),s.start=n,this.nextBitrate=s,this.checkNextBitrate(t)}},{key:"upDateDownload",value:function(e){var t=e.cdn_size,i=e.pcdn_size,n=this.curBitrate,r=this.nextBitrate,o=0,a=0;i?(o=1,a=i):t&&(a=t),this.cachedSize+=a,o>0&&(this.pcdnCached+=a);var s=r.start>=0?r:n;s.cdnSize+=a,o>0&&(s.pcdnSize+=a)}},{key:"updateBuffered",value:function(e){var t=function(e){var t=[];if(!e||e.length<1)return t;for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10)/1e3,r=parseInt(1e3*e.end(i),10)/1e3;t.push({start:n,end:r})}return t}(e),i=0;t.forEach((function(e){var t,n;i+=(t=e.end,n=e.start,parseInt(1e3*t-1e3*n,10)/1e3)})),this.buffered=t,this.cachedTime=i}},{key:"isDefInfoFirstChange",value:function(){return!(this.curBitrate&&this.curBitrate.vBitrate>0)}}]),e}();const rD="0.11.37";var oD=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];cP("xgVodLogger version is ".concat(rD));var aD,sD,lD=(aD="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(aD,"]")}),cD=1300,uD="__tea_cache_tokens_".concat(cD),hD=-1,dD="",fD=null,pD=function(){function e(t,i){var n=this;if(Ru(this,e),Bu(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===mP(e)?e:"";"String"!==mP(t)&&(t=""),n.urlLog={initial_url:t,initial_host:sP(t),initial_ip:""}})),Bu(this,"onXgLogCache",(function(){var e,t=n._getLogCache();t&&(n._templog={vtype:null===(e=n.player)||void 0===e?void 0:e.vtype,log:t},n.onOneTemp())})),Bu(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),Bu(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),Bu(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),Bu(this,"onDrmTypeChange",(function(e){n.addIfExist("drm_type",{drm_type:e},n._options)})),Bu(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),Bu(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=uP(),n._endType="switch"})),Bu(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),Bu(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),cP("onDefinitionChange from:".concat(t,", to:").concat(i))})),Bu(this,"onDefiChangeSuccess",(function(){cP("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),Bu(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;cP("abrChange",o),o.last_definition=t,o.now_definition=i,n.abrInfo.abr_event_info.video_switch.push(o),n.changeResolution({from:t,to:i,startTime:uP(),operaType:"abr_switch",abrInfo:r})}})),Bu(this,"onAbrPrestallEnd",(function(e){n.abrInfo.abr_user_info.cancel_abr=e?1:0})),Bu(this,"onTimeUpdate",(function(){var e=n.playlogs,t=n.resLogs,i=n.player;if(n.errorLog.try_err_c=0,e.vt||1!==n.startStep||(e.vt=hP(),cP("onTimeUpdate: first frame inited","currentTime11:".concat(i.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),n.startStep=2),!t.initial_resolution){var r=i.currentDefitionFromPlayer&&i.currentDefitionFromPlayer.definition?i.currentDefitionFromPlayer.definition:i.config.defaultDefinition||"".concat(i.video.videoHeight,"p")||"";r=bP(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:i.currentTime,end:-1}):e.played[o-1].end=i.currentTime,n._progressInfo.updatePlayed(i.currentTime),n._progressInfo.checkNextBitrate(i.currentTime);var a=t.played.length;a<1?t.played.push({begin:i.currentTime,end:-1}):t.played[a-1].end=i.currentTime,n.lastVideoTime=i.currentTime||0})),Bu(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),Bu(this,"onCanplay",(function(){cP("onCanplay","this.startStep:".concat(n.startStep," ").concat(hP())),n.setVt()})),Bu(this,"onLoadeddata",(function(){cP("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(hP())),n.setVt(),n.updateVideoSize()})),Bu(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=fP(n.player.currentSrc);n.triggerTask("start"),cP("onLoadStart","this.startStep:".concat(n.startStep," ").concat(hP()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),Bu(this,"onBufferedChange",(function(){var e=n.player.video&&n.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>n.player.duration&&(n.bft=hP())}})),Bu(this,"onPlayerInited",(function(){cP("player init"),n._playerCreatedTime=hP(),n.playlogs.rt=hP()})),Bu(this,"onNotAutoPlay",(function(){cP("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),Bu(this,"onDashError",(function(e){e=e||{};var t=n.errorLog;t.last_errors.push(e.errorCode),t.accu_errc++,n.onOneError({errorType:e.errorTypeCode,code:e.errorCode,url:e.url||"",headers:e.headers||{}},0)})),Bu(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(cP("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(JL.isSupportMP4," isPC:").concat(JL.isPC)),cP("onPlayerError",e),n.load_state=zP,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),JL.isPC&&!JL.isSupportMP4||JL.isSpider)return t.errc=MP[5],t.errt=AP.notSupport,n.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(n._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&AP[e.errorType]?AP[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&MP[e.errorCode]?MP[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&MP[e.code]?MP[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(GP),n.onOnePlay(GP),n.onOneTemp(GP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade);var r=!1,o=e.mediaError;o&&n._options.needXhrCheck&&(4===o.code||2===o)&&(r=!0),n.onOneError({endState:XP,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),Bu(this,"onPlayInterfaceInfo",(function(e){cP("onPlayInterfaceInfo",e);var t=n.errorLog,i=n.apiLog,r=n.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?i.vsc=e[t]:"message"===t?i.vsc_message=e.message||"success,视频可正常播放":i[t]=e[t]})),r.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(i.vsc=e.code||10,i.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=uP()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),Bu(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.netLog;if(e.speed){var i=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=i,t.totalSpeed+=i,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=EP(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=lP(a));var c=Au(Au({},l=vP(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&&n.merror.cdn.push(Au(Au({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:sP(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:sP(u)},c,"error"===e.type?0:2)}})),Bu(this,"onNext",(function(){if(cP("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(WP))return;n.sendSwitchOpera(WP),n.onOnePlay(WP),n.onOneTemp(WP),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),Bu(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=bP(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),Bu(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){cP("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:n.realSpeed,avg_speed:n.avgSpeed,mse_op:n.mp4MseOpLength,mp4_load_range:n.mp4LoadSegmentTimeRange,bitrate:n.curBitrate};if("waitingStart"===e.eventType)return n.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void n.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=uP();cP("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),n.appendStallInfo("end",c,o),t.bc++,n.checkInBuffer(n.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),i.bc++,t.bu_acu_t+=a,i.bu_acu_t+=a,r.end=n.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=n.cur_play_pos),n.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),Bu(this,"onSeeking",(function(){if(!fP(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;cP("onSeeking","currentTime:".concat(i.currentTime)),0===n.startStep&&n.setPt(),n.suspendWaitingStatus("seek"),n.isSeeking&&n.suspendSeekStatus("seek",!1),n.isSeeking=!0,t.played.push({begin:i.currentTime,end:-1}),e.played.push({begin:i.currentTime,end:-1}),n._progressInfo.updatePlayed(i.currentTime,0),r.lastSeekStartTime=uP(),r.seekBefore=n.lastVideoTime.toString(),r.intervalId=setTimeout((function(){n.isSeeking&&n.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),Bu(this,"onSeeked",(function(){fP(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),Bu(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=FP;var e=uP();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),Bu(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(cP("onPlayCatch",e,t),e){switch(e){case"mp42dash":n.vtype="DASH_2";break;case"dash2mp4":n.vtype="MP4_2";break;case"dash1mp4":n.vtype="MP4_1";break;default:n.vtype=e}var i=n.errorLog,r=n.playlogs,o=n.merror;o.playCatch.push(Au({errc:t.errorCode,errt:t.errorType},t.headers)),n.setBr("playcatch"),i.accu_errc++,i.try_err_c++,i.fir_errc=t.errorCode,t.errorCode&&i.last_errors.push(t.errorCode),n.suspendWaitingStatus("playcatch"),n.sendDegradeLog("playCatch",r.degrade,{cdn_url:t.url}),r.degrade=e,n.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||n.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:qP,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),Bu(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=n.errorLog,i=n.playlogs;cP("onMediaExpied",e),n.suspendWaitingStatus("expied"),n.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),i.at=(new Date).getTime(),n.merror.expied.push(Au({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},vP(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),Bu(this,"onLog",(function(e){cP("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case JP:break;case eO:n._templog||(n._templog={}),n._templog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(n){e[n]="append"===i?yP(e[n],t[n]):t[n]})),e}(n._templog,e.data,e.action),n._templog.preload_hit&&(n._cacheFile=iO);break;case ZP:var i=n.errorLog;i.accu_errc++,i.try_err_c++,n.setBr("mp4error"),i.last_errors.push(e.code),n.onOneError(e,0);break;case QP:var r=function(e,t){var i={ext:e.ext||{},data:{}};return Object.keys(e).map((function(n){t[n]?i.data[t[n]]=e[n]:"ext"!==n&&(i.ext[n]=e[n])})),i}(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])})),n.onOneEvent(r.data,r.ext,2)}})),Bu(this,"onPlay",(function(){cP("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),Bu(this,"onPause",(function(){cP("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=uP()})),Bu(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(cP("onWaiting>","isSeeking:".concat(n.isSeeking," startStep:").concat(n.startStep," intervalId:").concat(n.stallIntervalId)),n.isSeeking||0===n.playlogs.vt||n.inWaitingStart>0||(n.stallIntervalId&&(window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null),n.inWaitingStart=uP(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;cP("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(uP()-n.inWaitingStart)),n._endType="wait",n.load_state=VP,n.vtype.indexOf("MP4")>-1&&n.player.currentTime>10&&n.task&&(n.triggerTask("waiting",n.initial_url),n.requestCount++),e.start=n.waitStartTime,e.bc++,1===e.bc&&(e.startf=n.waitStartTime),window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null,n.startWaitingStatus(n.inWaitingStart,uP()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),Bu(this,"onEnded",(function(){if(n.initial_url){cP("onEnded","watchDur:".concat(n.watchDur," vt:").concat(n.vt," pt:").concat(n.pt)),n.isEnded=!0;var e=n.resLogs.df,t=n._progressInfo;t.calculatePlaySize(),t.cachedSize<1?n.changeResolution({from:e,to:e,startTime:uP(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(KP),n.onOnePlay(KP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(KP),n.sendEventsQueue(),n.playlogs.lc++}})),Bu(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp($P),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV($P)||(n.sendSwitchOpera($P),n.onOnePlay($P,!0)))})),Bu(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),Bu(this,"onDestroy",(function(){cP("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(YP),n.startStep>0&&n.initial_url&&(n.onOneTemp(YP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:uP(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(KP),n.sendEventsQueue(),JL.isPC?window.removeEventListener("beforeunload",n.onUnload):(JL.isMobile||JL.isPad)&&window.removeEventListener("pagehide",n.onUnload),document.removeEventListener("visibilitychange",n.onVisibilitychange),n.listeners.forEach((function(e){n.player.off(e.evt,e.handler)})),n.clearTimers(),n.player.off("destroy",n.onDestroy),n.task&&n.task.clear()})),Bu(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(cP("onOnePlay _isOnePlayReport:".concat(n._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!n._isOnePlayReport){var i=n.errorLog,r=n.playlogs,o=n.abrInfo,a=n.resLogs,s=n.player,l=n.apiLog,c=n.pauseLog,u=n.stall,h=n.netLog,d=n.watchDur;n._isOnePlayReport=!0;var f=hP();n.getBufferTime(s);var p=n.getFrameInfo(),g=n.getPerformance(),v=i.errc,y=n._progressInfo,m=y.playedSize,_=y.cachedSize,b=y.pcdnCached,k=n._progressInfo.getFileSize(s.duration);n.setExt();var w=Au(Au(Au(Au({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:n.vid,initial_url:n.initial_url,initial_host:n.initial_host,initial_ip:n.curHeaders.x_response_sinfo||0,initial_type:n.initial_type},n.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:n.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||hP(),vt:n.vt,lt:n.lt,lpt:n.lpt,fvt:n.fvt,nvt:n.nvt,bft:n.bft,sc:n.seekLog.sc,sat:n.seekLog.sat,bc:n.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:n.videoNetworkState,status:n.curStatus,first_buf_startt:u.startf,first_buf_endt:u.endf,lc:r.lc,bu_acu_t:n.bu_acu_t>nO?0:n.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:n.cur_play_pos,load_state:n.load_state,play_speed:n.playbackRate,playback_state:n.playback_state,end_state:e,watch_dur:d>nO?0:d,switch_resolution_c:n.switchResolutionCount,is_start_play_automatically:n.isAutoplay,start_time:n.start_time,finish:n.finish,errt:i.errt,errc:v,vsc:l.vsc,vsc_message:i.message||l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:n.videoWidth,height:n.videoHeight,vd:n.vd,video_length:k.video,audio_length:k.audio,df:n.resolution,lf:a.lf,play_c:0,player_created_t:n.player_created_t,fir_errt:i.fir_errt,fir_errc:i.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:n.mute,volume:n.volume,download_speed:n.realSpeed?n.realSpeed:n.task&&n.task.speed?n.task.speed:h.downloadSpeed,avg_speed:n.avgSpeed?n.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:n.curBitrate,preload_state:n.preloadState,preload_hit:n.preLoadData.hit||0,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:n.watingCost,br:r.br,fbrt:r.fbrt,try_err_c:i.try_err_c,accu_errc:i.accu_errc,merror:kP(n.merror),ex:kP(n.exInfo),perf:kP(g),bufs:kP(n.buffers.allBuffer),vds:_,pvds:b,vps:m,pcdn:kP(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:kP(n.encryptedInfo)});0!==n.vt&&(w.et=f);var T=n._logstrcache||n._getLogCache();if(0===w.fvt&&T&&(w.log=T,n._logstrcache=null),null!=s&&s.softDecoder&&(w.soft_decoder=s.softDecoder),s&&s.dashState&&(w.dash_state=s.dashState),null!=s&&s.softDecoder&&(w.soft_decoder=s.softDecoder),o.abr_init_opts=s.config.autoBitrateOpts||{},w.abr_info=kP(n.abrInfo),t){var S=!n._options.disableLocalCache;n.reportLog(PP,w,S?1:0)}else n.reportLog(PP,w)}})),Bu(this,"onOneEvent",(function(e){var t=e.costTime,i=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;cP("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=Au(Au({local_time:(new Date).getTime(),v:i||n.vid,cost_time:t,end_type:r||n.end_type,cdn_url:a||n.url,cdn_host:s||"",initial_type:n.initial_type,resolution:n.resolution,play_speed:n.playbackRate,first_frame_interval:uP()-n.pt,last_switch_interval:n.getLastInterval("lastSwitchStartTime",n.resLogs,!1),last_seek_interval:n.updateSeekPt(!1),last_event_interval:n.getLastInterval("lastEventTime"),cur_play_pos:o||n.cur_play_pos,video_ready_s:n.videoReadyState,video_seeking:n.videoSeeking,video_paused:n.videoPaused,bufs:kP(d),retry_count:n._retryCount,at:n.playlogs.at,bc:n.stall.bc,stay_seconds:parseInt(((new Date).getTime()-n.playlogs.at)/1e3,10),preload_state:n.preloadState,preload_hit:n.preLoadData.hit,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength},h),f);r.indexOf("waitend")>=0&&t>3e3&&(p.log=n._getLogCache());var g=n.player,v=g.currentTime,y=g.duration,m=y-v;if(r.indexOf("waitstart")>=0&&m<=1){var _=p.local_time,b=p.v,k=p.cost_time,w=p.cdn_url,T=p.first_frame_interval,S=p.cur_play_pos,C=p.video_ready_s,x=p.video_seeking,E=p.video_paused,P=p.bufs,O=p.bc,I=p.preload_hit;n.reportLog(LP,Au({end_type:"longwait",local_time:_,v:b,cost_time:k,cdn_url:w,first_frame_interval:T,cur_play_pos:S,video_ready_s:C,video_seeking:x,video_paused:E,bufs:P,bc:O,preload_hit:I},h),c)}if("waitstart"===r&&"function"==typeof n._options.getPageFPS){var L=n._options.getPageFPS();p.cur_fps=L.curFPS||0,p.avg_fps=L.avgFPS||0}var D=n.player;D&&D.dashState&&(p.dash_state=n.player.dashState),Object.keys(l).forEach((function(e){p[e]=l[e]})),p.ex=kP(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog(LP,p,c)})),Bu(this,"onOneTemp",(function(){if(cP("onOneTemp>>",!n._templog),n._templog){var e=n.player,t=n.playlogs,i=n.pauseLog,r=n.errorLog,o=n.resLogs,a=n.watchDur,s=Au(Au(Au({local_time:(new Date).getTime()},n._templog),{},{v:n.vid,initial_type:n.initial_type,pt:n.pt,vt:n.vt,lt:n.lt,fvt:n.fvt,bc:n.bc,bu_acu_t:n.bu_acu_t>nO?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>nO?0:a,finish:n.finish,errt:r.errt,errc:r.errc,vd:n.vd,df:n.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:kP(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=hP()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,s)})),n.reportLog(DP,s,0),n._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(i&&i.line_app_id){i.isTask&&(this.task=new tD),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),i.codec_type=i.codec_type||"h264",this._envInfo=i.envInfo||{},this._options=i,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(i.line_app_id,10)||0,this.line_user_id=(i.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=i.playerVersion,this.closeSeekLog=i.closeSeekLog||!1,this.start_time=1e3*(i.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this._progressInfo=new nD,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),cP("logger constructor:".concat(this.player.video))}catch(Kl){console.error(Kl)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return ju(e,[{key:"resetLoggerParams",value:function(){cP("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:hP(),vt:0,rt:this.isEnded?hP():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}],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._progressInfo.reset(),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=hD,this.lastEventTime=hD,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:uP(),seekBefore:0,sat:0,sc:0},this.resLogs={lastSwitchStartTime:hD,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:JL.isSupportMP4?0:1005,last_errors:[],message:""},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=HP,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=tO}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(uD).web_id||"0"}catch(aV){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(Kl){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 i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))}(e),cP("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 fD("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?cD:1300===cD?323254:cD,channel:i,log:!1,disable_sdk_monitor:!0};t.channelDomain&&(n.channel_domain=t.channelDomain),n.enable_ab_test=!!t.enableAbTest,this.tracker.init(n)}this.initSessionId();var r=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:rD,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:JL.isPad?"pad":JL.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:QL(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};cP("commonParams ",this.commonParams,a);var s=Au({evtParams:this.commonParams,disable_auto_pv:!0},a);!JL.name||JL.isChrome||JL.isSafari||(s.browser=JL.name,JL.appVersion&&(s.browser_version=JL.appVersion)),this.line_user_id&&(s.user_unique_id=this.line_user_id,s.web_id=this.line_user_id),t.referrer&&(s.referrer=t.referrer,s.referrer_host=sP(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),cP("trackConfig",s),this.tracker.config(s),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=cO.get();cO.remove(),t.map((function(t){Object.keys(t).map((function(i){if(cP("sendLocalLog",i,t[i]),e.player){e.player.emit("abLog",i,t[i]);var n=e._options.sendLocalCallback;n&&"function"==typeof n&&n(i,t[i])}e._track(i,t[i])}))}))}},{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:"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},{evt:"definitionChangeDetail",handler:this.onDefinitionChangeDetail},{evt:"prf_data_size",handler:this.onPrfDataSize}];var t=this.player.config.errorKey;cP(">>>errorKey",t);var i={evt:"error",handler:this.onPlayerError};t&&(i.evt=t),this.listeners.push(i),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t,i=(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=i,i}},{key:"addIfExist",value:function(e,t,i){if(lD(t)){var n=t[e];!(null==n)&&(i[e]=n)}}},{key:"sendSwitchOpera",value:function(e){var t=this._progressInfo,i=t.lastBitrate,n=t.curBitrate,r=t.nextBitrate,o={costTime:0,operaType:"detail_switch",stateBefore:"",stateAfter:"",endType:e},a=null;if("changedetail"===e){if(!i)return;a=i,o.stateBefore=i.definition,o.stateAfter=r.definition}else a=n,o.stateBefore=n.definition,o.stateAfter="";var s={vds:a.cdnSize,pvds:a.pcdnSize,fileid:a.fileid};this.onOneOperator(o,s)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,n=e.startTime,r=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=bP(t),i=bP(i),l.ldet=uP(),l.df=i,l.lf=t,l.final_resolution=i,l.switch_count++;var c=l.ldet-n,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:aP(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:r,endType:s,stateBefore:t,stateAfter:i},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t[e],r=uP(),o=n===hD?hD:r-n;return i&&(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(){JL.isPC?window.addEventListener("beforeunload",this.onUnload):(JL.isMobile||JL.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",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};cP("sendDegradeLog",e,t,i);var n=this.degradeLog;if(!(n.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(n.hasSendEnd=!0);var r=this.bu_acu_t-n.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:i.url},Au({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>nO?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?aO.FULLSCREEN_TYPE:this.player.isCssfullScreen?aO.CSS:aO.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,i=0,n=e.video&&e.video.buffered;if(n){for(var r=n.length,o=0,a=0;a<r;a++)o+=n.end(a)-n.start(a);t=i=1e3*o}return{video:t,audio:i}}},{key:"updateAbrInfo",value:function(e,t,i){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:i},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(i){"performance"!==i&&(e.exInfo[i]=t[i])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,i=e.operaType,n=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:i,state_before:n,state_after:r,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:kP(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(OP,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,interval_time:0},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];cP("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=vP(t.headers||{}),u=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=Au(Au(Au({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:kP(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||GP,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:kP(this.exInfo),pref:kP(u),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0});s&&s.dashState&&(d.dash_state=s.dashState);var f=this.player.currentSrc,p=pP(f)?pP(t.url)?this.initial_url:t.url:f,g={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:pP(f)?1:0};if(n&&"String"===mP(p)){var v={};dP(p,{range:"0-8",timeout:2e3}).then((function(e){cP("getXhr>>check result ",e);var t=vP(e.headers||{});d.server_ip=t.x_response_sinfo,v=Au(Au({},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=Au(Au({},g),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=CP(p);v.isexpired=t,d.net=kP(v),e.reportLog(IP,d,i)}))}else d.net=kP(g),this.reportLog(IP,d,i)}},{key:"reportLog",value:function(t,i,n){var r=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===mP(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(i.abtest_tag=a);var c=this._options;if(i.codec_type=this.codecType,lD(c)&&(oO.forEach((function(e){r.addIfExist(e,c,i)})),Object.keys(s).forEach((function(e){r.addIfExist(e,s,i)})),i.vtype=this.vtype),i.env_info=kP(this._envInfo||{}),i.support=QL(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0,1===n){var u={};return u[t]=i,void cO.set(u)}2!==n?(this.player&&this.player.emit("abLog",t,i),this._track(t,i)):this.addEventsQueue(t,i)}},{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;cP("triggerTask>>",e);var i=fP(t=t||this.player.src);!i&&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,i=arguments.length>2?arguments[2]:void 0;this.exInfo.stall||(this.exInfo.stall=[]);var n=this.exInfo.stall;if("start"===e){n.length>6&&n.splice(0,n.length-6);var r=this.buffers.curBuffer;n.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=n.length-1;if(o<0)return;n[o].end<0&&(n[o].end=t,n[o].endType=i,n[o].cost=t-n[o].start)}cP("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=uP(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(cP("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(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=a,i.dbc++):(i.nbc++,i.n_bu_acu_t+=a),n.bc++,i.bu_acu_t+=a,n.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=FP,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 i=this.seekLog,n=this.resLogs,r=this.player,o=uP()-i.lastSeekStartTime;cP("suspendSeekStatus>>","".concat(e," currentTime:").concat(r.currentTime," costTime:").concat(o," sat:").concat(i.sat," resLogs.sat:").concat(n.sat)),i.intervalId&&window.clearTimeout(i.intervalId),i.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=i.seekBefore,l=(r.currentTime||0).toString();i.sc++,i.sat+=o>rO?0:o,n.sc++,n.sat+=o>rO?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=hP(),cP("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=hP(),cP("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||hP()}},{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,i=e.pt,n=0;return t>0&&i>0&&(n=parseInt(t-i,10)),n>6e4?6e4:n}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,i=e.nt;return t>0&&i>0?parseInt(t-i,10):0}},{key:"getFrameInfo",value:function(){if(this.player&&this.player.videoFrameInfo){var e=this.player.videoFrameInfo,t=e.dropped,i=e.corrupted,n=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:parseInt(100*n,10),corrupted:i}}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(Kl){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:fP(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:sP(fP(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?vP(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,i=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:i.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 i=t.preLoadData.length;return{hit:i>0,length:i}}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,i=e.curDefinition;return i&&i.bitrate?i.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 _P(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return _P(this.player.root,"xgplayer-ended")||_P(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return _P(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return _P(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&&(cP("lt init",this.playlogs.lt),e=hP()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?BP:this.isStop?RP:this.isPause?jP:this.isLoading?UP:NP}},{key:"is_start_play_automatically",get:function(){return"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,i=e.cumulateTime?e.cumulateTime:aP(t.played);return i>=0?i: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:"envInfo",get:function(){return this._envInfo},set:function(e){e&&(this._envInfo=e)}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=uP()-this.inWaitingStart;return e>rO?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 i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10),r=parseInt(1e3*e.end(i),10);t.push({s:n,e:r})}this.buffers.allBuffer=t}}},{key:"updateCurBuffer",value:function(e){var t=this.player,i=t.buffered,n=t.currentTime,r={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!i||i.length<1)return r;for(var o=-1,a=-1,s=parseInt(1e3*n,10),l=i.length-1;l>-1;l--){var c=parseInt(1e3*i.start(l),10),u=parseInt(1e3*i.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=i.length-1),r.buf_s_pos=parseInt(1e3*i.start(a),10),r.buf_e_pos=parseInt(1e3*i.end(a),10)),this.buffers.curBuffer=r}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.player.buffered;if(!i)return!1;e=parseInt(1e3*e,10);for(var n=0;n<i.length;n++){var r=parseInt(1e3*i.start(n),10)+t,o=parseInt(1e3*i.end(n),10)+t;if(e>r&&e<o)return!0}return!1}},{key:"getPCDNStat",value:function(){if(this.player&&this.player.pcdnVVStat){var e=this.player.pcdnVVStat,t=e.try_req_num,i=e.req_node_succ,n=e.conn_req_num;return Au({try_req:t,req_succ:i,has_ret:e.has_ret_node,conn_req:n,conn_fail:e.conn_fail_num,conn_jump:e.conn_jump_num},Uu(e,oD))}return{}}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,i=this.resLogs,n=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];cP("updateVideoSize》》videoItem",a),r=a?a.bitrate||a.bandwidth:0,n=a?a.size:0}else{var s=this.player.curDefinition;s?(r=s.bitrate||t.config.bitrate||0,n=parseInt(s.bitrate*t.duration/8,10)):(n=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}cP("updateVideoSize","bitrate:".concat(r,", vs:").concat(n)),n&&(i.vs=n,i.vis=parseInt(n/t.duration,10),i.bitrate=r||i.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,i=this.player;if(0!==e.vis){for(var n=parseInt(aP(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);cP("updateVds","pdur:".concat(n," 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.lplayed=n,e.lbuf=o}else cP("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return cD},set:function(e){uD="__tea_cache_tokens_".concat(cD=e)}},{key:"AB_SDK_VERSION",get:function(){return dD},set:function(e){dD="Array"===mP(e)?e.join(","):e}},{key:"Collector",set:function(e){fD=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,trackerConfig:{},envInfo:{}}}}]),e}(),gD=null===(sD=Sl())||void 0===sD?void 0:sD.__LOG_TEA_ID__;pD.TEA_ID=gD,pD.Collector=Lu;var vD=function(e){if(e&&e.player){var t=e.player.config.vodLogOpts||{};e.player.vodLogger=new pD(e.player,t),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new pD(this,this.config.vodLogOpts||{})};vD.pluginName="__xgVodLogger",vD.playerConfig={},vD.Collector=Lu,vD.setABSdkVersion=function(e){pD.AB_SDK_VERSION=e};var yD,mD=["options","type","isLive","id","root","plugins","defaultConfig","languages","url","codec","playList","streamType","isMobile","useSoftDecoding","enableH265Degrade","checkExpireInterval","expireDetectType","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableMenu","region","debug"],_D=function(){function e(t){var i;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:Hi.UNKNOWN},this.strategiesPlugins=[],this.strategiesPluginConfigs={};var n=t.options,r=t.type,o=t.isLive,s=t.id,l=t.root,c=t.plugins,u=void 0===c?[]:c,h=t.defaultConfig,d=t.languages;t.url;var p=t.codec;t.playList,t.streamType;var g,v,y=t.isMobile,m=void 0!==y&&y,k=t.useSoftDecoding,w=void 0!==k&&k,T=t.enableH265Degrade,S=void 0!==T&&T,C=t.checkExpireInterval,x=void 0===C?400:C,E=t.expireDetectType,P=void 0===E?[]:E,O=t.onMediaExpired,I=t.onTokenExpired,L=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=t.enableMenu,U=void 0!==B&&B,H=t.region,F=void 0===H?"sg":H,V=t.debug,z=void 0!==V&&V,G=f(t,mD);this.configs=t,z&&(qs.config.debug=3),this.options=Object.assign({},n,G),this.options.poster="string"==typeof this.options.poster?function(e){var t,i=""+e,n=xl.exec(i);if(!n)return i;var r,o="",a=0;for(r=n.index;r<i.length;r++){switch(i.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+=i.substring(a,r)),a=r+1,o+=t}return a!==r?o+i.substring(a,r):o}(this.options.poster):void 0,this.options.icons=(g=this.options.icons,v={},g&&Object.entries(g).forEach((function(e){var t=_(e,2),i=t[0],n=t[1];n&&"string"!=typeof n&&(v[i]=n)})),v),this.id=s,this.root=l,this.type=r,this.isLive=!!(null!=o?o:"live"===r),this.defaultConfig=h,this.languageData=this.initI18nData(d),this.isMobile=m||"mobile"===Sn.device,this.openSoftDecoding=w,this.enableH265Degrade=S,this.codec=p||Hi.UNKNOWN,this.checkExpireInterval=x,this.expireDetectType=P,this.onMediaExpired=O,this.onTokenExpired=I,null===(i=this.setVodPlayListConfig)||void 0===i||i.call(this,t),this.initPlayData(t),this.current=Gi.observe(this.current),this.playList=Gi.observe(this.playList),this.plugins=b(u),this.isMusic=A,this.unionId=L,this.sdkPlugins=R,this.useHlsPluginForSafari=j,this.enableMenu=U,U&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=F,this.setVodTeaId(),this.playDomainDegrade=!1,t.getVideoByToken||this.codec!==Hi.UNKNOWN||qs.warn("The codec of media is not provided")}return l(e,[{key:"initPlayData",value:function(e){var t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}},{key:"initPlaylistAndGetCurrent",value:function(e){var i,n=e.url,r=e.playList,o=e.streamType,a=void 0===o?"":o,s=e.definitionText,l=e.definitionTextKey,c=e.codec,u=void 0===c?Hi.UNKNOWN:c,h=null;if(r&&(this.playList=b(r)),n)if(0===this.playList.length){var d=t(t({},this.current),{},{url:n,streamType:a,definitionTextKey:l,codec:u},l||s?{definition:s}:{definition:"HD"});this.playList=[d]}else{var f=this.getUrlList({url:n});f.length>0?h=f[0]:qs.warn("默认url不在Playlist中")}var p=this.getCurrentByDefaultConfig();return p&&(h=p),null!==(i=h)&&void 0!==i?i:this.playList[0]}},{key:"isCurrentH265",value:function(){return!!this.codec&&this.codec.replace(".","").toLowerCase()===Hi.H265}},{key:"getCurrentByDefaultConfig",value:function(){if(this.defaultConfig){var e=this.defaultConfig,t=e.type,i=e.isLive,n=e.lineId,r=void 0===n?"":n,o=e.definition,a=void 0===o?"":o;if((null!=i?i:"live"===t)===this.isLive){if(!r&&!a)return qs.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);var s=this.getUrlList({lineId:r,definition:a});return s.length>0?(this.isHitDefault=!0,s[0]):(qs.warn("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}}}},{key:"initCurrent",value:function(e){var t=this;Object.keys(this.current).forEach((function(i){t.current[i]=null==e?void 0:e[i]}));var i=(null==e?void 0:e.codec)||(null==e?void 0:e.Codec);this.codec=i&&Object.values(Hi).includes(i)?i:Hi.UNKNOWN}},{key:"initI18nData",value:function(e){var t=[js,Ns],i=e&&Object.entries(e).reduce((function(e,i){var n=_(i,2),r=n[0],o=n[1];return Us.includes(r)?e.push({LANG:"zh"===r?"zh-cn":r,TEXT:o}):t.push({LANG:r,TEXT:o}),e}),[]);return{extraLangList:t,extendLangList:i}}},{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],i=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"}(i)}return this.configs.streamType}},{key:"getCurrentStreams",value:function(){var e=this.current;return this.getUrlList(e)}},{key:"getLineList",value:function(){return Kt(Ui(this.playList,"lineId"))}},{key:"getLineListByLineId",value:function(e){return this.playList.filter((function(t){var i;return(null==e?void 0:e.toString())===(null===(i=t.lineId)||void 0===i?void 0:i.toString())}))}},{key:"getDefinitionListByLineId",value:function(e){return Kt(Ui(this.getLineListByLineId(e),"definition"))}},{key:"getUrlList",value:function(e){return this.playList.filter((function(t){return Object.keys(e).every((function(i){var n,r,o=(null===(n=e[i])||void 0===n?void 0:n.toString())===(null===(r=t[i])||void 0===r?void 0:r.toString()),a=!e[i];return o||a}))}))}},{key:"getNextDefinition",value:function(){var e,t,i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0,r=i?"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=ul(n)||Bs,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});qs.log("已经降至最低级")}}}},{key:"apiMap",get:function(){var e={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com",__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.8.1/plugin"}},t=e[this.region]||e.sg;return{playDomain:t.__PLAY_DOMAIN__,backupPlayDomain:t.__BACKUP_PLAY_DOMAIN__}}},{key:"playDomain",get:function(){var e;return this.playDomainDegrade&&null!==(e=this.apiMap.backupPlayDomain)&&void 0!==e?e:this.apiMap.playDomain}},{key:"setVodTeaId",value:function(){!function(e){pD.TEA_ID=e}(Sl(this.region).__LOG_TEA_ID__||4951)}}]),e}();function bD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function kD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?bD(Object(i),!0).forEach((function(t){PD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):bD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function wD(){wD=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(O){c=function(e,t,i){return e[t]=i}}function u(e,t,i,n){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new x(n||[]);return r(a,"_invoke",{value:w(e,i,s)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}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(E([])));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 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"==n(d)&&i.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,i){function n(){return new t((function(t,n){o(e,i,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return{value:void 0,done:!0}}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=T(a,i);if(s){if(s===d)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=h(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function T(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),d;var r=h(n,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 x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function E(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 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}}return{next:P}}function P(){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,i,n,r,o){void 0===o&&(o=Promise);var a=new k(u(t,i,n,r),o);return e.isGeneratorFunction(i)?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),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=E,x.prototype={constructor:x,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(i,n){return a.type="throw",a.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}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 i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),C(i),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;C(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:E(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},e}function TD(e,t,i,n,r,o,a){try{var s=e[o](a),l=s.value}catch(aV){return void i(aV)}s.done?t(l):Promise.resolve(l).then(n,r)}function SD(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function a(e){TD(o,n,r,a,s,"next",e)}function s(e){TD(o,n,r,a,s,"throw",e)}a(void 0)}))}}function CD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xD(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RD(n.key),n)}}function ED(e,t,i){return t&&xD(e.prototype,t),i&&xD(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function PD(e,t,i){return(t=RD(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,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 ID(e){return(ID=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 DD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AD(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return DD(e)}function MD(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(Kl){return!1}}();return function(){var i,n=ID(e);if(t){var r=ID(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return AD(this,i)}}function RD(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}function ND(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function jD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ND(Object(i),!0).forEach((function(t){WD(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ND(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function BD(){BD=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(O){c=function(e,t,i){return e[t]=i}}function u(e,t,i,n){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new x(n||[]);return r(a,"_invoke",{value:w(e,i,s)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}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(E([])));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 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"==n(d)&&i.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,i){function n(){return new t((function(t,n){o(e,i,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return{value:void 0,done:!0}}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=T(a,i);if(s){if(s===d)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=h(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function T(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),d;var r=h(n,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 x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function E(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 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}}return{next:P}}function P(){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,i,n,r,o){void 0===o&&(o=Promise);var a=new k(u(t,i,n,r),o);return e.isGeneratorFunction(i)?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),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=E,x.prototype={constructor:x,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(i,n){return a.type="throw",a.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}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 i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),C(i),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;C(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:E(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},e}function UD(e){return(UD="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 HD(e,t,i,n,r,o,a){try{var s=e[o](a),l=s.value}catch(aV){return void i(aV)}s.done?t(l):Promise.resolve(l).then(n,r)}function FD(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function a(e){HD(o,n,r,a,s,"next",e)}function s(e){HD(o,n,r,a,s,"throw",e)}a(void 0)}))}}function VD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zD(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aA(n.key),n)}}function GD(e,t,i){return t&&zD(e.prototype,t),i&&zD(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function WD(e,t,i){return(t=aA(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function KD(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&&YD(e,t)}function $D(e){return($D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function YD(e,t){return(YD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function qD(){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(Kl){return!1}}function XD(e,t,i){return(XD=qD()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&YD(r,i.prototype),r}).apply(null,arguments)}function JD(e){var t="function"==typeof Map?new Map:void 0;return JD=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;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,n)}function n(){return XD(e,arguments,$D(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),YD(n,e)},JD(e)}function ZD(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function QD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eA(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QD(e)}function tA(e){var t=qD();return function(){var i,n=$D(e);if(t){var r=$D(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return eA(this,i)}}function iA(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$D(e)););return e}function nA(){return nA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=iA(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},nA.apply(this,arguments)}function rA(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function oA(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return rA(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?rA(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function aA(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}var sA="network",lA="network_timeout",cA="network_forbidden",uA="network_notfound",hA="network_range_not_satisfiable",dA="demux",fA="remux",pA="media",gA="drm",vA="other",yA="runtime",mA=(WD(yD={},"manifest",{HLS:1100,DASH:1200}),WD(yD,sA,2100),WD(yD,lA,2101),WD(yD,cA,2103),WD(yD,uA,2104),WD(yD,hA,2116),WD(yD,dA,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),WD(yD,fA,{FMP4:4100,MP4:4200}),WD(yD,pA,{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}),WD(yD,gA,{LICENSE:7100,CUSTOM_LICENSE:7200}),WD(yD,vA,8e3),WD(yD,yA,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),yD),_A=function(e){KD(i,e);var t=tA(i);function i(e,n,r,o,a){var s;return VD(this,i),(s=t.call(this,a||(null==r?void 0:r.message))).errorType=e===lA?sA:e,s.originError=r,s.ext=o,s.errorCode=mA[e][n]||mA[e],s.errorMessage=s.message,s.errorCode||(s.errorType=vA,s.errorCode=mA[s.errorType]),s}return GD(i,null,[{key:"create",value:function(e,t,n,r,o){return e instanceof i?e:(e instanceof Error&&(n=e,e=""),e||(e=vA),new i(e,t,n,r,o))}},{key:"network",value:function(e){var t;return new i(null!=e&&e.isTimeout?lA:sA,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})}}]),i}(JD(Error)),bA={DEBUG:1,LOG:2,WARN:3,ERROR:4},kA=["Boolean","Number","String","Undefined","Null","Date","Object"],wA=function(){function e(t,i){VD(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=(null==i?void 0:i.disabled)||!0,this.logCacheLevel=(null==i?void 0:i.logCacheLevel)||3,this.logMaxSize=(null==i?void 0:i.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return GD(e,[{key:"debug",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[bA.DEBUG].concat(n)),e.disabled||(t=console).debug.apply(t,[this._prefix,TA()].concat(n))}},{key:"log",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[bA.LOG].concat(n)),e.disabled||(t=console).log.apply(t,[this._prefix,TA()].concat(n))}},{key:"warn",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[bA.WARN].concat(n)),e.disabled||(t=console).warn.apply(t,[this._prefix,TA()].concat(n))}},{key:"error",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[bA.ERROR].concat(n)),e.disabled||(t=console).error.apply(t,[this._prefix,TA()].concat(n))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];var o=n.map((function(e){return CA(e)}));t=this._prefix+TA()+JSON.stringify(o)}catch(Kl){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 TA(){return(new Date).toLocaleString()}function SA(e){if("object"!==UD(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 CA(e,t,i){i||(i=1),t||(t=2);var n={};if(!e||"object"!==UD(e))return e;var r=Object.prototype.toString.call(e).slice(8,-1);if(!kA.includes(r))return r;if(!(i>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i===t?n[o]=SA(e[o]):"object"===UD(e[o])?n[o]=CA(e[o],t,i+1):n[o]=e[o]);return n}}WD(wA,"disabled",!0);var xA="fetch",EA="xhr",PA="arraybuffer",OA="text",IA="json",LA=function(e){KD(i,e);var t=tA(i);function i(e,n,r,o){var a;return VD(this,i),WD(QD(a=t.call(this,o)),"retryCount",0),WD(QD(a),"isTimeout",!1),WD(QD(a),"loaderType",xA),WD(QD(a),"startTime",0),WD(QD(a),"endTime",0),WD(QD(a),"options",{}),a.url=e,a.request=n,a.response=r,a}return GD(i)}(JD(Error)),DA=Object.prototype.toString;function AA(e){if("[object Object]"!==DA.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function MA(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 RA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NA(e,t){if(e){if(!t)return e;var i,n=Object.keys(t).map((function(e){if(null!=(i=t[e]))return Array.isArray(i)?e+="[]":i=[i],i.map((function(t){var i;return i=t,"[object Date]"===DA.call(i)?t=t.toISOString():function(e){return null!==e&&"object"===UD(e)}(t)&&(t=JSON.stringify(t)),"".concat(RA(e),"=").concat(RA(t))})).join("&")})).filter(Boolean).join("&");if(n){var r=e.indexOf("#");-1!==r&&(e=e.slice(0,r)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}}function jA(e,t,i,n,r,o,a,s,l,c,u){return r=null!=r?parseFloat(r):null,n=parseInt(n||"0",10),Number.isNaN(n)&&(n=0),{data:e,done:t,options:{range:l,vid:c,index:s,contentLength:n,age:r,startTime:o,firstByteTime:a,endTime:Date.now(),priOptions:u},response:i}}function BA(e,t){return Math.round(8*e*1e3/t/1024)}var UA="error",HA="core.ttfb",FA="core.loadstart",VA="core.loadresponseheaders",zA="core.loadcomplete",GA="core.loadretry",WA="core.metadataparsed",KA="real_time_speed",$A=2097152,YA=function(e){KD(n,e);var t,i=tA(n);function n(){var e;return VD(this,n),WD(QD(e=i.call(this)),"_abortController",null),WD(QD(e),"_timeoutTimer",null),WD(QD(e),"_reader",null),WD(QD(e),"_response",null),WD(QD(e),"_aborted",!1),WD(QD(e),"_index",-1),WD(QD(e),"_range",null),WD(QD(e),"_receivedLength",0),WD(QD(e),"_running",!1),WD(QD(e),"_logger",null),WD(QD(e),"_vid",""),WD(QD(e),"_onProcessMinLen",0),WD(QD(e),"_onCancel",null),WD(QD(e),"_priOptions",null),e}return GD(n,[{key:"load",value:function(e){var t,i=this,n=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,x=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||n,this._priOptions=x||{};var E={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},P=!1;clearTimeout(this._timeoutTimer),n=NA(n,p);var O=MA(h);O&&(y=f?f.headers:E.headers=E.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",O):y.Range=O),o&&(this._timeoutTimer=setTimeout((function(){if(P=!0,i.cancel(),c){var e=new LA(n,E,null,"timeout");e.isTimeout=!0,c(e,{index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions})}}),o));var I=Date.now();return this._logger.debug("[fetch load start], index,",l,",range,",h),new Promise((function(e,t){fetch(f||n,f?void 0:E).then(function(){var r=FD(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(i._timeoutTimer),i._response=o,!i._aborted&&i._running){r.next=4;break}return r.abrupt("return");case 4:if(d&&(o=d(o,n)||o),o.ok){r.next=7;break}throw new LA(n,E,o,"bad network response");case 7:if(c=Date.now(),a!==OA){r.next=15;break}return r.next=11,o.text();case 11:u=r.sent,i._running=!1,r.next=37;break;case 15:if(a!==IA){r.next=22;break}return r.next=18,o.json();case 18:u=r.sent,i._running=!1,r.next=37;break;case 22:if(!s){r.next=29;break}return i.resolve=e,i.reject=t,i._loadChunk(o,s,I,c),r.abrupt("return");case 29:return r.next=31,o.arrayBuffer();case 31:u=r.sent,u=new Uint8Array(u),i._running=!1,f=Date.now()-I,p=BA(u.byteLength,f),i.emit(KA,{speed:p,len:u.byteLength,time:f,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions});case 37:i._logger.debug("[fetch load end], index,",l,",range,",h),e(jA(u,!0,o,o.headers.get("Content-Length"),o.headers.get("age"),I,c,l,h,i._vid,i._priOptions));case 39:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){var r;clearTimeout(i._timeoutTimer),i._running=!1,i._aborted&&!P||((e=e instanceof LA?e:new LA(n,E,null,null===(r=e)||void 0===r?void 0:r.message)).startTime=I,e.endTime=Date.now(),e.isTimeout=P,e.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},t(e))}))}))}},{key:"cancel",value:(t=FD(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(aV){}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,i,n){var r=this;if(!e.body||!e.body.getReader){this._running=!1;var o=new LA(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($A),this._writeIdx=0);var a,s,l,c=this._reader=e.body.getReader(),u=function(){var o=FD(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:i,firstByteTime:n,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<$A?(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:i,firstByteTime:n,priOptions:r._priOptions},e),a.done?(y=Date.now()-i,m=BA(r._receivedLength,y),r.emit(KA,{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(jA(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),i,n,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)}}]),n}(hn);var qA=function(e){KD(i,e);var t=tA(i);function i(){var e;return VD(this,i),WD(QD(e=t.call(this)),"_xhr",null),WD(QD(e),"_aborted",!1),WD(QD(e),"_timeoutTimer",null),WD(QD(e),"_range",null),WD(QD(e),"_receivedLength",0),WD(QD(e),"_url",null),WD(QD(e),"_onProgress",null),WD(QD(e),"_index",-1),WD(QD(e),"_headers",null),WD(QD(e),"_currentChunkSizeKB",384),WD(QD(e),"_timeout",null),WD(QD(e),"_xhr",null),WD(QD(e),"_withCredentials",null),WD(QD(e),"_startTime",-1),WD(QD(e),"_loadCompleteResolve",null),WD(QD(e),"_loadCompleteReject",null),WD(QD(e),"_runing",!1),WD(QD(e),"_logger",!1),WD(QD(e),"_vid",""),WD(QD(e),"_responseType",void 0),WD(QD(e),"_credentials",void 0),WD(QD(e),"_method",void 0),WD(QD(e),"_transformResponse",void 0),WD(QD(e),"_firstRtt",void 0),WD(QD(e),"_onCancel",null),WD(QD(e),"_priOptions",null),e}return GD(i,[{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=NA(e.url,e.params);var i=Date.now();return new Promise((function(e,i){t._loadCompleteResolve=e,t._loadCompleteReject=i,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof LA?e:new LA(t._url,t._request)).startTime=i,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===PA&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,i=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-i&&(n=i+t),e=[i,n],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 i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType,this._timeout&&(i.timeout=this._timeout),i.withCredentials=this._withCredentials,i.onload=this._onLoad.bind(this),i.onreadystatechange=this._onReadyStatechange.bind(this),i.onerror=function(e){var i,n,r;t._running=!1;var o=new LA(t._url,t._request,null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.response,"xhr.onerror.status:"+(null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.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)},i.ontimeout=function(e){t.cancel();var i=new LA(t._url,t._request,{status:408},"timeout");t._onTimeout&&(i.isTimeout=!0,t._onTimeout(i,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),i.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(i)};var n=this._headers||{},r=MA(e);r&&(n.Range=r),n&&Object.keys(n).forEach((function(e){i.setRequestHeader(e,n[e])})),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),i.send(this._body)}catch(Kl){Kl.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(Kl)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,i=e.target.status;if(i<200||i>299){var n=new LA(this._url,null,jD(jD({},e.target.response),{},{status:i}),"bad response,status:"+i);return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(n)}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===PA){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(KA,{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:i>=200&&i<300,status:i,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(jA(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,nA($D(i.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,i={},n=oA(e.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(t=n.n()).done;){var r=t.value.split(": ");i[r[0].toLowerCase()]=r.slice(1).join(": ")}}catch(o){n.e(o)}finally{n.f()}return i}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),i}(hn),XA=["retry","retryDelay","onRetryError","transformError"],JA=function(){function e(t,i){var n,r,o;VD(this,e),this.promise=((o=new Promise((function(e,t){n=e,r=t}))).used=!1,o.resolve=function(){return o.used=!0,n.apply(void 0,arguments)},o.reject=function(){return o.used=!0,r.apply(void 0,arguments)},o),this.alive=!!i.onProgress,!i.logger&&(i.logger=new wA("Loader")),this._loaderType=t,this._loader=t===xA&&window.fetch?new YA:new qA,this._config=i,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=i.retryCheckFunc,this._logger=i.logger}var t;return GD(e,[{key:"exec",value:function(){var e=this,t=this._config,i=t.retry,n=t.retryDelay,r=t.onRetryError,o=t.transformError,a=ZD(t,XA),s=function(){var t=FD(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<=i)){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,n),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=FD(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 ZA(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var QA=function(e){KD(n,e);var t,i=tA(n);function n(e){var t;return VD(this,n),WD(QD(t=i.call(this,e)),"type",xA),WD(QD(t),"_queue",[]),WD(QD(t),"_alive",[]),WD(QD(t),"_currentTask",null),WD(QD(t),"_config",void 0),t._config=function(e){return jD({loaderType:xA,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:OA,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!==EA&&YA.isSupported()||(t.type=EA),t.log=e.logger,t}return GD(n,[{key:"isFetch",value:function(){return this.type===xA}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?i=e:i.url=e||i.url||this._config.url,(i=Object.assign({},this._config,i)).params&&(i.params=Object.assign({},i.params)),i.headers&&AA(i.headers)&&(i.headers=Object.assign({},i.headers)),i.body&&AA(i.body)&&(i.body=Object.assign({},i.body)),i.transformRequest&&(i=i.transformRequest(i)||i),i.logger=this.log;var n=new JA(this.type,i);return n.loader.on(KA,(function(e){t.emit(KA,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(t=FD(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,ZA();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,i;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(i=e._alive)||void 0===i?void 0:i.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return YA.isSupported()}}]),n}(hn),eM="core.rtcstatechange",tM={},iM={},nM={exports:{}},rM=nM.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(rM).forEach((function(e){rM[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},i=function(e,i,n){var r=e.name&&e.names;e.push&&!i[e.push]?i[e.push]=[]:r&&!i[e.name]&&(i[e.name]={});var o=e.push?{}:r?i[e.name]:i;!function(e,i,n,r){if(r&&!n)i[r]=t(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(i[n[o]]=t(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&i[e.push].push(o)},n=nM.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<(n[t]||[]).length;s+=1){var l=n[t][s];if(l.reg.test(r))return i(l,a,r)}})),t.media=o,t};var o=function(e,i){var n=i.split(/=(.+)/,2);return 2===n.length?e[n[0]]=t(n[1]):1===n.length&&i.length>1&&(e[n[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 i=[],n=e.split(" ").map(t),r=0;r<n.length;r+=3)i.push({component:n[r],ip:n[r+1],port:n[r+2]});return i},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 i,n=!1;return"~"!==e[0]?i=t(e):(i=t(e.substring(1,e.length)),n=!0),{scid:i,paused:n}}))}))}}(iM);var oM=nM.exports,aM=/%[sdv%]/g,sM=function(e){var t=1,i=arguments,n=i.length;return e.replace(aM,(function(e){if(t>=n)return e;var r=i[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},lM=function(e,t,i){var n=[e+"="+(t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var o=t.names[r];t.name?n.push(i[t.name][o]):n.push(i[t.names[r]])}else n.push(i[t.name]);return sM.apply(null,n)},cM=["v","o","s","i","u","e","p","c","b","t","r","z","a"],uM=["i","c","b","a"],hM=iM,dM=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 i=t.outerOrder||cM,n=t.innerOrder||uM,r=[];return i.forEach((function(t){oM[t].forEach((function(i){i.name in e&&null!=e[i.name]?r.push(lM(t,i,e)):i.push in e&&null!=e[i.push]&&e[i.push].forEach((function(e){r.push(lM(t,i,e))}))}))})),e.media.forEach((function(e){r.push(lM("m",oM.m[0],e)),n.forEach((function(t){oM[t].forEach((function(i){i.name in e&&null!=e[i.name]?r.push(lM(t,i,e)):i.push in e&&null!=e[i.push]&&e[i.push].forEach((function(e){r.push(lM(t,i,e))}))}))}))})),r.join("\r\n")+"\r\n"};tM.write=dM,tM.parse=hM.parse,tM.parseParams=hM.parseParams,tM.parseFmtpConfig=hM.parseFmtpConfig,tM.parsePayloads=hM.parsePayloads,tM.parseRemoteCandidates=hM.parseRemoteCandidates,tM.parseImageAttributes=hM.parseImageAttributes,tM.parseSimulcastStreamList=hM.parseSimulcastStreamList;var fM=new wA("rts"),pM=function(e){OD(r,e);var t,i,n=MD(r);function r(e){var t;return CD(this,r),PD(DD(t=n.call(this)),"_url",""),PD(DD(t),"_pc",null),PD(DD(t),"_audioTransceicer",null),PD(DD(t),"_videoTransceicer",null),PD(DD(t),"_mediaStream",null),PD(DD(t),"_media",null),PD(DD(t),"_opts",null),PD(DD(t),"_loader",null),PD(DD(t),"_retry",0),PD(DD(t),"_waitingTimer",0),PD(DD(t),"_rctConnectStartTs",0),PD(DD(t),"_onTrack",(function(e){if(fM.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 i=t._media.play();i&&i.catch&&i.catch((function(e){}))}t._mediaStream.addTrack(e.track)})),PD(DD(t),"_mockWaitingByTimeupdate",(function(){var e,i;"connected"!==(null===(e=t._pc)||void 0===e?void 0:e.connectionState)&&"connected"!==(null===(i=t._pc)||void 0===i?void 0:i.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))})),PD(DD(t),"_onLoadedData",(function(){fM.log("loadeddata emit"),t.getStatsSnapshoot().then((function(e){t.emit(WA,{type:"video",elapsed:Date.now()-t._rctConnectStartTs,meta:e.video}),t.emit(WA,{type:"audio",elapsed:Date.now()-t._rctConnectStartTs,meta:e.audio})}))})),PD(DD(t),"_onLoaderRetry",(function(e,i){t.emit(GA,{error:_A.network(e),retryTime:i})})),t._opts=function(e){return kD({retryCount:0,retryDelay:1e3,loadTimeout:5e3,stallInterval:400,delayHint:0},e)}(e),t._media=t._opts.media,t._loader=new QA(kD(kD({},e.fetchOptions),{},{responseType:"json",method:"POST",retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onLoaderRetry,logger:fM})),t._retry=t._opts.retryCount,t._bindMediaEvent(),t}return ED(r,[{key:"pc",get:function(){return this._pc}},{key:"audioTrack",get:function(){return this._audio}},{key:"videoTack",get:function(){return this._video}},{key:"loader",get:function(){return this._loader}},{key:"getStats",value:function(){return e=this._pc,new Promise((function(t){var i;null===(i=e.getStats(null))||void 0===i||i.then((function(e){var i,n;t((n=[],(i=e).forEach((function(e){"inbound-rtp"===e.type&&n.push(e)})),n.map((function(e){var t=i.get(e.codecId),n=i.get(e.trackId);return{type:e.mediaType,inboundRtp:e,codec:t,track:n}}))))}))})).catch((function(){}));var e}},{key:"getStatsSnapshoot",value:function(){return this.getStats().then((function(e){return function(e){var t,i,n,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,T,S,C,x,E,P,O,I=null==e?void 0:e.filter((function(e){return"video"===e.type}))[0],L=null==e?void 0:e.filter((function(e){return"audio"===e.type}))[0];return{video:I?{codec:null===(t=I.codec)||void 0===t?void 0:t.mimeType,payloadType:null===(i=I.codec)||void 0===i?void 0:i.payloadType,sdpFmtpLine:null===(n=I.codec)||void 0===n?void 0:n.sdpFmtpLine,bytesReceived:null===(r=I.inboundRtp)||void 0===r?void 0:r.bytesReceived,firCount:null===(o=I.inboundRtp)||void 0===o?void 0:o.firCount,pliCount:null===(a=I.inboundRtp)||void 0===a?void 0:a.pliCount,frameHeight:null===(s=I.inboundRtp)||void 0===s?void 0:s.frameHeight,frameWidth:null===(l=I.inboundRtp)||void 0===l?void 0:l.frameWidth,framesDecoded:null===(c=I.inboundRtp)||void 0===c?void 0:c.framesDecoded,framesDropped:null===(u=I.inboundRtp)||void 0===u?void 0:u.framesDropped,framesPerSecond:null===(h=I.inboundRtp)||void 0===h?void 0:h.framesPerSecond,framesReceived:null===(d=I.inboundRtp)||void 0===d?void 0:d.framesReceived,jitter:null===(f=I.inboundRtp)||void 0===f?void 0:f.jitter,jitterBufferDelay:null===(p=I.inboundRtp)||void 0===p?void 0:p.jitterBufferDelay,keyFramesDecoded:null===(g=I.inboundRtp)||void 0===g?void 0:g.keyFramesDecoded,nackCount:null===(v=I.inboundRtp)||void 0===v?void 0:v.nackCount,packetsLost:null===(y=I.inboundRtp)||void 0===y?void 0:y.packetsLost,packetsReceived:null===(m=I.inboundRtp)||void 0===m?void 0:m.packetsReceived}:void 0,audio:L?{codec:null===(_=L.codec)||void 0===_?void 0:_.mimeType,payloadType:null===(b=L.codec)||void 0===b?void 0:b.payloadType,sdpFmtpLine:null===(k=L.codec)||void 0===k?void 0:k.sdpFmtpLine,bytesReceived:null===(w=L.inboundRtp)||void 0===w?void 0:w.bytesReceived,audioLevel:null===(T=L.inboundRtp)||void 0===T?void 0:T.audioLevel,jitter:null===(S=L.inboundRtp)||void 0===S?void 0:S.jitter,jitterBufferDelay:null===(C=L.inboundRtp)||void 0===C?void 0:C.jitterBufferDelay,packetsLost:null===(x=L.inboundRtp)||void 0===x?void 0:x.packetsLost,packetsReceived:null===(E=L.inboundRtp)||void 0===E?void 0:E.packetsReceived,totalSamplesDuration:null===(P=L.inboundRtp)||void 0===P?void 0:P.totalSamplesDuration,totalSamplesReceived:null===(O=L.inboundRtp)||void 0===O?void 0:O.totalSamplesReceived}:void 0}}(e)}))}},{key:"load",value:(i=SD(wD().mark((function e(t){var i,n=this;return wD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._disconnect(),this._url=t,this._retry=this._opts.retryCount,(i=this._pc)&&i.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 n._emitError(_A.create(vA,null,e.t0))}));case 15:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e){return i.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(fM.warn("onconnectionstatechange:",t.connectionState),e.emit(eM,{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(_A.network(new Error("rtc connect failed")));e._retry--,e.load(e._url)}"connected"===t.connectionState&&e.emit(HA,{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=SD(wD().mark((function e(){var t,i,n,r,o,a,s,l,c,u,h,d,f,p;return wD().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"}),(n=this._opts.delayHint)&&(this._audioTransceicer.receiver.playoutDelayHint=n,this._audioTransceicer.receiver.jitterBufferDelayHint=n,this._videoTransceicer.receiver.playoutDelayHint=n,this._videoTransceicer.receiver.jitterBufferDelayHint=n),e.next=8,t.createOffer();case 8:i=e.sent,e.next=14;break;case 11:return e.next=13,t.createOffer({iceRestart:!0,offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 13:i=e.sent;case 14:return fM.log("local offer"),fM.log(i.sdp),(r=tM.parse(i.sdp)).media.filter((function(e){return"audio"===e.type})).forEach((function(e){var t,i,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")})),null===(i=e.rtcpFb)||void 0===i||i.push({payload:n,type:"nack"}))})),i.sdp=tM.write(r),fM.log("local offer modified:\n",i.sdp),e.next=22,t.setLocalDescription(i);case 22:return o=this._url,e.prev=23,this._opts.preProcessUrl&&(o=this._opts.preProcessUrl(o).url),this._loader.finnalUrl=o,l=/_?session_id=([^&$]+)/.exec(o),c=l?l[1]:Date.now()+"666",this.emit(FA,{url:o,offersdp:i.sdp,sessionId:c}),u=Date.now(),e.next=32,this._loader.load(o,{body:JSON.stringify({sessionId:c,version:"1.0-html",localSdp:i})});case 32:if(h=e.sent,this.emit(VA,{headers:h.response.headers}),404!==(null==(d=null==h?void 0:h.data)?void 0:d.code)&&403!==(null==d?void 0:d.code)){e.next=40;break}return(f=_A.create(404===d.code?uA:cA,null,d)).errorType=sA,this._emitError(f),e.abrupt("return");case 40:if(200===(null==d?void 0:d.code)){e.next=42;break}throw new Error("code: ".concat(null==d?void 0:d.code,", message:").concat(null==d?void 0:d.message));case 42:return fM.log("answer:"),fM.log(null===(a=d.remoteSdp)||void 0===a?void 0:a.sdp),this.emit(zA,{url:o,elapsed:Date.now()-u,answersdp:null===(s=d.remoteSdp)||void 0===s?void 0:s.sdp}),(p=tM.parse(d.remoteSdp.sdp)).media.forEach((function(e){e.fingerprint.hash=e.fingerprint.hash.toUpperCase()})),d.remoteSdp.sdp=tM.write(p),fM.log("answer modified:\n",d.remoteSdp.sdp),this._rctConnectStartTs=Date.now(),e.next=52,this._pc.setRemoteDescription(d.remoteSdp);case 52:e.next=57;break;case 54:e.prev=54,e.t0=e.catch(23),this._emitError(_A.network(e.t0));case 57:case"end":return e.stop()}}),e,this,[[23,54]])}))),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(UA,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(){wA.enable()}},{key:"disableLogger",value:function(){wA.disable()}}]),r}(hn);try{localStorage.getItem("xgd")?pM.enableLogger():pM.disableLogger()}catch(aV){}function gM(){return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)}var vM=function(e){OD(n,e);var t,i=MD(n);function n(){var e;CD(this,n);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return PD(DD(e=i.call.apply(i,[this].concat(r))),"_rts",null),PD(DD(e),"_rtsOpts",null),PD(DD(e),"_init",(function(){var t;null===(t=e._rts)||void 0===t||t.destroy();var i=e.player.config,n=i.rts||{};e._rtsOpts=n,e._rts=new pM(kD({media:e.player.video,preProcessUrl:function(t,i){var n,r;return(null===(n=(r=e.player).preProcessUrl)||void 0===n?void 0:n.call(r,t,i))||{url:t,ext:i}}},n)),e._rts.load(i.url)})),PD(DD(e),"_onSwitchURL",(function(t){e._rts&&(e.player.config.url=t,e._rts.switchURL(t))})),e}return ED(n,[{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:"loader",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.loader}},{key:"version",get:function(){return"0.2.0-alpha.6"}},{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(FA),this._transCoreEvent(zA),this._transCoreEvent(HA),this._transCoreEvent(VA),this._transCoreEvent(GA),this._transCoreEvent(WA),this._transCoreEvent(eM);try{Vr.defineGetterOrSetter(this.player,{__url:{get:function(){try{return URL.createObjectURL(new MediaSource)}catch(Kl){var e,i;null!==(e=t.player)&&void 0!==e&&null!==(i=e.video)&&void 0!==i&&i.srcObject||(t.player.video.srcObject=new MediaStream)}}}})}catch(Kl){}}},{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(UA,(function(t){if(e.player){var i=new Pn(e.player,t),n=e._rtsOpts,r=n.backupConstruct,o=n.backupURL;if(o){var a,s=e.player;s.emit("core_event",kD(kD({},{url:s.config.url,code:i.errorCode,message:i.message,httpCode:i.httpCode}),{},{eventName:"core.degrade"})),s.emit("degrade",{url:s.config.url,code:i.errorCode,message:i.message,httpCode:i.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(An,i)}})),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(i){t.player&&t.player.emit("core_event",kD(kD({},i),{},{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 gM()}},{key:"getCapacity",value:function(){return function(){if(!gM())return Promise.reject("RTCPeerConnection no support");var e;try{(e=new RTCPeerConnection).addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"})}catch(Kl){return Promise.reject(null==Kl?void 0:Kl.message)}return e.createOffer().then((function(t){var i,n,r,o;fM.log(t.sdp);var a=tM.parse(t.sdp),s=null===(i=a.media)||void 0===i?void 0:i.filter((function(e){return"video"===e.type}))[0],l=null===(n=a.media)||void 0===n?void 0:n.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=SD(wD().mark((function e(t){var i,r,o,a,s;return wD().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.getCapacity();case 3:if(r=e.sent,o=null===(i=r.video)||void 0===i?void 0:i.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length){e.next=10;break}return e.next=8,n.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)})}]),n}(Vr);function yM(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var mM=Math.max;var _M=ce?function(e,t){return ce(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Di,bM=_M,kM=Date.now;var wM=function(e){var t=0,i=0;return function(){var n=kM(),r=16-(n-i);if(i=n,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(bM),TM=wM;function SM(e,t){return TM(function(e,t,i){return t=mM(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=mM(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=i(a),yM(e,this,s)}}(e,t,Di),e+"")}var CM,xM=Object.prototype.hasOwnProperty,EM=(CM=function(e,t){if(He(t)||Ge(t))fe(t,We(t),e);else for(var i in t)xM.call(t,i)&&de(e,i,t[i])},SM((function(e,t){var i=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=CM.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,i){if(!U(i))return!1;var r=n(t);return!!("number"==r?Ge(i)&&Ee(t,i.length):"string"==r&&t in i)&&S(i[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++i<r;){var s=t[i];s&&CM(e,s,i,o)}return e}))),PM=EM,OM=function(e){u(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i,[{key:"beforeCreate",value:function(e){var t=(e.player.config.rtm||{}).backupStreamType,i={flv:window.FlvPlayer,hls:window.HlsPlayer};e.player.config.rts=PM({},e.player.config.rtm,{backupConstruct:i[t]})}},{key:"afterCreate",value:function(){var e=this.player;e.on("degrade",(function(){e.unRegisterPlugin("rtm")}))}}],[{key:"pluginName",get:function(){return"rtm"}}]),i}(vM),IM={PLAYER_CREATED_FINISH:"player_create_finish",PLAYER_REBUILD:"player_rebuild",NOT_SUPPORT_HARDWARE_DECODER:"not_support_hardware_decoder",NOT_SUPPORT_SOFT_DECODER:"not_support_soft_decoder",TOKEN_EXPIRED:"playAuthToken_expired",UMD_LOAD_FAIL:"umd_load_fail"},LM={DANMU_CHANGE:"danmu_change",TIME_SHIFT_CHANGE:"time_shift_change",AI_SUBTITLE_LANG_CHANGE:"ai_subtitle_lang_change",AI_SUBTITLE_MATCH:"ai_subtitle_match",CANCEL_UNMUTE:"cancel_unmute",REFRESH_CLICK:"refresh_click",PLAY_BACKUP_CHANGE:"play_backup_change",PLAY_BACKUP_CHANGE_FINISH:"play_backup_change_finish",PLAY_ERROR_BUTTON_CLICK:"play_error_button_click",PlAY_URL_CHANGE:"play_url_change",SHOW_PLAY_ERROR:"show_play_error",PLAYER_EXTEND_BUTTON:"player_extend_button",LONG_WAITING:"long_waiting",OFTEN_WAITING:"often_waiting",DEFINITION_DEMOTE:"definition_demote",LARKWINDOW_CHANGE:"larkWindow_change",PANEL_MODE_CHANGE:"panel_mode_change",INNER_DEFINITION_CHANGE:"inner_definition_change",LINE_CHANGE:"line_change",GET_PLAY_URL_ERR:"get_play_url_err",MEDIA_EXPIRED:"MEDIA_EXPIRED",MIRROR_CHANGE:"mirror_change",TIME_SCALE_CHANGE:"time_scale_change",MUSIC_MODE_CHANGE:"music_mode_change",MUSIC_CHANGE:"music_change",MUSIC_LIST_CHANGE:"music_list_change",AUTOPLAY_SUCCESS:"autoplay_success",AUTOPLAY_FAILED:"autoplay_failed",MENU_LOG:"MENU_LOG",MENU_REPORT:"MENU_REPORT",PLAY_LIST_CHANGE:"play_list_change",PLAY_LIST_ITEM_CHANGE:"play_list_item_change"},DM=t(t(t({},Tr),IM),LM),AM={SDKEvents:IM,PluginEvents:LM},MM=30,RM=30,NM=40,jM=50,BM=60,UM=20,HM=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).playerData=null,n.playerData=n.playerConfig.playerData,n}return l(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playerData,i=t.getLineList(),n=t.current.lineId;Array.isArray(i)&&i.length>0&&(e.config.list=i.map((function(t){return t.text=e.player.i18n[t.lineTextKey]||t.lineTextKey,t}))),e.config.defaultLine=n}},{key:"afterCreate",value:function(){m(h(i.prototype),"afterCreate",this).call(this),this.config.list.length<2?this.hide():this.renderItemList()}},{key:"afterPlayerInit",value:function(){}},{key:"renderItemList",value:function(){var e=this,t=this.config,n=t.list,r=t.defaultLine,o=0,a=n.map((function(t,i){var n,a={lineId:t.lineId||"",showText:e.i18n[t.lineTextKey]||t.lineTextKey,isCurrent:!1,selected:!1};return yn.isUndefined(t.lineId)||(null===(n=t.lineId)||void 0===n?void 0:n.toString())!==(null==r?void 0:r.toString())||(a.isCurrent=!0,a.selected=!0,o=i),a}));m(h(i.prototype),"renderItemList",this).call(this,a,o)}},{key:"onItemClick",value:function(e,t){this.player.emit(LM.LINE_CHANGE,{from:this.playerData.current.lineId,to:t.to.lineId}),this.playerData.current.lineId=t.to.lineId,this.player.emit(IM.PLAYER_REBUILD)}}],[{key:"pluginName",get:function(){return"sdkMultilinePlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.CONTROLS_RIGHT,index:NM,list:[],defaultLine:0,className:"xgplayer-multiline",hidePortrait:!1,isShowIcon:!0}}}]),i}(ns),FM=function(e){u(n,e);var i=v(n);function n(e){var t;return a(this,n),(t=i.call(this,e)).playerData=null,t.toastInfo={},t.canChange=!0,t._playTimer=null,t.playerData=t.playerConfig.playerData,t.dataMonitoring(),t}return l(n,[{key:"registerLanguageTexts",value:function(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"beforeCreate",value:function(e){var i;null!==(i=e.player.config)&&void 0!==i&&i.alwaysShowDefinition&&(e.config.alwaysShowDefinition=!0),this.toastInfo={},this.canChange=!0;var n=this.getConfig(e.player),r=n.defaultDefinition,o=n.list;e.config.defaultDefinition=r,e.config.list=o.map((function(e,i){return t(t({},e),{},{itemIndex:i})}))}},{key:"getConfig",value:function(e){var t=this,i={list:[],defaultDefinition:""},n=e.config.playerData;this.toastInfo={},this.canChange=!0;var r=n.current,o=r.lineId,a=r.definition,s=n.getDefinitionListByLineId(o);return Array.isArray(s)&&s.length>0&&(i.list=s.map((function(i){return i.text||(i.text=t.getShowText(e.i18n,i,i.definition)),i}))),i.defaultDefinition=a,i}},{key:"dataMonitoring",value:function(){var e=this;Gi.subscribeProperty(this.playerData.current,"definition",(function(i,n){if(e.canChange&&i!==n&&e.player){var r,o=e.config.list,a=(void 0===o?[]:o).find((function(e){return e.definition===n}));if(a&&a.url)"dash"===(e.player.config.playerData.getCurrentStreamType()||ol(null===(r=e.player.config.playerData)||void 0===r||null===(r=r.configs)||void 0===r?void 0:r.getVideoByToken)).toLowerCase()&&(a.url=a.itemIndex+""),e.player.changeDefinition(t(t({},a),{},{definition:n,url:a.url})),e.player.emit(LM.INNER_DEFINITION_CHANGE,{from:i,to:n,url:a.url}),e.player.emit(LM.PlAY_URL_CHANGE,{url:a.url,from:LM.INNER_DEFINITION_CHANGE}),e.renderItemList(n),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,i=this,n=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(n){var r=e.showText,o=n.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=i.toastInfo[o])&&void 0!==e&&e.delayClose&&(n.remove(o),clearTimeout(i.toastInfo[o].timer),delete i.toastInfo[o])}),2e3);var a=function(){var e;i.toastInfo[o]&&(Date.now()-(null===(e=i.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?(n.remove(o),delete i.toastInfo[o]):i.toastInfo[o].delayClose=!0)};this.player.once(sr,a),this.player.once(An,a)}}},{key:"afterCreate",value:function(){m(h(n.prototype),"afterCreate",this).call(this),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.config.alwaysShowDefinition?(this.renderItemList(this.config.list),this.show()):this.hide():(this.renderItemList(this.config.list),this.show()))}},{key:"show",value:function(){var e;!this.config.list||(null===(e=this.config.list)||void 0===e?void 0:e.length)<2&&!this.config.alwaysShowDefinition||yn.addClass(this.root,"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,i=arguments.length>2?arguments[2]:void 0;return e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}},{key:"renderItemList",value:function(e){var t=this,i=this.config,r=i.list,o=i.defaultDefinition,a=0,s=r.map((function(i,n){var r={url:i.url,definition:i.definition||"",showText:t.getShowText(t.i18n,i,i.definition),isCurrent:!1,selected:!1},s="string"==typeof e?i.definition===e:i.definition===o;return!yn.isUndefined(i.definition)&&s&&(r.isCurrent=!0,r.selected=!0,a=n),r}));m(h(n.prototype),"renderItemList",this).call(this,s,a)}},{key:"onItemClick",value:function(e,t){this.config.showToastOnManualClick&&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:MM,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}}]),n}(ns);function VM(){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 zM=Sn.isWeixin,GM=Sn.os,WM=Sn.device,KM=GM.isAndroid,$M=GM.isIos,YM="mobile"===WM,qM=0,XM=!1,JM=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).state={mode:0,showUnmuteBt:!1},n.userClickPlay=function(){if(!XM){var e=n.player.play();e&&e.then?e.then((function(){qs.log("user action autoplay success"),XM=!0})).catch((function(e){qs.warn("user action autoplay fail:",e)})):(qs.warn("no play promise"),XM=!0)}},n}return l(i,[{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:VM,class:"xgplayer-muted-svg"}}}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initState",value:function(){var e=this.player.config,t=e.enableDegradeMuteAutoplay,i=e.enableWxJsBridgeAutoplay,n=e.enableUserActionAutoplay;t&&(this.config.enableDegradeMuteAutoplay=!0),i&&(this.config.enableWxJsBridgeAutoplay=!0),n&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}},{key:"initEvents",value:function(){this.player.on(Jn,this.handleAutoplayPrevented.bind(this)),this.player.on(Xn,this.handleAutoplayStart.bind(this)),this.player.on(Hn,this.handleVolumechange.bind(this)),this.setUserActionAutoPlay()}},{key:"setWXAutoPlay",value:function(){zM&&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(){qs.log("wechat autoplay success")})).catch((function(t){qs.warn("wechat autoplay fail:",t),e.state.showUnmuteBt=!1,e.renderUnmuteBt()})):qs.warn("wechat browser no play promise")}))}))}},{key:"wxPlay",value:function(){this.player.readyState>=2?this.wxCanPlayFn():KM?this.player.once(Bn,this.wxCanPlayFn.bind(this)):$M&&this.player.once(Zn,this.wxCanPlayFn.bind(this))}},{key:"setUserActionAutoPlay",value:function(){var e=this;this.config.enableUserActionAutoplay&&this.player.once(LM.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?(qs.warn("unmute autoplay fail"),this.player.emit(LM.AUTOPLAY_FAILED,{mode:"unmute"}),KM&&zM?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(qs.warn("mute autoplay fail"),this.player.emit(LM.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(LM.AUTOPLAY_FAILED,{mode:"noSupport"}),void qs.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(){qs.log("degrade mute autoplay success")})).catch((function(t){qs.warn("degrade mute autoplay fail:",t),e.player.muted=!1,e.state.showUnmuteBt=!1,e.renderUnmuteBt()})):qs.warn("no play promise")}))}},{key:"handleAutoplayStart",value:function(){if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(LM.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(LM.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(LM.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,i=yn.createDom("div",t,void 0,"xgplayer-unmute-bt");e.appendChild(i),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,i=Date.now();if(i-qM>200){qM=i,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt();var n=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);n&&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(Jn,this.handleAutoplayPrevented.bind(this)),this.player.off(Xn,this.handleAutoplayStart.bind(this)),this.player.off(Hn,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=YM?"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}}}]),i}(Qr);function ZM(){return(new DOMParser).parseFromString('<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="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 QM=function(){return I.Date.now()},eR=/\s/;var tR=/^\s+/;function iR(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&eR.test(e.charAt(t)););return t}(e)+1).replace(tR,""):e}var nR=/^[-+]0x[0-9a-f]+$/i,rR=/^0b[01]+$/i,oR=/^0o[0-7]+$/i,aR=parseInt;function sR(e){if("number"==typeof e)return e;if(hi(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=iR(e);var i=rR.test(e);return i||oR.test(e)?aR(e.slice(2),i?2:8):nR.test(e)?NaN:+e}var lR=Math.max,cR=Math.min;function uR(e,t,i){var n,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 i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function p(e){return c=e,s=setTimeout(v,t),u?f(e):a}function g(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function v(){var e=QM();if(g(e))return y(e);s=setTimeout(v,function(e){var i=t-(e-l);return h?cR(i,o-(e-c)):i}(e))}function y(e){return s=void 0,d&&n?f(e):(n=r=void 0,a)}function m(){var e=QM(),i=g(e);if(n=arguments,r=this,l=e,i){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=sR(t)||0,U(i)&&(u=!!i.leading,o=(h="maxWait"in i)?lR(sR(i.maxWait)||0,t):o,d="trailing"in i?!!i.trailing:d),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=r=s=void 0},m.flush=function(){return void 0===s?a:y(QM())},m}var hR=Qr.POSITIONS,dR=function(e){u(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.refresh),this.initEvents()}},{key:"registerIcons",value:function(){return{refresh:{icon:ZM,class:"xgplayer-refresh-svg"}}}},{key:"registerLanguageTexts",value:function(){return{refresh:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"}}}},{key:"initEvents",value:function(){this.handleRefresh=uR(this.handleRefresh.bind(this),200);var e="mobile"===Sn.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(LM.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:hR.CONTROLS_LEFT,index:1}}}]),i}(Qr);function fR(){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 pR=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).panel=null,n.panelContainer=null,n}return l(i,[{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"),i=this.getAndSplitList().extraList;t.forEach((function(t){var n,r=Number(t.getAttribute("plugin-index"));null!==(n=i[r])&&void 0!==n&&null!==(n=n.textTips)&&void 0!==n&&n[e]&&(t.innerHTML=i[r].textTips[e])}))}}},{key:"registerIcons",value:function(){return{more:{icon:fR,class:"xgplayer-more-svg"}}}},{key:"getAndSplitList",value:function(){var e,t,i,n,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?(n=a.slice(0,this.config.maxShowNum),r=a.slice(-(a.length-this.config.maxShowNum))):n=b(a),{list:null!==(t=n)&&void 0!==t?t:[],extraList:null!==(i=r)&&void 0!==i?i:[]}}},{key:"children",value:function(){var e=this,t=this.getAndSplitList().list,i={};return t.forEach((function(t){i[t.pluginName]={plugin:t,options:{root:e.root}}})),i}},{key:"renderMoreIcon",value:function(){var e=this,t=this.getAndSplitList().extraList;if(0!==t.length){var i=this.root,n=yn.createDom("div","",{},"xgplayer-icon");n.appendChild(this.icons.more),n.addEventListener("click",(function(){e.renderPanel(t)}));var r=yn.createDom("xg-icon","",{"data-index":0},"xgplayer-more");r.appendChild(n),i.appendChild(r)}}},{key:"renderPanel",value:function(e){var t=this;this.panelContainer||(this.panelContainer=yn.createDom("div","",{},"panel-content"),e.forEach((function(e,i){var n,r,o=yn.createDom("div","",{},"panel-icon-bt"),a=yn.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!==(n=null===(r=e.textTips)||void 0===r?void 0:r[s])&&void 0!==n?n:e.pluginName;o.appendChild(yn.createDom("span",l,{"plugin-index":i},"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}}}]),i}(Qr);function gR(){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 vR=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).playerData=null,n.state={showError:!1,retryTimes:0,idx:0},n._errDetailList=[],n.playerData=e.player.config.playerData,n}return l(i,[{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:gR,class:"xgplayer-error-svg"}}}},{key:"updateLang",value:function(){if(this.$errorDom){var e=this.$errorDom.querySelector(".xgplayer-error-tips");if(e){var t,i,n=null!==(t=null===(i=this.config.errorTipsText)||void 0===i?void 0:i[this.lang])&&void 0!==t?t:this.langText.errorTips;e.innerHTML=n}var r=this.$errorDom.querySelector(".xgplayer-error-button");r&&(r.innerHTML=this.langText.clickButton)}}},{key:"initEvents",value:function(){this.player.on(An,this.handleError.bind(this)),this.playerData.isLive&&(this.player.on(Ln,this.handleEnd.bind(this)),this.player.on(LM.REFRESH_CLICK,this.closeError.bind(this))),this.on(Bn,this.closeError.bind(this)),this.on(On,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(no.ENTER);var t=this.getRetryList(),i=this.config.retryLoopNum*t.length,n=(t.indexOf(this.player.config.url)+1)%t.length;this.state.idx=n;var r=t[n];if(!r||this.state.retryTimes===i)return this.player.removeClass(no.ENTER),this.state.retryTimes===i&&this.player.emit(LM.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(function(){e.state.retryTimes=0})),qs.log("重试第".concat(this.state.retryTimes,"次"),r),this.player.emit(LM.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(LM.PlAY_URL_CHANGE,{url:e,from:LM.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(LM.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 i,n;if(this.$errorDom=yn.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){var r=yn.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=yn.createDom("div",s,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(d)}if(this.config.isNeedRefreshButton){var f=yn.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!==(i=this._errDetailList)&&void 0!==i&&i.length)null===(n=this._errDetailList)||void 0===n||n.forEach((function(e){var i="function"==typeof e?e():e;if(i){var n=yn.createDom("div","".concat(i.label,": ").concat(i.value),void 0,"xgplayer-error-detail-info");t.$errorDom.appendChild(n)}}));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(LM.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(An,this.handleError.bind(this)),this.playerData.isLive&&this.player.off(Ln,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}}}]),i}(Qr);function yR(){return(new DOMParser).parseFromString('<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.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 mR(){return(new DOMParser).parseFromString('<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.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 _R(){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 bR(e){return e&&e.ownerDocument||document}function kR(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function wR(e,t){e.classList?e.classList.add(t):kR(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var TR=!("undefined"==typeof window||!window.document||!window.document.createElement),SR=!1,CR=!1;try{var xR={get passive(){return SR=!0},get once(){return CR=SR=!0}};TR&&(window.addEventListener("test",xR,xR),window.removeEventListener("test",xR,!0))}catch(Kl){}function ER(e,t,i,n){if(n&&"boolean"!=typeof n&&!CR){var r=n.once,o=n.capture,a=i;!CR&&r&&(a=i.__once||function e(n){this.removeEventListener(t,e,o),i.call(this,n)},i.__once=a),e.addEventListener(t,a,SR?n:o)}e.addEventListener(t,i,n)}function PR(e){var t=bR(e);return t&&t.defaultView||window}function OR(e,t){return PR(e).getComputedStyle(e,t)}var IR=/([A-Z])/g;function LR(e){return e.replace(IR,"-$1").toLowerCase()}var DR=/^ms-/;function AR(e){return LR(e).replace(DR,"-ms-")}var MR=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function RR(e){return!(!e||!MR.test(e))}function NR(e,t){var i="",n="";if("string"==typeof t)return e.style.getPropertyValue(AR(t))||OR(e).getPropertyValue(AR(t));Object.keys(t).forEach((function(r){var o=t[r];o||0===o?RR(r)?n+=r+"("+o+") ":i+=AR(r)+": "+o+";":e.style.removeProperty(AR(r))})),n&&(i+="transform: "+n+";"),e.style.cssText+=";"+i}function jR(e,t,i,n){var r=n&&"boolean"!=typeof n?n.capture:n;e.removeEventListener(t,i,r),i.__once&&e.removeEventListener(t,i.__once,r)}function BR(e,t,i,n){return ER(e,t,i,n),function(){jR(e,t,i,n)}}function UR(e,t,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=!0),e){var r=document.createEvent("HTMLEvents");r.initEvent(t,i,n),e.dispatchEvent(r)}}function HR(e,t,i,n){var r,o;null==i&&(r=NR(e,"transitionDuration")||"",o=-1===r.indexOf("ms")?1e3:1,i=parseFloat(r)*o||0);var a=function(e,t,i){void 0===i&&(i=5);var n=!1,r=setTimeout((function(){n||UR(e,"transitionend",!0)}),t+i),o=BR(e,"transitionend",(function(){n=!0}),{once:!0});return function(){clearTimeout(r),o()}}(e,i,n),s=BR(e,"transitionend",t);return function(){a(),s()}}var FR={transition:"","transition-duration":"","transition-delay":"","transition-timing-function":""};function VR(e){var t=e.node,i=e.properties,n=e.duration,r=void 0===n?200:n,o=e.easing,a=e.callback,s=[],l={},c="";Object.keys(i).forEach((function(e){var t=i[e];RR(e)?c+=e+"("+t+") ":(l[e]=t,s.push(LR(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=HR(t,(function(e){e.target===e.currentTarget&&(NR(t,FR),a&&a.call(this,e))}),r);return t.clientLeft,NR(t,l),{cancel:function(){u(),NR(t,FR)}}}var zR=(new Date).getTime();var GR="clearTimeout",WR=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-zR)),n=setTimeout(e,i);return zR=t,n},KR=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};TR&&["","webkit","moz","o","ms"].some((function(e){var t=KR(e,"request");return t in window&&(GR=KR(e,"cancel"),WR=function(e){return window[t](e)}),!!WR}));var $R,YR=function(e){"function"==typeof window[GR]&&window[GR](e)},qR=WR;function XR(e,t){if(!$R){var i=document.body,n=i.matches||i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;$R=function(e,t){return n.call(e,t)}}return $R(e,t)}function JR(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var ZR=Function.prototype.bind.call(Function.prototype.call,[].slice);var QR=Function.prototype.bind.call(Function.prototype.call,[].slice);function eN(e,t){return QR(e.querySelectorAll(t))}function tN(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function iN(e){return"window"in e&&e.window===e?e:tN(e)&&e.defaultView||!1}function nN(e){var t="pageXOffset"===e?"scrollLeft":"scrollTop";return function(i,n){var r=iN(i);if(void 0===n)return r?r[e]:i[t];r?r.scrollTo(r[e],n):i[t]=n}}var rN=nN("pageXOffset"),oN=nN("pageYOffset");function aN(e){var t=bR(e),i={top:0,left:0,height:0,width:0},n=t&&t.documentElement;return n&&JR(n,e)?(void 0!==e.getBoundingClientRect&&(i=e.getBoundingClientRect()),i={top:i.top+oN(n)-(n.clientTop||0),left:i.left+rN(n)-(n.clientLeft||0),width:i.width,height:i.height}):i}function sN(e,t){var i=iN(e);return i?i.innerHeight:t?e.clientHeight:aN(e).height}var lN=/^(?:input|select|textarea|button)$/i;function cN(e,t,i){void 0===t&&(t=null),void 0===i&&(i=null);for(var n=[];e;e=e.nextElementSibling)if(e!==t){if(i&&XR(e,i))break;n.push(e)}return n}var uN=function(e){return!!e&&"offsetParent"in e};function hN(e){for(var t=bR(e),i=e&&e.offsetParent;uN(i)&&"HTML"!==i.nodeName&&"static"===NR(i,"position");)i=i.offsetParent;return i||t.documentElement}function dN(){return dN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},dN.apply(this,arguments)}var fN;function pN(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gN(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=pN(e.className,t):e.setAttribute("class",pN(e.className&&e.className.baseVal||"",t))}function vN(e,t){var i=NR(e,"position"),n="absolute"===i,r=e.ownerDocument;if("fixed"===i)return r||document;for(;(e=e.parentNode)&&!tN(e);){var o=n&&"static"===NR(e,"position"),a=(NR(e,"overflow")||"")+(NR(e,"overflow-y")||"")+NR(e,"overflow-x");if(!o&&(/(auto|scroll)/.test(a)&&(t||sN(e)<e.scrollHeight)))return e}return r||document}var yN=/ /gi,mN=/\xA0/g,_N=/\s+([^\s])/gm;var bN={addEventListener:ER,removeEventListener:jR,triggerEvent:UR,animate:function(e,t,i,n,r){if(!("nodeType"in e))return VR(e);if(!t)throw new Error("must include properties to animate");return"function"==typeof n&&(r=n,n=""),VR({node:e,properties:t,duration:i,easing:n,callback:r})},filter:function(e,t){return function(i){var n=i.currentTarget,r=i.target;eN(n,e).some((function(e){return JR(e,r)}))&&t.call(this,i)}},listen:BR,style:NR,getComputedStyle:OR,attribute:function(e,t,i){if(e){if(void 0===i)return e.getAttribute(t);i||""===i?e.setAttribute(t,String(i)):e.removeAttribute(t)}},activeElement:function(e){void 0===e&&(e=bR());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(Kl){return e.body}},ownerDocument:bR,ownerWindow:PR,requestAnimationFrame:qR,cancelAnimationFrame:YR,matches:XR,height:sN,width:function(e,t){var i=iN(e);return i?i.innerWidth:t?e.clientWidth:aN(e).width},offset:aN,offsetParent:hN,position:function(e,t){var i,n={top:0,left:0};if("fixed"===NR(e,"position"))i=e.getBoundingClientRect();else{var r=t||hN(e);i=aN(e),"html"!==function(e){return e.nodeName&&e.nodeName.toLowerCase()}(r)&&(n=aN(r));var o=String(NR(r,"borderTopWidth")||0);n.top+=parseInt(o,10)-oN(r)||0;var a=String(NR(r,"borderLeftWidth")||0);n.left+=parseInt(a,10)-rN(r)||0}var s=String(NR(e,"marginTop")||0),l=String(NR(e,"marginLeft")||0);return dN({},i,{top:i.top-n.top-(parseInt(s,10)||0),left:i.left-n.left-(parseInt(l,10)||0)})},contains:JR,scrollbarSize:function(e){if((!fN&&0!==fN||e)&&TR){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),fN=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return fN},scrollLeft:rN,scrollParent:vN,scrollTo:function(e,t){var i=aN(e),n={top:0,left:0};if(e){var r=t||vN(e),o=iN(r),a=oN(r),s=sN(r,!0);o||(n=aN(r));var l=(i={top:i.top-n.top,left:i.left-n.left,height:i.height,width:i.width}).height,c=i.top+(o?0:a),u=c+l;a=a>c?c:u>a+s?u-s:a;var h=qR((function(){return oN(r,a)}));return function(){return YR(h)}}},scrollTop:oN,querySelectorAll:eN,closest:function(e,t,i){e.closest&&!i&&e.closest(t);var n=e;do{if(XR(n,t))return n;n=n.parentElement}while(n&&n!==i&&n.nodeType===document.ELEMENT_NODE);return null},addClass:wR,removeClass:gN,hasClass:kR,toggleClass:function(e,t){e.classList?e.classList.toggle(t):kR(e,t)?gN(e,t):wR(e,t)},transitionEnd:HR,childNodes:function(e){return e?ZR(e.childNodes):[]},childElements:function(e){return e?Array.from(e.children):[]},nextUntil:function(e,t){return cN(e,e,t)},parents:function(e){return function(e,t){var i=null,n=[];for(i=e?e[t]:null;i&&9!==i.nodeType;)n.push(i),i=i[t]||null;return n}(e,"parentElement")},siblings:function(e){return cN(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&&lN.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,i){void 0===t&&(t=!0),void 0===i&&(i=!0);var n="";return e&&(n=(e.textContent||"").replace(yN," ").replace(mN," "),t&&(n=n.trim()),i&&(n=n.replace(_N," $1"))),n}};var kN=function(){function e(t,i){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=i.ticks,this.itemProps=i,this.sliderTitle=document.createElement("div"),this.sliderTitle.innerHTML=i.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"),bN.addClass(this.wrapper,"wrapper"),bN.addClass(this.parent,"xg-player-slider"),bN.addClass(this.sliderContent,"line-slider"),bN.addClass(this.sliderTitle,"line-title"),bN.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(i.defaultValue)}return l(e,[{key:"renderTicks",value:function(){var e=this.wrapper,t=document.createElement("div");bN.addClass(t,"ticks");for(var i=1;i<this.ticks.length-1;i++){var n=this.ticks[i],r=document.createElement("div");bN.addClass(r,"tick"),bN.style(r,{left:n.val+"%"}),t.appendChild(r)}e.appendChild(t)}},{key:"rendInner",value:function(){var e=this.wrapper,t=this.inner;bN.addClass(t,"inner");var i=this.button;bN.addClass(i,"button"),e.appendChild(t),e.appendChild(i)}},{key:"bindEvents",value:function(){bN.addEventListener(this.wrapper,"click",this.onClick.bind(this)),bN.addEventListener(this.button,"touchstart",this.onTouchStart.bind(this)),bN.addEventListener(this.button,"touchmove",function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return U(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),uR(e,t,{leading:n,maxWait:t,trailing:r})}(this.onTouchmove.bind(this),30)),bN.addEventListener(this.button,"touchend",this.onTouchend.bind(this)),bN.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 i=this.currentValue+"%";return setTimeout((function(){bN.style(t.inner,{width:i}),bN.style(t.button,{left:i})})),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=bN.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 i=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;bN.style(this.inner,{width:i+"%"}),bN.style(this.button,{left:i+"%"})}}},{key:"onMouseup",value:function(e){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=bN.offset(this.wrapper);this.wrapperWidth=t.width,this.wrapperLeft=t.left;var i=(e.clientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(i)}}]),e}(),wN={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:"极大"},TN={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"},SN={zh:wN,"zh-cn":wN,en:TN,jp:TN,"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:"極大"}},CN=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=SN[e]||SN.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 i=this.sliderItemsProps.find((function(t){return t.key===e}))||this.sliderItemsProps[0];return(i.ticks.find((function(e){return e.val===t}))||i.ticks[0]).renderVal}}]),e}(),xN=function(){function e(t){a(this,e),this.state=t,this.root=yn.createDom("xg-danmu"),bN.addClass(this.root,"xgplayer-danmu-container")}var t;return l(e,[{key:"initDanmuContainer",value:function(){var e=this.state.getConfig(),t=e.opacity,i=void 0===t?1:t,n=e.fontSize,r=void 0===n?16:n,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",i)),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(i().mark((function e(){return i().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}(),EN=function(){function e(t){a(this,e),this.state=t,this.root=document.createElement("div"),bN.addClass(this.root,"panel-box"),bN.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}(),PN=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"),bN.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,bN.addClass(t,"left"),t.innerHTML=this.name;var i=document.createElement("div");this.$right=i,bN.addClass(i,"right"),i.innerHTML='<label class="switch">\n <input type="checkbox">\n <span class="slider round"></span>\n </label>',this.root.appendChild(t),this.root.appendChild(i);var n=this.$right.querySelector("input");bN.addEventListener(this.$right,"click",uR((function(t){t.stopPropagation(),e.value=!e.value,e.value?null==n||n.setAttribute("checked","checked"):null==n||n.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}(),ON="pc"===Sn.device,IN=Qr.POSITIONS,LN=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).seekCost=window.performance.now(),n.eventBus=new hn,window["danmu.js"]?(n.state=new CN(e.config),n.state.updateLang(n.player.lang),n.iconWrap=document.createElement("div"),bN.addClass(n.iconWrap,"icon-warp"),n.tipsWrap=document.createElement("div"),bN.addClass(n.tipsWrap,"tips-wrap"),n.container=new xN(n.state),n.panel=new EN(n.state),n):g(n)}return l(i,[{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),ON&&(this.state.getConfig().usePanel&&this.root.appendChild(this.panel.root),this.renderTips(),bN.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:yR,class:"xgplayer-danmu-open-svg"},close:{icon:mR,class:"xgplayer-danmu-close-svg"},reset:{icon:_R,class:"xgplayer-danmu-reset-svg"}}}},{key:"initEvents",value:function(){ON?this.bindPCEvent():this.bindMobileEvent(),this.bindPlayerEvent()}},{key:"bindPlayerEvent",value:function(){var e=this;this.once(Nn,(function(){e.container.start()})),this.on(Dn,(function(){e.container.pause()})),this.on(On,(function(){e.container.play()})),this.on(Mn,(function(){e.seekCost=window.performance.now(),e.container.stop()})),this.on(Rn,uR((function(){e.container.start()}),300)),this.on([nr,rr,or],(function(){e.container.resize(),e.handleResize()})),this.on(ur,this.handlePIP.bind(this))}},{key:"bindPCEvent",value:function(){var e=this;bN.addEventListener(this.root,"click",this.onClick.bind(this)),bN.addEventListener(this.root,"mouseenter",(function(){var t=e.state.getConfig().active,i=e.player.controls;"rightSide"===e.config.listType?i.blur():i.focus(),t?(bN.style(e.panel.root,{display:"block"}),bN.style(e.tipsWrap,{display:"none"})):(bN.style(e.panel.root,{display:"none"}),bN.style(e.tipsWrap,{display:"block"}))})),bN.addEventListener(this.root,"mouseleave",(function(){var t=e.player.controls;"rightSide"===e.config.listType?t.focus():t.focusAwhile(),bN.style(e.panel.root,{display:"none"}),bN.style(e.tipsWrap,{display:"none"})}))}},{key:"bindMobileEvent",value:function(){var e=this;bN.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,i=e.maskActive,n=!t;n?(this.state.updateConfig({active:n}),i&&this.initMask()):(null==this||this.container.clear(),this.destroyMask(),this.state.updateConfig({active:n})),this.player.emit(LM.DANMU_CHANGE,{active:n}),this.danmuSwitchInSettingPanel&&(this.danmuSwitchInSettingPanel.value=n,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");bN.addClass(t,"box-header"),t.innerHTML='<div class="header-setting">'+this.state.curLangMap.danmuSetting+'</div> <div class="header-reset"></div>';var i=t.querySelector(".header-reset");i.appendChild(this.icons.reset),bN.addEventListener(i,"click",(function(t){t.stopPropagation(),e.eventBus.emit("reset")}),{capture:!0});var n=document.createElement("span");n.innerHTML=this.state.curLangMap.reset,i.appendChild(n),this.eventBus.on("updateLang",(function(){n.innerHTML=e.state.curLangMap.reset,t.querySelector(".header-setting").innerHTML=e.state.curLangMap.danmuSetting})),this.panel.root.appendChild(t),ON||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},i=new PN(t);this.danmuSwitchInSettingPanel=i,this.panel.root.appendChild(i.root),i.onChange((function(t){e.toggleDanmu(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){i.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 i=new PN(e);t.panel.root.appendChild(i.root),t.eventBus.on("updateLang",(function(){i.renderName(e.name)})),i.onChange((function(i){var n=t.state.getConfig().external||[];n.forEach((function(t){t.key===e.key&&(t.value=i)})),t.state.updateConfig({external:n}),t.player.emit(LM.DANMU_CHANGE,{external:n})}))}))}},{key:"renderSliders",value:function(){var e=this;this.state.sliderItemsProps.forEach((function(t,i){var n,r,o=document.createElement("div"),a=new kN(o,t);null!=(null===(n=e.state.getConfig())||void 0===n?void 0:n[t.key])&&a.setValue(null===(r=e.state.getConfig())||void 0===r?void 0:r[t.key]);a.onChange((function(i){e.state.updateConfig(c({},t.key,i)),e.player.emit(LM.DANMU_CHANGE,c({},t.key,i)),e.container.setProperty(t.key,i)})),e.eventBus.on("reset",(function(){a.setValue(t.defaultValue)})),e.eventBus.on("updateLang",(function(){a.renderText(e.state.sliderItemsProps[i])})),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,i=e.active,n=e.maskActive;t.maskUrl&&(this.renderDanmuMaskTurnOff(),i&&n&&this.initMask())}}},{key:"renderDanmuMaskTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuMask,key:"maskActive",value:this.state.getConfig().maskActive||!1},i=new PN(t);this.panel.root.appendChild(i.root),i.onChange((function(t){e.state.updateConfig({maskActive:t}),t?e.initMask():e.destroyMask(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){i.renderName(e.state.curLangMap.danmuMask)}))}},{key:"initMask",value:function(){this.destroyMask();var e=this.state.getConfig(),t=e.maskConfig,i=e.maskActive,n=e.active;t.maskUrl&&i&&n&&(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,i,n;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!==(i=null==r||null===(n=r.root)||void 0===n?void 0:n.offsetHeight)&&void 0!==i?i: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:IN.CONTROLS_RIGHT,index:RM}}}]),i}(Qr);function DN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AN(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HN(n.key),n)}}function MN(e,t,i){return t&&AN(e.prototype,t),i&&AN(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function RN(e,t,i){return(t=HN(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function NN(e){return(NN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jN(e,t){return(jN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function BN(e,t){if(t&&("object"===n(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 UN(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(Kl){return!1}}();return function(){var i,n=NN(e);if(t){var r=NN(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return BN(this,i)}}function HN(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}var FN=Wu,VN=sh,zN=qu,GN=Gu,WN=ly,KN=fg,$N=Xu,YN=Td,qN=vh,XN=Object.assign,JN=Object.defineProperty,ZN=VN([].concat),QN=!XN||GN((function(){if(FN&&1!==XN({b:1},XN(JN({},"a",{enumerable:!0,get:function(){JN(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=XN({},e)[i]||WN(XN({},t)).join("")!=n}))?function(e,t){for(var i=YN(e),n=arguments.length,r=1,o=KN.f,a=$N.f;n>r;)for(var s,l=qN(arguments[r++]),c=o?ZN(WN(l),o(l)):WN(l),u=c.length,h=0;u>h;)s=c[h++],FN&&!zN(a,l,s)||(i[s]=l[s]);return i}:XN,ej=QN;Fg({target:"Object",stat:!0,arity:2,forced:Object.assign!==ej},{assign:ej});var tj=!Gu((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ij=xd,nj=Eh,rj=Td,oj=tj,aj=tp("IE_PROTO"),sj=Object,lj=sj.prototype,cj=oj?sj.getPrototypeOf:function(e){var t=rj(e);if(ij(t,aj))return t[aj];var i=t.constructor;return nj(i)&&t instanceof i?i.prototype:t instanceof sj?lj:null},uj=Wu,hj=Gu,dj=sh,fj=cj,pj=ly,gj=Th,vj=dj(Xu.f),yj=dj([].push),mj=uj&&hj((function(){var e=Object.create(null);return e[2]=2,!vj(e,2)})),_j=function(e){return function(t){for(var i,n=gj(t),r=pj(n),o=mj&&null===fj(n),a=r.length,s=0,l=[];a>s;)i=r[s++],uj&&!(o?i in n:vj(n,i))||yj(l,e?[i,n[i]]:n[i]);return l}},bj={entries:_j(!0),values:_j(!1)}.values;Fg({target:"Object",stat:!0},{values:function(e){return bj(e)}});var kj,wj="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Tj=Vu,Sj=q_,Cj=Eh,xj=wj,Ej=Nh,Pj=J_,Oj=Q_,Ij=Tj.Function,Lj=/MSIE .\./.test(Ej)||xj&&((kj=Tj.Bun.version.split(".")).length<3||0==kj[0]&&(kj[1]<3||3==kj[1]&&0==kj[2])),Dj=function(e,t){var i=t?2:1;return Lj?function(n,r){var o=Oj(arguments.length,1)>i,a=Cj(n)?n:Ij(n),s=o?Pj(arguments,i):[],l=o?function(){Sj(a,this,s)}:a;return t?e(l,r):e(l)}:e},Aj=Fg,Mj=Vu,Rj=Dj(Mj.setInterval,!0);Aj({global:!0,bind:!0,forced:Mj.setInterval!==Rj},{setInterval:Rj});var Nj=Fg,jj=Vu,Bj=Dj(jj.setTimeout,!0);Nj({global:!0,bind:!0,forced:jj.setTimeout!==Bj},{setTimeout:Bj});var Uj,Hj,Fj={MENU_REPORT:"MENU_REPORT",MENU_LOG:"MENU_LOG"},Vj={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},zj={MENU:0,INTERACT:1,CONTEXTMENU:2},Gj={STATS:0,REPORT:1},Wj={CLOSE:0,COPY:1},Kj={SHOW:0,HIDE:1},$j={STATS:"STATS",REPORT:"REPORT",CLOSE:"CLOSE",COPY:"COPY",CONTEXTMENU_SHOW:"CONTEXTMENU_SHOW",CONTEXTMENU_HIDE:"CONTEXTMENU_HIDE"},Yj=Object.freeze(Object.defineProperty({__proto__:null,CONTEXTMENU_TYPES:Kj,EVENTS:Fj,INFO_TYPES:Vj,INTERACT_TYPES:Wj,LOG_EVENTS:$j,LOG_TYPES:zj,MENU_TYPES:Gj},Symbol.toStringTag,{value:"Module"})),qj={cn:(Uj={},RN(Uj,Vj.VID,"VID"),RN(Uj,Vj.TYPE,"类型"),RN(Uj,Vj.CODECS,"编码"),RN(Uj,Vj.SPEED,"加载速度"),RN(Uj,Vj.BUFFER,"缓冲时长"),RN(Uj,Vj.PLAY_QUALITY,"丢帧率"),RN(Uj,Vj.SCHEME,"视频协议"),RN(Uj,Vj.RESOLUTION,"分辨率"),RN(Uj,Vj.VIEWPORT,"视图尺寸"),RN(Uj,Vj.VOLUME,"音量大小"),RN(Uj,Vj.CDN,"CDN"),RN(Uj,Vj.P2P,"P2P"),RN(Uj,Vj.PLAYER_VERSION,"播放器版本"),Uj),en:(Hj={},RN(Hj,Vj.VID,"Video ID"),RN(Hj,Vj.TYPE,"Video Type"),RN(Hj,Vj.CODECS,"Codecs"),RN(Hj,Vj.SPEED,"Connection Speed"),RN(Hj,Vj.BUFFER,"Buffer Health"),RN(Hj,Vj.PLAY_QUALITY,"Dropped Frames"),RN(Hj,Vj.SCHEME,"Protocol"),RN(Hj,Vj.RESOLUTION,"Res"),RN(Hj,Vj.VIEWPORT,"Viewport"),RN(Hj,Vj.VOLUME,"Volume"),RN(Hj,Vj.CDN,"CDN"),RN(Hj,Vj.P2P,"P2P"),RN(Hj,Vj.PLAYER_VERSION,"Player Version"),Hj)},Xj=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&&jN(e,t)}(i,e);var t=UN(i);function i(){return DN(this,i),t.apply(this,arguments)}return MN(i,[{key:"afterCreate",value:function(){}},{key:"onPluginsReady",value:function(){var e=this.player.plugins.stats;this.menuInst=new Jj(this.player,this.config||{},e)}}],[{key:"pluginName",get:function(){return"MenuPlugin"}},{key:"defaultConfig",get:function(){return{enableDebug:!0}}}]),i}(Vr),Jj=function(){function e(t,i,n){var r=this;DN(this,e),RN(this,"_cdnUpdate",(function(e){var t=r.infoItems[Vj.CDN],i=e||r.player.domain;i&&(t.value=i),r._cacheUpdate(Vj.CDN,i)||i&&r.updateInfoItem(t)})),this.player=t,this.options=i||{},this.statsPlugin=n;var o={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>'},a=Object.assign({},o,this.options.icons);this.options.icons=a,this.playerInstance="dash_".concat((new Date).getTime()),window[this.playerInstance]=this.player,this.menuItems=[{name:"视频统计信息",handler:this.showPanelInfo.bind(this),type:Gj.STATS,icon:a.stats,eventName:$j.STATS},{name:"播放问题反馈",handler:this._handleReport.bind(this),type:Gj.REPORT,icon:a.report,eventName:$j.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)},{evt:"playing",handler:this._startup.bind(this)},{evt:"changeHost",handler:this._cdnUpdate}];for(var s=0;s<this.playerHandler.length;s++){var l=this.playerHandler[s],c=l.evt,u=l.handler;this.player.on(c,u)}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 MN(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){var t=this.infoItems[Vj.RESOLUTION];t.value=e,this._cacheUpdate(Vj.RESOLUTION,e)||(e?(t.value=e,this.updateInfoItem(t)):(t.hide=!0,this.createPanelInfo()))}},{key:"_codecsUpdate",value:function(e){var t=this.infoItems[Vj.CODECS];t.value=e,this._cacheUpdate(Vj.CODECS,e)||this.updateInfoItem(t)}},{key:"_cacheUpdate",value:function(e,t){return!this.hasInitDOM&&(this._cacheMap[e]=t,!0)}},{key:"_handleReport",value:function(){for(var e=this.player.video.readyState,t=this.player.video.buffered,i=[],n=0;n<t.length;n++){var r=t.start(n),o=t.end(n);i.push({start:r,end:o})}var a={readyState:e,curTime:this.player.video.currentTime,err:this.player.video.error||-1,buffer:i},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.ext&&(s.ext=this.player.ext),this.player.emit(Fj.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 i=e[t],n=this.infoItems[i];n.value=this._cacheMap[i],this.updateInfoItem(n,!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,i=qj.cn,n=this.options.lang||"cn";this.langConfig=this.options.langConfig||qj[n]||i,this.infoItems=(RN(e={},Vj.VID,{name:"VID",value:this.player.config.vid,render:Zj,hide:!this.player.config.vid,key:"vid"}),RN(e,Vj.TYPE,{name:"类型",value:t,render:Zj,key:"player_type"}),RN(e,Vj.CODECS,{name:"编码",value:this.player.menuCodeType,render:Zj,key:"menuCodeType",hide:!this.player.menuCodeType}),RN(e,Vj.SPEED,{name:"加载速度",value:0,render:Zj,posfix:" KB/s",hide:!this._isMenusHide("speed"),key:"speed"}),RN(e,Vj.BUFFER,{name:"缓冲时长",value:0,render:Zj,posfix:"s",key:"buffer"}),RN(e,Vj.PLAY_QUALITY,{name:"丢帧率",value:{droppedVideoFrames:0,totalVideoFrames:0},render:Qj,hide:null===this.player.video.getVideoPlaybackQuality,key:"frames_info"}),RN(e,Vj.SCHEME,{name:"视频协议",value:"HTTPS",render:Zj,key:"scheme"}),RN(e,Vj.CDN,{name:"CDN",value:this.player.domain?this.player.domain:"false",render:Zj,hide:!this._isMenusHide("cdn"),key:"CDN"}),RN(e,Vj.P2P,{name:"P2P",value:"false",render:Zj,hide:!0,key:"p2p"}),RN(e,Vj.RESOLUTION,{name:"分辨率",value:{width:0,height:0,fps:void 0},render:eB,hide:!this._isMenusHide("resolution"),key:"resolution"}),RN(e,Vj.VIEWPORT,{name:"视图尺寸",value:{width:0,height:0},render:eB,key:"viewport"}),RN(e,Vj.VOLUME,{name:"音量大小",value:"".concat((100*this.player.volume).toFixed(0),"%"),render:Zj,key:"volume"}),RN(e,Vj.PLAYER_VERSION,{name:"播放器版本",value:this.player.playerVersion,render:Zj,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&&nB(c.render)||(c.render=Zj),this.infoItems[c.type]=c):iB("".concat(c.name))}}},{key:"_isMenusHide",value:function(e){return!0===(this.player.supportMenus||{})[e]}},{key:"renderItemByType",value:function(e,t){var i=this.infoItems[e];i?(i.value=t,this._cacheUpdate(e,t)||this.updateInfoItem(i)):iB("".concat(e," item null"))}},{key:"_initDOM",value:function(){if(this.parentNode&&yn){this.hasInitDOM=!0;var e=document.createDocumentFragment(),t=document.createElement("xg-menu");yn.addClass(t,"xg-menu"),this.rightMenu=t;for(var i=this.menuItems.filter((function(e){return!e.hide})),n=0;n<i.length;n++)e.appendChild(this.createMenuItem(i[n]));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(),i=e.clientX-t.x+document.body.scrollLeft+document.documentElement.scrollLeft,n=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=i+a>r?r-a:i,c=n+s>o?o-s:n;this.rightMenu.style.left="".concat(l,"px"),this.rightMenu.style.top="".concat(c,"px"),this.emitLog(zj.CONTEXTMENU,Kj.SHOW,$j.CONTEXTMENU_SHOW)}},{key:"getOffset",value:function(){for(var e=this.parentNode,t=0,i=0;e&&!Number.isNaN(e.offsetLeft)&&!Number.isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,i+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:i}}},{key:"_munuHideHandler",value:function(){this.rightMenu&&"block"===this.rightMenu.style.display&&this.emitLog(zj.CONTEXTMENU,Kj.HIDE,$j.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[Vj.BUFFER];if(t.value=e,this.updateInfoItem(t),this.player.video.getVideoPlaybackQuality){var i=this.player.video.getVideoPlaybackQuality(),n=this.infoItems[Vj.PLAY_QUALITY];n.value={totalVideoFrames:i.totalVideoFrames,droppedVideoFrames:i.droppedVideoFrames},this.updateInfoItem(n)}var r=this.infoItems[Vj.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 i(){t.removeEventListener("DOMNodeInserted",i),e._onWinElemSizeChange()})),this.onWinSizeChange=function(e,t,i){var n;return function(){var r=this,o=arguments,a=function(){n=null,i||e.apply(r,o)},s=i&&!n;clearTimeout(n),n=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[Vj.VIEWPORT],i={width:Math.floor(e.width),height:Math.floor(e.height)};if(t.value=i,this._cacheUpdate(Vj.VIEWPORT,i))return;this.updateInfoItem(t)}}},{key:"_handleVolumeChange",value:function(){var e=this.infoItems[Vj.VOLUME];e.value="".concat((100*this.player.video.volume).toFixed(0),"%"),this._cacheUpdate(Vj.VOLUME)||this.updateInfoItem(e)}},{key:"createMenuItem",value:function(e){var t=this,i=document.createElement("div");if(i.classList.add("v-menu-item"),e.clsName&&i.classList.add(e.clsName),e.icon){var n=document.createElement("div");yn.addClass(n,"menu-item-icon"),n.innerHTML=e.icon,i.appendChild(n)}var r=document.createElement("div");return yn.addClass(r,"menu-item-content"),r.textContent=e.name,i.appendChild(r),!1!==i.clickable&&i.addEventListener("click",(function(i){i.stopPropagation(),i.preventDefault(),t.toggle(t.rightMenu,!1),e.handler(),t.emitLog(zj.MENU,e.type,e.eventName)})),i}},{key:"createIconBtn",value:function(e,t,i,n){var r=document.createElement("div");return yn.addClass(r,e),r.innerHTML="".concat(t,"<div class='svg-hover'>").concat(i,"</div>"),n.appendChild(r),r}},{key:"createPanelInfo",value:function(){var e=this,t=document.createElement("xg-panel-info");yn.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(zj.INTERACT,Wj.CLOSE,$j.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})),i={},n=0;n<t.length;n++){var r=t[n],o=r.key,a=void 0;a=e.options.connectPrefix&&r.posfix?"".concat(r.value).concat(r.posfix):r.value,i[o]=a}e.options.enableDebug&&e.statsPlugin&&Object.assign(i,{stats:e.statsPlugin.getStats()}),e.copyToClipboard(JSON.stringify(i)),e.emitLog(zj.INTERACT,Wj.COPY,$j.COPY)}));var i=document.createElement("ul");yn.addClass(i,"xg-panel-detail");for(var n=Object.values(this.infoItems).filter((function(e){return!e.hide})),r=document.createDocumentFragment(),o=0;o<n.length;o++){var a=this.createInfoItem(n[o]);r.appendChild(a)}i.appendChild(r),t.appendChild(i),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 i=e.elem;if(i){tB(i);var n=document.createElement("label"),r=this.langConfig[e.type]||e.name;n.textContent="".concat(r),yn.addClass(n,"xg-item-label"),i.appendChild(n);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:""),i.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,i=e[1]-Math.max(e[0],t);return i=Math.max(0,i).toFixed(2),parseFloat(i)}},{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],i=t.evt,n=t.handler;this.player.off(i,n)}window.removeEventListener("resize",this.onWinSizeChange)}},{key:"removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"isPIPMode",value:function(){return yn.hasClass(this.parentNode,"xgplayer-pip-active")}},{key:"emitLog",value:function(e,t,i){this.player.emit(Fj.MENU_LOG,{logType:e,code:t,event:i})}}]),e}();function Zj(e){return e}function Qj(e){var t=e.droppedVideoFrames,i=e.totalVideoFrames,n=0;n=0===i?0:t/i*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(i,", ").concat(n.toFixed(2),"%"),r.appendChild(a),r}function eB(e){var t=e.width,i=e.height,n=e.fps;return"".concat(t," * ").concat(i).concat(void 0!==n?" / ".concat(n,"fps"):"")}function tB(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function iB(e){console&&console.warn&&console.warn(e)}function nB(e){return"[object Function]"===Object.prototype.toString.call(e)}Xj.MenuEvents=Yj,Xj.Menu=Jj;function rB(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function oB(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?rB(Object(i),!0).forEach((function(t){uB(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):rB(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function aB(e){return(aB="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 sB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lB(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mB(n.key),n)}}function cB(e,t,i){return t&&lB(e.prototype,t),i&&lB(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function uB(e,t,i){return(t=mB(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function hB(e){return(hB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dB(e,t){return(dB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function fB(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pB(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fB(e)}function gB(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(Kl){return!1}}();return function(){var i,n=hB(e);if(t){var r=hB(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return pB(this,i)}}function vB(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=hB(e)););return e}function yB(){return yB="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=vB(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},yB.apply(this,arguments)}function mB(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}var _B=/^WEBVTT/,bB=/^STYLE+$/,kB=/^\:\:cue/,wB=/^}+$/,TB=/^\[Script Info\].*/,SB=[/[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}/],CB=/^Format:\s/,xB=/^Style:\s/,EB=/^Dialogue:\s/;function PB(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 OB(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function IB(e,t){return e>=0&&e<t.length?t[e]:""}var LB=function(){function e(){sB(this,e)}return cB(e,null,[{key:"parseJson",value:function(e){for(var t=[],i=0,n=0;n<e.length;n++){if(i>=50&&(i=0),0===i){var r={start:e[n].start,list:[e[n]],end:e[n].end};t.push(r)}else t[t.length-1].list.push(e[n]),t[t.length-1].end=e[n].end;i++}return t}},{key:"parse",value:function(t,i){var n=e.checkFormat(t);n||i({format:n});try{var r=[];"ass"===n?r=e.parseASS(t):"vtt"===n&&(r=e.parseVTT(t)),i({format:n,list:r.list,styles:r.styles})}catch(aV){console.error(aV),i({format:n},aV)}}},{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]:[],i=e.split(","),n={},r="";try{var o=i.length-t.length;return r=(r=o>0?i.splice(t.length-1,o+1).join(",")+"":i[i.length-1]+"").replace(/\\n+/g,""),i[t.length-1]=r,t.map((function(e,t){"end"===e||"start"===e?n[e]=PB(i[t].split(":")):"text"===e?n[e]=[i[t]]:"layer"===e?(n[e]=[i[t]],n.textTag=[i[t]]):n[e]="style"===e?[i[t]]:Number(i[t])?Number(i[t]):i[t]})),n}catch(aV){return console.error(aV),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(CB.test(i[r]))s=(s=i[r].replace(CB,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(xB.test(i[r]))a.push(i[r].replace(xB,"").replace(/\s+/g,""));else if(EB.test(i[r])){var c=e.parseASSItem(i[r].replace(EB,""),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(aV){console.error(aV)}else{l=c;var p=null;o%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),n.push(p)):((p=n[n.length-1]).end=l.end,p.list.push(l)),o++}}r++}return{list:n,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var i=e.split(":");if(i.length>1){var n=i[0].trim().split("-"),r="";n.length>1?n.map((function(e,t){r+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):r=n[0],t[r]=i[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(_B,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=IB(n,t).trim();if(!h||a&&OB(h))a=!h;else if(kB.test(h)&&bB.test(IB(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)wB.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[n]);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),i.push(g)):((g=i[i.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[n]);y.push(_.text),m.push(_.tag)}a=!1}n++}return{list:i,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<SB.length&&!(i=SB[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){n=t[0].replace(/\<|\>|\&/g,"");var r=RegExp("^<".concat(n,">(([\\s\\S])*?)</").concat(n,">$")).exec(e);r?i=r[1]:(i=e,n="")}else i=e;for(var o=/<(\w+).(\w+)>/g,a=o.exec(i);a&&a.length>2;)i=i.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(i);return{tag:n,text:i.replace(/\\n+/g,"<br/>")}}},{key:"parseVttTime",value:function(e){var t,i=e.split("--\x3e"),n=0;if(2===i.length){var r=i[0].split(":"),o=i[1].split(":");t=PB(r),n=PB(o)}return{start:t,end:n,time:e}}},{key:"isVTT",value:function(e){return _B.test(e)}},{key:"isASS",value:function(e){return TB.test(e)}},{key:"checkFormat",value:function(e){return e?_B.test(e)?"vtt":TB.test(e)?"ass":null:null}}]),e}(),DB=[{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 AB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={code:DB[e].code,msg:DB[e].msg};return Object.keys(t).map((function(e){i[e]=t[e]})),i}var MB=cB((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.url,n=t.method,r=void 0===n?"GET":n,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 sB(this,e),new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if(a&&(n.responseType=a),l&&(n.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),n.onload=function(){200===n.status||206===n.status?e({context:h,res:n}):t(new Error({context:h,res:n,type:"error"}))},n.onerror=function(e){t(new Error({context:h,res:n,type:"error"}))},n.ontimeout=function(e){t(new Error({context:h,res:n,type:"error"}))},n.onabort=function(){t(new Error({context:h,res:n,type:"error"}))},"GET"===o)n.open(o,"".concat(i)),n.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));n.open(o,i),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(s.join("&"))}}))})),RB=function(){function e(){var t,i;sB(this,e);var n=new Promise((function(e,n){t=e,i=n}));return n.resolve=function(e){t(e),n.state="fulfilled"},n.reject=function(e){i(e),n.state="rejected",n.isBreak="DESTROYED"===e},n.state="pending",n}return cB(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function NB(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var i=e.className&&"object"===aB(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function jB(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):NB(e,t)||(e.className&&"object"===aB(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function BB(e,t,i){var n=t.length;if(n<1)return-1;if(t[i=i<0?0:i>=n?n-1:i].start<=e&&e<t[i].end)return i;for(var r=t[i].end<=e?i+1:0;r<n;r++){if(t[r].start<=e&&e<t[r].end)return r;if(e>t[r].end&&r+1<n&&e<t[r+1].start)return-1;if(e>t[r].end&&r+1>=n)return-1}return-1}function UB(e,t,i){var n=t.length;if(n<1)return[];var r=[];if((i=i<0?0:i>=n?n-1:i)<n)for(var o=t[i].end<=e?i:0;o<n&&(t[o].start<=e&&e<t[o].end&&r.push(o),!(e<t[o].start));o++);return r}function HB(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function FB(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r}function VB(e,t,i){if(i||(i=new RB),"json"===t){var n=LB.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&LB.parse(e,(function(e,t){if(t){var n=AB(2,t);i.reject(n,{format:e.format})}else if(e.format)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=AB(3);i.reject(r)}}));return i}function zB(e,t){return t||(t=new RB),new MB({url:e.url,type:"text"}).then((function(i){VB(i.res.response,"string").then((function(i){t.resolve(oB(oB({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(i){var n=AB(1,oB({statusText:i.statusText,status:i.status,type:i.type,message:"http load error",url:e.src},e));t.reject(n)})),t}function GB(e,t){return!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function WB(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function KB(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var $B=function(){function e(){var t=this;sB(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return cB(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=this.__handlers,n=-1,r=0;r<i.length;r++)i[r]&&e===i[r].target&&(n=r);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)})),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 i=this.__handlers,n=0;n<i.length;n++)if(i[n]&&e===i[n].target){i[n].handler&&i[n].handler.forEach((function(i){try{i(e,t)}catch(aV){console.error(aV)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),YB=null;var qB="resize",XB="change",JB="off";function ZB(e){var t=[];return e&&"String"===HB(e)?t.push({url:e,index:0,start:-1,end:-1}):"Array"===HB(e)&&e.forEach((function(e,i){t.push({url:e.url||e.src,index:i,start:e.start||-1,end:e.end||-1})})),t}var QB=!1,eU=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&&dB(e,t)}(i,e);var t=gB(i);function i(e){var n,r,o,a,s,l,c;return sB(this,i),uB(fB(n=t.call(this)),"_onPause",(function(){n.stopRender()})),uB(fB(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),uB(fB(n),"_onTimeupdate",(function(){if(n._isOpen){var e=n.player.video,t=e.videoWidth,i=e.videoHeight;!n._videoMeta.scale&&t&&i&&n._onResize(n.player.root);var r=n._getPlayerCurrentTime();Math.round(Math.abs(1e3*r-n._ctime))<200||(n._ctime=1e3*r,n.currentText&&n.currentText.list&&("live"===n.config.updateMode?n._liveUpdate(r):n._update(r)))}})),uB(fB(n),"_onResize",(function(e){var t=fB(n),i=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=n.player.root),n._iId&&(clearTimeout(n._iId),n._iId=null),!i.scale){if(!n.player.video)return;var r=n.player.video,o=r.videoWidth,a=r.videoHeight;if(!o||!a)return;i.videoWidth=o,i.videoHeight=a,i.scale=parseInt(a/o*100,10)}n.__startResize(e)}})),uB(fB(n),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":n._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":n._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":n._onCoreSeiintime(e)}}catch(t){console.error(t)}})),uB(fB(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=fB(n)._curRenderTask;n._lastTimeStamp=(new Date).getTime();var i=[];t.forEach((function(t,r){var o=t.lastTime,a=t.wordList,s=t.interval,l=t.dom,c=t.ids;if(e<0||n._lastTimeStamp<0||n._lastTimeStamp-o>=s){var u=a.shift();u&&l.appendData(u),t.lastTime=n._lastTimeStamp}a.length<1&&i.push({index:r,ids:c})})),n._log(">>>>_renderByWords emptyArr",i.length,t.length),i.forEach((function(e){t.splice(e.index,1),n._log(">>>_renderByWords remove emptyArr",e.index,t.length)})),t.length>0&&(n._renderIntervalId=window.requestAnimationFrame(n.startRender))}})),uB(fB(n),"destroy",(function(){n.detachPlayer(),n.removeAllListeners(),n.player=null,n.textTrack=null,n._curRenderTask=[],n.stopRender()})),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),QB=/(?:iPhone)/.test(r)&&!c||s||a||c,n.currentText=null,n.currentExtText=null,n.textTrack=[],n._cid=-1,n._gid=-1,n._cids=[],n._iId=null,n._iC=0,n.player=null,n.root=null,n.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",renderMode:"",debugger:!1},n._ctime=0,n._loadingTrack={},Object.keys(n.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(n.config[t]=e[t])})),n._isOpen=n.config.defaultOpen||!1,n._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===HB(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.seiTime=0,n.lastSeiTime=0,n._curTexts=[],n._curRenderTask=[],n._renderIntervalId=-1,n._lastTimeStamp=-1,n.setSubTitles(e.subTitles,n.config.defaultOpen),n):pB(n)}return cB(i,[{key:"version",get:function(){return"3.0.10-alpha.4"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._isOpen||i;n&&this.innerRoot&&this.switchOff(),this.currentText=null,this.textTrack=[],t.forEach((function(t){var i={};Object.keys(t).map((function(e){i[e]=t[e]})),i.url=ZB(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),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,i=-1,n=0;n<this.textTrack.length;n++)if(GB(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=GB(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=ZB(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[i].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[i]),this._loadTrackUrls(this.currentText,2)):this.textTrack[i].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,i=e.format;t&&"vtt"===i&&(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]:"",i="";e.map((function(e){i+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var n=document.createElement("style"),r=document.head||document.getElementsByTagName("head")[0];if(n.type="text/css",n.id="ssss",n.styleSheet){var o=function(){try{n.styleSheet.cssText=i}catch(Kl){}};n.styleSheet.disabled?setTimeout(o,10):o()}else{var a=document.createTextNode(i);n.appendChild(a)}r.appendChild(n)}(t,"xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e){this.player&&this.detachPlayer();var i,n,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&&jB(this.root,"text-track-hide"),!s&&jB(this.root,"text-track-no-fitvideo"),a&&jB(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),i=e.root,n=this._onResize,YB||(YB=new $B),YB.addObserver(i,n)),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("pause",this._onPause),this.player.on("play",this._onPlay),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,i=this.player,n=this.config;i&&(i.off("destroy",this.destroy),i.off("timeupdate",this._onTimeupdate),i.off("pause",this._onPause),i.off("play",this._onPlay),i.off("core_event",this._onCoreEvents),n.domRender&&(i.root&&(e=i.root,t=this._onResize,YB&&YB.unObserver(e,t),i.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(i,n){if(t.id||t.language)if(e.currentText&&GB(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(AB(0));else{var r=null;e.__removeByTime(e._curTexts,0);for(var o=0;o<e.textTrack.length;o++)if(GB(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(),i(AB(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(),i(AB(0));else{var o=AB(6,{message:"check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(t.id)});n(o)}})).catch((function(e){n(e)})));else{var a=AB(4,new Error("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]")));n(a)}}else{if(e.currentText){e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn();var s=AB(0,{message:"switch default subtitle success"});return void i(s)}var l=AB(5,{message:"no default subtitle"});n(l)}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(i,n){if(t.id||t.language){for(var r=null,o=0;o<e.textTrack.length;o++)if(GB(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!GB(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(AB(0))}))}else e.currentExtText=null,i(AB(0))}))}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show(),this.emit(XB,this.currentText)}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide(),this.emit(JB)}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];(e=console).log.apply(e,["[xgSubtitle]"].concat(i))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var i=new RB,n="",r="";if(e.json?(n="json",r=e.json):e.stringContent&&!e.url&&(n="string",r=e.stringContent),r)return VB(r,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):(zB(o.splice(0,1)[0]).then((function(n){e.format=n.format,e.styles=n.styles,e.list||(e.list=[]),t._pushList(e.list,n.list),o.length>1&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=oB({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&this.player.emit("switch_subtitle",i)}},{key:"_loadTrackUrls",value:function(e,t,i){var n=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){zB(oB(oB({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.format,e.list||(e.list=[]),n._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(i&&i.resolve(e),n._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},i=-1;e.url.forEach((function(e,n){e.url===t.url&&(i=n)})),i>-1&&e.url.splice(i,1)}},{key:"_pushList",value:function(e,t){var i=t[0].start,n=t[t.length-1].end;if(0===e.length||i>=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>n){r=o;break}r>-1&&t.forEach((function(t,i){e.splice(r+i,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 i=this._getPlayerCurrentTime();i&&("live"===this.config.updateMode?this._liveUpdate(i):this._update(i))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var i=[],n=0;n<e.length;n++)t.includes(e[n])||i.push(e[n]);return i}},{key:"getNewCid",value:function(e,t){for(var i=[],n=0;n<t.length;n++)e.includes(t[n])||i.push(t[n]);return i}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=[],n=BB(e,this.currentText.list,this._gid);if(n>-1&&(i=UB(e,this.currentText.list[n].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,n,i,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),i.length>0){var r=function(e,t,i){if(0===e.length||t<0||t>e.length-1)return[];var n=e[t].list;if(0===i.length)return[];var r=n.splice(i[0],i.length);return t>0&&e.splice(0,t),0===n.length&&e.splice(0,1),r}(this.currentText.list,n,i),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,i){e.index=i+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 i=BB(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=UB(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),void(this._cids=[]);if(this._cids!==n||i!==this._gid){this._gid=i,this._cid=n[0];var r=this.getDelCid(this._cids,n),o=this.getNewCid(this._cids,n);this._cids=n,this.config.domRender&&this.__remove(r);var a=[];o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this.currentExtText&&o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this._log("update",a,e),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}}))};GB(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(i){}}},{key:"resize",value:function(e,t){var i,n=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,i=e):(d=t,i=parseInt(t/h*100,10)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;h>120?(f=a,p=parseInt(f*d/1080,10)):(f=o,p=parseInt(f*i/1920,10));var g=QB?s:l,v={fontSize:p=p<g?g:p>f?f:p},y=parseInt((t-d)/2,10),m=parseInt((e-i)/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){n.root.style[e]="".concat(v[e],"px")})),this.emit(qB,{vLeft:m,vBottom:y,marginBottom:_,vWidth:i,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,i=e.getBoundingClientRect(),n=this._videoMeta,r=i.width,o=i.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),r>0&&o>0&&(r!==n.lwidth||o!==n.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 i=[],n=0;n<e.length;n++)(!t||e[n].end<t)&&i.push(n);0!==i.length&&(e.splice(i[0],i.length),this.config.domRender&&this.__remove(i))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){this._log(">>>>_renderByWords__remove",e);for(var i=this.innerRoot.children,n=[],r=0;r<i.length;r++){var o=Number(i[r].getAttribute("data-index"));e.includes(o)&&n.push(i[r])}n.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);var i=this.config,n=i.renderMode,r=i.domRender;t.length>0&&r&&t.forEach((function(t){var i="text-track-".concat(e.config.line);t.text.forEach((function(r,o){o>0&&(i+=" text-track-deputy");var a={"data-start":t.start,"data-end":t.end,"data-index":t.index},s=FB("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=FB("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),l.innerHTML=r,e._renderByWords(s,o,t.start,t.end,r)}else s.innerHTML=r}))}))}},{key:"_renderByWords",value:function(e,t,i,n,r){var o=document.createTextNode("");e.appendChild(o);var a=function(e){for(var t=e.split(""),i=[],n=!1,r=0;r<t.length;r++){var o=t[r];if(WB(o))if(n){var a=i.length-1;i[a]="".concat(i[a]).concat(o)}else i.push(o),n=!0;else if(o.match(/^[ ]*$/)||KB(o)||/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(o)){n=!1;var s=i.length-1;i[s]="".concat(i[s]).concat(o)}else n=!1,i.push(o)}return i}(r),s=parseInt(1e3*(n-i),10);s>300&&(s-=100);var l={dom:o,ids:t,wordList:a,interval:s/a.length,start:i,end:n,duration:s,lastTime:0};this._log(">>>>_renderByWords",s,l);for(var c=this._curRenderTask,u=-1,h=0;h<c.length;h++)if(c[h].ids===t){u=h;break}u>-1&&c.slice(u,1),c.push(l),this.startRender(-1)}},{key:"stopRender",value:function(){this._renderIntervalId&&window.cancelAnimationFrame(this._renderIntervalId)}},{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)})):NB(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===aB(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(jB(this.root,"text-track-hide"),this.innerRoot.innerHTML="")}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=yB(hB(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=yB(hB(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=yB(hB(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=yB(hB(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){yB(hB(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}(hn),tU=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this))._onChange=function(e){var t=n._media.textTracks;if(t&&0!==t.length){for(var i=[],r=[],o=-1,a=0;a<t.length;a++){var s=t[a];"subtitles"===s.kind&&(i.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("|")!==n._languages?(n._languages=r.join("|"),n.emit("reset",{list:i,isOpen:o>-1})):-1===o?n.emit("off"):n.curIndex!==o&&n.emit("change",i[o]),n.curIndex=o}},n._media=e,n._list=[],n._languages="",n.curIndex=-1,n._init(),n}return l(i,[{key:"_init",value:function(){var e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):qs.warn("current browser not support native subtitle")}},{key:"switch",value:function(e){var t=this;return new Promise((function(i,n){if(!e)return n({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 i({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}}]),i}(hn);function iU(){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 nU(){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 rU=Qr.POSITIONS,oU="mobile"===Sn.device,aU="text-close";function sU(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=-1;return e.map((function(e,i){e.id||e.language||(e.id=""+i),!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=i:e.isDefault=e.default=!1)})),t}var lU=function(e){u(r,e);var i=v(r);function r(e){var t;a(this,r),(t=i.call(this,e)).isOpenState=!0,t.optionList=null,t.currentLang="",t.handlerClickSwitch=function(e,i){e.stopPropagation(),e.preventDefault(),t.subTitles&&(i.type===aU?t.switchOffSubtitle():t.switchSubTitle({language:i.language,id:i.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 n=e.player;return e.config,n.config.isLive&&(e.config.updateMode="live",Sn.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 i=sU(t);m(h(r.prototype),"afterCreate",this).call(this),"native"===this.config.mode?this._initNativeSubtitle(i):this._initExtSubTitle(i)}},{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,i=t.list,n=void 0===i?[]:i,r=t.style,o=t.isDefaultOpen,a=t.updateMode,s={subTitles:n,defaultOpen:o,debugger:!1,renderMode:t.renderMode,updateMode:a};this.isOpenState=o,Object.keys(r).map((function(e){s[e]=r[e]})),!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(Kn,this.onPlayerFocus),this.on($n,this.onPlayerBlur));var l=this.player;l._subTitles?l._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,l._subTitles.currentText)):(l._subTitles=new eU(s),l._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=l._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&&yn.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}},{key:"_renderList",value:function(e){var t=this.config,i=t.list,n=void 0===i?[]:i,r=t.isDefaultOpen;n.length&&(r&&e<0?(n[0].isDefault=!0,this.curIndex=0,this.curItem=n[0]):(this.curIndex=e,this.curItem=n[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?yn.addClass(this.root,"isOpen"):yn.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,i){this.curIndex=e,this.curItem=this.config.list[e-1],this.renderItemList(),this.emit("subtitle_change",t({off:!1,isListUpdate:!1,list:[]},i))}},{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||(oU?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle())}},{key:"showList",value:function(){var e;!oU&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hideList",value:function(){var e;!oU&&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:""},i=-1;return t&&(t.id||t.language)?(e.forEach((function(e,n){e.id!==t.id&&e.language!==t.language||(i=n)})),i):i}},{key:"registerIcons",value:function(){return{vttSubOpen:{icon:iU,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:nU,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(!oU){var t={config:{data:this.getList(),className:"",onItemClick:function(t,i){e.handlerClickSwitch(t,null==i?void 0:i.to)}},root:this.root};this.optionList=new Ja(t)}}},{key:"getList",value:function(){var e=this;return this.config.list.map((function(t,i){return i===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:""},i=-1;if(t&&(t.id||t.language)&&(this.config.list.map((function(e,n){e.id+""==t.id+""&&e.language+""==t.language+""&&(i=n)})),!(i<0||this.isOpenState&&i===this.curIndex)))return this.subTitles.switch(t).then((function(n){0===n.code&&(t.off=!1,t.isListUpdate=!1,t.list=[],e.curIndex=i,e.curItem=e.config.list[i],e.isOpenState=!0,yn.removeClass(e.root,"isClose"),yn.addClass(e.root,"isOpen"),e.renderItemList(),e.changeTipText(),e.emit("subtitle_change",t))})).catch((function(e){return qs.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,yn.addClass(this.root,"isClose"),yn.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null===(e=this.optionList)||void 0===e||e.hide()}},{key:"renderItemList",value:function(){oU?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 i,n=sU(t);if(e.isOpen)this.isOpenState=!0,this.curIndex=n,this.curItem=n>-1?t[n]:null,yn.removeClass(this.root,"isClose"),yn.addClass(this.root,"isOpen");else this.isOpenState=!1,this.curIndex=-1,this.curItem=null,yn.removeClass(this.root,"isOpen"),yn.addClass(this.root,"isClose"),this.changeTipText(),null===(i=this.optionList)||void 0===i||i.hide();if(this.config.list=t,t.length>0){var r;if(!oU)null===(r=this.optionList)||void 0===r||r.hide()}else{var o,a;if(this.switchOffSubtitle(),oU?this.showMobilePanel():null===(o=this.optionList)||void 0===o||o.show(),!oU)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,i=b(this.config.list),n=yn.createDom("div","",{},"ai-panel-content");i.map((function(i,r){var o=t({language:i.language||i.srclang,"data-id":i.id,selected:e.isOpenState&&e.curIndex===r,showText:e.getTextByLang(i)},i),a=e.renderPanelItem(o);n.appendChild(a)}));var r={showText:this.langText.subClose,"data-type":aU,selected:!this.isOpenState};return n.appendChild(this.renderPanelItem(r)),n}},{key:"renderPanelItem",value:function(e){var t=this,i=e.showText,n=e.selected,r=yn.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item ".concat(n?"select-in":""));r.innerHTML=i;var o=oU?"touchend":"click",a=Qr.delegate(r,".panel-Item",o,(function(i){e["data-type"]===aU?(i.stopPropagation(),i.preventDefault(),t.switchOffSubtitle()):t.handlerClickSwitch(i,e)}));return this._delegates.push(a),r}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var r=this.config.list;return!i&&(i=this.player.lang),t=!t||yn.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=r[e]),"object"===n(e[t])?e[t][i]||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 i=this.player,n=i.video,r=i.root.getBoundingClientRect(),o=r.height,a=r.width,s=n.videoHeight,l=n.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:rU.CONTROLS_RIGHT,index:BM,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),cU=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).toastNumber=0,n.toastMaps={},n}return l(i,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"add",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.toastNumber+1;this.toastNumber=r;var o=this.renderToast(e,n,r);return this.root.appendChild(o),this.toastMaps[r]=o,i&&setTimeout((function(){t.remove(r)}),i),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,i){var n=this,r=yn.createDom("div","",void 0,"toast-container"),o=yn.checkIsObject(e)?e:yn.createDom("div",e,void 0,"toast-txt");if(r.appendChild(o),t){var a=yn.createDom("span","×",void 0,"toast-close-bt");a.addEventListener("click",(function(){n.remove(i)})),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}}}]),i}(Qr);function uU(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hU(e,t,i){return t&&uU(e.prototype,t),i&&uU(e,i),e}function dU(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function fU(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function pU(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?fU(Object(i),!0).forEach((function(t){dU(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):fU(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var gU="xgplayer_device_id",vU="xgplayer_user_id",yU=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),i=0,n=t.length;i<n;i++){var r=t[i];if(t[i].indexOf(e)>=0)return r.split("=")[1]||null}},mU=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},_U=function(){var e=yU(gU);if(e)return e;var t=mU(11);return document.cookie=gU+"="+t+";max-age=31536000;path=/",t},bU=function(){var e=yU(vU);if(e)return e;var t=mU(12);return document.cookie=vU+"="+t+";max-age=31536000;path=/",t};var kU={get device(){return kU.os.isPc?"pc":"mobile"},get browser(){var e=function(){var e=navigator.userAgent.toLowerCase(),t={},i={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 n in i)if(i[n]){var r="";if("IE"===n)r=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===n){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(n="360");var a=e.match(/chrome\/([\d.]+)/);r=a?a[1]:"-1"}else if("Firefox"===n){var s=e.match(/firefox\/([\d.]+)/);r=s?s[1]:"-1"}else if("Opera"===n){var l=e.match(/opera\/([\d.]+)/);r=l?l[1]:"-1"}else if("Safari"===n){var c=e.match(/version\/([\d.]+)/);r=c?c[1]:"-1"}else if("Edge"===n){var u=e.match(/edge\/([\d.]+)/);r=u?u[1]:"-1"}else if("QQBrowser"===n){var h=e.match(/qqbrowser\/([\d.]+)/);r=h?h[1]:"-1"}t.type=n,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),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||n&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:n,isPc:!(a||n||i||o),isSymbian:i,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)/}],i=0;i<t.length;i++){var n=t[i];if(n.r.test(e))return n.s}return"unknown"}};function wU(){return Date.now()}function TU(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 SU(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.rtm)return e.plugins.rtm}return null}var CU={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},xU=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}hU(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),this.core&&this.core.loader&&this.core.loader.finnalUrl?e.cdn_play_url=this.core.loader.finnalUrl:e.cdn_play_url=t&&t.startsWith("//")?window.location.protocol+t:t,e.live_stream_session_id=function(e,t,i){var n=new URLSearchParams(e.split("?")[1]);return n.get(t)||n.get(i)}(e.cdn_play_url,"_session_id","session_id"),e.play_format=TU(e.cdn_play_url),e.timestamp=wU();var i=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(aV){}return e}(),n=i.cpu_core_number,r=i.memory_usage,o=i.network_downlink;e.cpu_core_number=n,e.memory_usage=r,e.network_downlink=o,Object.assign(e,pU({},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,pU({},e)))},e}(),EU=function(){return void 0!==navigator.onLine?navigator.onLine?(e=navigator.connection)&&(e.effectiveType||e.type)||kU.device:"none":"unknown";var e},PU=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],OU=function(){function e(e){this.options=e,this.logger=new IU(e),this.restart=this.restart.bind(this),this.bindUrlChange(),kU.browser.includes("Chrome")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new IU(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}(),IU=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||_U(),user_id:e.user_id||bU(),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 xU(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}hU(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,i=t.player,n=void 0!==i.hlsOps;this.commonParams=pU({os:kU.operation_os},function(e){var t=e.player,i=t.config.mediaType;return pU({project_key:e.project_key,live_sdk_version:SU(t)||t.hlsOps?"2":"-1",player_sdk_version:t.version,logger_version:"1.1.0-alpha.8",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:mU(12),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!i&&"video"!==i),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:kU.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:TU(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);n&&Object.defineProperty(this.log[o],"m3u8",{get:function(){if(i.__core__){var e=i.__core__.m3u8Text;return e?e.slice(0,25e4):""}return""},enumerable:!0}),Object.defineProperty(this.log[o],"volume",{get:function(){if(i&&i.video)return i.volume||0},enumerable:!0}),Object.defineProperty(this.log[o],"access",{get:function(){return EU()},enumerable:!0})}},t.updateExt=function(e){for(var t in this.log)for(var i in e)this.log[t][i]=e[i]},t.reportStartPlay=function(){this.started||(this.core=SU(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=wU(),this.logmanager.push(this.log.start_play,!0))},t.initWindowListener=function(){"pc"===kU.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===kU.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},t.removeWindowListener=function(){"pc"===kU.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===kU.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},t.initEvt=function(){var e=this,t=this.player;PU.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,i=e.headers,n=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=i.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(n);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=wU(),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 i=this.player;i.start=function(){try{if(i._start)return i._start.apply(i,Array.prototype.slice.call(e,0))}catch(Kl){}t.destroyed||t.handlePlayerComlete()}},t.handleTTFB=function(e){var t=e||{},i=t.end,n=t.elapsed;this.log.first_frame.ttfb=n||-1,this.log.first_frame.ttfb_end=i||0},t.handleUrlChange=function(e){this.logmanager.push(Object.assign(this.log.play_url_change,{url:e,timestamp:wU()}))},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=wU(),this.logmanager.push(this.log.source_opened)},t.handleBufferAppend=function(){this.log.source_updateend.timestamp=wU(),this.logmanager.push(this.log.source_updateend)},t.handlePlayerPause=function(){this.log.pause.timestamp=wU(),this.logmanager.push(this.log.pause,!0),this.stallEnd()},t.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,i=e.errorCode;Object.assign(this.log.play_error,pU({timestamp:wU(),code:e.httpCode||i||("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:i||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=wU()),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,i=e.offersdp,n=e.sessionId;if("string"==typeof t){var r=this.log.play_loadstream;r.timestamp=wU(),r.loadstream_url=t,r.offersdp=i,r.sessionId=n,this.logmanager.push(r)}},t.handlePlayerLoadedStream=function(e){var t=this.log.play_stream_loaded;t.timestamp=wU(),Object.assign(t,e),this.logmanager.push(t)},t.handleSEIParsed=function(e){var t=this.log,i=t.playing,n=t.first_frame;if(100===e.code){var r=function(e){var t,i,n,r,o,a;for(t="",n=e.length,i=0;i<n;)switch((r=e[i++])>>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[i++],t+=String.fromCharCode((31&r)<<6|63&o);break;case 14:o=e[i++],a=e[i++],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;i.sei_delay=a,i.sei_source=o.source,i.ntp_sync=this.options.ntp?1:0,i.ntp_delta=this.ntp_delta,n.first_sei_delay=a,n.ntp_sync=this.options.ntp?1:0,n.ntp_delta=this.ntp_delta}catch(Kl){}}},t.handleMetaDataLoaded=function(e,t){var i;this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=wU(),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=(i=t.codec,"undefined"!=typeof MediaSource?+MediaSource.isTypeSupported("video/mp4; codecs="+i):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=wU(),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=SU(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),(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 i=Number.parseInt(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=i,i}catch(Kl){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 i=this,n=i.player.plugins.rts||i.player.plugins.rtm,r=n&&n.pc,o={};return r?Promise.resolve(r.getStats()).then((function(t){return t.forEach((function(t){var n=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,x=t.concealedSamples,E=t.currentRoundTripTime,P=t.decoderImplementation,O=t.mimeType,I=t.freezeCount,L=t.totalFreezesDuration,D=t.totalPausesDuration;switch(n){case"inbound-rtp":"audio"===r?(o.audio_bytes_received=a-(i.cacheRtcStats.audioBytesReceived||0),i.cacheRtcStats.audioBytesReceived=a,o.audio_packets_lost=T-(i.cacheRtcStats.audioPacketsLost||0),o.audio_packets_received=s-(i.cacheRtcStats.audioPacketsReceived||0),i.cacheRtcStats.audioPacketsLost=T,i.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!==i.cacheRtcStats.totalSamplesReceived&&(o.audio_rec_sample_rate=(C-i.cacheRtcStats.totalSamplesReceived)/e),i.cacheRtcStats.totalSamplesReceived=C,o.concealed_samples=x,o.total_samples_received=C):(o.frames_dropped=d,o.iframes_decoded=f,o.video_bytes_received=a-(i.cacheRtcStats.videoBytesReceived||0),i.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!==i.cacheRtcStats.framesDecoded&&(o.video_decode_framerate=(g-i.cacheRtcStats.framesDecoded)/e),i.cacheRtcStats.framesDecoded=g,void 0!==i.cacheRtcStats.framesReceived&&(o.video_recv_framerate=(m-i.cacheRtcStats.framesReceived)/e),void 0!==i.cacheRtcStats.freezeCount&&(o.freeze_count=I-i.cacheRtcStats.freezeCount,o.freeze_duration=L-i.cacheRtcStats.totalFreezesDuration),i.cacheRtcStats.freezeCount=I,i.cacheRtcStats.totalFreezesDuration=L,i.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-(i.cacheRtcStats.videoPacketsLost||0),o.video_packets_received=s-(i.cacheRtcStats.videoPacketsReceived||0),o.video_fraction_lost=o.video_packets_lost/o.video_packets_received,i.cacheRtcStats.videoPacketsLost=T,i.cacheRtcStats.videoPacketsReceived=s,o.video_pli_count=S,o.decoder_name=P);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*E;break;case"codec":O.includes("video")?o.video_codec=O:o.audio_codec=r}o.total_delay=o.e2e_delay_ms+(o.video_decoded_delay_ms||0)+(o.video_jb_delay||0)})),Object.assign(i.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(Kl){return Promise.reject(Kl)}},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 i,n=t.log.playing.timestamp;t.inWaitingStart&&t.inWaitingStart<wU()&&(i=Math.min(t.options.playingInterval||t.log.playing.play_time,wU()-Math.max(t.inWaitingStart,n))),t.getPlayerQuality(),t.getPlayerBuffer(),t.options.downloadSpeedInterval||(t.log.playing.current_speed=t.getPlayerDownloadSpeed());var r=wU(),o=r-n,a=(i>200?i:0)+t.log.playing.stall_time,s=(i>200?1:0)+t.log.playing.stall_count;return t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=(i>t.options.aggregationDowngradeStallTime?i:0)+(t.log.playing.aggregation_downgrade_stall||0)),Object.assign(t.log.playing,pU({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(i){t.logmanager.push(Object.assign({},t.log.playing,pU({play_time:e?0:o},i)),!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(Kl){return Promise.reject(Kl)}},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 i=function(){if(Math.abs(Date.now()-e.log.playing.timestamp-t)<100||Date.now()-e.log.playing.timestamp>=t){var i=function(){if(e.player&&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(i&&i.then)return i.then((function(){}))}}();return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(Kl){return Promise.reject(Kl)}}),1e3),e.clearStallTimer(),e.handleVideoplaying(),e.started||e.reportStartPlay(),e.saveBuffered()}))}catch(Kl){return Promise.reject(Kl)}},t.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=wU(),this.player.config.autoplay&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.log.play_result.start=wU(),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=wU(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=wU(),this.log.stall_start.stall_start_time=wU(),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=wU();this.reportStartPlay(),this.log.first_frame.start=e},t.stallEnd=function(){this.clearStallTimer();var e=wU();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=wU(),this.log.playing.stall_count++,Object.assign(this.log.stall,pU({},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,pU({timestamp:wU(),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,pU(pU({timestamp:wU()},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=CU[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=wU()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=CU[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"===kU.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===kU.device&&window.removeEventListener("pagehide",this.handleUserLeave),PU.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._player=null),this.clearPlayingInterval(),this.clearStallTimer(),this.clearPlayResultTimer(),clearTimeout(this.collectDownloadSpeedTimer))},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(aV){}},t.getBuffered=function(){try{for(var e=[],t=this.player.video,i=0;i<t.buffered.length;i++)e.push([t.buffered.start(i),t.buffered.end(i)]);return e}catch(aV){}},t.reportPlayStop=function(){this.player&&(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=wU();Object.assign(this.log.first_frame,pU({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 i=t[0],n=t[t.length-1];return{dns_parse_time:Number.parseInt(i.domainLookupEnd-i.domainLookupStart),redirect:Number.parseInt(i.redirectEnd-i.redirectStart),ttfb:Number.parseInt(n.responseStart-n.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}}(this._url),t=wU();this.playedTime=t-this.log.start_play.start_play_time;var i=this.log.play_stop;Object.assign(i,pU({},0===i.stall_count&&{stall_time:0})),this.inWaitingStart&&t-this.inWaitingStart>200&&(i.stall_time+=t-this.inWaitingStart),this.inWaitingStart=0,Object.assign(i,pU({stall_time_per_100sec:i.stall_time/this.playedTime*100,stall_count_per_100sec:1e3*i.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,pU({timestamp:wU(),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=wU(),Object.assign(i,pU({timestamp:t,stop_time:t,duration:this.playedTime/1e3,play_time:this.playedTime/1e3},this.videoSize)),0===this.errorNumber&&(i.play_time_on_no_frame=i.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}(),LU=function(){return LU=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},LU.apply(this,arguments)};function DU(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){r={error:s}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function AU(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(DU(arguments[t]));return e}var MU,RU,NU,jU,BU=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 i=this;e&&t&&"function"==typeof t&&this.on(e,(function n(r){t(r),i.off(e,n)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var i=this._hooks[e].indexOf(t);-1!==i&&this._hooks[e].splice(i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,i){if(i){if(!e)return;-1!==this._cache.indexOf(i)?this._emit(e,t):(this._hooksCache.hasOwnProperty(i)||(this._hooksCache[i]={}),this._hooksCache[i].hasOwnProperty(e)||(this._hooksCache[i][e]=[]),this._hooksCache[i][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&AU(this._hooks[e]).forEach((function(e){try{e(t)}catch(i){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),UU=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},HU=(MU=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return MU+=1}),FU=function(e){var t=document.createElement("a");return t.href=e,t},VU=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,i=document.referrer,n=i?FU(i).hostname:"";!function(e){var t={};try{var i=FU(e).search;(i=i.slice(1)).split("&").forEach((function(e){var i,n,r=e.split("=");r.length&&(i=r[0],n=r[1]);try{t[i]=decodeURIComponent(void 0===n?"":n)}catch(o){t[i]=n}}))}catch(n){}}(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:i,referrer_host:n}},e.prototype.browser=function(){var e,t,i="",n=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(i="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),n=r.substring(e+5)):(e=r.indexOf("Edg"),n=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(i="Microsoft Internet Explorer",n=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(i="Lark",n=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(i="sougoubrowser",n=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(i="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),n=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),n=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(i="weixin",n=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(i="360browser",n=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),n=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),n=r.substring(e+12,e+15)),i="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(i="openlanguage xiaomi",n=r.substring(e+7,e+13)):(i="xiaomi",n=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(i="TTWebView",n=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(i="Chrome",n=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(i="qqbrowser",n=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(i="Safari",n=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(n=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(i="Firefox",n=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(i="weixin",n=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))?(i="qqbrowser",n=r.substring(e+3,e+8)):-1!==(e=r.indexOf("Opera"))&&(i="Opera",n=r.substring(e+6),-1!==(e=r.indexOf("Version"))&&(n=r.substring(e+8))),-1!==(t=n.indexOf(";"))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(" "))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(")"))&&(n=n.substring(0,t)),{browser:i,browser_version:n}},e.prototype.os=function(){for(var e="",t="",i=[{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)/}],n=0;n<i.length;n++){var r=i[n];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 i=e.exec(t);return i&&i[1]?i[1]:""},l=function(e,t){var i=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return i?i.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 i=navigator.userAgent.replace("Mozilla/5.0 (",""),n=i.indexOf(";");t=i.slice(0,n)}}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}(),zU=(RU=function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}return function t(i,n){function r(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({},n,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+"="+i.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("; "):[],n={},r=0;r<t.length;r++){var o=t[r].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=i.read(a,s),e===s)break}catch(l){}}return e?n[e]:n}},remove:function(t,i){r(t,"",e({},i,{expires:-1}))},withAttributes:function(i){return t(this.converter,e({},this.attributes,i))},withConverter:function(i){return t(e({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(i)}})}({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:"/"})}()},RU(NU={exports:{}}),NU.exports),GU=zU,WU=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}(),KU={getItem:function(e){try{var t=localStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(n){}return i||{}}catch(n){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,i)}catch(n){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){try{return GU.get(e,{domain:t||document.domain})}catch(i){return""}},setCookie:function(e,t,i,n){try{var r=n||document.domain,o=+new Date+i;GU.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(Kl){return!1}}()},$U={getItem:function(e){try{var t=sessionStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(n){}return i||{}}catch(n){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,i)}catch(n){}},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(Kl){return!1}}()},YU=function(){function e(e,t){this._storage=t&&"session"===t?$U:!e&&KU.isSupportLS?KU:new WU}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,i,n){this._storage.setCookie(e,t,i,n)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),qU={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},XU=void 0,JU=(new Date).getTimezoneOffset(),ZU=parseInt(""+-JU/60,10),QU=60*JU,eH=function(){function e(e,t){this.is_first_time=!0,this.initConfig=t,this.collect=e;var i=new VU(t.app_id).init(),n="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new YU(!1,"session"),this.localStorage=new YU(!1,"local");var r=this.localStorage.getItem(n);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(n,"1")),this.envInfo={user:{user_unique_id:XU,user_type:XU,user_id:XU,user_is_auth:XU,user_is_login:XU,device_id:XU,web_id:XU,user_unique_id_type:XU},header:{app_id:XU,app_name:XU,app_install_id:XU,install_id:XU,app_package:XU,app_channel:XU,app_version:XU,ab_version:XU,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:XU,traffic_type:XU,client_ip:XU,device_brand:XU,os_api:XU,access:XU,language:i.language,region:XU,app_language:XU,app_region:XU,creative_id:XU,ad_id:XU,campaign_id:XU,log_type:XU,rnd:XU,platform:i.platform,sdk_version:"0.0.3-lite",sdk_lib:"js",province:XU,city:XU,timezone:ZU,tz_offset:QU,tz_name:XU,sim_region:XU,carrier:XU,resolution:i.screen_width+"x"+i.screen_height,browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:XU,utm_content:XU,utm_source:XU,utm_medium:XU,utm_campaign:XU,custom:{},wechat_unionid:XU,wechat_openid:XU}},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,i){if("string"==typeof e&&"number"==typeof i){var n,r=[];i=i<=25?i:i%25;var o=String.fromCharCode(i+97);n=e.split(o);for(var a=0;a<n.length;a++){var s=parseInt(n[a],i);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)}(qU[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(i){"evtParams"===i?t.evtParams=LU({},t.evtParams||{},e.evtParams||{}):"_staging_flag"===i?t.evtParams=LU({},t.evtParams||{},{_staging_flag:e._staging_flag}):"reportErrorCallback"===i&&"function"==typeof e[i]?t.reportErrorCallback=e[i]:Object.hasOwnProperty.call(t.envInfo.user,i)?["user_id","web_id","user_unique_id"].indexOf(i)>-1&&(t.envInfo.user[i]=e[i]?String(e[i]):e[i]):Object.hasOwnProperty.call(t.envInfo.header,i)?t.envInfo.header[i]=e[i]:t.envInfo.header.custom[i]=e[i]}))},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"}(jU||(jU={}));var tH=jU;function iH(e,t,i,n,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"),i&&(c.timeout=i,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(i){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 nH=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new YU(!0),this.localStorage=new YU(!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(){i.reportAll(!1)})),this.collect.on(tH.Event,(function(e){i.event(e)})),this.collect.on(tH.BeconEvent,(function(e){i.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 i=AU(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),n)}}catch(r){}},e.prototype.beconEvent=function(e){var t=AU(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 i=0;i<e.length;i+=this.eventLimit){var n;n=e.slice(i,i+this.eventLimit);var r=this.split(this.merge(n));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.merge=function(e){var t=this,i=this.configManager.get(),n=i.header,r=i.user;n.custom=JSON.stringify(n.custom);var o=this.configManager.get("evtParams"),a=e.map((function(e){try{return Object.keys(o).length&&(e.params=LU({},o,e.params)),e.session_id=t.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(Kl){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:n}));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 i=this;e.length&&e.forEach((function(e){try{if(!e.length)return;n=i.reportUrl,r=e,o=i.timeout,a=function(e,t){},s=function(e,t){i.configManager.get("reportErrorCallback")(e,t)},!1,t&&window.navigator&&window.navigator.sendBeacon?window.navigator.sendBeacon(n,JSON.stringify(r))||s(n,r):iH(n,r,o,0,a,s,0,"",false)}catch(l){console.warn("something error, "+JSON.stringify(l.stack))}var n,r,o,a,s}))},e}(),rH=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},oH=function(){return rH().replace(/-/g,"").slice(0,19)},aH=function(){function e(){this.cacheToken={}}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new YU(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.collect.on(tH.ConfigUuid,(function(e){i.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"),i={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:""},n=oH();iH(t,i,3e5,0,(function(t){var i;t&&0===t.e?i=t.web_id:(i=n,e.collect.configManager.set({localWebId:n}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i})}),(function(){e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n}),e.collect.configManager.set({localWebId:n}),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,i=e.user_unique_id;t||i?(e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:i}),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),i=this.configManager.get("user_unique_id"),n=this.cacheToken&&this.cacheToken.user_unique_id;if(t===i&&t===n)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}(),sH=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 i=this;this.collect=e,this.storage=new YU(!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(){i.resetSessionId()})),this.collect.on(tH.SessionResetTime,(function(){i.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:sH(),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:sH(),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:sH(),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:sH(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),cH=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 BU,this.Types=tH,this.adapters.fetch=iH,this.adapters.storage=YU}return e.prototype.init=function(e){var t,i=this;this.inited?console.log("init can be call only one time"):e&&UU(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 eH(this,e),this.initConfig=e,e.disable_auto_pv&&(this.disableAutoPageView=!0),this.configManager.set({app_id:e.app_id}),this.eventManager=new nH,this.tokenManager=new aH,this.sessionManager=new lH,Promise.all([new Promise((function(e){i.once(tH.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once(tH.Start,(function(){e(!0)}))}))]).then((function(){i.sdkReady=!0,i.emit(tH.Ready),console.info("appid: "+e.app_id+", userInfo:"+JSON.stringify(i.configManager.get("user"))),console.info("appid: "+e.app_id+", sdk is ready, version is 0.0.3-lite, you can report now !!!"),i.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&&UU(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=LU({},e);t.user_unique_id;var i=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}(t,["user_unique_id"]);t.hasOwnProperty("user_unique_id")&&this.emit(tH.ConfigUuid,t.user_unique_id),this.configManager.set(i)}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 i=this;try{var n=[];Array.isArray(e)?e.forEach((function(e){n.push(i.processEvent(e[0],e[1]||{}))})):n.push(this.processEvent(e,t)),n.length&&(this.emit(tH.Event,n),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 i=[];i.push(this.processEvent(e,t||{})),i.length&&(this.emit(tH.BeconEvent,i),this.emit(tH.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var i=e;/^event\./.test(e)&&(i=e.slice(6));var r=t;"object"!=n(r)&&(r={}),r.event_index=HU();var o=void 0;return r.local_ms?(o=r.local_ms,delete r.local_ms):o=+new Date,{event:i,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,i){this.hook.emit(e,t,i)},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)},i=LU({},t,e);this.event("predefine_pageview",i)},e}(),uH=new cH("default");var hH,dH={name:"@byted/veplayer",version:"1.8.1",main:"index.min.js",module:"index.min.js",types:"index.d.ts",sideEffects:["*.css","*.less"],files:["index.min.css","index.d.ts"],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-fix-timeout-20231213030748","@byted/lux-core":"1.2.0","@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.37","@byted/xgplayer-encrypt":"3.5.23","@byted/xgplayer-encrypt-hls":"4.1.7","@byted/xgplayer-encrypt-mp4":"3.0.9","@byted/xgplayer-live-logger":"1.1.0-alpha.8","@byted/xgplayer-rts":"0.2.0-alpha.6","@byted/xgplayer-vod-menu":"3.0.9","@byted/xgplayer-xgvideo":"0.1.16","@datarangers/sdk-javascript":"0.0.3-lite","@dp/byted-tea-sdk-oversea":"^5.1.5","@volcengine/vestrategy":"^1.0.0","@volcengine/vestrategy-h265":"^1.0.0","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.12-alpha.5","xgplayer-flv":"3.0.10-alpha.4","xgplayer-hls":"3.0.10-alpha.4","xgplayer-service":"^0.5.0","xgplayer-subtitles":"3.0.10-alpha.4"},"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"]},fH=dH.dependencies||{},pH="veplayer_live_device_id",gH="veplayer_live_user_id",vH=function(e){return Math.floor((9*Math.random()+1)*Math.pow(10,e-1)).toString()},yH=function(e){u(n,e);var i=v(n);function n(){return a(this,n),i.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e,t,i,n,r,o=this;this.config.enable&&(this.config.appId?(this._userId=(null===(e=this.config)||void 0===e?void 0:e.userId)||((n=localStorage.getItem(gH))||(n=vH(12),localStorage.setItem(gH,n),n)),this._deviceId=(null===(t=this.config)||void 0===t?void 0:t.deviceId)||((r=localStorage.getItem(pH))||(r=vH(11),localStorage.setItem(pH,r),r)),this.openLog(this.config),null===(i=this.player.plugins)||void 0===i||null===(i=i.sdkerrorplugin)||void 0===i||i.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}}))):qs.warn("not found appid, logger is closed"))}},{key:"_createTea",value:function(e){uH.init({app_id:507365,channel:"sg"}),uH.start(),uH.config({user_unique_id:this._userId,device_id:this._deviceId})}},{key:"startLog",value:function(e){this._createTea(e),this._liveLogger=new OU({Tea:uH,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.8.1",flv_version:fH["xgplayer-flv"],hls_version:fH["xgplayer-hls"],rts_version:fH["@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}}}]),n}(Qr),mH=function(e){return e.HLS="hls",e.FLV="flv",e.XGVideo="XGVideo",e.HLSEncrypt="hlsEncrypt",e.DASH="dash",e.MP4Encrypt="mp4Encrypt",e.DanmuJS="danmujs",e.DanmuMask="danmuMask",e.StreamProbe="streamprobe",e.VeStrategy="vestrategy",e.VeStrategyH265="vestrategy_h265",e}(mH||{}),_H=dH.dependencies||{},bH=(c(hH={},"hls",{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:"xgplayer-hls@".concat(_H["xgplayer-hls"],"/dist/index.min.js")}),c(hH,"flv",{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:"xgplayer-flv@".concat(_H["xgplayer-flv"],"/dist/index.min.js")}),c(hH,"XGVideo",{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:"@byted/xgplayer-xgvideo@".concat(_H["@byted/xgplayer-xgvideo"],"/dist/index.min.js")}),c(hH,"hlsEncrypt",{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:"@byted/xgplayer-encrypt-hls@".concat(_H["@byted/xgplayer-encrypt-hls"],"/dist/index.min.js")}),c(hH,"dash",{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:"@byted/xgplayer-encrypt@".concat(_H["@byted/xgplayer-encrypt"],"/dist/index.min.js")}),c(hH,"mp4Encrypt",{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:"@byted/xgplayer-encrypt-mp4@".concat(_H["@byted/xgplayer-encrypt-mp4"],"/dist/index.min.js")}),c(hH,"danmujs",{name:"danmu.js",packageName:"danmu.js",devPath:"danmu.js@".concat(_H["danmu.js"],"/dist/index.js")}),c(hH,"danmuMask",{name:"DanmuMask",packageName:"@byted/danmu-mask",devPath:"@byted/danmu-mask@".concat(_H["@byted/danmu-mask"],"/browser/index.js")}),c(hH,"streamprobe",{name:"StreamProbe",pluginName:"Mp4EncryptPlayer",packageName:"@byted/streamprobe",devPath:"@byted/streamprobe@".concat(_H["@byted/streamprobe"],"/dist/index.min.js")}),c(hH,"vestrategy",{name:"VeStrategy",packageName:"@volcengine/vestrategy",devPath:"@volcengine/vestrategy@".concat(_H["@volcengine/vestrategy"],"/umd/vestrategy.production.js")}),c(hH,"vestrategy_h265",{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@volcengine/vestrategy-h265",devPath:"@volcengine/vestrategy-h265@".concat(_H["@volcengine/vestrategy-h265"],"/umd/vestrategy.strategy.h265.production.js")}),hH);function kH(e,t){return wH.apply(this,arguments)}function wH(){return wH=o(i().mark((function e(t,n){var r,a,s,l,c,u,h,d,f,p,g,v,y,m,k,w,T,S,C,x,E;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=t.isLive,s=void 0!==a&&a,l=t.type,c=t.isMobile,u=void 0!==c&&c,h=t.getSoftOptionTask,d=t.playerData,f=["default",TH(s)],p=d.openSoftDecoding,g=d.isMusic,v=d.configs,y=!(null===(r=d.playList)||void 0===r||null===(r=r[0])||void 0===r||!r.kid),m=gl(v,"EncryptHlsPlugin"),k=!!m||"hls"===l&&y,w=[],T=[],u?f.push(SH({isLive:s,playerData:n.playerData})):f.push(CH({isLive:s,playerData:n.playerData})),e.t0=l,e.next="flv"===e.t0?12:"rtm"===e.t0?14:16;break;case 12:return T.push(o(i().mark((function e(){var t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=8;break}if(!bl()&&!p){e.next=6;break}return e.next=4,n.sdkUmdLoader.loadPlugins(mH.FLV);case 4:t=e.sent,w.push(t);case 6:e.next=12;break;case 8:return e.next=10,n.sdkUmdLoader.loadPlugins(mH.FLV);case 10:r=e.sent,w.push(r);case 12:case"end":return e.stop()}}),e)})))()),e.abrupt("break",17);case 14:return T.push(o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([n.sdkUmdLoader.loadPlugins(mH.HLS),n.sdkUmdLoader.loadPlugins(mH.FLV)]);case 2:w.push(OM);case 3:case"end":return e.stop()}}),e)})))()),e.abrupt("break",17);case 16:return e.abrupt("break",17);case 17:return!g&&gl(n.playerData.options,"DanmuPlugin")&&T.push(o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([n.sdkUmdLoader.loadPlugins(mH.DanmuJS),n.sdkUmdLoader.loadPlugins(mH.DanmuMask)]);case 2:(t=e.sent)[0]&&t[1]&&w.push(LN);case 4:case"end":return e.stop()}}),e)})))()),gl(n.playerData.options,"Subtitle")&&n.playerData.plugins.every((function(e){return"subtitle"!==e.pluginName.toLowerCase()}))&&w.push(lU),e.next=21,Promise.all([h(),xH({isMobile:u,isLive:s,openSoftDecoding:p,type:l,isHlsEncrypt:k,playerData:n.playerData,plugins:w},n)].concat(T));case 21:return S=e.sent,C=_(S,2),x=C[0],E=C[1],e.abrupt("return",{presets:f,softDecodingOption:x,plugins:[].concat(w,b(E)).filter(Boolean)});case 26:case"end":return e.stop()}}),e)}))),wH.apply(this,arguments)}function TH(e){var t=[vR,cU,JM];return e&&t.push(dR,yH),l((function e(){a(this,e),this.plugins=t,this.ignores=["error"]}))}function SH(e){var t,i=e.isLive,n=e.playerData,r=["error","playbackRate"],o=n.configs,s=gl(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=[pR];return l((function e(){a(this,e),this.plugins=h,this.ignores=i?[].concat(u,r):[].concat(r)}))}function CH(e){var t,i=e.isLive,n=e.playerData,r=["cssfullscreen"],o=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue"],s=i?[HM]:[],c=n.configs,u=gl(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(FM)),l((function e(){a(this,e),this.plugins=s,this.ignores=i?[].concat(o,r):[].concat(r)}))}function xH(e,t){return EH.apply(this,arguments)}function EH(){return EH=o(i().mark((function e(t,n){var r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,T,S,C,x,E,P;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.isMobile,s=t.isLive,l=t.openSoftDecoding,c=t.type,u=t.isHlsEncrypt,h=t.playerData,d=t.plugins,f=[],p=h.configs,g=h.options,v=h.useHlsPluginForSafari,y=!(null===(r=h.playList)||void 0===r||null===(r=r[0])||void 0===r||!r.kid)||rl(null==p?void 0:p.getVideoByToken),"hls"!==c){e.next=29;break}if(!u){e.next=12;break}return e.next=8,n.sdkUmdLoader.loadPlugins(mH.HLSEncrypt);case 8:m=e.sent,f.push(m),e.next=29;break;case 12:if(!a){e.next=24;break}if(_=gl(g,"Subtitle"),b=s&&_,k=(bl()||window.WebAssembly)&&l,w=p.enableHlsMSE,!(k||b||w)){e.next=22;break}return e.next=20,n.sdkUmdLoader.loadPlugins(mH.HLS);case 20:T=e.sent,f.push(T);case 22:e.next=29;break;case 24:if(Tl&&!v){e.next=29;break}return e.next=27,n.sdkUmdLoader.loadPlugins(mH.HLS);case 27:S=e.sent,f.push(S);case 29:if(("dash"!==c||p.url)&&!gl(g,"DASHPlugin")){e.next=34;break}return e.next=32,n.sdkUmdLoader.loadPlugins(mH.DASH);case 32:null!=(E=e.sent)&&null!==(C=E.encryptUtils)&&void 0!==C&&null!==(x=C.isSupported)&&void 0!==x&&x.call(C)&&d.push(E);case 34:if(gl(g,"vodLogOpts")&&f.push(vD),h.enableMenu&&f.push(Xj),!(p.enableMp4MSE||gl(g,"Mp4EncryptPlayer")||["mp4","m4a"].includes(c)&&(y||null!=p&&null!==(o=p.autoBitrateOpts)&&void 0!==o&&o.isOpenAutoDefi||h.openSoftDecoding))){e.next=41;break}return e.next=39,n.sdkUmdLoader.loadPlugins(mH.MP4Encrypt);case 39:P=e.sent,f.push(P);case 41:return e.abrupt("return",f.filter((function(e){var t,i,n,r,o;return"encrypthlsplugin"===(null==e||null===(t=e.pluginName)||void 0===t?void 0:t.toLowerCase())?!(null==e||null===(n=e.isSupported)||void 0===n||!n.call(e))||(qs.warn("当前浏览器环境不支持HLS格式视频的加密播放"),!1):"dashplugin"!==(null==e||null===(i=e.pluginName)||void 0===i?void 0:i.toLowerCase())||(!(null==e||null===(r=e.encryptUtils)||void 0===r||null===(o=r.isSupported)||void 0===o||!o.call(r))||(qs.warn("当前浏览器环境不支持DASH格式视频播放"),!1))})));case 42:case"end":return e.stop()}}),e)}))),EH.apply(this,arguments)}function PH(){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 OH(){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 IH(){return(new DOMParser).parseFromString('<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="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 LH(){return(new DOMParser).parseFromString('<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="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 DH(){return(new DOMParser).parseFromString('<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="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 AH={startPlay:OH,play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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" viewBox="0 0 20 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:PH,refresh:ZM,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:mR,closeDanmu:yR,volumeLarge:IH,volumeMuted:LH,volumeSmall:DH},MH={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:yl(),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({},AH),flv:{retryCount:0},hls:{retryCount:3},gapJump:{smallGapLimit:1}},RH={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},NH={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 jH(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=t({},MH),n=t({},e?RH:NH);return t(t({},i),n)}var BH={startPlay:OH,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:PH,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:IH,volumeMuted:LH,volumeSmall:DH},UH={width:"100%",height:"100%",lang:yl(),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({},BH),flv:{innerDegrade:1,retryCount:0},hls:{innerDegrade:1,retryCount:3},gapJump:{smallGapLimit:1}},HH={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}},FH={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 VH(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=t({},UH),n=t({},e?HH:FH);return t(t({},i),n)}var zH=Qr.POSITIONS,GH=function(){function e(t){var i,n,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!==(i=null==o?void 0:o.mode)&&void 0!==i?i:Fs,this.isAutoChange=null!==(n=null==o?void 0:o.isAutoChange)&&void 0!==n&&n,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(nr,this.handleOrientationChange.bind(this)))}},{key:"handleOrientationChange",value:function(){var e,t,i,n=[90,-90,"90","-90"].includes(window.orientation);null!==(e=this.player)&&void 0!==e&&e.fullscreen&&n?this.changeMode(Vs):this.changeMode(null!==(t=null===(i=this.config)||void 0===i?void 0:i.mode)&&void 0!==t?t:Fs)}},{key:"changeConfig",value:function(e){this.config=e}},{key:"changeMode",value:function(e){this.mode=e,this.player.emit(LM.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=yn.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case Hs:var t=yn.createDom("div","",{},"xg-mobile-panel-content ".concat(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(t),this.showCancelBtn){var i="zh-cn"===this.player.lang?"zh":this.player.lang,n=yn.createDom("div",Gs[i],{},"xg-mobile-panel-cancel");this.root.appendChild(n)}this.container=t,t.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}));break;case Fs:this.container=this.root;break;case Vs:var r=yn.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(i().mark((function e(t){var n,r=this,o=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:"",o.length>2&&void 0!==o[2]&&o[2]&&yn.addClass(t,"item-list-panel-content"),this.setTitle(n),!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&&yn.hasClass(this.children,"item-list-panel-content")&&yn.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!==Fs?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}},{key:"renderTitle",value:function(e){return yn.createDom("div",e,{},"xg-mobile-panel-title")}},{key:"show",value:function(){this.isShow=!0,yn.removeClass(this.root,"hide"),yn.addClass(this.root,"active")}},{key:"hide",value:function(){this.isShow=!1,yn.removeClass(this.root,"active"),yn.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 i=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,i)}},{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(nr,this.handleOrientationChange.bind(this))}}]),e}();function WH(){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 KH=Qr.POSITIONS,$H=function(e){u(n,e);var i=v(n);function n(e){var t;return a(this,n),(t=i.call(this,e)).toastInfo={},t.playerData=null,t.playerData=e.player.config.playerData,t.dataMonitoring(),t}return l(n,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&Gi.subscribeProperty(this.playerData.current,"definition",(function(i,n){if(i!==n&&e.player){var r,o=e.playerData.current.lineId,a=(e.playerData.getDefinitionListByLineId(o)||[]).map((function(e,i){return t(t({},e),{},{itemIndex:i})})).find((function(e){return e.definition===n}));if(a&&a.url)"dash"===(e.player.config.playerData.getCurrentStreamType()||ol(null===(r=e.player.config.playerData)||void 0===r||null===(r=r.configs)||void 0===r?void 0:r.getVideoByToken)).toLowerCase()&&(a.url=a.itemIndex+""),e.player.changeDefinition(t(t({},a),{},{definition:n,url:a.url})),e.updatePanel(),e.player.emit(LM.INNER_DEFINITION_CHANGE,{from:i,to:n,url:a.url}),e.player.emit(LM.PlAY_URL_CHANGE,{url:a.url,from:LM.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:WH,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(){var e,t=this.playerData.current.lineId,i=this.playerData.getDefinitionListByLineId(t);null!==(e=this.player.config)&&void 0!==e&&e.alwaysShowDefinition&&(this.config.alwaysShowDefinition=!0),(i.length>1||this.config.alwaysShowDefinition)&&(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,i=this.playerData.getDefinitionListByLineId(t),n=yn.createDom("div","",{},"definition-panel-content");return i.forEach((function(t){var i=e.renderItem(t);n.appendChild(i)})),n}},{key:"renderItem",value:function(e){var t=this,i=this.playerData.current.definition,n=yn.createDom("div","",{},"panel-Item ".concat(i===e.definition?"select-in":""));return n.innerHTML=this.getShowText(this.i18n,e,i),n.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.config.showToastOnManualClick&&t.showToast(e,i),t.playerData.current.definition=e.definition})),n}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;return e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}},{key:"showToast",value:function(e,t){var i,n=this,r=null===(i=this.player)||void 0===i?void 0:i.getPlugin("sdkToastPlugin");if(r){var o=this.getShowText(this.i18n,e,t),a=r.add("".concat(this.langText.switching).concat(o,"..."),0,!0),s=Date.now();this.toastInfo[a]={showTime:s,delayClose:!1},this.toastInfo[a].timer=setTimeout((function(){var e;null!==(e=n.toastInfo[a])&&void 0!==e&&e.delayClose&&(r.remove(a),clearTimeout(n.toastInfo[a].timer),delete n.toastInfo[a])}),2e3);var l=function(){var e;n.toastInfo[a]&&(Date.now()-(null===(e=n.toastInfo[a])||void 0===e?void 0:e.showTime)>2e3?(r.remove(a),delete n.toastInfo[a]):n.toastInfo[a]&&(n.toastInfo[a].delayClose=!0))};this.player.once(sr,l),this.player.once(An,l)}}},{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:KH.CONTROLS_RIGHT,index:2.7,showToastOnManualClick:!0,alwaysShowDefinition:!1}}}]),n}(Qr);function YH(){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 qH=Qr.POSITIONS,XH=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).playerData=null,n.playerData=e.player.config.playerData,n.dataMonitoring(),n}return l(i,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&Gi.subscribeProperty(this.playerData.current,"definition",(function(t,i){if(t!==i&&e.player){var n=e.playerData.getCurrentUrl();e.player.changeDefinition({definition:i,url:n}),e.updatePanel(),setTimeout((function(){e.player.paused&&e.player.play()}),1e3)}}))}},{key:"registerIcons",value:function(){return{line:{icon:YH,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(),i=yn.createDom("div","",{},"line-panel-content");return t.forEach((function(t){var n=e.renderItem(t);i.appendChild(n)})),i}},{key:"renderItem",value:function(e){var t=this,i=this.playerData.current.lineId,n=yn.createDom("div","",{},"panel-Item ".concat(i===e.lineId?"select-in":""));return n.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,n.addEventListener("click",(function(i){i.stopPropagation(),i.preventDefault(),t.player.emit(LM.LINE_CHANGE,{from:t.playerData.current.lineId,to:e.lineId}),t.playerData.current.lineId=e.lineId,t.player.emit(IM.PLAYER_REBUILD)})),n}},{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:qH.CONTROLS_RIGHT,index:2.8}}}]),i}(Qr);function JH(){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 ZH=Qr.POSITIONS,QH=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).playerData=null,n.state={currentRate:1,isSupport:!0},n.playerData=e.player.config.playerData,n}return l(i,[{key:"registerIcons",value:function(){return{playbackRate:{icon:JH,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(Vn,(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=yn.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((function(i){var n=e.renderItem(i);t.appendChild(n)})),t}},{key:"renderItem",value:function(e){var t=this,i=U(e)?e:{textKey:e+"X",value:e},n=yn.createDom("div","",{},"panel-Item ".concat(this.state.currentRate===i.value?"select-in":""));return n.innerHTML=this.i18n[i.textKey]||i.textKey,n.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault(),t.emit(Vn,{from:t.player.playbackRate,to:i.value}),t.state.currentRate=i.value,t.player.playbackRate=i.value,t.updatePanel(),t.changeIconText()})),n}},{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,i=t%1==0?t.toFixed(1):t+"";switch(i.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}var n=this.find(".icon-text");n.style.transform="scale(".concat(e,")"),n.innerHTML=i}},{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:ZH.CONTROLS_RIGHT,index:2.9,list:[2,1.5,1.25,1,.75,.5],default:1}}}]),i}(Qr),eF=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 i=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():i.constructor.pluginName.toLowerCase()},configurable:!0},_emitter:{get:function(){return t.sdk._emitter},configurable:!0}})}},{key:"__destroy",value:function(){var e=this,t=this.sdk,i=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[i]}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.defineProperty(e,i,t[i])}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),tF={playAuthToken:"",needDefinitionList:!0},iF=function(e){u(d,e);var n,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(i().mark((function e(){return i().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(i().mark((function e(){var n,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,k,w,T,S,C,x,E;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!al(this.tokenInfo)){e.next=8;break}return qs.error("playAuthToken is expired, please check or update your playAuthToken"),this.sdk.emit(IM.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(!al(this.keyTokenInfo)){e.next=16;break}return qs.error("keyToken is expired, please check or update your keyToken"),this.sdk.emit(IM.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===(n=this.tokenInfo)||void 0===n||null===(n=n.Codec)||void 0===n?void 0:n.toLowerCase())||Hi.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||ol(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,x=S.Mp4EncryptPlayer,E=S.enableMp4MSE,(["mp4","m4a"].includes(y)&&this.isEncrypt||"mp4"===y&&null!=C&&C.isOpenAutoDefi||x||E)&&this.getMp4EncryptConfig(T)):qs.error("get no video by playAuthToken"),e.next=44;break;case 41:e.prev=41,e.t1=e.catch(0),qs.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(i().mark((function e(){var n,r,a=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){var t,i;try{100006===Oi(JSON.parse(e.response),"ResponseMetadata.Error.CodeN")&&(qs.error("playAuthToken is invalid or expired, please check or update your playAuthToken"),a.sdk.emit(IM.TOKEN_EXPIRED,e))}catch(r){qs.log(r)}null===(t=a._emitter)||void 0===t||t.emit(LM.GET_PLAY_URL_ERR,e);var n={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",ext:{},originError:e};null===(i=a.sdk)||void 0===i||i.delayError.push(n)},r=function(){var e=o(i().mark((function e(r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.config.playDomain||502!==(null==r?void 0:r.status)||!a.playerData.apiMap.backupPlayDomain){e.next=7;break}return a.playerData.playDomainDegrade=!0,e.next=4,ll((function(){return sl(t({playDomain:a.playerData.playDomain},a.config))}),a.retryCount,(function(e){return 502===e.status}),n);case 4:return e.abrupt("return",e.sent);case 7:n(r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=4,ll((function(){return sl(t({playDomain:a.config.playDomain||a.playerData.playDomain},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:(n=o(i().mark((function e(t,n,r){var o,a,s,l,c,u,h,d=this;return i().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,this.sdk.sdkUmdLoader.loadPlugins(mH.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,this.sdk.sdkUmdLoader.loadPlugins(mH.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,this.sdk.sdkUmdLoader.loadPlugins(mH.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,ml(pl(this.config.getDrmAuthToken(c,n,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=nl(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),qs.error("get privaterDrmToken fail");case 34:case"end":return e.stop()}}),e,this,[[24,31]])}))),function(e,t,i){return n.apply(this,arguments)})},{key:"getEncryptHlsConfig",value:function(e){var i,n=e||{},r=n.playList,o=n.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===(i=r[0])||void 0===i?void 0:i.kid;if(l)this.playerData.options.EncryptHlsPlugin=t({keyToken:l,playDomain:s||this.playerData.playDomain,getKeyType:c||"TOP"},u);else if(this.privateDrmAuthToken&&this.sessionId){var d=nl(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.playDomain},u)}}},{key:"getThumbnailConfig",value:function(e){var i=e[0],n=t({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=t({pic_num:i.CaptureNum,urls:i.StoreUrls,width:i.CellWidth,height:i.CellHeight,col:i.ImgXLen,row:i.ImgYLen},n)}},{key:"getBarrageMaskUrl",value:function(e){var i,n=t({},(null===(i=this.playerData.configs)||void 0===i||null===(i=i.DanmuPlugin)||void 0===i?void 0:i.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},n)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:t({maskUrl:e},n)}}},{key:"getDashPluginConfig",value:function(e){var i,n,r=e||{},o=r.vid,a=r.playList,s=void 0===a?[]:a,l=r.dashOpts,c=this.config.playDomain,u=t({},(null===(i=this.playerData.configs)||void 0===i?void 0:i.DASHPlugin)||{}),h=null==s||null===(n=s[0])||void 0===n?void 0:n.kid,d=l.Data.PlayInfoList.reduce((function(e,t){var i=t.Definition||t.Quality,n="",r=s.find((function(e){return e.Definition===i||e.Quality===i}));return r&&(n=r.definition),e[i]=n,e}),{});if(this.privateDrmAuthToken&&this.sessionId){var f=nl(this.privateDrmAuthToken),p=parseInt(f["X-Expires"]),g=isNaN(p)?30:p;this.playerData.options.DASHPlugin=t({playInfoType:"TOP",vid:o,dashOpts:l,defaultFormat:"dash",definitionText:d,useUnionInfoDRM:this.useUnionInfoDRM,kid:h,keyTokenExpiredDuration:g,sessionId:this.sessionId,drmKeyToken:this.privateDrmAuthToken,playDomain:c||this.playerData.playDomain},u)}else this.playerData.options.DASHPlugin=t({vid:o,dashOpts:l,playInfoType:"TOP",defaultFormat:"dash",definitionText:d},u)}},{key:"getMp4EncryptConfig",value:function(e){var i,n,r=e.playList,o=e.vid,a=this.config.playDomain,s=null==r||null===(i=r[0])||void 0===i?void 0:i.kid,l=t({},(null===(n=this.playerData.configs)||void 0===n?void 0:n.Mp4EncryptPlayer)||{});if(this.isEncrypt){if(this.privateDrmAuthToken&&this.sessionId){var c=nl(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.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=il(e.playAuthToken),e.keyToken){var t=vl(e.keyToken)?window.atob(e.keyToken):e.keyToken;this.keyTokenInfo=nl(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}(eF),nF={init:function(e){var t;if(e){var i=e.playerData.sdkPlugins;null!==(t=e.playerData)&&void 0!==t&&t.isLive?e.sdkPlugins=b(i):e.sdkPlugins=[iF].concat(b(i)),e._sdkPlugins={}}},registerPlugin:function(e,t){if(e&&t){var i=null,n=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),n.sdk=t;var r=n.pluginName||i.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 i(n);return o[r.toLowerCase()]=a,o[r.toLowerCase()].func=i,a&&"function"==typeof a.afterCreate&&a.afterCreate(),a}catch(s){qs.error(s)}}},unRegister:function(e,t){if(e&&t){e=e.toLowerCase();try{var i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(n){qs.error(n)}}},beforePlayerCreate:function(e){if(e){e._sdkPlugins||this.init(e);for(var t=e._sdkPlugins,i=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];if(t[o]&&t[o].beforePlayerCreate)try{var a=t[o].beforePlayerCreate();i.push(pl(a))}catch(Kl){throw i.push(pl(null)),Kl}}return new Promise((function(e){Promise.all([].concat(i)).then((function(){e(null)})).catch((function(t){qs.error(t),e(null)}))}))}},afterPlayerCreate:function(e){if(e)for(var t=e._sdkPlugins,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];if(t[r]&&t[r].beforePlayerCreate)try{t[r].afterPlayerCreate()}catch(Kl){throw Kl}}},destroy:function(e){if(e){for(var t=e._sdkPlugins,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.unRegister(r,e)}delete e._sdkPlugins}}},rF=[{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:"品質ログパラメータが正しく構成されていません"}}],oF=function(){function e(){a(this,e),this.umdMap=bH,this.backupUmdUrlMap={},this.region="sg",this.customPluginPublicPath=""}return l(e,[{key:"pluginPublicPath",get:function(){var e;return this.customPluginPublicPath||(null===(e=Sl(this.region))||void 0===e?void 0:e.__UMD_PRE_PATH__)}},{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(i,n){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(){n("url: ".concat(e))},r.onload=r.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r.onload=r.onreadystatechange=null,i())}}))}},{key:"loadPlugins",value:function(t,i){var n=this;return new Promise((function(r){var o="".concat(n.pluginPublicPath,"_").concat(t,"_load");if(Reflect.get(e.jsLoadMap,o))r(e.jsLoadMap[o]);else{var a,s=n.umdMap[t];if((null===(a=n.importedPlugins)||void 0===a?void 0:a.length)>0&&s.pluginName){var l=n.importedPlugins.find((function(e){return e.pluginName===s.pluginName}));if(l)return r(l)}var c=function(e){n.failCallback&&"function"==typeof n.failCallback&&n.failCallback&&n.failCallback(t,e),r(null)};if(!s)return qs.error("".concat(t," umd info not exit")),c(void 0);var u=s.name;if(s.devPath,u&&window[u])return e.jsLoadMap[o]=window[u],i&&i(),r(e.jsLoadMap[o]);var h=n.pluginPublicPath+"/"+t+".js";_l((function(){return n.loadExtraCdn(h,!0)}),2).then((function(){u?(e.jsLoadMap[o]=window[u],i&&i(),r(window[u])):(e.jsLoadMap[o]=!0,i&&i(),r(null))})).catch((function(a){var s,l=n.backupUmdUrlMap[t];return l?(s=l)&&s.indexOf&&/^(?:http|data:|\/)/.test(s)?void n.loadExtraCdn(n.backupUmdUrlMap[t]).then((function(){e.jsLoadMap[o]=window[u],i&&i(),r(e.jsLoadMap[o])})).catch((function(e){qs.error("load ".concat(t," error, ").concat(e)),c(void 0)})):(qs.error("umdMap.".concat(t," isn't a valid url")),c(void 0)):(qs.error("load ".concat(t," error, ").concat(a)),c(a))}))}}))}}]),e}(),aF=oF;aF.jsLoadMap={};var sF=function(){function e(t,i){a(this,e),this.url=t;var n=new window.XMLHttpRequest;n.target=this,n.responseType="arraybuffer",n.open("get",t),n.onload=function(){200!==n.status&&206!==n.status||i&&i instanceof Function&&i(n.response)},n.onerror=function(e){},this.xhr=n,this.run()}return l(e,[{key:"cancel",value:function(){this.xhr.abort()}},{key:"run",value:function(){1===this.xhr.readyState&&this.xhr.send()}}]),e}(),lF={ORDER:"order",SLOOP:"sloop",LOOP:"loop",RANDOM:"random"},cF="xgplayer-music";function uF(e,t,i){var n=Math.floor(Math.random()*(t-e)+e);return n===i?(n>t/2?t/=2:e=t/2,t-e>2?uF(e,t,i):n):n}var hF=function(e){u(n,e);var i=v(n);function n(){var e;return a(this,n),(e=i.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===lF.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),i=t.config,n=t.player;if(!e.halfPass&&n.currentTime>n.duration/2&&e.confirmOrder(),i.abCycle){var r=i.abCycle,o=r.end>n.duration?n.duration:r.end;n.currentTime>=o?(r.loop||(n.pause(),e.emit("abCycle_ended")),n.currentTime=r.start||0):n.currentTime<r.start&&(n.currentTime=r.start||0)}},e}return l(n,[{key:"afterCreate",value:function(){var e,t,i,n,r,o,a=this.player,s=this.playerConfig;(yn.addClass(a.root,cF),this.halfPass=!1,this.list=this.config.list||[],this.emit(LM.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!==(i=null===(n=this.list)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.title)&&void 0!==i?i:"");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(Nn,this._onTimeUpdate),this.on(Ln,this._onEnded),this.on(Un,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){qs.error(e)}))}},{key:"destroy",value:function(){yn.removeClass(this.player.root,cF)}},{key:"_nextCompute",value:function(){if(!this.disable)switch(this.mode){case lF.SLOOP:this.nextIndex=this.index;break;case lF.ORDER:case lF.LOOP:this.index+1<this.list.length?this.nextIndex=this.index+1:this.nextIndex=0;break;default:this.nextIndex=uF(0,this.list.length,this.index)}}},{key:"_prevCompute",value:function(){if(!this.disable)switch(this.mode){case lF.SLOOP:this.nextIndex=this.index;break;case lF.ORDER:case lF.LOOP:this.index-1>=0?this.prevIndex=this.index-1:this.prevIndex=this.list.length-1;break;default:this.prevIndex=uF(0,this.list.length,this.index)}}},{key:"_emitChange",value:function(){this.emit(LM.MUSIC_CHANGE,this._curInfo)}},{key:"_initABCycle",value:function(e,t){var i=t.plugins.progresspreview;if(e&&t){var n=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:n-r,text:e.text,color:e.color};i.findDot(o.id)?i.updateDot(o):i.createDot(o)}else i.findDot(t.playerId)&&i.deleteDot(t.playerId)}},{key:"random",value:function(){if(this.list.length<0)return null;var e=uF(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(LM.MUSIC_LIST_CHANGE,this.list)}},{key:"remove",value:function(e){var t=-1;this.list.every((function(i,n){return i.vid!==e||(t=n,!1)})),t>-1&&(this.list.splice(t,1),this.emit(LM.MUSIC_LIST_CHANGE,this.list)),this.disable=!(this.list.length>0)}},{key:"setAbCycle",value:function(e,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e&&"Object"===yn.typeOf(e)?this.config.abCycle=t({},e):this.config.abCycle=t({start:e||0,end:i||this.player.duration,loop:n},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(LM.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,i=this.list,n=this.index,r=i[n].vid;this.halfPass=!1,this.checkOffline(i[n].src,r).then((function(i){e._curInfo={title:e.list[e.index].title||"",vid:e.list[e.index].vid,poster:e.list[e.index].poster||"",src:i.url},t.playNext({url:i.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 i=this;return new Promise((function(n,r){if(!i.config.offline||i.disable)return n({url:e,code:-1,vid:t});var o=i.player.database;o.openDB((function(){o.getDataByKey(o.myDB.ojstore.name,t,(function(i){setTimeout((function(){o.closeDB()}),5e3),n(i?{url:URL.createObjectURL(i.blob),code:0,vid:i.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],i=this.player;this.checkOffline(t.src,t.vid).then((function(e){if(-2===e.code){var n=t.vid;new sF(t.src,(function(e){i.database.openDB((function(){i.database.addData(i.database.myDB.ojstore.name,[{vid:n,blob:new Blob([e],{type:'audio/mp4; codecs="mp4a.40.5"'})}]),setTimeout((function(){i.database.closeDB()}),5e3)}))}))}}))}}},{key:"timeScale",get:function(){return this.config.timeScale||15},set:function(e){this.config.timeScale=e,this.emit(LM.TIME_SCALE_CHANGE,e)}},{key:"mode",get:function(){return this.config.mode||lF.RANDOM},set:function(e){Object.values(lF).includes(e)&&(this.config.mode=e,this.emit(LM.MUSIC_MODE_CHANGE,e))}}],[{key:"pluginName",get:function(){return"music"}},{key:"defaultConfig",get:function(){return{offline:!1,preloadNext:!0,abCycle:null,timeScale:15,mode:lF.ORDER,list:[]}}},{key:"ModeType",get:function(){return Object.keys(lF).map((function(e){return lF[e]}))}}]),n}(Vr),dF=function(e){u(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i,[{key:"afterCreate",value:function(){var e=this;this.on(LM.MUSIC_CHANGE,(function(t){if(t&&t.poster){var i=e.find("img");i?i.src=t.poster:e.root.innerHTML="<img src=".concat(t.poster,' alt=""/>'),e.show()}else e.hide()}))}},{key:"render",value:function(){var e,t,i=this.playerConfig;return i.poster||null!=i&&null!==(e=i.url)&&void 0!==e&&e[0].poster?'<xg-icon class="xgplayer-cover">\n <img src="'.concat(i.poster||(null==i||null===(t=i.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}}}]),i}(Qr);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="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 pF=function(e){u(i,e);var t=v(i);function i(){var e;return a(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=p(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.backward()},e}return l(i,[{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(LM.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicBackward:{icon:fF,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}}}]),i}(Qr),gF=function(e){u(i,e);var t=v(i);function i(){var e;return a(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=p(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.prev()},e}return l(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(LM.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}}}]),i}(Qr);function vF(){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 yF=function(e){u(i,e);var t=v(i);function i(){var e;return a(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=p(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.forward()},e}return l(i,[{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(LM.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicForward:{icon:vF,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}}}]),i}(Qr),mF=function(e){u(i,e);var t=v(i);function i(){var e;return a(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=p(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.next()},e}return l(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(LM.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}}}]),i}(Qr),_F=function(e){u(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i,[{key:"afterCreate",value:function(){var e=this;this.on(LM.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}}}]),i}(Qr);function bF(){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 kF(){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 wF(){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 TF(){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 SF=function(e){u(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i,[{key:"afterCreate",value:function(){var e,t=this;if(m(h(i.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(LM.MUSIC_MODE_CHANGE,(function(e){t.animate(e)}));var n=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(n),this.updateVisible(),this.on(LM.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:bF,class:"xg-icon-order"},loop:{icon:kF,class:"xg-icon-loop"},sloop:{icon:TF,class:"xg-icon-sloop"},random:{icon:wF,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 i=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,n=hF.ModeType.findIndex((function(e){return e===i})),r=0;n+1<hF.ModeType.length&&(r=n+1),this.player.plugins.music.mode=hF.ModeType[r]}},{key:"animate",value:function(e){switch(e){case lF.ORDER:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order");break;case lF.LOOP:this.setAttr("data-state","loop"),this.changeLangTextKey(this.find(".xg-tips"),"loop");break;case lF.SLOOP:this.setAttr("data-state","sloop"),this.changeLangTextKey(this.find(".xg-tips"),"sloop");break;case lF.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}}}]),i}(Qr);function CF(){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 xF(){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 EF,PF=l((function e(i,n){a(this,e),function(e){if("Object"!==yn.typeOf(e.controls))e.controls={mode:"flex",initShow:!0};else{var i=e.controls;e.controls=t({mode:"flex",initShow:!0},i)}var n=e.play||{};e.play=t({index:3},n),e.marginControls=!0,e.icons=t({play:CF,pause:xF},e.icons||{})}(n);var r="mobile"===Sn.device;this.plugins=[hF,_F,dF].concat(b(r?[]:[pF,gF,yF,mF,SF])),this.ignores=["start","cssFullScreen","fullscreen","pip","enter","replay","pc","loading","poster","error","playbackrate","mobile"]})),OF=function(e){return e.H265="h265",e}(OF||{}),IF=function(){function e(){a(this,e),this.status=0,this.initUmdLoader()}var n,r,s,c;return l(e,[{key:"initUmdLoader",value:function(){this.sdkUmdLoader=new aF}},{key:"fetchWebId",value:(c=o(i().mark((function n(){var r,o,a=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(null===(r=this.config)||void 0===r||!r.deviceId){i.next=2;break}return i.abrupt("return",Promise.resolve(null===(o=this.config)||void 0===o?void 0:o.deviceId));case 2:return i.abrupt("return",new Promise((function(t){var i=new Lu;i.init({app_id:e.TEA_ID,channel:"sg"}),i.start(),i.getToken((function(e){return t(null==e?void 0:e.web_id)}))})).then((function(e){return a.config=t(t({},a.config),{},{deviceId:e}),a.webId})));case 3:case"end":return i.stop()}}),n,this)}))),function(){return c.apply(this,arguments)})},{key:"fetchVeStrategy",value:(s=o(i().mark((function e(){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.Module){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.sdkUmdLoader.loadPlugins(mH.VeStrategy).then((function(e){e&&(n.config=t(t({},n.config),{},{Module:e}))})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"fetchStrategies",value:(r=o(i().mark((function n(){var r,a=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r={},n.next=3,Promise.all(Object.keys(this.config.strategies).map(function(){var n=o(i().mark((function n(o){var s;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a.config.strategies[o]){i.next=2;break}return i.abrupt("return");case 2:if(!0===a.config.strategies[o]&&(a.config.strategies[o]={}),!a.config.strategies[o].Strategy){i.next=7;break}r[o]=a.config.strategies[o],i.next=11;break;case 7:return i.next=9,a.sdkUmdLoader.loadPlugins(e.mapStrategyNameToUmdKey(o));case 9:(s=i.sent)&&(r[o]=t(t({},a.config.strategies[o]),{},{Strategy:s}));case 11:case"end":return i.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()));case 3:return this.config.strategies=r,n.abrupt("return",r);case 5:case"end":return n.stop()}}),n,this)}))),function(){return r.apply(this,arguments)})},{key:"initOnce",value:(n=o(i().mark((function e(n){var r,o,a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&n.appId){e.next=2;break}return e.abrupt("return");case 2:return this.status=1,this.config=n,e.prev=4,e.next=7,Promise.all([this.fetchWebId(),this.fetchVeStrategy()]);case 7:return e.next=9,this.fetchStrategies();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(4);case 13:if(r=this.config,o=r.appId,a=r.deviceId,s=r.Module,!(o&&a&&s)){e.next=20;break}return e.next=17,s.bootstrap(t(t({},this.config),{},{logger:qs}));case 17:this.status=2,e.next=21;break;case 20:this.status=3;case 21:return e.abrupt("return",this.isReady());case 22:case"end":return e.stop()}}),e,this,[[4,11]])}))),function(e){return n.apply(this,arguments)})},{key:"init",value:function(e){return this.initPromise||(this.initPromise=this.initOnce(e)),this.initPromise}},{key:"prepare",value:function(){return this.initPromise||Promise.resolve(this.isReady())}},{key:"getDeviceId",value:function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId}},{key:"isReady",value:function(){return 2===this.status}},{key:"getStrategyRecommendations",value:function(){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};var e=this.config.Module.rec(void 0);return qs.log("strategy recommendations:",e),e}},{key:"isHevcRecommended",value:function(){var e;return!(null===(e=this.getStrategyRecommendations().result)||void 0===e||null===(e=e.h265)||void 0===e||!e.enableH265Hardware)}}],[{key:"mapStrategyNameToUmdKey",value:function(e){return"h265"===e?mH.VeStrategyH265:null}}]),e}(),LF=IF;LF.TEA_ID=null===(EF=Sl())||void 0===EF?void 0:EF.__LOG_TEA_ID__;var DF=new LF,AF=["plugins"];window&&!window.Player&&(window.Player=Rs);var MF=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.vodLogCommon={},this._init(t)}var r,s,h,d,p,g,y;return l(e,[{key:"_init",value:function(e){this.playerData=new _D(e),this.initUmdLoader(e),this._emitter=new hn,this.on(IM.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;nF.init(this),b(this.sdkPlugins).map((function(t){return nF.registerPlugin(t,e)}))}},{key:"initCheckExpire",value:function(){var e=this;this.checkExpireTimer=new dl,this.checkExpireTimer.repeat((function(){e.onRepeat()}),this.playerData.checkExpireInterval)}},{key:"initUmdLoader",value:function(e){var t=this;this.sdkUmdLoader=new aF,this.sdkUmdLoader.failCallback=function(e,i){return t.umdLoadErr(e,i)},e.umdUrlMap&&"object"===n(e.umdUrlMap)&&this.sdkUmdLoader.updateBackupMap(e.umdUrlMap),this.sdkUmdLoader.region=this.playerData.region,e.pluginPublicPath&&"string"==typeof e.pluginPublicPath&&(this.sdkUmdLoader.customPluginPublicPath=e.pluginPublicPath),this.sdkUmdLoader.importedPlugins=e.plugins}},{key:"checkVodLogOptions",value:function(){var e=this.playerData,t=e.isLive,i=e.configs,n=gl(i,"vodLogOpts");if(!(t||i.disableVodLogOptsCheck||null!=n&&n.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(IM.UMD_LOAD_FAIL,{name:e,error:t})}},{key:"onRepeat",value:function(){var e,t=this,i=this.playerData.expireDetectType;i.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()));i.indexOf("xhrStatus")>-1&&this._playOriginalUrl&&Math.random()<1/7.5&&new fl({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 i,n=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=k(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}(new URL(e).searchParams);try{for(n.s();!(i=n.n()).done;){var r=_(i.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){n.e(h)}finally{n.f()}}catch(h){qs.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){qs.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,i=e.root,n=document.createElement("div");this.playerContainer=n;var r=i||document.querySelector("#".concat(t));r&&(r.appendChild(n),this.mountingDom=r)}},{key:"renderPoster",value:function(){if(this.playerContainer){var e=this.playerData.options,t=e.poster,i=void 0===t?"":t,n=e.width,r=e.height;i&&(this.playerContainer.style.cssText='background: url("'.concat(i,'");\n background-size: cover;\n width:').concat(n?n+"px":"100%",";\n height:").concat(r?r+"px":"100%",";\n "))}}},{key:"createPlayer",value:(y=o(i().mark((function e(){var n,r,a,s,l,c,u,h,d,p,g,v,y,m,_,k,w,T,S,C,x,E,P,O,I,L,D,A,M,R,N,j,B,U,H,F,V,z,G,W,K=this;return i().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,p=u.plugins,g=u.isMobile,v=u.openSoftDecoding,y=u.configs,m=u.isMusic,_=u.strategiesPlugins,k=u.strategiesPluginConfigs,w=this.playerData.getCurrentUrl(),T=this.playerData.getCurrentStreamType()||ol(null==y?void 0:y.getVideoByToken),gl(y,"EncryptHlsPlugin")||w&&T||m?(this._playOriginalUrl=w,this.getUrlTimestamp(w)):(qs.warn("url is empty or streamType is empty (url:".concat(w,", streamType: ").concat(T,")")),this.renderPoster()),S={defaultDefinition:null===(n=this.playerData.playList[0])||void 0===n?void 0:n.definition,list:this.playerData.playList},C=function(){var e=o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K.getSoftDecodingOption(v,w,T);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,kH({isLive:h,isMobile:g,type:T,playerData:this.playerData,getSoftOptionTask:C},this);case 13:return x=e.sent,E=x.presets,P=x.softDecodingOption,O=x.plugins,I=g?VH(h):jH(h),L=this._analyzeExtendPlugins(),D=L.basicPlugins,A=void 0===D?[]:D,M=L.iconPlugins,R=void 0===M?[]:M,N=this.playerData.getLineList(),j=this.playerData.current.lineId,this.playerData.getDefinitionListByLineId(j),U=(B=P||{}).plugins,H=void 0===U?[]:U,F=f(B,AF),V=t(t(t(t(t({},I),d),F||{}),{},{definition:S,icons:t(t(t({},I.icons),m?{play:CF,pause:xF}:{}),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(R),[QH,$H])}},k),{},{playerData:this.playerData}),N.length>1&&V.MoreButtonPlugin.iconPlugins.push(XH),this.setDefaultConfigOptions(V),z=Cl([].concat(b(A),b(p),b(O),b(H),b(_))),G=(null!==(l=null==V?void 0:V.ignores)&&void 0!==l?l:[]).some((function(e){return"sdkunmuteplugin"===(e+"").toLowerCase()})),V.ignores=[].concat(b(null!==(c=null==V?void 0:V.ignores)&&void 0!==c?c:[]),b(G?["AutoplayPlugin"]:[]),b(m?["sdkErrorPlugin","sdkToastPlugin","MoreButtonPlugin","DanmuPlugin","AutoplayPlugin"]:[])),this._isFirstCreated?this._isFirstCreated=!1:(V.autoplayMuted=!1,V.ignores=[].concat(b(null!==(W=null==V?void 0:V.ignores)&&void 0!==W?W:[]),["sdkUnmutePlugin"])),this.setPluginConfig(V),this.player=new Rs(t(t(m?{el:this.playerContainer,controls:{mode:"flex",initShow:!0},marginControls:!0,presets:[].concat(b(E),[PF]),mediaType:["mp4","m4a","hls"].includes(T)?"video":"audio",url:w}:{el:this.playerContainer,presets:E,url:w,isLive:h},V),{},{plugins:b(z)})),this.player.playerData=this.playerData,this.player.sdk=this,this._emitter.emit(IM.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),e.abrupt("return",this.player);case 37:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"setPluginConfig",value:function(e){var i,n=this.playerData,r=n.apiMap,o=n.configs,a=n.unionInfo,s=n.playList,l=n.useHlsPluginForSafari,c=n.isMobile,u=this.playerData.getCurrentStreamType()||ol(null==o?void 0:o.getVideoByToken),h=gl(o,"EncryptHlsPlugin"),d=gl(o,"Mp4EncryptPlayer"),f=gl(o,"DASHPlugin"),p=gl(o,"vodLogOpts"),g=!(null==s||null===(i=s[0])||void 0===i||!i.kid)||!!h;if(h&&(e.EncryptHlsPlugin=t(t({playDomain:r.playDomain,getKeyType:"TOP"},c||!Tl||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){qs.log("codec",this.playerData.codec);var v=Sl(this.region),y=null==v?void 0:v.__LOG_CUSTOM_REGION__;e.vodLogOpts=t(t({vtype:(u||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:g?1:0,playerVersion:"1.8.1",channel:null==v?void 0:v.__LOG_CHANNEL__,needXhrCheck:!0},y?{trackerConfig:{log_from_region:null==v?void 0:v.__LOG_CUSTOM_REGION__}}:{}),{},{ext:this.vodLogCommon},p)}}},{key:"detectCodec",value:(g=o(i().mark((function e(t){var n,r,o,a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.sdkUmdLoader.loadPlugins(mH.StreamProbe);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(n=e.t0,!(r=n.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=Hi.H265:"avc"===s&&(this.playerData.codec=Hi.H264);case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),qs.warn("detect codec error: ",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return g.apply(this,arguments)})},{key:"setDefaultConfigOptions",value:function(e){if(this._isFirstCreated){var i=this.playerData,n=i.defaultConfig,r=i.isHitDefault;if(n){var o=null!=n?n:{},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,i,n=this.playerData,r=n.isLive,o=n.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!==(i=this.player.currentTime)&&void 0!==i?i:0);return t({},s)}},{key:"_analyzeExtendPlugins",value:function(){var e,t=this.playerData.options,i=t.extendPlugin||[],n=null!==(e=null==t?void 0:t.ignore)&&void 0!==e?e:[],r=[],o=[];return i.forEach((function(e){var t=function(e){var t="mobile"===Sn.device,i=e.pluginName,n=void 0===i?"ExtendPlugin".concat(Math.random().toString().slice(-5)):i,r=e.type,o=void 0===r?t?"inner":"normal":r,s=e.position,h=void 0===s?zH.CONTROLS_LEFT:s,d=e.icon,f=void 0===d?mR: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(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i,[{key:"afterCreate",value:function(){var e;this.appendChild(".xgplayer-icon",this.icons[n]),this.initEvents(),m&&null!==(e=this.player)&&void 0!==e&&e.fullscreen&&this.handleFullScreenChange()}},{key:"registerIcons",value:function(){return c({},n,{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({},n,b)}},{key:"initEvents",value:function(){this.handleCallback=uR(this.handleCallback.bind(this),200);var e,t="mobile"===Sn.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),m&&(null===(e=this.player)||void 0===e||e.on(nr,this.handleFullScreenChange.bind(this)))}},{key:"handleFullScreenChange",value:function(){var e,t=this.player;null===(e=this.player)||void 0===e||e.changePluginsIcon(n,!(null!=t&&t.fullscreen))}},{key:"handleCallback",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.emit(LM.PLAYER_EXTEND_BUTTON,n))}},{key:"destroy",value:function(){var e;this.unbind(["touchend","click"],this.handleCallback),m&&(null===(e=this.player)||void 0===e||e.off(nr,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(n,'">').concat(this.langText[n],"</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 n}},{key:"defaultConfig",get:function(){return{position:h,index:g}}}]),i}(Qr)}(e);"inner"!==t.type||n[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}},{key:"beforePlayerCreate",value:(p=o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([nF.beforePlayerCreate(this),this.prepareStrategies()]);case 2:this.updateConfigByStrategy();case 3:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"prepareStrategies",value:(d=o(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,DF.prepare();case 2:e.sent?(t=DF.getStrategyRecommendations(),n=t.plugins,r=t.pluginConfiguration,this.playerData.strategiesPlugins=n,this.playerData.strategiesPluginConfigs=r):(this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={});case 4:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"updateConfigByStrategy",value:function(){if(DF.isReady()){var e=DF.getStrategyRecommendations().result;if(qs.log("vodLogCommon strategyConfig:",e),this.vodLogCommon={strategyResult:e},null!=e&&e[OF.H265]){var i=this.playerData.configs;if(!i)return;var n=i.url,r=i.codec,o=i.playList,a=void 0===o?[]:o,s=a.filter((function(e){return!e.codec||e.codec===Hi.UNKNOWN})),l=a.filter((function(e){return e.codec===Hi.H264})),c=a.filter((function(e){return e.codec===Hi.H265})),u=e[OF.H265].enableH265Hardware,h=Ui(u?c.concat(l).concat(s):l.concat(s).concat(c),"definition"),d=!u&&!!n&&r===Hi.H265&&h.length>0;this.playerData.initPlayData(t(t({},this.playerData.configs),{},{url:d?null:n,codec:d?Hi.UNKNOWN:r,playList:h})),qs.log("hit h265strategy, current playList: ",this.playerData.playList)}}}},{key:"afterPlayerCreate",value:function(){var e=this.playerData.isMobile;this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),nF.afterPlayerCreate(this),this.emitDelayError()}},{key:"emitDelayError",value:function(){var e=this;setTimeout((function(){e.player&&e.delayError.forEach((function(t){var i=new Pn(e.player,t);e.player.emit("error",i)})),e.delayError=[]}),0)}},{key:"_setPlayerInfo",value:function(){var e;if(this.player){this.player.playerVersion="1.8.1";var t,i=this.playerData.getCurrentStreamType()||ol(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=i,"hls"===(null==i?void 0:i.toLowerCase())&&null!==(t=this.player)&&void 0!==t&&t.vodLogger&&(this.player.vodLogger.vtype="HLS")}}},{key:"_mountingPlayerPanel",value:function(e){var t,i=this.playerData,n=i.options,r=i.isLive;this.player&&e&&(this.mobilePanel=new GH({config:null!==(t=n.panel)&&void 0!==t?t:{mode:r?Fs:Hs,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}},{key:"_bindPlayerEvents",value:function(){this.player&&(this.player.on(IM.PLAYER_REBUILD,this.createPlayer.bind(this)),this.player.on(LM.MEDIA_EXPIRED,this.onMediaExpiredAction.bind(this)),this.player.once(Zn,this.emitDelayError.bind(this)))}},{key:"onMediaExpiredAction",value:function(){var e,t,i=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 n=pl(this.playerData.onMediaExpired());null!=n&&n.then&&n.then((function(e){return i.playNext(e)}))}}},{key:"onTokenExpiredAction",value:function(){var e,t,i=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 n=pl(this.playerData.onTokenExpired());null!=n&&n.then&&n.then((function(e){return i.updateAuthToken(e)}))}}},{key:"_bindSdkEvents",value:function(){var e=this;[].concat(b(Object.values(LM)),b(Object.values(IM)),b(Object.values(Tr))).forEach((function(t){"string"==typeof t&&e.player.on(t,(function(){for(var i,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(i=e._emitter).emit.apply(i,[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(IM.PLAYER_REBUILD,this.createPlayer.bind(this))}},{key:"changePluginsIcon",value:function(e,t){var i;if(this.player){var n=this.player.getPlugin(e);if(n&&null!=n&&n.root){var r=yn.hasClass(null==n?void 0:n.parent,"panel-icon-svg")?null==n||null===(i=n.parent)||void 0===i?void 0:i.parentNode:null==n?void 0:n.root;r&&(t?yn.show(r,"block"):yn.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 i=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n?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(n,c){o?(i.player.addClass(no.ENTER),o.switchAuthToken(e).then((function(){var e,o=i.playerData.getCurrentUrl();i._playOriginalUrl=o;var u={defaultDefinition:null===(e=i.playerData.playList[0])||void 0===e?void 0:e.definition,list:i.playerData.playList};if(l&&(l.config=l.getConfig(i.player),l.renderItemList(),l.canChange=!0),i.player){var h=t(t({},i.playerData.options),{},{definition:u,startTime:r,url:o});if(i.player.playNext(h),6===s)i.player.once(Bn,(function(){a&&i.player.pause(),n()}));else{var d=h.autoplay||h.autoplayMuted;i.player.once(Bn,(function(){d?i.player.play():i.player.pause(),n()}))}}else qs.error("no player created"),c()}))):(qs.error("current is not playAuthToken play"),c())}))}},{key:"updateAuthToken",value:function(e){var i=this,n=this.player.config,r=this.getSdkPlugin("AuthToken");return new Promise((function(o,a){r?r.switchAuthToken(e).then((function(){var e=i.playerData.getCurrentUrl();if(i._playOriginalUrl=e,i.getUrlTimestamp(e),i.player){i.player.resetState(),i.player.setConfig(t(t(t({},n),i.playerData.options),{},{url:e}));var r=i.player.start(e);r&&r.then?r.then((function(){return o()})):o()}else qs.error("player not created"),a()})):(qs.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 i=this.player.switchURL(e,!1),n=this.player.currentTime;return i&&i.then?i:new Promise((function(e){var i=t.player.paused&&!t.player.isError,r=function(){t.player.currentTime=n,i&&t.player.once(Bn,(function(){t.player.pause()})),e()};Sn.os.isAndroid?t.once(Nn,(function(){r()})):t.once(Bn,(function(){r()})),t.player.play()}))}},{key:"next",value:function(e){var i,n=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!==(i=e.getVideoByToken)&&void 0!==i&&i.playAuthToken&&(s.streamType=ol(null==e?void 0:e.getVideoByToken)||"mp4"),this.destroy().then((function(){return n._init(s)})).catch((function(e){qs.error("next_error",e)}))}},{key:"playNext",value:function(e){var i,n=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===(i=this.player)||void 0===i||null===(i=i.plugins)||void 0===i||!i.dashplugin),l=this.player.paused&&!this.player.isError,c=r?0:this.player.currentTime;if(o){this.resetUrlState(o);var u=this.player.state,h=t({startTime:c},e);return this.setPluginConfig(h),this.player.playNext(h),new Promise((function(e,t){if(n.player.once(An,(function(e){t(e)})),6===u)n.player.once(Wn,(function(){n.player.once(Bn,(function(){l&&n.player.pause(),e(void 0)}))}));else{var i=n.player.config.autoplay;n.player.once(Wn,(function(){n.player.once(Bn,(function(){i?n.player.play():n.player.pause(),e(void 0)}))}))}}))}if(null!=a&&a.playAuthToken){var d,f=this.playerData.getCurrentStreamType()||ol(null===(d=this.playerData.configs)||void 0===d?void 0:d.getVideoByToken),p=e.streamType||ol(null==e?void 0:e.getVideoByToken)||"mp4";return f!==p?this.next(e,r):s?el.url(null==a?void 0:a.playAuthToken,this.playerData.playDomain).then((function(e){var t=gl(n.player.config,"DASHPlugin");t.dashOpts={Data:e},n.player.plugins.dashplugin.next(n.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(i().mark((function e(){var t,n;return i().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===(n=this.player)||void 0===n?void 0:n.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(i().mark((function e(t,n,r){var o,a,s,l,c,u,h,d,f,p,g,v,y,m;return i().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=rl(null==c?void 0:c.getVideoByToken),h=!!(c.enableMp4MSE||gl(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===r&&(l===Hi.H265||u||null!=c&&null!==(o=c.autoBitrateOpts)&&void 0!==o&&o.isOpenAutoDefi)),!t){e.next=27;break}return e.next=6,this.sdkUmdLoader.loadPlugins(mH.XGVideo);case 6:if(!(null==(d=e.sent)?void 0:d.isSupported())){e.next=21;break}if(l&&d.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),!h){e.next=18;break}return e.next=14,this.sdkUmdLoader.loadPlugins(mH.MP4Encrypt);case 14:return f=e.sent,e.abrupt("return",{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=l?l:Hi.H264,plugins:[f]});case 18:return e.abrupt("return",{mediaType:"xg-video",innerDegrade:1,codecType:null!=l?l:Hi.H264});case 19:e.next=25;break;case 21:this.emit(IM.NOT_SUPPORT_SOFT_DECODER),p={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(p),qs.error("soft decode is not support by current browser");case 25:e.next=60;break;case 27:if(!s||l){e.next=30;break}return e.next=30,this.detectCodec(n);case 30:if(!this.playerData.isCurrentH265()||(i=void 0,_=void 0,b=void 0,i=window.navigator.userAgent.toLocaleLowerCase(),_=/(iphone)/.test(i)||/(ipad)/.test(i),b=/(quark)/.test(i),_&&!b||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=60;break}if(!s){e.next=56;break}return e.next=34,this.sdkUmdLoader.loadPlugins(mH.XGVideo);case 34:if(!(null==(g=e.sent)?void 0:g.isSupported())){e.next=50;break}if(null==g||g.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,!h){e.next=47;break}return e.next=43,this.sdkUmdLoader.loadPlugins(mH.MP4Encrypt);case 43:return v=e.sent,e.abrupt("return",{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=l?l:Hi.H264,plugins:[v]});case 47:return e.abrupt("return",{mediaType:"xg-video",innerDegrade:1,codecType:null!=l?l:Hi.H264});case 48:e.next=54;break;case 50:this.emit(IM.NOT_SUPPORT_SOFT_DECODER),y={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(y),qs.error("soft decode is not support by current browser");case 54:e.next=60;break;case 56:this.emit(IM.NOT_SUPPORT_HARDWARE_DECODER),m={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"},this.delayError.push(m),qs.error("h265 hardware decode is not supported by this browser");case 60:return e.abrupt("return",{});case 61:case"end":return e.stop()}var i,_,b}),e,this)}))),function(e,t,i){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())===Hi.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}},{key:"_initI18N",value:function(e){var t=e.extraLangList,i=e.extendLangList;null==t||t.forEach((function(e){uo.use(e)})),uo.extend(rF),i&&uo.extend(i)}},{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,i;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(i=t.add)||void 0===i||i.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,i;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(i=t.setIndex)||void 0===i||i.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,i;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(i=t.remove)||void 0===i||i.call(t,e)}},{key:"musicSetAbCycle",value:function(e,t,i,n){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,i,n)}},{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 i,n,r=(null==t||null===(i=t.tracker)||void 0===i?void 0:i.getConfig())||{};return null==r||null===(n=r.user)||void 0===n?void 0:n.user_unique_id}}},{key:"region",get:function(){return this.playerData.region}},{key:"getPlugin",value:function(e){var t;return null===(t=this.player)||void 0===t?void 0:t.getPlugin(e)}},{key:"destroy",value:(r=o(i().mark((function e(){return i().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,nF.destroy(this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]),e}();MF.isMSESupported=bl,MF.isRTMSupported=OM.isSupported,MF.veStrategy=DF,MF.sdkVersion="1.8.1",MF.isRTMSupportCodec=function(e,t){if(e===Fi.H264)return OM.isSupportedH264(null==t?void 0:t.targetProfileLevel)};var RF=function(e){u(n,e);var i=v(n);function n(e){var t;return a(this,n),(t=i.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(n,[{key:"beforePlayerInit",value:function(){var e=this;this.on(Nn,this.handleVideoTimeupdate.bind(this)),this.on(Dn,this.onPause.bind(this)),this.on(On,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(Nn,this.handleVideoTimeupdate.bind(this)),this.off(lr,this.handleSEIParsed.bind(this)),this.off(Dn,this.onPause.bind(this)),this.off(On,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,i,n=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:n;if(this.state.showLang&&a&&this.player.isPlaying){var s=this.findSubTitleByTime(a);s&&s.text!==this.state.showingSubtitle&&null!==(i=s.wordpiece)&&void 0!==i&&i.length&&(this.renderSubtitle(s),this.player.emit(LM.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,i=this.root,n=this.find(".xgplayer-subtitles-inner"),r=this.find(".xgplayer-subtitles-helper");if(n){this.clearLineTimer&&clearTimeout(this.clearLineTimer),this.showTimer&&(clearTimeout(this.showTimer),this.showSurplus());var o=this.createNewDom(n);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(n),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==i?void 0:i.offsetWidth)&&void 0!==u?u:300;r.offsetWidth>g&&(o=t.createNewDom(n),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 i,n,r=e.dts;if(5===e.code)try{var o="string"==typeof e.content?e.content:(i=e.content,(n=String.fromCharCode.apply(null,i)).slice(n.indexOf("{"),n.lastIndexOf("}")+1)),a=JSON.parse(o).rtmp_dts;if(a&&r){var s=t||r;this.state.rtmpDtsGap=a-s}}catch(Kl){}}},{key:"insertSubTitle",value:function(){for(var e,t=this,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];n.forEach((function(e){e.timestamp=t.adjustSubTitleTime(e.timestamp)})),(e=this.state.subTitleList).push.apply(e,n)}},{key:"setCurrentLang",value:function(e){this.state.showLang=e,this.player.emit(LM.AI_SUBTITLE_LANG_CHANGE,e)}},{key:"adjustSubTitleTime",value:function(e){var t,i,n,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===(i=this.player)||void 0===i||null===(i=i.plugins)||void 0===i?void 0:i.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===(n=this.player)||void 0===n||null===(n=n.plugins)||void 0===n?void 0:n.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,i=this.state.subTitleList,n=i.findIndex((function(i){var n=t.player,r=i.lang===t.state.showLang,o=((null==n?void 0:n.__curUrl)||n.config.url)===i.url,a=i.timestamp;return a+i.duration/1e3>=e&&a<=e&&o&&r}));if(!(n<0)){var r=i.splice(0,n+1),o=r[r.length-1];return this.splitSubTitle(o)}}},{key:"splitSubTitle",value:function(e){var i="en"===e.lang?" ":"",n=e.text.split(i);if(!e.wordpiece){var r=e.duration/n.length,o=n.map((function(e,t){return{text:e,OffsetMs:r*t,duration:r}}));return t(t({},e),{},{delimiter:i,textArr:n,wordpiece:o})}return t(t({},e),{},{delimiter:i,textArr:n})}},{key:"showSurplus",value:function(){var e,t=this;if(this.state.currentSub){var i=this.state.currentSub,n=i.index,r=i.subObj,o=i.dom,a=null!=r?r:{},s=a.wordpiece,l=a.delimiter;if(!(n>=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(n,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 i=e.classList.contains("scroll-1"),n=e.classList.contains("scroll-2");i&&e.classList.replace("scroll-1","scroll-2"),n&&e.classList.replace("scroll-2","scroll-1"),i||n||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(Nn,(function(i){if(t){var n,r={pts:null==i||null===(n=i.detail)||void 0===n?void 0:n.pts,rtmpDtsGap:e.state.rtmpDtsGap};r.timestamp=r.pts+r.rtmpDtsGap,qs.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,qs.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:""}}}]),n}(Qr),NF=Qr.POSITIONS,jF=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).isMobile="mobile"===Sn.device,n.isOpenState=!0,n.optionList=null,n.currentLang="",n}return l(i,[{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:iU,class:"xgplayer-aisub-open-svg"},aiSubClose:{icon:nU,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:RF,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),i=yn.createDom("div","",{},"ai-panel-content");return t.push({key:"",showText:this.langText.subClose}),t.forEach((function(t){var n=e.renderItem(t);i.appendChild(n)})),i}},{key:"renderItem",value:function(e){var t=this,i=""===e.key&&!this.isOpenState||this.currentLang===e.key&&this.isOpenState,n=yn.createDom("div","",{},"panel-Item ".concat(i?"select-in":""));return n.innerHTML=e.showText,n.addEventListener("click",(function(i){i.stopPropagation(),i.preventDefault(),t.changeSubTitleLang(e.key),t.updatePanel()})),n}},{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,yn.removeClass(this.root,"isClose"),yn.addClass(this.root,"isOpen"),!e&&this.showPanel(),this.toggleSubTitle()}},{key:"close",value:function(){var e;this.isOpenState=!1,yn.removeClass(this.root,"isOpen"),yn.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 i={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,i){var n;e.stopPropagation(),e.preventDefault(),t.changeSubTitleLang(null===(n=i.to)||void 0===n?void 0:n.key)}},root:this.root};this.optionList=new Ja(i)}}},{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:NF.CONTROLS_RIGHT,index:2.7,defaultOpen:!0,default:"en",list:[{key:"zh",showText:"中文"},{key:"en",showText:"En"}]}}}]),i}(Qr),BF=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).waitings=[],n.longWaitingEmitTime=0,n.waitingStartTime=0,n.playerData=null,n.isNeedShowTips=!0,n.playerData=n.playerConfig.playerData,n}return l(i,[{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(jn,this._waiting),this.on(In,this._clearTime),this.on(Dn,this._clearTime),this.on(Nn,this._clearTime),this.on(On,this._clearTime),this.on(Bn,(function(){e.isNeedShowTips=!0})),this.config.isNeedAutoDemote&&this.player.on(LM.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(LM.OFTEN_WAITING),this.clearState())}}},{key:"_time",value:function(){var e=this;if(this.timer)qs.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&&(qs.warn("waiting持续时间超过 ".concat(e.config.longWaitingTime," 秒")),e.player.emit(LM.LONG_WAITING),e.clearState())}),this.config.longWaitingTime)}}},{key:"_clearTime",value:function(){this.waitingStartTime&&qs.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 i=t.definition;if(i){var n=this.playerData.current.definition;if(this.player.emit(LM.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){var r=t.url;this.changeUrl(r)}else i!==n&&this.showToast(t)}}}}},{key:"changeUrl",value:function(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(LM.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}},{key:"showToast",value:function(e){var t,i=this,n=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(n&&this.isNeedShowTips){var r=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,o=yn.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),a=yn.createDom("span",r,void 0,"toast-txt-bt");o.appendChild(a);var s=n.add(o,5e3,!0);a.addEventListener("click",(function(){i.playerData&&(i.playerData.current.definition=e.definition,n.remove(s))})),this.isNeedShowTips=!1,setTimeout((function(){i.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:[]}}}]),i}(Qr),UF=Qr.POSITIONS,HF=604800,FF=function(e){u(n,e);var i=v(n);function n(){var e;return a(this,n),(e=i.apply(this,arguments)).isMobile="mobile"===Sn.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(),yn.event(e)},e}return l(n,[{key:"duration",get:function(){var e,t=this.liveGap+Math.floor(Date.now()/1e3-this.initTime),i=(null!==(e=this.config)&&void 0!==e?e:{}).maxMoveTime;return i&&t>i?i:t>HF?HF: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:{},i=t.livingStartTime,n=t.currentTime;this.initTime=Math.floor(Date.now()/1e3),this.liveGap=Math.floor(n-i)}},{key:"initEvents",value:function(){this.on(Nn,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",yn.stopPropagation),e.center&&e.center.addEventListener("touchend",yn.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(),yn.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,yn.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(),yn.addClass(this.root,"active")}},{key:"blur",value:function(){this.player.controls.recoverAutoHide(),yn.removeClass(this.root,"active")}},{key:"computeTime",value:function(e){var t,i,n,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=yn.getEventPos(e,r.zoom);90===r.rotateDeg?(t=s,i=l,n=u.clientY):(t=a,i=c,n=u.clientX);var h=n-i,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:i,e:e}}},{key:"tipsUpdate",value:function(e){var t,i,n,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,i=Math.floor(t/3600),n=t%3600,r=Math.floor(n/60),o=Math.round(n%60),i>0?(r<10&&(r="0"+r),o<10&&(o="0"+o),"".concat(i,":").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 i=this.shiftTimeGap<6?6:this.shiftTimeGap;t=e?e.replace("{}",i):function(e,t){if(!t)return e;var i=Object.entries(t).map((function(e){var t=_(e,2),i=t[0],n=t[1];return"".concat(i,"=").concat(null!=n?n:"")})).join("&");return e+(-1===e.indexOf("?")?"?":"&")+i}(this.liveUrl,{timeshift:i}),this.player.src=t,this.player.config.url=t,this.player.emit(LM.TIME_SHIFT_CHANGE,!0),this.player.emit(LM.PlAY_URL_CHANGE,{shiftUrl:t,from:LM.TIME_SHIFT_CHANGE})}},{key:"createBackLiveBtDom",value:function(){var e,t=this;if(this.backLiveBt)return this.backLiveBt;this.backLiveBt=yn.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(LM.TIME_SHIFT_CHANGE,!1),this.player.emit(LM.PlAY_URL_CHANGE,{url:this.liveUrl,from:LM.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 i=yn.createDom("xg-card","",void 0,"xgplayer-shift-progress-card"),n=yn.createDom("img","",{src:e.img},"xgplayer-shift-progress-card-img"),r=yn.createDom("div","",void 0,"xgplayer-shift-progress-card-point");i.appendChild(n),i.appendChild(r),this.cardDomList.push(t(t({},e),{},{dom:i}))}}},{key:"cardProcessUpdate",value:function(){var e=this;0!==this.cardDomList.length&&this.cardDomList.forEach((function(t){if(t.dom){var i=e.calcCardProcess(t.timestamp);if(!(i>1)){var n=e.innerBar.contains(t.dom);i<0?n&&e.innerBar.removeChild(t.dom):(n||e.innerBar.appendChild(t.dom),t.dom.style.left="".concat(100*i,"%"))}}}))}},{key:"calcCardProcess",value:function(e){var t,i=null!==(t=this.config)&&void 0!==t?t:{},n=i.maxMoveTime,r=i.livingStartTime,o=this.liveGap+Math.floor(Date.now()/1e3-this.initTime);return n&&o>n&&(r=o-n),e<r?-1:(e-r)/this.duration}},{key:"destroy",value:function(){if(this.off(Nn,this.handleTimeUpdate.bind(this)),this.isMobile){this.unbind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.removerEventListener("touchmove",yn.stopPropagation),e.center&&e.center.removerEventListener("touchend",yn.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:UF.CONTROLS_CENTER,livingStartTime:Date.now()/1e3,maxMoveTime:0,currentTime:Date.now()/1e3,timeShiftUrl:"",cardList:[]}}}]),n}(Qr);function VF(){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 zF(){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 GF=Qr.POSITIONS,WF="getMirror",KF="exitMirror",$F=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).isEnableMirror=!0,n.isEnableMirror=n.config.defaultEnable,n}return l(i,[{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={},WF,{icon:VF,class:"xg-get-mirror"}),c(e,KF,{icon:zF,class:"xg-exit-mirror"}),e}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e[WF]),t.appendChild(e[KF])}},{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(LM.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?KF:WF)}},{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[WF],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"mirrorPlugin"}},{key:"defaultConfig",get:function(){return{position:GF.CONTROLS_RIGHT,index:jM,disable:!1,defaultEnable:!1}}}]),i}(Qr);var YF=function(e){u(i,e);var t=v(i);function i(e){var n;return a(this,i),(n=t.call(this,e)).memoryId="",n.canJump=!1,n.saveTimeFun=yn.checkIsFunction(n.config.saveTime)?n.config.saveTime:n.saveTimeByStorage,n.getTimeFun=yn.checkIsFunction(n.config.getTime)?n.config.getTime:n.getTimeByStorage,n.startTime=0,n.memoryId=n.config.memoryId,n.showToast=n.showToast.bind(p(n)),n}return l(i,[{key:"registerLanguageTexts",value:function(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}},{key:"children",value:function(){return{toast:cU}}},{key:"afterCreate",value:function(){this.once(Bn,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 i,n=(i=e.getTimeFun(e.memoryId))&&i.then?i:new Promise((function(e){e(i)}));n.then((function(i){var n=parseFloat(i);isNaN(n)||0===n?qs.warn("the time got is invalid",i):(e.startTime=n,e.canJump=!0,e.playerConfig.startTime=e.startTime,"mobile"===Sn.device&&e.player.once("canplay",(function(){e.player.currentTime=e.startTime}))),t()})).catch((function(e){qs.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 i=yn.format(this.startTime);t.add("".concat(this.langText.preText).concat(i),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:""}}}]),i}(Qr);var qF=function(){function e(t){a(this,e),this.config=t.config,this.parent=t.root,this.root=yn.createDom("ul","",{},"xg-play-list xg-list-slide-scroll ".concat(this.config.className));var i="mobile"===Sn.device?"touchend":"click";this.modal=yn.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),t.root.appendChild(this.modal),this._delegates=Qr.delegate.call(this,this.modal,".xg-play-list-modal",i,this.modalClick.bind(this));var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(Qr.delegate.call(this,this.root,"li",i,this.onItemClick))}return l(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=i;var r=e.duration?yn.format(e.duration):"",o=e.poster?"background-image: url('".concat(e.poster,"')"):"",a=(new DOMParser).parseFromString('<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dii_340_912)">\n<path d="M4.00011 7.66678C4.00005 5.82578 5.49245 4.33333 7.33344 4.33333H23.3742H32.6657C34.5066 4.33333 35.999 5.82572 35.999 7.66667V13.5764L35.9998 32.3332C35.9999 34.1742 34.5075 35.6667 32.6665 35.6667H7.33423C5.49332 35.6667 4.00096 34.1743 4.0009 32.3334L4.00011 7.66678Z" fill="url(#paint0_linear_340_912)"/>\n<path d="M4.10011 7.66677C4.10005 5.88101 5.54768 4.43333 7.33344 4.43333H23.3742H32.6657C34.4514 4.43333 35.899 5.88095 35.899 7.66667V13.5764L35.8998 32.3332C35.8999 34.119 34.4523 35.5667 32.6665 35.5667H7.33423C5.54855 35.5667 4.10095 34.1191 4.1009 32.3334L4.10011 7.66677Z" stroke="url(#paint1_linear_340_912)" stroke-width="0.2"/>\n</g>\n<path d="M6.76669 9.66667C6.76669 8.24914 7.91582 7.1 9.33335 7.1H30.6667C32.0842 7.1 33.2334 8.24914 33.2334 9.66667V30.3333C33.2334 31.7509 32.0842 32.9 30.6667 32.9H9.33335C7.91582 32.9 6.76669 31.7509 6.76669 30.3333V9.66667Z" fill="url(#paint2_linear_340_912)" stroke="url(#paint3_linear_340_912)" stroke-width="0.2"/>\n<g filter="url(#filter1_dii_340_912)">\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" fill="url(#paint4_linear_340_912)"/>\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" stroke="url(#paint5_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<g filter="url(#filter2_dii_340_912)">\n<circle cx="23.6667" cy="14.6667" r="2" fill="url(#paint6_linear_340_912)"/>\n<circle cx="23.6667" cy="14.6667" r="2" stroke="url(#paint7_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<defs>\n<filter id="filter0_dii_340_912" x="3.8431" y="4.17631" width="32.6278" height="32.1184" 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 dx="0.157018" dy="0.314036"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0684375 0 0 0 0 0.0704062 0 0 0 0 0.075 0 0 0 0.5 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\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 dx="0.471054" dy="0.471054"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.355764 0 0 0 0 0.368819 0 0 0 0 0.391667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\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 dx="-0.471054" dy="-0.471054"/>\n<feGaussianBlur stdDeviation="0.0785089"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.191389 0 0 0 0 0.197708 0 0 0 0 0.216667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter1_dii_340_912" x="10.4333" y="17.5669" width="18.6828" height="11.6831" 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="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\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 dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\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 dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.409097 0 0 0 0 0.443509 0 0 0 0 0.570833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter2_dii_340_912" x="21.25" y="12.25" width="4.83329" height="5.00001" 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="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\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 dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\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 dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.364583 0 0 0 0 0.397828 0 0 0 0 0.520833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<linearGradient id="paint0_linear_340_912" x1="30.2254" y1="8.17498" x2="11.4982" y2="41.5657" gradientUnits="userSpaceOnUse">\n<stop stop-color="#434548"/>\n<stop offset="0.855332" stop-color="#3E3F42"/>\n</linearGradient>\n<linearGradient id="paint1_linear_340_912" x1="7.52649" y1="1.8673" x2="25.0283" y2="33.3887" gradientUnits="userSpaceOnUse">\n<stop stop-color="#383838"/>\n<stop offset="0.192009" stop-color="#45484D"/>\n<stop offset="0.703503" stop-color="#37393D"/>\n<stop offset="0.962692" stop-color="#1B1C1E"/>\n</linearGradient>\n<linearGradient id="paint2_linear_340_912" x1="28.5212" y1="10.1877" x2="13.0162" y2="37.9513" gradientUnits="userSpaceOnUse">\n<stop stop-color="#2E2F32"/>\n<stop offset="0.855332" stop-color="#242528"/>\n</linearGradient>\n<linearGradient id="paint3_linear_340_912" x1="9.60543" y1="4.95372" x2="24.0954" y2="31.1622" gradientUnits="userSpaceOnUse">\n<stop stop-color="#1F2124"/>\n<stop offset="0.192009" stop-color="#282B30"/>\n<stop offset="0.703503" stop-color="#27292F"/>\n<stop offset="0.962692" stop-color="#1D1F23"/>\n</linearGradient>\n<linearGradient id="paint4_linear_340_912" x1="16.969" y1="16.5412" x2="22.5457" y2="28.6249" gradientUnits="userSpaceOnUse">\n<stop stop-color="#C7CCE2"/>\n<stop offset="1" stop-color="#8B95BC"/>\n</linearGradient>\n<linearGradient id="paint5_linear_340_912" x1="17.5125" y1="20.3581" x2="20.121" y2="28.4669" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#535C80"/>\n</linearGradient>\n<linearGradient id="paint6_linear_340_912" x1="23.0637" y1="12.5093" x2="25.4773" y2="15.7207" gradientUnits="userSpaceOnUse">\n<stop stop-color="#B8BED6"/>\n<stop offset="1" stop-color="#7E88AD"/>\n</linearGradient>\n<linearGradient id="paint7_linear_340_912" x1="23.1781" y1="13.818" x2="24.4392" y2="16.2252" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#495274"/>\n</linearGradient>\n</defs>\n</svg>\n',"image/svg+xml").firstChild,s='\n <div style="'.concat(o,'" class="xg-play-list-poster ').concat(e.selected?"is-active":""," ").concat(e.poster?"":"no-poster",'" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">').concat(r,'</div>\n <duv class="playing">\n <div class="icon-wrap">\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n </div>\n </duv>\n </div>\n <div class="xg-play-list-title">\n <div class="xg-play-list-title-text">').concat(e.title,"</div>\n </div>\n "),l=yn.createDom("li",s,e,n),c=yn.findDom(l,".bg");!e.poster&&c.appendChild(a),t.root.appendChild(l)}));var r=e.findIndex((function(e){return e.selected}));if(r>=0){var o=yn.findDom(this.root,".xg-play-list-item.selected");if(!o)return;var a=o.getBoundingClientRect().height,s=this.root.getBoundingClientRect().height,l=(e.length-r)*a,c=a*e.length;this.root.scrollTop=l<s?c-s:r*a}}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&yn.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");yn.addClass(t,"selected"),n&&yn.removeClass(n,"selected"),i&&i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){yn.removeClass(this.modal,"hide"),yn.addClass(this.modal,"active"),yn.removeClass(this.root,"hide"),yn.addClass(this.root,"active")}},{key:"hide",value:function(){yn.removeClass(this.modal,"active"),yn.addClass(this.modal,"hide"),yn.removeClass(this.root,"active"),yn.addClass(this.root,"hide")}},{key:"modalClick",value:function(e){e.stopPropagation(),this.hide();var t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{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}();function XF(){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 d="M12.8499 8.49494C13.7054 8.98885 14.1331 9.23581 14.2767 9.55822C14.4019 9.83944 14.4019 10.1606 14.2767 10.4418C14.1331 10.7642 13.7054 11.0112 12.8499 11.5051L6.65863 15.0796C5.80315 15.5735 5.37542 15.8205 5.02442 15.7836C4.71827 15.7514 4.44016 15.5909 4.25921 15.3418C4.05177 15.0563 4.05177 14.5624 4.05177 13.5746V6.42547C4.05177 5.43765 4.05177 4.94374 4.25921 4.65822C4.44016 4.40917 4.71827 4.2486 5.02442 4.21642C5.37542 4.17953 5.80315 4.42649 6.65863 4.92039L12.8499 8.49494Z" fill="white"/>\n<rect x="13.8274" y="4.02594" width="2.17238" height="11.9481" rx="0.814644" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function JF(){return(new DOMParser).parseFromString('<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_126_721)">\n<path d="M8.18979 6.3414C8.60304 6.57999 8.80967 6.69928 8.87901 6.85503C8.93949 6.99088 8.93949 7.14601 8.87901 7.28186C8.80967 7.4376 8.60304 7.5569 8.18979 7.79549L5.59253 9.29502C5.17928 9.53361 4.97266 9.6529 4.80311 9.63508C4.65522 9.61954 4.52087 9.54197 4.43346 9.42167C4.33325 9.28374 4.33325 9.04515 4.33325 8.56797V5.56891C4.33325 5.09173 4.33325 4.85314 4.43346 4.71522C4.52087 4.59491 4.65522 4.51735 4.80311 4.5018C4.97266 4.48398 5.17928 4.60328 5.59253 4.84187L8.18979 6.3414Z" fill="white"/>\n</g>\n<path d="M11.5264 7.19745H18" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 12.5922L18.0001 12.5922" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 17.9869L18.0001 17.9869" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<defs>\n<filter id="filter0_d_126_721" x="0.736733" y="0.903543" width="11.7841" height="12.3298" 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/>\n<feGaussianBlur stdDeviation="1.79826"/>\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.08 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_126_721"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_126_721" result="shape"/>\n</filter>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var ZF="playListNext",QF="playListToggle",eV="mobile"===Sn.device;function tV(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(e))return[];var i=e.filter((function(e){return e.url||e.playAuthToken}));return i.map((function(e,i){var n=t({},e||{});return n.vid||(n.vid=""+i),n}))}function iV(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Number(t),n=Number.isNaN(i)?0:i,r=0;return(r=n<=0?0:n<e.length?n:0)<0?0:r}_D.prototype.setVodPlayListConfig=function(e){if((e.plugins||[]).find((function(e){return e.pluginName===nV.pluginName}))){var i=gl(e,"playListPlugin");if(i&&function(e){var t=n(e);return null!==e&&("object"===t||"function"===t)}(i)){var r=i.list,o=void 0===r?[]:r,a=i.defaultIndex,s=void 0===a?0:a,l=tV(o),c=iV(l,s),u=null==l?void 0:l[c];if(u){var h=u.url,d=u.poster,f=u.playAuthToken;f?e.getVideoByToken=t(t({},e.getVideoByToken||{}),{},{playAuthToken:f}):h&&(e.url=h),d&&(e.poster=d)}}}};var nV=function(e){u(n,e);var i=v(n);function n(){var e;return a(this,n),(e=i.apply(this,arguments)).onEnter=function(t){t.stopPropagation(),e.emit("icon_mouseenter",{pluginName:e.pluginName}),e.switchActiveState(t)},e.switchActiveState=function(t){t.stopPropagation(),"click"===e.config.toggleMode?e.toggle(!e.isActive):e.toggle(!0)},e.handleNext=function(t){t.stopPropagation(),e.next()},e._onTimeUpdate=function(){var t=p(e).player;!e.halfPass&&t.currentTime>t.duration/2&&e.confirmOrder()},e._onEnded=function(){if("order"===e.mode&&e.curIndex+1>=e.list.length)return e.player.pause(),void(e.player.currentTime=0);e.next()},e.onLeave=function(t){t.stopPropagation(),e.emit("icon_mouseleave",{pluginName:e.pluginName}),e.isActive&&e.toggle(!1)},e}return l(n,[{key:"beforeCreate",value:function(e){Object.values(Qr.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=Qr.POSITIONS.CONTROLS_LEFT,e.position=Qr.POSITIONS.CONTROLS_LEFT)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t||{},n=i.list,r=void 0===n?[]:n,o=i.mode,a=i.defaultIndex;this.initIcons(),this.halfPass=!1,this.list=tV(r),this.timer=setTimeout((function(){e.emit(LM.PLAY_LIST_CHANGE,e.list)})),this.disable=!(r.length>0),this.mode=o,this.curIndex=iV(this.list,a),this.curIndex>0?(this.nextIndex=this.curIndex+1<this.list.length?this.curIndex+1:0,this.prevIndex=this.curIndex-1):(this.nextIndex=1,this.prevIndex=this.list.length-1),this.on(Nn,this._onTimeUpdate),this.on(Ln,this._onEnded),this.on([cr,nr],(function(){e._resizeList()})),this.once(Bn,(function(){e.list&&e.list.length>0&&(e.renderItemList(),e.show())})),eV&&this.on(Kn,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),eV?(t.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===t.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===t.toggleMode?this.bind(".xg-play-list-btn",this.activeEvent,this.switchActiveState):(this.bind(".xg-play-list-btn",this.activeEvent,this.onEnter),this.bind(".xg-play-list-btn","mouseleave",this.onLeave))}},{key:"registerLanguageTexts",value:function(){return{playNext:{jp:"次に遊ぶ",en:"play next",zh:"播放下一个","zh-hk":"播放下一個"},playList:{jp:"プレイリスト",en:"playList",zh:"播放列表","zh-hk":"播放清單"}}}},{key:"registerIcons",value:function(){var e;return c(e={},ZF,{icon:XF,class:"xg-play-next-btn"}),c(e,QF,{icon:JF,class:"xg-play-list-btn"}),e}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xg-play-next-btn",e[ZF]),this.appendChild(".xg-play-list-btn",e[QF])}},{key:"show",value:function(){!this.list||this.list.length<1||yn.addClass(this.root,"show")}},{key:"hide",value:function(){yn.removeClass(this.root,"show")}},{key:"prev",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}},{key:"next",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}},{key:"changeList",value:function(e){this.player.currentTime=0,this.list=tV(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(LM.PLAY_LIST_CHANGE,this.list)}},{key:"setIndex",value:function(e){e<0||e>=this.list.length||(this.nextIndex=e+1<this.list.length?e+1:0,this.prevIndex=e-1<0?this.list.length-1:e-1,this.curIndex=e,this.change())}},{key:"change",value:function(){if(!this.disable){var e=this.player,t=this.list,i=this.curIndex;this.halfPass=!1;var n=t[i],r=n.url,o=n.playAuthToken,a=n.title,s=void 0===a?"":a,l=n.vid,c=void 0===l?"":l,u=n.poster,h=void 0===u?"":u;this.curInfo={url:r,playAuthToken:o,title:s,vid:c,poster:h};var d=e.sdk||e;o?d.playNext({vid:c,poster:h,autoplay:!0,getVideoByToken:{playAuthToken:o}}):d.playNext({vid:c,poster:h,autoplay:!0,url:r}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}}},{key:"confirmOrder",value:function(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}},{key:"_nextCompute",value:function(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}},{key:"_prevCompute",value:function(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}},{key:"_emitChange",value:function(){this.emit(LM.PLAY_LIST_ITEM_CHANGE,this.curInfo)}},{key:"toggle",value:function(e){if(e!==this.isActive){var t=this.player.controls;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}},{key:"renderItemList",value:function(e){var i=this,n=this.list,r=this.config,o=this.optionsList,a=this.player;"number"==typeof e&&(this.curIndex=e,this.curInfo=n[e]);var s=n.map((function(n,r){var o=t(t({},n),{},{selected:!1});return r===i.curIndex&&(o.selected=!0,e=r),o}));if(o)o.renderItemList(s);else{var l={config:{data:s,className:"xg-side-play-list",onItemClick:function(e,t){i.onItemClick(e,t)},onModalClick:function(){i.toggle(!1)}},root:a.innerContainer||a.root},c=this.player.root.getBoundingClientRect().height;c&&r.heightLimit&&(l.config.maxHeight="".concat(c,"px")),this.optionsList=new qF(l),this.show(),this._resizeList()}}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(e,"px")})}}},{key:"destroy",value:function(){"click"===this.config.toggleMode?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null),this.timer&&(clearTimeout(this.timer),this.timer=null)}},{key:"disable",get:function(){return this._disable},set:function(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}},{key:"render",value:function(){if(!this.disable)return'<xg-icon class="xg-options-icon xg-play-list-btn-container '.concat(this.config.className||"",'">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">').concat(this.langText.playNext,'</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">').concat(this.langText.playList,"</div>\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"playListPlugin"}},{key:"defaultConfig",get:function(){return{position:Qr.POSITIONS.CONTROLS_LEFT,index:UM,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}}]),n}(Qr),rV=function(e){u(n,e);var i=v(n);function n(){var e;return a(this,n),(e=i.apply(this,arguments))._infoItems=[],e}return l(n,[{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 i={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?i:{})}},{key:"_init",value:function(){var e=this,t=this._initDom(this._getInfoListData());this._infoItems=new Proxy(t,{set:function(t,i,n){return e._updateDom(t[i].dom,n),Reflect.set(t,i,n)}}),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,i=this.find(".veplayer-livepanel-container");return i.innerHTML="",Object.values(e).forEach((function(e){var n=yn.createDom("veplayer-livepanel-div","",void 0,"veplayer-livepanel-container-row");"title"===e.type?t._updateTitle(n,e):t._updateDom(n,e),i.appendChild(n),e.dom=n})),e}},{key:"_updateTitle",value:function(e,t){e.innerHTML="";var i=yn.createDom("veplayer-livepanel-span",t.label,void 0,"veplayer-livepanel-container-row-title");e.appendChild(i)}},{key:"_updateDom",value:function(e,t){e.innerHTML="";var i=yn.createDom("veplayer-livepanel-span",this._renderLabel(t),void 0,"veplayer-livepanel-container-row-label");if(e.appendChild(i),"title"!==t.type){var n=yn.createDom("veplayer-livepanel-span",this._renderValue(t));e.appendChild(n)}}},{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,i=this._getInfoListData();Object.values(this._infoItems).forEach((function(n){"title"!==n.type&&e._renderValue(n)!==e._renderValue(i[n.key])&&(e._infoItems[n.key]=t(t({},n),i[n.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");yn.removeClass(e,"veplayer-livepanel-hidden"),this._init()}},{key:"_close",value:function(){var e=this.find(".veplayer-livepanel-container");yn.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}}}]),n}(Qr),oV=function(e){u(i,e);var t=v(i);function i(){return a(this,i),t.apply(this,arguments)}return l(i)}(MF);return oV.Music=PF,oV.LiveSubtitlesIconPlugin=jF,oV.LiveSubtitlesPlugin=RF,oV.DefinitionDemotePlugin=BF,oV.TimeShiftPlugin=FF,oV.MirrorPlugin=$F,oV.MemoryPlay=YF,oV.Subtitle=lU,oV.PlayListPlugin=nV,oV.Service=el,oV.LiveInfoPanel=rV,oV.Events=DM,oV.Event=AM,oV.getI18N=function(){return uo},oV.BasePlugin=Vr,oV.Plugin=Qr,oV.Sniffer=Sn,oV.Util=yn,oV.STATE_CLASS=no,oV.I18N=uo,oV.STATES=ho,oV.SdkPlugin=eF,oV}));
|