@byteplus/veplayer 1.18.0 → 1.19.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lite.cjs CHANGED
@@ -1,2 +1,2 @@
1
- // @byteplus/veplayer@1.18.0 Built @9/1/2026, 4:36:00 PM
2
- "use strict";var e,t=Object.defineProperty,i=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=Math.pow,l=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,c=(e,t)=>{for(var i in t||(t={}))o.call(t,i)&&l(e,i,t[i]);if(r)for(var i of r(t))a.call(t,i)&&l(e,i,t[i]);return e},u=(e,t)=>i(e,n(t)),h=(e,t)=>{var i={};for(var n in e)o.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&r)for(var n of r(e))t.indexOf(n)<0&&a.call(e,n)&&(i[n]=e[n]);return i},d=(e,t,i)=>new Promise(((n,r)=>{var o=e=>{try{s(i.next(e))}catch(ds){r(ds)}},a=e=>{try{s(i.throw(e))}catch(ds){r(ds)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((i=i.apply(e,t)).next())}));function f(e,t){return e===t||e!=e&&t!=t}function p(e,t){for(var i=e.length;i--;)if(f(e[i][0],t))return i;return-1}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var g=Array.prototype.splice;function y(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])}}y.prototype.clear=function(){this.__data__=[],this.size=0},y.prototype.delete=function(e){var t=this.__data__,i=p(t,e);return!(i<0)&&(i==t.length-1?t.pop():g.call(t,i,1),--this.size,!0)},y.prototype.get=function(e){var t=this.__data__,i=p(t,e);return i<0?void 0:t[i][1]},y.prototype.has=function(e){return p(this.__data__,e)>-1},y.prototype.set=function(e,t){var i=this.__data__,n=p(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};const v="object"==typeof global&&global&&global.Object===Object&&global;var m="object"==typeof self&&self&&self.Object===Object&&self;const _=v||m||Function("return this")();const E=_.Symbol;var T=Object.prototype,S=T.hasOwnProperty,b=T.toString,C=E?E.toStringTag:void 0;var k=Object.prototype.toString;var I="[object Null]",P="[object Undefined]",D=E?E.toStringTag:void 0;function w(e){return null==e?void 0===e?P:I:D&&D in Object(e)?function(e){var t=S.call(e,C),i=e[C];try{e[C]=void 0;var n=!0}catch(ds){}var r=b.call(e);return n&&(t?e[C]=i:delete e[C]),r}(e):function(e){return k.call(e)}(e)}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R="[object AsyncFunction]",x="[object Function]",O="[object GeneratorFunction]",L="[object Proxy]";function N(e){if(!A(e))return!1;var t=w(e);return t==x||t==O||t==R||t==L}const M=_["__core-js_shared__"];var U,B=(U=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var F=Function.prototype.toString;function H(e){if(null!=e){try{return F.call(e)}catch(ds){}try{return e+""}catch(ds){}}return""}var j=/^\[object .+?Constructor\]$/,V=Function.prototype,K=Object.prototype,G=V.toString,W=K.hasOwnProperty,Y=RegExp("^"+G.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!A(e)||(t=e,B&&B in t))&&(N(e)?Y:j).test(H(e));var t}function $(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return z(i)?i:void 0}const X=$(_,"Map");const q=$(Object,"create");var Z=Object.prototype.hasOwnProperty;var Q=Object.prototype.hasOwnProperty;function J(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 ee(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function te(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])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},J.prototype.get=function(e){var t=this.__data__;if(q){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Z.call(t,e)?t[e]:void 0},J.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:Q.call(t,e)},J.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(X||y),string:new J}},te.prototype.delete=function(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ee(this,e).get(e)},te.prototype.has=function(e){return ee(this,e).has(e)},te.prototype.set=function(e,t){var i=ee(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ie(e){var t=this.__data__=new y(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new y,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var i=this.__data__;if(i instanceof y){var n=i.__data__;if(!X||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new te(n)}return i.set(e,t),this.size=i.size,this};var ne=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(ds){}}();const re=ne;function oe(e,t,i){"__proto__"==t&&re?re(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var ae=Object.prototype.hasOwnProperty;function se(e,t,i){var n=e[t];ae.call(e,t)&&f(n,i)&&(void 0!==i||t in e)||oe(e,t,i)}function le(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?oe(i,s,l):se(i,s,l)}return i}function ce(e){return null!=e&&"object"==typeof e}function ue(e){return ce(e)&&"[object Arguments]"==w(e)}var he=Object.prototype,de=he.hasOwnProperty,fe=he.propertyIsEnumerable;const pe=ue(function(){return arguments}())?ue:function(e){return ce(e)&&de.call(e,"callee")&&!fe.call(e,"callee")};const ge=Array.isArray;var ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,ve=ye&&"object"==typeof module&&module&&!module.nodeType&&module,me=ve&&ve.exports===ye?_.Buffer:void 0;const _e=(me?me.isBuffer:void 0)||function(){return!1};var Ee=9007199254740991,Te=/^(?:0|[1-9]\d*)$/;function Se(e,t){var i=typeof e;return!!(t=null==t?Ee:t)&&("number"==i||"symbol"!=i&&Te.test(e))&&e>-1&&e%1==0&&e<t}var be=9007199254740991;function Ce(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=be}var ke={};function Ie(e){return function(t){return e(t)}}ke["[object Float32Array]"]=ke["[object Float64Array]"]=ke["[object Int8Array]"]=ke["[object Int16Array]"]=ke["[object Int32Array]"]=ke["[object Uint8Array]"]=ke["[object Uint8ClampedArray]"]=ke["[object Uint16Array]"]=ke["[object Uint32Array]"]=!0,ke["[object Arguments]"]=ke["[object Array]"]=ke["[object ArrayBuffer]"]=ke["[object Boolean]"]=ke["[object DataView]"]=ke["[object Date]"]=ke["[object Error]"]=ke["[object Function]"]=ke["[object Map]"]=ke["[object Number]"]=ke["[object Object]"]=ke["[object RegExp]"]=ke["[object Set]"]=ke["[object String]"]=ke["[object WeakMap]"]=!1;var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,De=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,we=De&&De.exports===Pe&&v.process;const Ae=function(){try{var e=De&&De.require&&De.require("util").types;return e||we&&we.binding&&we.binding("util")}catch(ds){}}();var Re=Ae&&Ae.isTypedArray;const xe=Re?Ie(Re):function(e){return ce(e)&&Ce(e.length)&&!!ke[w(e)]};var Oe=Object.prototype.hasOwnProperty;function Le(e,t){var i=ge(e),n=!i&&pe(e),r=!i&&!n&&_e(e),o=!i&&!n&&!r&&xe(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&&!Oe.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Se(c,l))||s.push(c);return s}var Ne=Object.prototype;function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function Ue(e,t){return function(i){return e(t(i))}}const Be=Ue(Object.keys,Object);var Fe=Object.prototype.hasOwnProperty;function He(e){return null!=e&&Ce(e.length)&&!N(e)}function je(e){return He(e)?Le(e):function(e){if(!Me(e))return Be(e);var t=[];for(var i in Object(e))Fe.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ve=Object.prototype.hasOwnProperty;function Ke(e){if(!A(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Me(e),i=[];for(var n in e)("constructor"!=n||!t&&Ve.call(e,n))&&i.push(n);return i}function Ge(e){return He(e)?Le(e,!0):Ke(e)}var We="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=We&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Ye&&Ye.exports===We?_.Buffer:void 0,$e=ze?ze.allocUnsafe:void 0;function Xe(e,t){if(t)return e.slice();var i=e.length,n=$e?$e(i):new e.constructor(i);return e.copy(n),n}function qe(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function Ze(){return[]}var Qe=Object.prototype.propertyIsEnumerable,Je=Object.getOwnPropertySymbols;const et=Je?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}(Je(e),(function(t){return Qe.call(e,t)})))}:Ze;function tt(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}const it=Ue(Object.getPrototypeOf,Object);const nt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)tt(t,et(e)),e=it(e);return t}:Ze;function rt(e,t,i){var n=t(e);return ge(e)?n:tt(n,i(e))}function ot(e){return rt(e,je,et)}function at(e){return rt(e,Ge,nt)}const st=$(_,"DataView");const lt=$(_,"Promise");const ct=$(_,"Set");const ut=$(_,"WeakMap");var ht="[object Map]",dt="[object Promise]",ft="[object Set]",pt="[object WeakMap]",gt="[object DataView]",yt=H(st),vt=H(X),mt=H(lt),_t=H(ct),Et=H(ut),Tt=w;(st&&Tt(new st(new ArrayBuffer(1)))!=gt||X&&Tt(new X)!=ht||lt&&Tt(lt.resolve())!=dt||ct&&Tt(new ct)!=ft||ut&&Tt(new ut)!=pt)&&(Tt=function(e){var t=w(e),i="[object Object]"==t?e.constructor:void 0,n=i?H(i):"";if(n)switch(n){case yt:return gt;case vt:return ht;case mt:return dt;case _t:return ft;case Et:return pt}return t});const St=Tt;var bt=Object.prototype.hasOwnProperty;const Ct=_.Uint8Array;function kt(e){var t=new e.constructor(e.byteLength);return new Ct(t).set(new Ct(e)),t}var It=/\w*$/;var Pt=E?E.prototype:void 0,Dt=Pt?Pt.valueOf:void 0;function wt(e,t){var i=t?kt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var At="[object Boolean]",Rt="[object Date]",xt="[object Map]",Ot="[object Number]",Lt="[object RegExp]",Nt="[object Set]",Mt="[object String]",Ut="[object Symbol]",Bt="[object ArrayBuffer]",Ft="[object DataView]",Ht="[object Float32Array]",jt="[object Float64Array]",Vt="[object Int8Array]",Kt="[object Int16Array]",Gt="[object Int32Array]",Wt="[object Uint8Array]",Yt="[object Uint8ClampedArray]",zt="[object Uint16Array]",$t="[object Uint32Array]";function Xt(e,t,i){var n,r=e.constructor;switch(t){case Bt:return kt(e);case At:case Rt:return new r(+e);case Ft:return function(e,t){var i=t?kt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case Ht:case jt:case Vt:case Kt:case Gt:case Wt:case Yt:case zt:case $t:return wt(e,i);case xt:return new r;case Ot:case Mt:return new r(e);case Lt:return function(e){var t=new e.constructor(e.source,It.exec(e));return t.lastIndex=e.lastIndex,t}(e);case Nt:return new r;case Ut:return n=e,Dt?Object(Dt.call(n)):{}}}var qt=Object.create,Zt=function(){function e(){}return function(t){if(!A(t))return{};if(qt)return qt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();const Qt=Zt;function Jt(e){return"function"!=typeof e.constructor||Me(e)?{}:Qt(it(e))}var ei=Ae&&Ae.isMap;const ti=ei?Ie(ei):function(e){return ce(e)&&"[object Map]"==St(e)};var ii=Ae&&Ae.isSet;const ni=ii?Ie(ii):function(e){return ce(e)&&"[object Set]"==St(e)};var ri=1,oi=2,ai=4,si="[object Arguments]",li="[object Function]",ci="[object GeneratorFunction]",ui="[object Object]",hi={};function di(e,t,i,n,r,o){var a,s=t&ri,l=t&oi,c=t&ai;if(i&&(a=r?i(e,n,r,o):i(e)),void 0!==a)return a;if(!A(e))return e;var u=ge(e);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&bt.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return qe(e,a)}else{var h=St(e),d=h==li||h==ci;if(_e(e))return Xe(e,s);if(h==ui||h==si||d&&!r){if(a=l||d?{}:Jt(e),!s)return l?function(e,t){return le(e,nt(e),t)}(e,function(e,t){return e&&le(t,Ge(t),e)}(a,e)):function(e,t){return le(e,et(e),t)}(e,function(e,t){return e&&le(t,je(t),e)}(a,e))}else{if(!hi[h])return r?e:{};a=Xt(e,h,s)}}o||(o=new ie);var f=o.get(e);if(f)return f;o.set(e,a),ni(e)?e.forEach((function(n){a.add(di(n,t,i,n,e,o))})):ti(e)&&e.forEach((function(n,r){a.set(r,di(n,t,i,r,e,o))}));var p=u?void 0:(c?l?at:ot:l?Ge:je)(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]),se(a,r,di(n,t,i,r,e,o))})),a}hi[si]=hi["[object Array]"]=hi["[object ArrayBuffer]"]=hi["[object DataView]"]=hi["[object Boolean]"]=hi["[object Date]"]=hi["[object Float32Array]"]=hi["[object Float64Array]"]=hi["[object Int8Array]"]=hi["[object Int16Array]"]=hi["[object Int32Array]"]=hi["[object Map]"]=hi["[object Number]"]=hi[ui]=hi["[object RegExp]"]=hi["[object Set]"]=hi["[object String]"]=hi["[object Symbol]"]=hi["[object Uint8Array]"]=hi["[object Uint8ClampedArray]"]=hi["[object Uint16Array]"]=hi["[object Uint32Array]"]=!0,hi["[object Error]"]=hi[li]=hi["[object WeakMap]"]=!1;function fi(e){return di(e,5)}function pi(e,t,i){(void 0!==i&&!f(e[t],i)||void 0===i&&!(t in e))&&oe(e,t,i)}var gi,yi=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),a=o.length;a--;){var s=o[gi?a:++n];if(!1===t(r[s],s,r))break}return e};const vi=yi;var mi="[object Object]",_i=Function.prototype,Ei=Object.prototype,Ti=_i.toString,Si=Ei.hasOwnProperty,bi=Ti.call(Object);function Ci(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function ki(e,t,i,n,r,o,a){var s=Ci(e,i),l=Ci(t,i),c=a.get(l);if(c)pi(e,i,c);else{var u,h=o?o(s,l,i+"",e,t,a):void 0,d=void 0===h;if(d){var f=ge(l),p=!f&&_e(l),g=!f&&!p&&xe(l);h=l,f||p||g?ge(s)?h=s:ce(u=s)&&He(u)?h=qe(s):p?(d=!1,h=Xe(l,!0)):g?(d=!1,h=wt(l,!0)):h=[]:function(e){if(!ce(e)||w(e)!=mi)return!1;var t=it(e);if(null===t)return!0;var i=Si.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Ti.call(i)==bi}(l)||pe(l)?(h=s,pe(s)?h=function(e){return le(e,Ge(e))}(s):A(s)&&!N(s)||(h=Jt(l))):d=!1}d&&(a.set(l,h),r(h,l,n,o,a),a.delete(l)),pi(e,i,h)}}function Ii(e,t,i,n,r){e!==t&&vi(t,(function(o,a){if(r||(r=new ie),A(o))ki(e,t,a,i,Ii,n,r);else{var s=n?n(Ci(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),pi(e,a,s)}}),Ge)}function Pi(e){return e}var Di=Math.max;var wi=re?function(e,t){return re(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Pi;const Ai=wi;var Ri,xi,Oi,Li=Date.now;const Ni=(Ri=Ai,xi=0,Oi=0,function(){var e=Li(),t=16-(e-Oi);if(Oi=e,t>0){if(++xi>=800)return arguments[0]}else xi=0;return Ri.apply(void 0,arguments)});function Mi(e,t){return Ni(function(e,t,i){return t=Di(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=Di(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),function(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)}(e,this,s)}}(e,t,Pi),e+"")}function Ui(e){return Mi((function(t,i){var n=-1,r=i.length,o=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,i){if(!A(i))return!1;var n=typeof t;return!!("number"==n?He(i)&&Se(t,i.length):"string"==n&&t in i)&&f(i[t],e)}(i[0],i[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=i[n];s&&e(t,s,n,o)}return t}))}const Bi=Ui((function(e,t,i,n){Ii(e,t,i,n)}));function Fi(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new te;++t<i;)this.add(e[t])}function Hi(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 ji(e,t){return e.has(t)}Fi.prototype.add=Fi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fi.prototype.has=function(e){return this.__data__.has(e)};var Vi=1,Ki=2;function Gi(e,t,i,n,r,o){var a=i&Vi,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=i&Ki?new Fi:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var y=a?n(g,p,h,t,e,o):n(p,g,h,e,t,o);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!Hi(t,(function(e,t){if(!ji(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 Wi(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Yi(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var zi=1,$i=2,Xi="[object Boolean]",qi="[object Date]",Zi="[object Error]",Qi="[object Map]",Ji="[object Number]",en="[object RegExp]",tn="[object Set]",nn="[object String]",rn="[object Symbol]",on="[object ArrayBuffer]",an="[object DataView]",sn=E?E.prototype:void 0,ln=sn?sn.valueOf:void 0;var cn=1,un=Object.prototype.hasOwnProperty;var hn=1,dn="[object Arguments]",fn="[object Array]",pn="[object Object]",gn=Object.prototype.hasOwnProperty;function yn(e,t,i,n,r,o){var a=ge(e),s=ge(t),l=a?fn:St(e),c=s?fn:St(t),u=(l=l==dn?pn:l)==pn,h=(c=c==dn?pn:c)==pn,d=l==c;if(d&&_e(e)){if(!_e(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new ie),a||xe(e)?Gi(e,t,i,n,r,o):function(e,t,i,n,r,o,a){switch(i){case an:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case on:return!(e.byteLength!=t.byteLength||!o(new Ct(e),new Ct(t)));case Xi:case qi:case Ji:return f(+e,+t);case Zi:return e.name==t.name&&e.message==t.message;case en:case nn:return e==t+"";case Qi:var s=Wi;case tn:var l=n&zi;if(s||(s=Yi),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=$i,a.set(e,t);var u=Gi(s(e),s(t),n,r,o,a);return a.delete(e),u;case rn:if(ln)return ln.call(e)==ln.call(t)}return!1}(e,t,l,i,n,r,o);if(!(i&hn)){var p=u&&gn.call(e,"__wrapped__"),g=h&&gn.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,v=g?t.value():t;return o||(o=new ie),r(y,v,i,n,o)}}return!!d&&(o||(o=new ie),function(e,t,i,n,r,o){var a=i&cn,s=ot(e),l=s.length;if(l!=ot(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:un.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]],y=t[u];if(n)var v=a?n(y,g,u,t,e,o):n(g,y,u,e,t,o);if(!(void 0===v?g===y||r(g,y,i,n,o):v)){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 vn(e,t,i,n,r){return e===t||(null==e||null==t||!ce(e)&&!ce(t)?e!=e&&t!=t:yn(e,t,i,n,vn,r))}var mn=1,_n=2;function En(e){return e==e&&!A(e)}function Tn(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Sn(e){var t=function(e){for(var t=je(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,En(r)]}return t}(e);return 1==t.length&&t[0][2]?Tn(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 ie;if(n)var d=n(c,u,l,e,t,h);if(!(void 0===d?vn(u,c,mn|_n,n,h):d))return!1}}return!0}(i,e,t)}}var bn="[object Symbol]";function Cn(e){return"symbol"==typeof e||ce(e)&&w(e)==bn}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;function Pn(e,t){if(ge(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Cn(e))||(In.test(e)||!kn.test(e)||null!=t&&e in Object(t))}var Dn="Expected a function";function wn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Dn);var i=function(){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(wn.Cache||te),i}wn.Cache=te;var An=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rn=/\\(\\)?/g,xn=function(e){var t=wn(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(An,(function(e,i,n,r){t.push(n?r.replace(Rn,"$1"):i||e)})),t}));const On=xn;var Ln=1/0,Nn=E?E.prototype:void 0,Mn=Nn?Nn.toString:void 0;function Un(e){if("string"==typeof e)return e;if(ge(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,Un)+"";if(Cn(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-Ln?"-0":t}function Bn(e,t){return ge(e)?e:Pn(e,t)?[e]:On(function(e){return null==e?"":Un(e)}(e))}var Fn=1/0;function Hn(e){if("string"==typeof e||Cn(e))return e;var t=e+"";return"0"==t&&1/e==-Fn?"-0":t}function jn(e,t){for(var i=0,n=(t=Bn(t,e)).length;null!=e&&i<n;)e=e[Hn(t[i++])];return i&&i==n?e:void 0}function Vn(e,t,i){var n=null==e?void 0:jn(e,t);return void 0===n?i:n}function Kn(e,t){return null!=e&&t in Object(e)}function Gn(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Bn(t,e)).length,o=!1;++n<r;){var a=Hn(t[n]);if(!(o=null!=e&&i(e,a)))break;e=e[a]}return o||++n!=r?o:!!(r=null==e?0:e.length)&&Ce(r)&&Se(a,r)&&(ge(e)||pe(e))}(e,t,Kn)}var Wn=1,Yn=2;function zn(e){return Pn(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Hn(e)):function(e){return function(t){return jn(t,e)}}(e)}function $n(e){return"function"==typeof e?e:null==e?Pi:"object"==typeof e?ge(e)?(t=e[0],i=e[1],Pn(t)&&En(i)?Tn(Hn(t),i):function(e){var n=Vn(e,t);return void 0===n&&n===i?Gn(e,t):vn(i,n,Wn|Yn)}):Sn(e):zn(e);var t,i}function Xn(e){return e!=e}function qn(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,Xn,i)}(e,t,0)>-1}function Zn(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}const Qn=ct&&1/Yi(new ct([,-0]))[1]==1/0?function(e){return new ct(e)}:function(){};var Jn=200;function er(e,t){return e&&e.length?function(e,t,i){var n=-1,r=qn,o=e.length,a=!0,s=[],l=s;if(i)a=!1,r=Zn;else if(o>=Jn){var c=t?null:Qn(e);if(c)return Yi(c);a=!1,r=ji,l=new Fi}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,$n(t)):[]}const tr={H264:"h264",H265:"h265",H266:"h266",AAC:"aac",MP3:"mp3",OPUS:"opus",UNKNOWN:"unknown"},ir={[tr.H265]:'video/mp4; codecs="hev1.1.6.L120.90"',[tr.H264]:'video/mp4; codecs="avc1.42c01e"'};var nr=(e=>(e.MP4="mp4",e.DASH="dash",e.HLS="hls",e))(nr||{}),rr=(e=>(e.M4A="m4a",e.MP4="mp4",e.MP3="mp3",e.DASH="dash",e.HLS="hls",e.OGG="ogg",e))(rr||{}),or=(e=>(e.DRM_ENCRYPT="drm_encrypt",e.PRIVATE_ENCRYPT="private_encrypt",e.PRIVATE_ENCRYPT_UPGRADE="private_encrypt_upgrade",e.STANDARD_ENCRYPT="standard_encrypt",e))(or||{}),ar=(e=>(e.ROOT="root",e.ROOT_LEFT="rootLeft",e.ROOT_RIGHT="rootRight",e.ROOT_TOP="rootTop",e.CONTROLS_LEFT="controlsLeft",e.CONTROLS_RIGTH="controlsRight",e.CONTROLS_RIGHT="controlsRight",e.CONTROLS_CENTER="controlsCenter",e.CONTROLS="controls",e))(ar||{}),sr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cr=function(){let e,t=null;function i(e){return!!e&&("object"==typeof e||"function"==typeof e)}function n(e){if(null!==e&&!i(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}const r=Object,o=Boolean(r.create)||!({__proto__:null}instanceof r),a=r.create||(o?function(e){return n(e),{__proto__:e}}:function(e){if(n(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}),s=function(){return null},l=r.getPrototypeOf||([].__proto__===Array.prototype?function(e){const t=e.__proto__;return i(t)?t:null}:s);return e=function(c,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!i(c)||!i(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");let h=function(){};t=function(){c=null,h=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}},setTimeout((function(){t=null}),0);const d=u;u={get:null,set:null,apply:null,construct:null};for(let e in d){if(!(e in u))throw new TypeError(`Proxy polyfill does not support trap '${e}'`);u[e]=d[e]}"function"==typeof d&&(u.apply=d.apply.bind(d));const f=l(c);let p,g=!1,y=!1;"function"==typeof c?(p=function(){const e=this&&this.constructor===p,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&u.construct)return u.construct.call(this,c,t);if(!e&&u.apply)return u.apply(c,this,t);if(e){t.unshift(c);return new(c.bind.apply(c,t))}return c.apply(this,t)},g=!0):c instanceof Array?(p=[],y=!0):p=o||null!==f?a(f):{};const v=u.get?function(e){return h("get"),u.get(this,e,p)}:function(e){return h("get"),this[e]},m=u.set?function(e,t){h("set"),u.set(this,e,t,p)}:function(e,t){h("set"),this[e]=t},_=r.getOwnPropertyNames(c),E={};_.forEach((function(e){if((g||y)&&e in p)return;const t=r.getOwnPropertyDescriptor(c,e),i={enumerable:Boolean(t.enumerable),get:v.bind(c,e),set:m.bind(c,e)};r.defineProperty(p,e,i),E[e]=!0}));let T=!0;if(g||y){const e=r.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return n(t),e.__proto__=t,e}:s);f&&e(p,f)||(T=!1)}if(u.get||!T)for(let e in c)E[e]||r.defineProperty(p,e,{get:v.bind(c,e)});return r.seal(c),r.seal(p),p},e.revocable=function(i,n){return{proxy:new e(i,n),revoke:t}},e};const ur=lr(cr)();const hr=new class{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new ur(e,{set:(e,i,n)=>{const r=Reflect.get(e,i);Reflect.set(e,i,n);const o=this.watcherMap.get(t);return o&&(this.flushCallback(o),this.flushPropertyCallback(o,i,r,n)),!0}});return this.watcherMap.set(t,{pending:!1,queue:[],property:{}}),t}subscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;this.subscribeId++;return i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}unsubscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;const n=i.queue,r=n.findIndex((e=>e.id===t));void 0!==r&&r>-1&&n.splice(r,1)}subscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){this.subscribeId++,n.property[t]||(n.property[t]={pending:!1,timer:0,pre:null,queue:[]});return n.property[t].queue.push({id:this.subscribeId,callback:i}),this.subscribeId}}unsubscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){const e=n.property[t];if(e){const t=e.queue,n=t.findIndex((e=>e.id===i));void 0!==n&&n>-1&&t.splice(n,1)}}}flushCallback(e){e.pending||(e.pending=!0,setTimeout((()=>{e.queue.forEach((e=>e.callback())),e.pending=!1}),0))}flushPropertyCallback(e,t,i,n){const r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=i),r.timer=setTimeout((()=>{r.queue.forEach((e=>e.callback(r.pre,n))),r.pending=!1}),0))}};function dr(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 fr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(i),!0).forEach((function(t){mr(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function pr(e){return(pr="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 gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yr(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,Dr(n.key),n)}}function vr(e,t,i){return t&&yr(e.prototype,t),i&&yr(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function mr(e,t,i){return(t=Dr(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _r(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&&Tr(e,t)}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tr(e,t){return(Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function br(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 Sr(e)}function Cr(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(ds){return!1}}();return function(){var i,n=Er(e);if(t){var r=Er(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return br(this,i)}}function kr(){return kr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Er(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},kr.apply(this,arguments)}function Ir(e){return function(e){if(Array.isArray(e))return Pr(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 Pr(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 Pr(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 Pr(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 Dr(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 wr={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}(wr);var Ar=wr.exports;const Rr=lr(Ar);var xr="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Or={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Lr="%c[xgplayer]",Nr={config:{debug:xr?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,[Lr,Or.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,[Lr,Or.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,[Lr,Or.error,e].concat(r))}}};var Mr=function(){function e(t){gr(this,e),this.bufferedList=t}return vr(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}(),Ur={};function Br(e){var t=pr(e);return null!==e&&("object"===t||"function"===t)}function Fr(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 y(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function v(){var e=Date.now();if(y(e))return m(e);s=g(v,function(e){var i=e-c,n=t-(e-l);return h?Math.min(n,o-i):n}(e))}function m(e){return s=void 0,d&&n?p(e):(n=r=void 0,a)}function _(){for(var e=Date.now(),i=y(e),o=arguments.length,d=new Array(o),f=0;f<o;f++)d[f]=arguments[f];if(n=d,r=this,l=e,i){if(void 0===s)return function(e){return c=e,s=g(v,t),u?p(e):a}(l);if(h)return s=g(v,t),p(l)}return void 0===s&&(s=g(v,t)),a}return t=+t||0,Br(i)&&(u=!!i.leading,o=(h="maxWait"in i)?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,n=l=r=s=void 0},_.flush=function(){return void 0===s?a:m(Date.now())},_.pending=function(){return void 0!==s},_}Ur.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},Ur.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&&Ur.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return Nr.logError("util.createDomFromHtml",o),null}},Ur.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(ds){var i=e.className&&"object"===pr(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Ur.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(ds){Ur.hasClass(e,t)||(e.className&&"object"===pr(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Ur.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(ds){Ur.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===pr(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},Ur.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Ur.hasClass(e,t)?Ur.removeClass(e,t):Ur.addClass(e,t)}))},Ur.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===Ur.typeOf(e[i])?t.push(e[i]):"Object"===Ur.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(" ")},Ur.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(ds){Nr.logError("util.findDom",ds),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},Ur.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Ur.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},Ur.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Ur.padStart(Math.floor(e/3600),2,0),i=Ur.padStart(Math.floor((e-3600*t)/60),2,0),n=Ur.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},Ur.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},Ur.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Ur.deepCopy=function(e,t){if("Object"===Ur.typeOf(t)&&"Object"===Ur.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==Ur.typeOf(t[i])||t[i]instanceof Node?"Array"===Ur.typeOf(t[i])?e[i]="Array"===Ur.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]:Ur.deepCopy(e[i],t[i])})),e},Ur.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===Ur.typeOf(t[i])&&"Array"===Ur.typeOf(e[i])?"Array"===Ur.typeOf(e[i])&&(n=e[i]).push.apply(n,Ir(t[i])):Ur.typeOf(e[i])!==Ur.typeOf(t[i])||null===e[i]||"Object"!==Ur.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):Ur.deepMerge(e[i],t[i])})),e},Ur.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},Ur.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""},Ur.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},Ur.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Ur.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),Ur.clearTimeout(e,n)}),i);return e._timers.push(n),n},Ur.clearTimeout=function(e,t){var i=e._timers;if("Array"===Ur.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},Ur.clearAllTimers=function(e){var t=e._timers;"Array"===Ur.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Ur.createImgBtn=function(e,t,i,n){var r,o,a,s=Ur.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},Ur.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)"},Ur.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Ur.checkIsFunction=function(e){return e&&"function"==typeof e},Ur.checkIsObject=function(e){return null!==e&&"object"===pr(e)},Ur.hide=function(e){e.style.display="none"},Ur.show=function(e,t){e.style.display=t||"block"},Ur.isUndefined=function(e){if(null==e)return!0},Ur.isNotNull=function(e){return!(null==e)},Ur.setStyleFromCsstext=function(e,t){t&&("String"===Ur.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]})))},Ur.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&&(!function(e,t){for(var i=0,n=t.length;i<n;i++)if(e.indexOf(t[i])>-1)return!0;return!1}(i[0],t)?o[i[0]]=i[1]:r[i[0]]=i[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Ur.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},Ur.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}},Ur.stopPropagation=function(e){e&&e.stopPropagation()},Ur.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Ur.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Ur.checkTouchSupport=function(){return"ontouchstart"in window},Ur.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 Mr(r)},Ur.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}},Ur.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Ur.getHostFromUrl=function(e){if("String"!==Ur.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},Ur.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Ur.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Ur.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Ur.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(ds){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(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)}))},Ur.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Ur.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},Ur.createPositionBar=function(e,t){var i=Ur.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},Ur.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")};return Object.keys(i).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},Ur.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Ur.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},Ur.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:Ur.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},Ur.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 Hr=/(Android)\s([\d.]+)/,jr=/(Version)\/([\d.]+)/,Vr=["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","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Kr={get device(){return Kr.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=/(?:Tizen)/gi.test(e),r=/(?:Web0S)/gi.test(e),o=/(?:Android)/.test(e),a=/(?:Firefox)/.test(e),s=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=s||o&&!/(?:Mobile)/.test(e)||a&&/(?:Tablet)/.test(e),c=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:c,isIpad:s,isIos:c||s,isAndroid:o,isPc:!(c||o||i||l),isSymbian:i,isWindowsPhone:t,isFireFox:a,isTizen:n,isWebOS:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?jr:Hr)?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&&Vr.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(ds){return Promise.resolve(t)}}},Gr="3.0.23-rc.3",Wr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},Yr={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},zr=vr((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};gr(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;Yr[f]&&(f=Yr[f]);var p={playerVersion:Gr,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:Ur.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:Gr,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)g[y[v]]=arguments[v];return g.ex=n?(n[arguments[0]]||{}).msg:"",g}})),$r="play",Xr="playing",qr="ended",Zr="pause",Qr="error",Jr="seeking",eo="seeked",to="timeupdate",io="waiting",no="canplay",ro="durationchange",oo="volumechange",ao="loadeddata",so="ratechange",lo="progress",co="loadstart",uo="emptied",ho="focus",fo="blur",po="ready",go="urlNull",yo="autoplay_started",vo="autoplay_was_prevented",mo="complete",_o="replay",Eo="destroy",To="urlchange",So="download_speed_change",bo="leaveplayer",Co="enterplayer",ko="loading",Io="fullscreen_change",Po="cssFullscreen_change",Do="mini_state_change",wo="definition_change",Ao="after_definition_change",Ro="video_resize",xo="pip_change",Oo="rotate",Lo="screenShot",No="playnext",Mo="shortcut",Uo="xglog",Bo="user_action",Fo="reset",Ho="source_error",jo="source_success",Vo=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],Ko={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Go="fps_stuck";const Wo=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:Ao,AUTOPLAY_PREVENTED:vo,AUTOPLAY_STARTED:yo,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:no,CANPLAY_THROUGH:"canplaythrough",COMPLETE:mo,CSS_FULLSCREEN_CHANGE:Po,DEFINITION_CHANGE:wo,DESTROY:Eo,DOWNLOAD_SPEED_CHANGE:So,DURATION_CHANGE:ro,EMPTIED:uo,ENDED:qr,ENTER_PLAYER:Co,ERROR:Qr,FPS_STUCK:Go,FULLSCREEN_CHANGE:Io,LEAVE_PLAYER:bo,LOADED_DATA:ao,LOADED_METADATA:"loadedmetadata",LOADING:ko,LOAD_START:co,MINI_STATE_CHANGE:Do,PAUSE:Zr,PIP_CHANGE:xo,PLAY:$r,PLAYER_BLUR:fo,PLAYER_FOCUS:ho,PLAYING:Xr,PLAYNEXT:No,PROGRESS:lo,RATE_CHANGE:so,READY:po,REPLAY:_o,RESET:Fo,RETRY:"retry",ROTATE:Oo,SCREEN_SHOT:Lo,SEEKED:eo,SEEKING:Jr,SEI_PARSED:"SEI_PARSED",SHORTCUT:Mo,SOURCE_ERROR:Ho,SOURCE_SUCCESS:jo,STALLED:"stalled",STATS_EVENTS:Ko,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:to,URL_CHANGE:To,URL_NULL:go,USER_ACTION:Bo,VIDEO_EVENTS:Vo,VIDEO_RESIZE:Ro,VOLUME_CHANGE:oo,WAITING:io,XGLOG:Uo},Symbol.toStringTag,{value:"Module"}));function Yo(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var zo=function(e){_r(i,Rr);var t=Cr(i);function i(e){var n;gr(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 Kr.isWeixin&&Kr.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=e.mediaEl instanceof HTMLMediaElement?e.mediaEl:"function"==typeof e.mediaEl?e.mediaEl(n.mediaConfig):Ur.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===Ur.typeOf(e.volume)&&(n.volume=e.volume),e.autoplayMuted&&(n.media.muted=!0,n._lastMuted=!0),e.autoplay&&(n.media.autoplay=!0),e.playsinline&&(n.media.playsinline=!0),n._interval={},n.mediaEventMiddleware={},n.attachVideoEvents(),n}return vr(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=Vo.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]),mr({},t,function(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:Ur.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=Yo.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw Yo.call(t,e,r),s}}else Yo.call(t,e,r)}}(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(Ur.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(jo,{src:e.target.currentSrc,host:Ur.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=Wr[4];i.emit(Ho,new zr(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?Wr[i.code]:"other";i.message;this.media.currentSrc||this.media.srcObject||(i={code:6,message:"empty_src"}),this.emit(e,new zr(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?Ur.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(To,e),this.emit(io),this._currentTime=0,this._duration=0,Ur.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===Ur.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:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{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=kr(Er(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=kr(Er(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=kr(Er(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=kr(Er(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){kr(Er(i.prototype),"removeAllListeners",this).call(this)}}]),i}(),$o=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"}};gr(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return vr(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}(),Xo=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],qo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Zo=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Qo="data-xgplayerid";function Jo(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 ea(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(ds){throw ds.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(ds.message),ds}if(this.__hooks&&this.__hooks[e])try{var a=la.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&Jo.apply(void 0,[r,t,i.next].concat(Ir(n)))})).catch((function(e){throw e})):Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(ds){throw ds.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(ds.message),ds}else Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function ta(e,t){var i=this.__hooks;if(!i||!Array.isArray(i[e]))return-1;for(var n=i[e],r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function ia(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===ta.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function na(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var n=i[e],r=ta.call(this,e,t);-1!==r&&n.splice(r,1)}else i[e]&&(i[e]=null)}function ra(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 oa(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 aa(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 sa(e){e.__hooks=null}function la(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&&Array.isArray(e.__hooks[t])){var a=e.__hooks[t],s=-1;return function e(t,i,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];if(s++,0===a.length||s===a.length)return n.call.apply(n,[t,t].concat(o));var c=a[s],u=c.call.apply(c,[t,t].concat(o));return u&&u.then?u.then((function(r){return!1===r?null:e.apply(void 0,[t,i,n].concat(o))})).catch((function(e){console.warn("[runHooks]".concat(i," reject"),e.message)})):!1!==u?e.apply(void 0,[t,i,n].concat(o)):void 0}.apply(void 0,[e,t,i].concat(r))}return i.call.apply(i,[e,e].concat(r))}function ca(e,t){Nr.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var ua=function(){function e(t){gr(this,e),Ur.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),aa(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return vr(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=Ur.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)})):ca(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)})):ca(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)})):ca(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=fr(fr({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return ea.call.apply(ea,[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 ia.call.apply(ia,[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 na.call.apply(na,[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(),Ur.clearAllTimers(this),Ur.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),sa(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:"defineMethod",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var ha=Element.prototype;ha.matches=ha.matchesSelector||ha.mozMatchesSelector||ha.msMatchesSelector||ha.oMatchesSelector||ha.webkitMatchesSelector}var da=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function fa(e,t,i,n,r){var o=pa.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function pa(e,t,i,n){return function(i){i.delegateTarget=da(i.target,t),i.delegateTarget&&n.call(e,i)}}var ga=function(e,t,i,n,r){return"function"==typeof e.addEventListener?fa.apply(null,arguments):"function"==typeof i?fa.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return fa(e,t,i,n,r)})))};const ya=lr(ga);var va={CONTROLS:"controls",ROOT:"root"},ma={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"},_a="xg-icon-disable";function Ea(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Ta(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 Ur.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(Ea(e)||Ea(e.url))return n.src=Ea(e)?e:e.url||"",o=Ur.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Ur.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Nr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(ds){return Nr.logError("Plugin named [".concat(r,"]:createIcon"),ds),null}return"string"==typeof e?Ur.createDomFromHtml(e,n,i):(Nr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Sa(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"===pr(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===pr(e)&&e.attr&&"object"===pr(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Ta(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Ta(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var ba=function(e){_r(i,ua);var t=Cr(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gr(this,i),(e=t.call(this,n)).__delegates=[],e}return vr(i,[{key:"__init",value:function(e){if(kr(Er(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],Sa(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(ds){throw Nr.logError("Plugin:".concat(this.pluginName,":render"),ds),new Error("Plugin:".concat(this.pluginName,":render:").concat(ds.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=Ur.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"===pr(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"===pr(a)&&"function"==typeof a.plugin&&(n=a.options?Ur.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:"disable",value:function(){this.config.disable=!0,Ur.addClass(this.find(".xgplayer-icon"),_a)}},{key:"enable",value:function(){this.config.disable=!1,Ur.removeClass(this.find(".xgplayer-icon"),_a)}},{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=kr(Er(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"===Ur.typeOf(e)?this.root.style[e]=t:void("Object"===Ur.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"===Ur.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Ur.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 Nr.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)),kr(Er(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null})),this.extraEls=[]}}],[{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=ya(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=ya(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return va}},{key:"POSITIONS",get:function(){return ma}}]),i}(),Ca=function(){function e(){var t=this;if(gr(this,e),mr(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 Br(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Fr(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(ds){console.error(ds)}}return vr(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(Qo),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{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(ds){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.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}(),ka=null;var Ia={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()},ka||(ka=new Ca),ka.addObserver(t,i)),this.pluginGroup[n]={_originalOptions:e.config||{},_plugins:{}}},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"===Ur.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=e;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"===Ur.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===Ur.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(ds){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),ds)}},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(ds){throw a.push(i(null)),ds}})),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()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n,r;i=e.root,null===(r=ka)||void 0===r||r.unObserver(i,n);for(var o=this.pluginGroup[t]._plugins,a=0,s=Object.keys(o);a<s.length;a++){var l=s[a];this.unRegister(t,l)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Pa={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 Da(){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 wa=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=Sr(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),mr(Sr(e),"onMouseLeave",(function(t){Sr(e).player.focus()})),e}return vr(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Kr.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(Pa.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(Do,(function(t){t?Ur.addClass(e.root,"mini-controls"):Ur.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Kr.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&&Ur.addClass(this.root,Pa.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){Ur.removeClass(this.root,Pa.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){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){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case ma.CONTROLS_LEFT:t.root=this.left;break;case ma.CONTROLS_RIGHT:t.root=this.right;break;case ma.CONTROLS_CENTER:t.root=this.center;break;case ma.CONTROLS:t.root=this.root;break;default:t.root=this.left}return kr(Er(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Kr.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,n=e.initShow;if(!e.disable){var r=Ur.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},mr({},Pa.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}(),Aa={lang:{},langKeys:[],textKeys:[]};function Ra(e,t){return Object.keys(t).forEach((function(i){var n,r=Ur.typeOf(t[i]),o=Ur.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,Ir(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Ra(e[i],t[i])):e[i]=t[i]})),e}function xa(){Object.keys(Aa.lang.en).map((function(e){Aa.textKeys[e]=e}))}function Oa(e,t){var i=e.LANG;if(t||(t=Aa),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Ra(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),xa()}}Oa({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 La={get textKeys(){return Aa.textKeys},get langKeys(){return Aa.langKeys},get lang(){var e={};return Aa.langKeys.map((function(t){e[t]=Aa.lang[t]})),Aa.lang["zh-cn"]&&(e.zh=Aa.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=Aa),t.lang){i="Array"!==Ur.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]?Ra(n[e.LANG]||{},e.TEXT||{}):Oa(e,t)})),xa()}},use:Oa,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Ra(i.lang,Aa.lang),(t=i.langKeys).push.apply(t,Ir(Aa.langKeys)),Ra(i.textKeys,Aa.textKeys),i}},Na={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Ma=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Ua={},Ba=null,Fa=function(e){_r(i,Ar.EventEmitter);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"add",value:function(e){e&&(Ua[e.playerId]=e,1===Object.keys(Ua).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Ua[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Ua)if(Object.prototype.hasOwnProperty.call(Ua,i)){var n=Ua[i];if(t){if(e(n))break}else e(n)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var n=e(i);return n&&(t=i),n}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ua[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Ua[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Ua),t=0;t<e.length;t++){var i=Ua[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ua[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Ua[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Ba||(Ba=new i),Ba}}]),i}();var Ha=["play","pause","replay","retry"],ja=0,Va=0,Ka=null,Ga=function(e){_r(i,zo);var t=Cr(i);function i(e){var n;gr(this,i);var r,o=Ur.deepMerge(Da(),e);mr(Sr(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Nr.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(no,n.canPlayFunc),n.removeClass(Pa.ENTER)}})),mr(Sr(n),"onFullscreenChange",(function(e,t){var i=function(){Ur.setTimeout(Sr(n),(function(){n.resize()}),100)},r=Ur.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Bo,{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,Qo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Pa.FULLSCREEN),n.emit(Io,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=Sr(n),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Ur.setTimeout(Sr(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(Pa.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Pa.FULLSCREEN)}n._fullscreenEl=null,n.emit(Io,!1)}})),mr(Sr(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),mr(Sr(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),aa(Sr(n),Ha),n.config=o,n._pluginInfoId=Ur.generateSessionId(),(r=Sr(n)).logInfo=Nr.logInfo.bind(r),r.logWarn=Nr.logWarn.bind(r),r.logError=Nr.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.handleSource=!0,n._state=Na.INITIAL,n.isAd=!1,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=La.init(n._pluginInfoId),Kr.os.isAndroid&&Kr.osVersion>0&&Kr.osVersion<6&&(n.config.autoplay=!1),n.database=new $o,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=Ka,!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"))),br(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(),Ia.onPluginsReady(Sr(n)),n.getInitDefinition(),n.setState(Na.READY),Ur.setTimeout(Sr(n),(function(){n.emit(po)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<Na.ATTACHED)&&n.start(),n}return vr(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.nodeType)return this.emit(Qr,new zr("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=i}var n=function(e){for(var t=Object.keys(Ua),i=0;i<t.length;i++){var n=Ua[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(Nr.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Qo,this.playerId),this.media.setAttribute(Qo,this.playerId),null===(e=Ka)||void 0===e||e.add(this),Ia.init(this),this._initBaseDoms(),this.config.controls){var r=this.config.controls.root||null,o=Ia.register(this,wa,{root:r});this.controls=o}var a="mobile"===this.config.isMobileSimulateMode?"mobile":Kr.device;if(this.addClass("".concat(Pa.DEFAULT," ").concat(Pa.INACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Pa.NO_CONTROLS)),this.config.autoplay?this.addClass(Pa.ENTER):this.addClass(Pa.NO_START),this.config.fluid){var s=this.config,l=s.width,c=s.height;"number"==typeof l&&"number"==typeof c||(l=600,c=337.5);var u={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*c/l,"%")};Object.keys(u).forEach((function(e){t.root.style[e]=u[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var h=this.root.getBoundingClientRect(),d=h.width,f=h.height,p=h.left,g=h.top;return this.sizeInfo.width=d,this.sizeInfo.height=f,this.sizeInfo.left=p,this.sizeInfo.top=g,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=Ur.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)])})),Xo.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Kr.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(ao,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once($r,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Xo.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off($r,this.playFunc),this.off(no,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(Ur.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.media&&(e&&""!==e&&("Array"!==Ur.typeOf(e)||0!==e.length)||(e="",this.emit(go),Nr.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){Ur.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===Ur.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"===Ur.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var r=this.media.readyState;Nr.logInfo("_startInit readyState",r),this.config.autoplay&&(!Ur.isMSE(this.media)&&this.load(),(Kr.os.isIpad||Kr.os.isPhone)&&this.mediaPlay());var o=this.config.startTime;this.__startTime=o>0?o:-1,this.config.startTime=0,r>=2&&this.duration>0?this.canPlayFunc():this.on(no,this.canPlayFunc),(!this.hasStart||this.state<Na.ATTACHED)&&Ia.afterInit(this),this.hasStart=!0,this.setState(Na.ATTACHED),Ur.setTimeout(this,(function(){t.emit(mo)}),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&&La.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=Ia.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Nr.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(s){Nr.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,Ir(a)),(n=e.config.ignores).push.apply(n,Ir(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,Ir(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case ma.ROOT_RIGHT:this.rightBar||(this.rightBar=Ur.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case ma.ROOT_LEFT:this.leftBar||(this.leftBar=Ur.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case ma.ROOT_TOP:this.topBar||(this.topBar=Ur.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&Ur.addClass(this.topBar,Pa.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=Ia.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!Ia.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=Ia.getRootByConfig(n.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s,l=r.position?r.position:r.config&&r.config.position||n.defaultConfig&&n.defaultConfig.position;return!r.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(s=this.controls)||void 0===s?void 0:s.registerPlugin(n,r,n.pluginName):(r.root||(r.root=this._getRootByPosition(l)),Ia.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?Ia.unRegister(this,e):e instanceof ua&&Ia.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 ua&&(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 Ia.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Ia.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Ur.hasClass(this.root,e)||Ur.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Ur.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Ur.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>Na.ATTACHING)){var i=this._playSessionId;return Ur.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(Na.ATTACHING),this._registerPlugins(!1),Ia.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url,{playSessionId:i})}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Nr.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===Ur.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._seekToStartTime(),o&&i.pause(),i.off("error",r),e(!0)};i.once("error",r),n?(Kr.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<Na.ATTACHED)return this.removeClass(Pa.NO_START),this.addClass(Pa.ENTER),this.start(),void(this._useAutoplay=!0);this.state<Na.RUNNING&&(this.removeClass(Pa.NO_START),!this.isCanplay&&this.addClass(Pa.ENTER));var t=kr(Er(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Pa.NOT_ALLOW_AUTOPLAY),e.addClass(Pa.PLAYING),e.state<Na.RUNNING&&(Nr.logInfo(">>>>playPromise.then"),e.setState(Na.RUNNING),e.emit(yo))})).catch((function(t){if(Nr.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Pa.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Ur.setTimeout(e,(function(){e._errorTimer=null,e.emit(vo),e.addClass(Pa.NOT_ALLOW_AUTOPLAY),e.removeClass(Pa.ENTER),e.pause(),e.setState(Na.NOTALLOW)}),0))})):(Nr.logWarn("video.play not return promise"),this.state<Na.RUNNING&&(this.setState(Na.RUNNING),this.removeClass(Pa.NOT_ALLOW_AUTOPLAY),this.removeClass(Pa.NO_START),this.removeClass(Pa.ENTER),this.addClass(Pa.PLAYING),this.emit(yo))),t}},{key:"mediaPause",value:function(){kr(Er(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){kr(Er(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Pa.PAUSED),la(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;la(this,"pause",(function(){kr(Er(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(eo,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Pa.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(eo,this._onceSeekCanplay),this.state<Na.RUNNING?(this.removeClass(Pa.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(wo,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,fr({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(Ao,{from:t,to:e})})):this.emit(Ao,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ao,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Pa.NOT_ALLOW_AUTOPLAY,Pa.PLAYING,Pa.NO_START,Pa.PAUSED,Pa.REPLAY,Pa.ENTER,Pa.ENDED,Pa.ERROR,Pa.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(Pa.NO_START),this.emit(Fo)}},{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;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var n=Da();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e,t=this,n=this.innerContainer,r=this.root,o=this.media;if(r&&o){if(this.hasStart=!1,this._useAutoplay=!1,r.removeAttribute(Qo),o.removeAttribute(Qo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),Ur.clearAllTimers(this),this.emit(Eo),null===(e=Ka)||void 0===e||e.remove(this),Ia.destroy(this),sa(this),kr(Er(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var a=n.children,s=0;s<a.length;s++)n.removeChild(a[s]);!n&&o instanceof window.Node&&r.contains(o)&&!this.config.remainMediaAfterDestroy&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var l=r.className.split(" ");l.length>0?r.className=l.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(Pa.ENDED),this.currentTime=0,this.isSeeking=!1,la(this,"replay",(function(){e.once(eo,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(_o),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Pa.ERROR),this.addClass(Pa.LOADING),la(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=Ur.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(no,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Pa.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Ur.filterStyleFromText(e)),Ur.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Ur.filterStyleFromText(t),Ur.addClass(t,n),t.setAttribute(Qo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Pa.PARENT_FULLSCREEN),this._orgCss&&(Ur.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Ur.removeClass(e,i),t&&t!==e&&this._orgPCss&&(Ur.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Ur.removeClass(t,n),t.removeAttribute(Qo))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:Ur.scrollTop(),left:Ur.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",Ur.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<qo.length;n++){var r=qo[n];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o:Promise.resolve()}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(a){return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||Ur.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<Zo.length;i++){var n=Zo[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(Pa.INNER_FULLSCREEN," ").concat(Pa.CSS_FULLSCREEN):Pa.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i;(!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(this.fullscreen=!0,this.emit(Io,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Po,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.CSS_FULLSCREEN):Pa.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(Io,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Po,!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(Pa.INNER_FULLSCREEN," ").concat(Pa.ROTATE_FULLSCREEN):Pa.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Pa.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style");var i=90===Math.abs(window.orientation)||90===Math.abs(screen.orientation.angle);this.root.style.width="".concat(i?window.innerWidth:window.innerHeight,"px"),this.emit(Io,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.ROTATE_FULLSCREEN):Pa.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Pa.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(Io,!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(ho,fr({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._clearUserTimer(),this.emit(fo,fr({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(Pa.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Ur.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||i||!this.paused&&!this.ended)&&this.addClass(Pa.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Pa.ENTER),this.removeClass(Pa.ERROR),this.removeClass(Pa.LOADING),this.isCanplay=!0,this.waitTimer&&Ur.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(ro,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Pa.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===Na.ENDED&&this.setState(Na.RUNNING),this.removeClass(Pa.PAUSED),this.ended&&this.removeClass(Pa.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Pa.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Pa.ENDED),this.setState(Na.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Pa.NOT_ALLOW_AUTOPLAY),this.removeClass(Pa.NO_START),this.removeClass(Pa.ENTER),this.removeClass(Pa.LOADING),this.addClass(Pa.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Pa.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Ur.clearTimeout(this,this.waitTimer),this.removeClass(Pa.LOADING),this.removeClass(Pa.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Ur.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Ur.setTimeout(this,(function(){e.addClass(Pa.LOADING),e.emit(ko),Ur.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Pa.NO_START,Pa.PAUSED,Pa.ENDED,Pa.ERROR,Pa.REPLAY,Pa.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(Pa.LOADING))&&this.media.readyState>2&&(this.removeClass(Pa.LOADING),Ur.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===Na.NOTALLOW&&this.duration&&(this.setState(Na.RUNNING),this.emit(yo)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Ur.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"===Ur.typeOf(e)?e:e.type||"";i.props&&"Array"!==Ur.typeOf(i.props)&&(i.props=[i.props]),this.emit(Bo,fr({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=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,n=void 0===i?0:i,r=t.endDiff,o=void 0===r?0:r,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,c=0;c<l;c++)if(a.start(c)+n<=s&&a.end(c)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,t=this.videoPos,i=t.vy,n=t.vx,r=t.h,o=t.w,a=this.videoPos.rotate;if(!(a<0&&r<0&&o<0)){var s=this.videoPos._pi;if(!s&&this.media.videoHeight&&(s=this.media.videoWidth/this.media.videoHeight*100),s){this.videoPos.pi=s;var l={rotate:a=a<0?0:a},c=0,u=0,h=1,d=Math.abs(a/90),f=this.root,p=this.innerContainer,g=f.offsetWidth,y=p?p.offsetHeight:f.offsetHeight,v={},m=y,_=g;if(d%2==0)h=r>0?100/r:o>0?100/o:1,l.scale=h,c=i>0?(100-r)/2-i:0,l.y=2===d?0-c:c,u=n>0?(100-o)/2-n:0,l.x=2===d?0-u:u,v.width="".concat(_,"px"),v.height="".concat(m,"px"),v.maxWidth="",v.maxHeight="";else if(d%2==1){m=g;var E=y-g;u=-E/2/(_=y)*100,l.x=3===d?u+i/2:u-i/2,c=E/2/m*100,l.y=3===d?c+n/2:c-n/2,l.scale=h,v.width="".concat(_,"px"),v.maxWidth="".concat(_,"px"),v.height="".concat(m,"px"),v.maxHeight="".concat(m,"px")}var T=Ur.getTransformStyle(l,this.media.style.transform||this.media.style.webkitTransform);v.transform=T,v.webkitTransform=T,Object.keys(v).map((function(t){e.media.style[t]=v[t]}))}}}},{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"===Ur.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,la(this,"playnext",(function(){t.start(),t.emit(No,e)}))}},{key:"resize",value:function(){var e=this;if(this.media&&this.root){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 y={videoScale:h,vWidth:f,vHeight:p,cWidth:f,cHeight:p+l};this.resizePosition(),this.emit(Ro,y)}}}},{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){Nr.logInfo("setState","state from:".concat(Ma[this.state]," to:").concat(Ma[e])),this._state=e}},{key:"preProcessUrl",value:function(e,t){var i=this.config,n=i.preProcessUrl,r=i.preProcessUrlOptions,o=Object.assign({},r,t);return Ur.isBlob(e)||"function"!=typeof n?{url:e}:n(e,o)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{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(Na.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===Na.RUNNING||this._state===Na.ENDED},set:function(e){e?this.setState(Na.RUNNING):this._state>=Na.RUNNING&&this.setState(Na.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){var t=La.langKeys.filter((function(t){return t===e}));0!==t.length||"zh"===e?(this.config.lang=e,Ia.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(La.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 Gr}},{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 kr(Er(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=kr(Er(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return kr(Er(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=Ur.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Va},set:function(e){Va=e}},{key:"realTimeSpeed",get:function(){return ja},set:function(e){ja=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 ea.call.apply(ea,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return ia.call.apply(ia,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return na.call.apply(na,[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 ra.call.apply(ra,[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 oa.call.apply(oa,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),Ur.typeOf(t)===Boolean&&(this.muted=t)),null===(i=Ka)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Nr.config.debug},set:function(e){Nr.config.debug=e}},{key:"instManager",get:function(){return Ka},set:function(e){Ka=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=Ka)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=Ka)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return Kr.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Kr.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}();mr(Ga,"defaultPreset",null),mr(Ga,"XgVideoProxy",null),Ga.instManager=Fa.getInstance();const Wa=Object.assign(Ga,{BasePlugin:ua,Errors:zr,Events:Wo,InstManager:Fa,Sniffer:Kr,Util:Ur}),Ya={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"}},za=["zh","en","jp","zh-hk"],$a={NORMAL:0,INNER:1,FULLSCREEN:2};var Xa=(e=>(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))(Xa||{});const qa=5e9,Za={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var Qa=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(Qa||{}),Ja={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:"生放送"}},es={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:"直播"}};const ts="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,is="color: #fff; background-color: #5f5f5f;",ns="color: #fff; background-color: #f53f3f;",rs="color: #fff; background-color: #ff7d00;",os="color: #fff; background: #4281ff",as="%c VePlayer %c 1.18.0 ",ss={config:{debug:ts?3:1},log:function(e,...t){this.config.debug>=3&&console.log(as,is,os,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(as,rs,os,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](as,ns,os,e,...t)}};localStorage.getItem("velog")&&(ss.config.debug=3);var ls={exports:{}};ls.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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])+"]"}},v=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},m={s:v,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(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,c),o=i-r<0,a=t.clone().add(n+(o?-1:1),c);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:c,y:h,w:l,d:s,D:d,h:a,m:o,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",E={};E[_]=y;var T=function(e){return e instanceof k},S=function e(t,i,n){var r;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();E[o]&&(r=o),i&&(E[o]=i,r=o);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;E[s]=t,r=s}return!n&&r&&(_=r),r||!n&&_},b=function(e,t){if(T(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new k(i)},C=m;C.l=S,C.i=T,C.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function y(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=y.prototype;return v.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(p);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()},v.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()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var i=b(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return b(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<b(e)},v.$g=function(e,t,i){return C.u(e)?this[t]:this.set(i,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var i=this,n=!!C.u(t)||t,u=C.p(e),f=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(s)},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,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(u){case h:return n?f(1,0):f(31,11);case c:return n?f(1,y):f(0,y+1);case l:var _=this.$locale().weekStart||0,E=(g<_?g+7:g)-_;return f(n?v-E:v+(6-E),y);case s:case d:return p(m+"Hours",0);case a:return p(m+"Minutes",1);case o:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var i,l=C.p(e),u="set"+(this.$u?"UTC":""),f=(i={},i[s]=u+"Date",i[d]=u+"Date",i[c]=u+"Month",i[h]=u+"FullYear",i[a]=u+"Hours",i[o]=u+"Minutes",i[r]=u+"Seconds",i[n]=u+"Milliseconds",i)[l],p=l===s?this.$D+(t-this.$W):t;if(l===c||l===h){var g=this.clone().set(d,1);g.$d[f](p),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[C.p(e)]()},v.add=function(n,u){var d,f=this;n=Number(n);var p=C.p(u),g=function(e){var t=b(f);return C.w(t.date(t.date()+Math.round(e*n)),f)};if(p===c)return this.set(c,this.$M+n);if(p===h)return this.set(h,this.$y+n);if(p===s)return g(1);if(p===l)return g(7);var y=(d={},d[o]=t,d[a]=i,d[r]=e,d)[p]||1,v=this.$d.getTime()+n*y;return C.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||f;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},p={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(g,(function(e,t){return t||p[e]||r.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,d,f){var p,g=C.p(d),y=b(n),v=(y.utcOffset()-this.utcOffset())*t,m=this-y,_=C.m(this,y);return _=(p={},p[h]=_/12,p[c]=_,p[u]=_/3,p[l]=(m-v)/6048e5,p[s]=(m-v)/864e5,p[a]=m/i,p[o]=m/t,p[r]=m/e,p)[g]||m,f?_:C.a(_)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return E[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=S(e,t,!0);return n&&(i.$L=n),i},v.clone=function(){return C.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},y}(),I=k.prototype;return b.prototype=I,[["$ms",n],["$s",r],["$m",o],["$H",a],["$W",s],["$M",c],["$y",h],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),b.extend=function(e,t){return e.$i||(e(t,k,b),e.$i=!0),b},b.locale=S,b.isDayjs=T,b.unix=function(e){return b(1e3*e)},b.en=E[_],b.Ls=E,b.p={},b}();const cs=lr(ls.exports);var us,hs,ds,fs={exports:{}};const ps=lr(fs.exports=(us="minute",hs=/[+-]\d\d(?::?\d\d)?/g,ds=/([+-]|\d\d)/g,function(e,t,i){var n=t.prototype;i.utc=function(e){return new t({date:e,utc:!0,args:arguments})},n.utc=function(e){var t=i(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),us):t},n.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var r=n.parse;n.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),r.call(this,e)};var o=n.init;n.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 o.call(this)};var a=n.utcOffset;n.utcOffset=function(e,t){var i=this.$utils().u;if(i(e))return this.$u?0:i(this.$offset)?a.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(hs);if(!t)return null;var i=(""+t[0]).match(ds)||["-",0,0],n=i[0],r=60*+i[1]+ +i[2];return 0===r?0:"+"===n?r:-r}(e)))return this;var n=Math.abs(e)<=16?60*e:e,r=this;if(t)return r.$offset=n,r.$u=0===e,r;if(0!==e){var o=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(r=this.local().add(n+o,us)).$offset=n,r.$x.$localOffset=o}else r=this.utc();return r};var s=n.format;n.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return s.call(this,t)},n.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var l=n.toDate;n.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=n.diff;n.diff=function(e,t,n){if(e&&this.$u===e.$u)return c.call(this,e,t,n);var r=this.local(),o=i(e).local();return c.call(r,o,t,n)}}));var gs=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"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},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 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.exports=function(e){return"object"===(void 0===e?"undefined":n(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,y=0,v={},m=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[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 v[++y]=function(){s("function"==typeof e?e:Function(e),t)},n(y),y},f=function(e){delete v[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),y=i(37),v=i(20).set,m=i(40)(),_=i(21),E=i(41),T=i(42),S=i(43),b=l.TypeError,C=l.process,k=C&&C.versions,I=k&&k.v8||"",P=l.Promise,D="process"==u(C),w=function(){},A=r=_.f,R=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(w,w)};return(D||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t&&0!==I.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(n){}}(),x=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},O=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&&M(e),e._h=1),!0===s?i=n:(u&&u.enter(),i=s(n),u&&(u.exit(),a=!0)),i===t.promise?c(b("Promise-chain cycle")):(o=x(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&&L(e)}))}},L=function(e){v.call(l,(function(){var t,i,n,r=e._v,o=N(e);if(o&&(t=E((function(){D?C.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=D||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){v.call(l,(function(){var t;D?C.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=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()),O(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 b("Promise can't be resolved itself");(i=x(t))?m((function(){var r={_w:n,_d:!1};try{i.call(t,c(e,r,1),c(U,r,1))}catch(o){U.call(r,o)}})):(n._v=t,n._s=1,O(n,!1))}catch(r){U.call({_w:n,_d:!1},r)}}};R||(P=function(e){p(this,P,"Promise","_h"),f(e),n.call(this);try{e(c(B,this,1),c(U,this,1))}catch(t){U.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)(P.prototype,{then:function(e,t){var i=A(y(this,P));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=D?C.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&O(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(U,e,1)},_.f=A=function(e){return e===P||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!R,{Promise:P}),i(45)(P,"Promise"),i(46)("Promise"),a=i(2).Promise,h(h.S+h.F*!R,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!R),"Promise",{resolve:function(e){return S(s&&this===a?P:this,e)}}),h(h.S+h.F*!(R&&i(47)((function(e){P.all(e).catch(w)}))),"Promise",{all:function(e){var t=this,i=A(t),n=i.resolve,r=i.reject,o=E((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=A(t),n=i.reject,r=E((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,y=t&e.B,v=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&&v&&void 0!==v[c])?v:l)[c],d=y&&u?s(h,n):g&&"function"==typeof h?s(Function.call,h):h,v&&a(v,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,y,v=d?function(){return e}:l(e),m=n(i,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(f=s(e.length);f>_;_++)if((y=t?m(a(p=e[_])[0],p[1]):m(e[_]))===c||y===u)return y}else for(g=v.call(e);!(p=g.next()).done;)if((y=r(g,m,p.value,t))===c||y===u)return y};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 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};t.default=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var s=void 0;try{s=(0,o.getUri)(e,t,i,r)}catch(l){return Promise.reject(l.message)}return new a.default({type:"json",method:"GET",url:s}).then((function(e){var t=void 0;if(e&&e.response)switch(n(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}))};var r,o=i(49),a=(r=i(51))&&r.__esModule?r:{default:r};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]:{},o=arguments[3];try{e=JSON.parse((0,n.decode)(e))}catch(s){throw new Error("base64 decode error: "+s.message)}!1===o.jointSsl||r(i,"ssl")||r(i,"Ssl")||(i.Ssl=1);var a=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+function(e){var t=[];for(var i in e)r(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}(i);return a};var n=i(50),r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.data,a=void 0===o?{}:o,s=t.headers,l=void 0===s?{}:s;return new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if("GET"!==o)throw new Error("xhr "+o+" is not supported");for(var c in a)s.push(c+"="+a[c]);for(var u in n.open(o,""+i,!0),n.responseType="",l)Object.prototype.hasOwnProperty.call(l,u)&&n.setRequestHeader(u,""+l[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}]);const ys=lr(gs);cs.extend(ps);var vs=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(vs||{});function ms(e){try{return JSON.parse(e)}catch(ds){return ss.warn(`[utils/json] decode fail: ${e}`,ds),null}}function _s(e,t="GetPlayInfoToken"){if(!e)return;const i={},n=ms(window.atob(e));if(n&&"string"==typeof n[t]){n[t].split("&").map((e=>{const t=e.split("=");t[0]&&t[1]&&(i[t[0]]=t[1])}))}return i}function Es(e){const t={};return decodeURIComponent(e).split("&").map((e=>{const i=e.split("=");i[0]&&i[1]&&(t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))})),t}const Ts=e=>{var t,i,n;if(!(null==e?void 0:e.playAuthToken))return;const r=_s(null==e?void 0:e.playAuthToken),o=null!=(i=null==(t=null==r?void 0:r.FileType)?void 0:t.toLowerCase())?i:"video",a=null==(n=null==r?void 0:r.Format)?void 0:n.toLowerCase();return a||(Object.values(vs).includes(o)?nr.MP4:rr.M4A)},Ss=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;const t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;const i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),n=cs.utc(i,"YYYYMMDD hhmmss");if(!n.isValid())return!1;return n.add(t,"seconds").isBefore(cs())};function bs(e,t){const i=["240p","360p","480p","540p","720p","1080p","2k","4k","od","oe"],n=e.Definition,r=t.Definition;if(i.includes(n)&&i.includes(r)){const e=i.findIndex((e=>e.toLocaleLowerCase()===n.toLocaleLowerCase()));return i.findIndex((e=>e.toLocaleLowerCase()===r.toLocaleLowerCase()))-e}return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}function Cs(e){const{playAuthToken:t,playDomain:i,reqParams:n={},definitionMap:r,needThumbs:o=!1,needBarrageMask:a=!1,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l,urlQueryParams:h}=e;if(t){const e=u(c({},n),{NeedThumbs:o?1:0,NeedBarrageMask:a?1:0});return new Promise(((n,o)=>{ys.url(t,i,e).then((e=>{var t;const{Status:i,PlayInfoList:o=[],PosterUrl:a,Vid:d,Duration:f,BarrageMaskUrl:p,ThumbInfoList:g=[],EnableAdaptive:y,AdaptiveBitrateStreamingInfo:v}=e.Data||e;if(i===Xa.VALID&&o.length){const i=o.map((e=>{var t;const i=h?zs(e.MainPlayUrl,h):e.MainPlayUrl,n=h?zs(e.BackupPlayUrl,h):e.BackupPlayUrl;return c(c({vid:d,url:i,_mainURL:i,_backupURL:n,streamType:e.Format,backupUrl:n,backUrlList:[n],fileType:e.FileType,format:e.Format,bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,playAuthId:e.PlayAuthId,playAuth:e.PlayAuth,secretKey:e.PlayAuth,vwidth:e.Width,vheight:e.Height,vtype:null==(t=e.Format)?void 0:t.toLocaleUpperCase(),codec:e.Codec,urlExpireTimestamp:al(e.MainUrlExpire,10,qa),drmType:e.DrmType},e),Hs(e,{definitionMap:r,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l}))})).sort(bs);n({playList:i,type:null==(t=i[0])?void 0:t.Format,poster:a,vid:d,duration:f,dashOpts:e.Data?e:{Data:u(c({},e),{VideoID:d})},thumbs:g,barrageMaskUrl:p,enableAdaptive:y,adaptiveBitrateStreamingInfo:v})}else n({playList:[],poster:a,vid:d,duration:f,dashOpts:e.Data?e:{Data:e},thumbs:g,barrageMaskUrl:p,enableAdaptive:y,adaptiveBitrateStreamingInfo:v}),ss.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{ss.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function ks(e,t,i,n){return d(this,null,(function*(){try{return yield e()}catch(r){if(--t&&i(r))return ks(e,t,i,n);if(n&&"function"==typeof n)return yield n(r);throw r}}))}function Is(e,t,i,n){return i+"/?"+n+"&"+rl({ThirdPartyDrmType:e,Kid:t})}const Ps="__veplayer_";function Ds(e,t="",i){if(!e)return;const n=Ps+t+"_"+e;localStorage.setItem(n,i+"")}function ws(e,t=""){if(!e)return;const i=Ps+t+"_"+e;return localStorage.getItem(i)}function As(){var e,t;try{const i=null==(t=null==(e=globalThis.crypto)?void 0:e.randomUUID)?void 0:t.call(e);if("string"==typeof i&&i.length>0)return i}catch(ds){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function Rs(e){if(!e)return As();const t=`line_user_${encodeURIComponent(e)}`;try{const e=ws(t,"ttdrama");if(e)return e;const i=As();return Ds(t,"ttdrama",i),i}catch(ds){return As()}}function xs(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var Os=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(Os||{});function Ls(e,t){return new Promise(((i,n)=>{try{e||n(new Error("url is undefined"));let r=xs();const o=r,a=new window.XMLHttpRequest,s={status:0,statusText:"",connectTime:0,raw:a};a.open("get",e),a.onreadystatechange=()=>{2===a.readyState&&(s.headers=function(e){const t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){const i=e.split(": "),n=i.shift();t[n]=i.join(": ")}))}catch(i){return t}return t}(a),s.connectTime=xs()-o,s.status=a.status,s.statusText=a.statusText,r=xs())},a.onload=()=>{s.response=a.response,i(s)},a.onprogress=e=>{const t=xs()-r;let i=0;i=parseInt(""+e.loaded/1e3/(t/1e3),10),s.speed=0|i,s.costTime=t},a.onerror=()=>{s.status||(s.status=-1,s.costTime=xs()-r),n(s)},a.ontimeout=()=>{s.status||(s.status=-2,s.costTime=xs()-r),i(s)},a.onabort=()=>{i(s)},(null==t?void 0:t.type)&&(a.responseType=t.type),a.timeout=(null==t?void 0:t.timeout)||1e4,a.setRequestHeader("Range",`bytes=${(null==t?void 0:t.range)||"0-1048576"}`),a.send()}catch(ds){n(ds)}}))}function Ns(e){var t,i,n;if(e.url)return(null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i.hls)||(null==(n=null==e?void 0:e.plugins)?void 0:n.mp4encryptplayer)?1:+Ur.isMSE(e.media)}function Ms(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class Us{constructor(){this.timings=[],this.timingMap={},this.now=function(){const e=globalThis.performance;return(null==e?void 0:e.now)&&"function"==typeof e.now?()=>e.now():()=>Date.now()}(),this.startAt=this.now()}markDuration(e,t){const i=Ms(t);this.timings.push({name:e,duration:i}),this.timingMap[e]=i}measure(e,t){const i=this.now();try{return t()}finally{this.markDuration(e,this.now()-i)}}measureAsync(e,t){return d(this,null,(function*(){const i=this.now();try{return yield t()}finally{this.markDuration(e,this.now()-i)}}))}finish(){return{totalDuration:Ms(this.now()-this.startAt),timings:[...this.timings],timingMap:c({},this.timingMap)}}}let Bs;const Fs=()=>Bs,Hs=function(e,t){var i;const{definitionMap:n,autoDemoteDefinition:r,autoDemoteDefinitionTextKey:o}=t||{};if(!e)return{definition:"240P"};const a=e,s=a.Definition||a.Quality||a.definition||a.quality;if(!s)return{definition:"240P"};if(n){let e={definition:s};const t=n[s];return e=t?"string"==typeof t?{definition:t}:c({definition:s},t||{}):{definition:s},r&&r.toLocaleLowerCase()===(null==(i=null==e?void 0:e.definition)?void 0:i.toLocaleLowerCase())&&(e={definition:"auto",definitionTextKey:o,mapDefinition:e.definition}),e}return{definition:s}};const js=class{constructor(){this.timeID=null,this.func=null}repeat(e,t){this.timeID=1,this.repeatInterval(e,t)}repeatInterval(e,t){this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((()=>{e(),this.repeatInterval(e,t)}),t)))}clear(){clearTimeout(this.timeID),this.timeID=null}},Vs='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',Ks=['video/mp4;codecs="hev1.1.6.L120.90"','video/mp4;codecs="hev1.2.4.L120.90"','video/mp4;codecs="hev1.3.E.L120.90"','video/mp4;codecs="hev1.4.10.L120.90"'],Gs={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]};function Ws(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(Gs)){const[i,n]=t;if(n.includes(i)){e=i;break}}if(e)return e}i=null==(t=e[0])?void 0:t.src}else i="string"==typeof e?e:"";return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(i)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(i)?"flv":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(i)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(i)?"dash":"mp4"}function Ys(e){return e&&e.then?e:Promise.resolve(e)}const zs=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+rl(t):e,$s=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((n=>{n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function Xs(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function qs(e,t=200,i=""){let n=setTimeout((()=>{i&&ss.warn(i),n=null}),t);return e.then?e.then((()=>clearTimeout(n))):(clearTimeout(n),n=null),e}function Zs(e,t=1,i=0){return new Promise(((n,r)=>{e().then(n).catch((o=>{setTimeout((()=>{1!==t?Zs(e,t-1,i).then(n,r):r(o)}),i)}))}))}function Qs(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return ss.error("mse error",t),!1}}function Js(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(Vs):"h265"===e?Ks.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const el="undefined"!=typeof window,tl=el&&navigator.userAgent.toLocaleLowerCase(),il=el&&/^((?!chrome|android).)*safari/.test(tl);function nl(e,t){const i={sg:{__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"byteplus",__LOG_CHANNEL_DOMAIN__:"https://mcs-nontt.byteintlapi.com",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.18.0/plugin"}},n=t||"sg";return e&&i[e]||i[n]}function rl(e){return Object.entries(e).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}function ol(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function al(e,t=10,i=0){const n=parseInt(e,t);return Number.isNaN(n)?i:n}function sl(e){var t,i,n,r,o,a,s;const l=e.getPlugin("drm"),c=e.getPlugin("EncryptHlsPlugin"),u=e.getPlugin("Mp4EncryptPlayer"),h=e.getPlugin("DASHPlugin"),d=(null==(t=null==c?void 0:c.config)?void 0:t.drmKeyToken)||(null==(i=null==u?void 0:u.config)?void 0:i.drmKeyToken)||(null==(n=null==h?void 0:h.config)?void 0:n.drmKeyToken),f=((null==(r=null==c?void 0:c.config)?void 0:r.drmType)||(null==(o=null==u?void 0:u.config)?void 0:o.drmType)||(null==(a=null==h?void 0:h.config)?void 0:a.drmType))===or.PRIVATE_ENCRYPT_UPGRADE,p=null==(s=null==c?void 0:c.config)?void 0:s.keyToken;return l?or.DRM_ENCRYPT:d?or.PRIVATE_ENCRYPT:p?or.STANDARD_ENCRYPT:f?or.PRIVATE_ENCRYPT_UPGRADE:void 0}function ll(e){var t,i,n,r;const o=null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i._playOriginalUrl,a=null==(n=null==e?void 0:e.curDefinition)?void 0:n.main_url;return o||a||(null==(r=e.curDefinition)?void 0:r.url)||e.config.url}const cl=/["'&<>]/;function ul(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 hl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ul(Object(i),!0).forEach((function(t){yl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ul(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function dl(e){return(dl="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 fl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pl(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,ml(n.key),n)}}function gl(e,t,i){return t&&pl(e.prototype,t),i&&pl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function yl(e,t,i){return(t=ml(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function vl(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 ml(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 _l=function(e){return e&&e.Math==Math&&e},El=_l("object"==typeof globalThis&&globalThis)||_l("object"==typeof window&&window)||_l("object"==typeof self&&self)||_l("object"==typeof sr&&sr)||function(){return this}()||Function("return this")(),Tl={},Sl=function(e){try{return!!e()}catch(t){return!0}},bl=!Sl((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Cl=!Sl((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),kl=Cl,Il=Function.prototype.call,Pl=kl?Il.bind(Il):function(){return Il.apply(Il,arguments)},Dl={},wl={}.propertyIsEnumerable,Al=Object.getOwnPropertyDescriptor,Rl=Al&&!wl.call({1:2},1);Dl.f=Rl?function(e){var t=Al(this,e);return!!t&&t.enumerable}:wl;var xl,Ol,Ll=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Nl=Cl,Ml=Function.prototype,Ul=Ml.call,Bl=Nl&&Ml.bind.bind(Ul,Ul),Fl=Nl?Bl:function(e){return function(){return Ul.apply(e,arguments)}},Hl=Fl,jl=Hl({}.toString),Vl=Hl("".slice),Kl=function(e){return Vl(jl(e),8,-1)},Gl=Sl,Wl=Kl,Yl=Object,zl=Fl("".split),$l=Gl((function(){return!Yl("z").propertyIsEnumerable(0)}))?function(e){return"String"==Wl(e)?zl(e,""):Yl(e)}:Yl,Xl=function(e){return null==e},ql=Xl,Zl=TypeError,Ql=function(e){if(ql(e))throw Zl("Can't call method on "+e);return e},Jl=$l,ec=Ql,tc=function(e){return Jl(ec(e))},ic="object"==typeof document&&document.all,nc={all:ic,IS_HTMLDDA:void 0===ic&&void 0!==ic},rc=nc.all,oc=nc.IS_HTMLDDA?function(e){return"function"==typeof e||e===rc}:function(e){return"function"==typeof e},ac=oc,sc=nc.all,lc=nc.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:ac(e)||e===sc}:function(e){return"object"==typeof e?null!==e:ac(e)},cc=El,uc=oc,hc=function(e,t){return arguments.length<2?(i=cc[e],uc(i)?i:void 0):cc[e]&&cc[e][t];var i},dc=Fl({}.isPrototypeOf),fc=hc("navigator","userAgent")||"",pc=El,gc=fc,yc=pc.process,vc=pc.Deno,mc=yc&&yc.versions||vc&&vc.version,_c=mc&&mc.v8;_c&&(Ol=(xl=_c.split("."))[0]>0&&xl[0]<4?1:+(xl[0]+xl[1])),!Ol&&gc&&(!(xl=gc.match(/Edge\/(\d+)/))||xl[1]>=74)&&(xl=gc.match(/Chrome\/(\d+)/))&&(Ol=+xl[1]);var Ec=Ol,Tc=Ec,Sc=Sl,bc=!!Object.getOwnPropertySymbols&&!Sc((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Tc&&Tc<41})),Cc=bc&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kc=hc,Ic=oc,Pc=dc,Dc=Object,wc=Cc?function(e){return"symbol"==typeof e}:function(e){var t=kc("Symbol");return Ic(t)&&Pc(t.prototype,Dc(e))},Ac=String,Rc=function(e){try{return Ac(e)}catch(t){return"Object"}},xc=oc,Oc=Rc,Lc=TypeError,Nc=function(e){if(xc(e))return e;throw Lc(Oc(e)+" is not a function")},Mc=Nc,Uc=Xl,Bc=function(e,t){var i=e[t];return Uc(i)?void 0:Mc(i)},Fc=Pl,Hc=oc,jc=lc,Vc=TypeError,Kc={exports:{}},Gc=El,Wc=Object.defineProperty,Yc=function(e,t){try{Wc(Gc,e,{value:t,configurable:!0,writable:!0})}catch(i){Gc[e]=t}return t},zc=Yc,$c="__core-js_shared__",Xc=El[$c]||zc($c,{}),qc=Xc;(Kc.exports=function(e,t){return qc[e]||(qc[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Zc=Kc.exports,Qc=Ql,Jc=Object,eu=function(e){return Jc(Qc(e))},tu=eu,iu=Fl({}.hasOwnProperty),nu=Object.hasOwn||function(e,t){return iu(tu(e),t)},ru=Fl,ou=0,au=Math.random(),su=ru(1..toString),lu=function(e){return"Symbol("+(void 0===e?"":e)+")_"+su(++ou+au,36)},cu=El,uu=nu,hu=lu,du=bc,fu=Cc,pu=Zc("wks"),gu=cu.Symbol,yu=gu&&gu.for,vu=fu?gu:gu&&gu.withoutSetter||hu,mu=function(e){if(!uu(pu,e)||!du&&"string"!=typeof pu[e]){var t="Symbol."+e;du&&uu(gu,e)?pu[e]=gu[e]:pu[e]=fu&&yu?yu(t):vu(t)}return pu[e]},_u=Pl,Eu=lc,Tu=wc,Su=Bc,bu=function(e,t){var i,n;if("string"===t&&Hc(i=e.toString)&&!jc(n=Fc(i,e)))return n;if(Hc(i=e.valueOf)&&!jc(n=Fc(i,e)))return n;if("string"!==t&&Hc(i=e.toString)&&!jc(n=Fc(i,e)))return n;throw Vc("Can't convert object to primitive value")},Cu=TypeError,ku=mu("toPrimitive"),Iu=function(e,t){if(!Eu(e)||Tu(e))return e;var i,n=Su(e,ku);if(n){if(void 0===t&&(t="default"),i=_u(n,e,t),!Eu(i)||Tu(i))return i;throw Cu("Can't convert object to primitive value")}return void 0===t&&(t="number"),bu(e,t)},Pu=Iu,Du=wc,wu=function(e){var t=Pu(e,"string");return Du(t)?t:t+""},Au=lc,Ru=El.document,xu=Au(Ru)&&Au(Ru.createElement),Ou=function(e){return xu?Ru.createElement(e):{}},Lu=Ou,Nu=!bl&&!Sl((function(){return 7!=Object.defineProperty(Lu("div"),"a",{get:function(){return 7}}).a})),Mu=bl,Uu=Pl,Bu=Dl,Fu=Ll,Hu=tc,ju=wu,Vu=nu,Ku=Nu,Gu=Object.getOwnPropertyDescriptor;Tl.f=Mu?Gu:function(e,t){if(e=Hu(e),t=ju(t),Ku)try{return Gu(e,t)}catch(i){}if(Vu(e,t))return Fu(!Uu(Bu.f,e,t),e[t])};var Wu={},Yu=bl&&Sl((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),zu=lc,$u=String,Xu=TypeError,qu=function(e){if(zu(e))return e;throw Xu($u(e)+" is not an object")},Zu=bl,Qu=Nu,Ju=Yu,eh=qu,th=wu,ih=TypeError,nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,oh="enumerable",ah="configurable",sh="writable";Wu.f=Zu?Ju?function(e,t,i){if(eh(e),t=th(t),eh(i),"function"==typeof e&&"prototype"===t&&"value"in i&&sh in i&&!i[sh]){var n=rh(e,t);n&&n[sh]&&(e[t]=i.value,i={configurable:ah in i?i[ah]:n[ah],enumerable:oh in i?i[oh]:n[oh],writable:!1})}return nh(e,t,i)}:nh:function(e,t,i){if(eh(e),t=th(t),eh(i),Qu)try{return nh(e,t,i)}catch(n){}if("get"in i||"set"in i)throw ih("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var lh=Wu,ch=Ll,uh=bl?function(e,t,i){return lh.f(e,t,ch(1,i))}:function(e,t,i){return e[t]=i,e},hh={exports:{}},dh=bl,fh=nu,ph=Function.prototype,gh=dh&&Object.getOwnPropertyDescriptor,yh=fh(ph,"name"),vh={EXISTS:yh,PROPER:yh&&"something"===function(){}.name,CONFIGURABLE:yh&&(!dh||dh&&gh(ph,"name").configurable)},mh=oc,_h=Xc,Eh=Fl(Function.toString);mh(_h.inspectSource)||(_h.inspectSource=function(e){return Eh(e)});var Th,Sh,bh,Ch=_h.inspectSource,kh=oc,Ih=El.WeakMap,Ph=kh(Ih)&&/native code/.test(String(Ih)),Dh=lu,wh=Zc("keys"),Ah=function(e){return wh[e]||(wh[e]=Dh(e))},Rh={},xh=Ph,Oh=El,Lh=lc,Nh=uh,Mh=nu,Uh=Xc,Bh=Ah,Fh=Rh,Hh="Object already initialized",jh=Oh.TypeError,Vh=Oh.WeakMap;if(xh||Uh.state){var Kh=Uh.state||(Uh.state=new Vh);Kh.get=Kh.get,Kh.has=Kh.has,Kh.set=Kh.set,Th=function(e,t){if(Kh.has(e))throw jh(Hh);return t.facade=e,Kh.set(e,t),t},Sh=function(e){return Kh.get(e)||{}},bh=function(e){return Kh.has(e)}}else{var Gh=Bh("state");Fh[Gh]=!0,Th=function(e,t){if(Mh(e,Gh))throw jh(Hh);return t.facade=e,Nh(e,Gh,t),t},Sh=function(e){return Mh(e,Gh)?e[Gh]:{}},bh=function(e){return Mh(e,Gh)}}var Wh={set:Th,get:Sh,has:bh,enforce:function(e){return bh(e)?Sh(e):Th(e,{})},getterFor:function(e){return function(t){var i;if(!Lh(t)||(i=Sh(t)).type!==e)throw jh("Incompatible receiver, "+e+" required");return i}}},Yh=Sl,zh=oc,$h=nu,Xh=bl,qh=vh.CONFIGURABLE,Zh=Ch,Qh=Wh.enforce,Jh=Wh.get,ed=Object.defineProperty,td=Xh&&!Yh((function(){return 8!==ed((function(){}),"length",{value:8}).length})),id=String(String).split("String"),nd=hh.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!$h(e,"name")||qh&&e.name!==t)&&(Xh?ed(e,"name",{value:t,configurable:!0}):e.name=t),td&&i&&$h(i,"arity")&&e.length!==i.arity&&ed(e,"length",{value:i.arity});try{i&&$h(i,"constructor")&&i.constructor?Xh&&ed(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=Qh(e);return $h(n,"source")||(n.source=id.join("string"==typeof t?t:"")),e};Function.prototype.toString=nd((function(){return zh(this)&&Jh(this).source||Zh(this)}),"toString");var rd=hh.exports,od=oc,ad=Wu,sd=rd,ld=Yc,cd=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(od(i)&&sd(i,o,n),n.global)r?e[t]=i:ld(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=i:ad.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},ud={},hd=Math.ceil,dd=Math.floor,fd=Math.trunc||function(e){var t=+e;return(t>0?dd:hd)(t)},pd=function(e){var t=+e;return t!=t||0===t?0:fd(t)},gd=pd,yd=Math.max,vd=Math.min,md=function(e,t){var i=gd(e);return i<0?yd(i+t,0):vd(i,t)},_d=pd,Ed=Math.min,Td=function(e){return e>0?Ed(_d(e),9007199254740991):0},Sd=Td,bd=function(e){return Sd(e.length)},Cd=tc,kd=md,Id=bd,Pd=function(e){return function(t,i,n){var r,o=Cd(t),a=Id(o),s=kd(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}},Dd={includes:Pd(!0),indexOf:Pd(!1)},wd=nu,Ad=tc,Rd=Dd.indexOf,xd=Rh,Od=Fl([].push),Ld=function(e,t){var i,n=Ad(e),r=0,o=[];for(i in n)!wd(xd,i)&&wd(n,i)&&Od(o,i);for(;t.length>r;)wd(n,i=t[r++])&&(~Rd(o,i)||Od(o,i));return o},Nd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Md=Ld,Ud=Nd.concat("length","prototype");ud.f=Object.getOwnPropertyNames||function(e){return Md(e,Ud)};var Bd={};Bd.f=Object.getOwnPropertySymbols;var Fd=hc,Hd=ud,jd=Bd,Vd=qu,Kd=Fl([].concat),Gd=Fd("Reflect","ownKeys")||function(e){var t=Hd.f(Vd(e)),i=jd.f;return i?Kd(t,i(e)):t},Wd=nu,Yd=Gd,zd=Tl,$d=Wu,Xd=function(e,t,i){for(var n=Yd(t),r=$d.f,o=zd.f,a=0;a<n.length;a++){var s=n[a];Wd(e,s)||i&&Wd(i,s)||r(e,s,o(t,s))}},qd=Sl,Zd=oc,Qd=/#|\.prototype\./,Jd=function(e,t){var i=tf[ef(e)];return i==rf||i!=nf&&(Zd(t)?qd(t):!!t)},ef=Jd.normalize=function(e){return String(e).replace(Qd,".").toLowerCase()},tf=Jd.data={},nf=Jd.NATIVE="N",rf=Jd.POLYFILL="P",of=Jd,af=El,sf=Tl.f,lf=uh,cf=cd,uf=Yc,hf=Xd,df=of,ff=function(e,t){var i,n,r,o,a,s=e.target,l=e.global,c=e.stat;if(i=l?af:c?af[s]||uf(s,{}):(af[s]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(a=sf(i,n))&&a.value:i[n],!df(l?n:s+(c?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;hf(o,r)}(e.sham||r&&r.sham)&&lf(o,"sham",!0),cf(i,n,o,e)}},pf=Kl,gf=Array.isArray||function(e){return"Array"==pf(e)},yf=TypeError,vf=function(e){if(e>9007199254740991)throw yf("Maximum allowed index exceeded");return e},mf=wu,_f=Wu,Ef=Ll,Tf=function(e,t,i){var n=mf(t);n in e?_f.f(e,n,Ef(0,i)):e[n]=i},Sf={};Sf[mu("toStringTag")]="z";var bf="[object z]"===String(Sf),Cf=bf,kf=oc,If=Kl,Pf=mu("toStringTag"),Df=Object,wf="Arguments"==If(function(){return arguments}()),Af=Cf?If: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=Df(e),Pf))?i:wf?If(t):"Object"==(n=If(t))&&kf(t.callee)?"Arguments":n},Rf=Fl,xf=Sl,Of=oc,Lf=Af,Nf=Ch,Mf=function(){},Uf=[],Bf=hc("Reflect","construct"),Ff=/^\s*(?:class|function)\b/,Hf=Rf(Ff.exec),jf=!Ff.exec(Mf),Vf=function(e){if(!Of(e))return!1;try{return Bf(Mf,Uf,e),!0}catch(t){return!1}},Kf=function(e){if(!Of(e))return!1;switch(Lf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jf||!!Hf(Ff,Nf(e))}catch(t){return!0}};Kf.sham=!0;var Gf=!Bf||xf((function(){var e;return Vf(Vf.call)||!Vf(Object)||!Vf((function(){e=!0}))||e}))?Kf:Vf,Wf=gf,Yf=Gf,zf=lc,$f=mu("species"),Xf=Array,qf=function(e){var t;return Wf(e)&&(t=e.constructor,(Yf(t)&&(t===Xf||Wf(t.prototype))||zf(t)&&null===(t=t[$f]))&&(t=void 0)),void 0===t?Xf:t},Zf=function(e,t){return new(qf(e))(0===t?0:t)},Qf=Sl,Jf=Ec,ep=mu("species"),tp=function(e){return Jf>=51||!Qf((function(){var t=[];return(t.constructor={})[ep]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},ip=ff,np=Sl,rp=gf,op=lc,ap=eu,sp=bd,lp=vf,cp=Tf,up=Zf,hp=tp,dp=Ec,fp=mu("isConcatSpreadable"),pp=dp>=51||!np((function(){var e=[];return e[fp]=!1,e.concat()[0]!==e})),gp=hp("concat"),yp=function(e){if(!op(e))return!1;var t=e[fp];return void 0!==t?!!t:rp(e)};ip({target:"Array",proto:!0,arity:1,forced:!pp||!gp},{concat:function(e){var t,i,n,r,o,a=ap(this),s=up(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(yp(o=-1===t?a:arguments[t]))for(r=sp(o),lp(l+r),i=0;i<r;i++,l++)i in o&&cp(s,l,o[i]);else lp(l+1),cp(s,l++,o);return s.length=l,s}});var vp=Kl,mp=Fl,_p=function(e){if("Function"===vp(e))return mp(e)},Ep=Nc,Tp=Cl,Sp=_p(_p.bind),bp=function(e,t){return Ep(e),void 0===t?e:Tp?Sp(e,t):function(){return e.apply(t,arguments)}},Cp=bp,kp=$l,Ip=eu,Pp=bd,Dp=Zf,wp=Fl([].push),Ap=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=Ip(l),g=kp(p),y=Cp(c,u),v=Pp(g),m=0,_=h||Dp,E=t?_(l,v):i||a?_(l,0):void 0;v>m;m++)if((s||m in g)&&(f=y(d=g[m],m,p),e))if(t)E[m]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:wp(E,d)}else switch(e){case 4:return!1;case 7:wp(E,d)}return o?-1:n||r?r:E}},Rp={forEach:Ap(0),map:Ap(1),filter:Ap(2),some:Ap(3),every:Ap(4),find:Ap(5),findIndex:Ap(6),filterReject:Ap(7)},xp=Rp.map;ff({target:"Array",proto:!0,forced:!tp("map")},{map:function(e){return xp(this,e,arguments.length>1?arguments[1]:void 0)}});var Op=Ld,Lp=Nd,Np=Object.keys||function(e){return Op(e,Lp)},Mp=eu,Up=Np;ff({target:"Object",stat:!0,forced:Sl((function(){Up(1)}))},{keys:function(e){return Up(Mp(e))}});var Bp=Af,Fp=String,Hp=function(e){if("Symbol"===Bp(e))throw TypeError("Cannot convert a Symbol value to a string");return Fp(e)},jp=Fl,Vp=pd,Kp=Hp,Gp=Ql,Wp=jp("".charAt),Yp=jp("".charCodeAt),zp=jp("".slice),$p=function(e){return function(t,i){var n,r,o=Kp(Gp(t)),a=Vp(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=Yp(o,a))<55296||n>56319||a+1===s||(r=Yp(o,a+1))<56320||r>57343?e?Wp(o,a):n:e?zp(o,a,a+2):r-56320+(n-55296<<10)+65536}},Xp={codeAt:$p(!1),charAt:$p(!0)},qp=Xp.charAt,Zp=Ql,Qp=pd,Jp=Hp;ff({target:"String",proto:!0,forced:!0},{at:function(e){var t=Jp(Zp(this)),i=t.length,n=Qp(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:qp(t,r)}});var eg=Af,tg=bf?{}.toString:function(){return"[object "+eg(this)+"]"};bf||cd(Object.prototype,"toString",tg,{unsafe:!0});var ig=qu,ng=function(){var e=ig(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},rg=Pl,og=nu,ag=dc,sg=ng,lg=RegExp.prototype,cg=function(e){var t=e.flags;return void 0!==t||"flags"in lg||og(e,"flags")||!ag(lg,e)?t:rg(sg,e)},ug=vh.PROPER,hg=cd,dg=qu,fg=Hp,pg=Sl,gg=cg,yg="toString",vg=RegExp.prototype[yg],mg=pg((function(){return"/a/b"!=vg.call({source:"a",flags:"b"})})),_g=ug&&vg.name!=yg;(mg||_g)&&hg(RegExp.prototype,yg,(function(){var e=dg(this);return"/"+fg(e.source)+"/"+fg(gg(e))}),{unsafe:!0});var Eg=Ou("span").classList,Tg=Eg&&Eg.constructor&&Eg.constructor.prototype,Sg=Tg===Object.prototype?void 0:Tg,bg=Sl,Cg=function(e,t){var i=[][e];return!!i&&bg((function(){i.call(null,t||function(){return 1},1)}))},kg=Rp.forEach,Ig=El,Pg={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},Dg=Sg,wg=Cg("forEach")?[].forEach:function(e){return kg(this,e,arguments.length>1?arguments[1]:void 0)},Ag=uh,Rg=function(e){if(e&&e.forEach!==wg)try{Ag(e,"forEach",wg)}catch(t){e.forEach=wg}};for(var xg in Pg)Pg[xg]&&Rg(Ig[xg]&&Ig[xg].prototype);Rg(Dg);var Og=oc,Lg=String,Ng=TypeError,Mg=Fl,Ug=qu,Bg=function(e){if("object"==typeof e||Og(e))return e;throw Ng("Can't set "+Lg(e)+" as a prototype")},Fg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Mg(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return Ug(i),Bg(n),t?e(i,n):i.__proto__=n,i}}():void 0),Hg=oc,jg=lc,Vg=Fg,Kg=function(e,t,i){var n,r;return Vg&&Hg(n=t.constructor)&&n!==i&&jg(r=n.prototype)&&r!==i.prototype&&Vg(e,r),e},Gg=Fl(1..valueOf),Wg="\t\n\v\f\r                 \u2028\u2029\ufeff",Yg=Ql,zg=Hp,$g=Wg,Xg=Fl("".replace),qg="["+$g+"]",Zg=RegExp("^"+qg+qg+"*"),Qg=RegExp(qg+qg+"*$"),Jg=function(e){return function(t){var i=zg(Yg(t));return 1&e&&(i=Xg(i,Zg,"")),2&e&&(i=Xg(i,Qg,"")),i}},ey={start:Jg(1),end:Jg(2),trim:Jg(3)},ty=bl,iy=El,ny=Fl,ry=of,oy=cd,ay=nu,sy=Kg,ly=dc,cy=wc,uy=Iu,hy=Sl,dy=ud.f,fy=Tl.f,py=Wu.f,gy=Gg,yy=ey.trim,vy="Number",my=iy[vy],_y=my.prototype,Ey=iy.TypeError,Ty=ny("".slice),Sy=ny("".charCodeAt),by=function(e){var t,i,n,r,o,a,s,l,c=uy(e,"number");if(cy(c))throw Ey("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=yy(c),43===(t=Sy(c,0))||45===t){if(88===(i=Sy(c,2))||120===i)return NaN}else if(48===t){switch(Sy(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=Ty(c,2)).length,s=0;s<a;s++)if((l=Sy(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c};if(ry(vy,!my(" 0o1")||!my("0b1")||my("+0x1"))){for(var Cy,ky=function(e){var t=arguments.length<1?0:my(function(e){var t=uy(e,"number");return"bigint"==typeof t?t:by(t)}(e)),i=this;return ly(_y,i)&&hy((function(){gy(i)}))?sy(Object(t),i,ky):t},Iy=ty?dy(my):"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(","),Py=0;Iy.length>Py;Py++)ay(my,Cy=Iy[Py])&&!ay(ky,Cy)&&py(ky,Cy,fy(my,Cy));ky.prototype=_y,_y.constructor=ky,oy(iy,vy,ky,{constructor:!0})}var Dy=bl,wy=vh.EXISTS,Ay=Fl,Ry=Wu.f,xy=Function.prototype,Oy=Ay(xy.toString),Ly=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ny=Ay(Ly.exec);Dy&&!wy&&Ry(xy,"name",{configurable:!0,get:function(){try{return Ny(Ly,Oy(this))[1]}catch(e){return""}}});var My=ff,Uy=$l,By=tc,Fy=Cg,Hy=Fl([].join),jy=Uy!=Object,Vy=Fy("join",",");My({target:"Array",proto:!0,forced:jy||!Vy},{join:function(e){return Hy(By(this),void 0===e?",":e)}});var Ky,Gy,Wy,Yy,zy="process"==Kl(El.process),$y=Wu.f,Xy=nu,qy=mu("toStringTag"),Zy=function(e,t,i){e&&!i&&(e=e.prototype),e&&!Xy(e,qy)&&$y(e,qy,{configurable:!0,value:t})},Qy=hc,Jy=Wu,ev=bl,tv=mu("species"),iv=function(e){var t=Qy(e),i=Jy.f;ev&&t&&!t[tv]&&i(t,tv,{configurable:!0,get:function(){return this}})},nv=dc,rv=TypeError,ov=Gf,av=Rc,sv=TypeError,lv=qu,cv=function(e){if(ov(e))return e;throw sv(av(e)+" is not a constructor")},uv=Xl,hv=mu("species"),dv=function(e,t){var i,n=lv(e).constructor;return void 0===n||uv(i=lv(n)[hv])?t:cv(i)},fv=Cl,pv=Function.prototype,gv=pv.apply,yv=pv.call,vv="object"==typeof Reflect&&Reflect.apply||(fv?yv.bind(gv):function(){return yv.apply(gv,arguments)}),mv=hc("document","documentElement"),_v=Fl([].slice),Ev=TypeError,Tv=/(?:ipad|iphone|ipod).*applewebkit/i.test(fc),Sv=El,bv=vv,Cv=bp,kv=oc,Iv=nu,Pv=Sl,Dv=mv,wv=_v,Av=Ou,Rv=function(e,t){if(e<t)throw Ev("Not enough arguments");return e},xv=Tv,Ov=zy,Lv=Sv.setImmediate,Nv=Sv.clearImmediate,Mv=Sv.process,Uv=Sv.Dispatch,Bv=Sv.Function,Fv=Sv.MessageChannel,Hv=Sv.String,jv=0,Vv={},Kv="onreadystatechange";try{Ky=Sv.location}catch(dF){}var Gv=function(e){if(Iv(Vv,e)){var t=Vv[e];delete Vv[e],t()}},Wv=function(e){return function(){Gv(e)}},Yv=function(e){Gv(e.data)},zv=function(e){Sv.postMessage(Hv(e),Ky.protocol+"//"+Ky.host)};Lv&&Nv||(Lv=function(e){Rv(arguments.length,1);var t=kv(e)?e:Bv(e),i=wv(arguments,1);return Vv[++jv]=function(){bv(t,void 0,i)},Gy(jv),jv},Nv=function(e){delete Vv[e]},Ov?Gy=function(e){Mv.nextTick(Wv(e))}:Uv&&Uv.now?Gy=function(e){Uv.now(Wv(e))}:Fv&&!xv?(Yy=(Wy=new Fv).port2,Wy.port1.onmessage=Yv,Gy=Cv(Yy.postMessage,Yy)):Sv.addEventListener&&kv(Sv.postMessage)&&!Sv.importScripts&&Ky&&"file:"!==Ky.protocol&&!Pv(zv)?(Gy=zv,Sv.addEventListener("message",Yv,!1)):Gy=Kv in Av("script")?function(e){Dv.appendChild(Av("script"))[Kv]=function(){Dv.removeChild(this),Gv(e)}}:function(e){setTimeout(Wv(e),0)});var $v,Xv,qv,Zv,Qv,Jv,em,tm,im={set:Lv,clear:Nv},nm=El,rm=/ipad|iphone|ipod/i.test(fc)&&void 0!==nm.Pebble,om=/web0s(?!.*chrome)/i.test(fc),am=El,sm=bp,lm=Tl.f,cm=im.set,um=Tv,hm=rm,dm=om,fm=zy,pm=am.MutationObserver||am.WebKitMutationObserver,gm=am.document,ym=am.process,vm=am.Promise,mm=lm(am,"queueMicrotask"),_m=mm&&mm.value;_m||($v=function(){var e,t;for(fm&&(e=ym.domain)&&e.exit();Xv;){t=Xv.fn,Xv=Xv.next;try{t()}catch(dF){throw Xv?Zv():qv=void 0,dF}}qv=void 0,e&&e.enter()},um||fm||dm||!pm||!gm?!hm&&vm&&vm.resolve?((em=vm.resolve(void 0)).constructor=vm,tm=sm(em.then,em),Zv=function(){tm($v)}):fm?Zv=function(){ym.nextTick($v)}:(cm=sm(cm,am),Zv=function(){cm($v)}):(Qv=!0,Jv=gm.createTextNode(""),new pm($v).observe(Jv,{characterData:!0}),Zv=function(){Jv.data=Qv=!Qv}));var Em=_m||function(e){var t={fn:e,next:void 0};qv&&(qv.next=t),Xv||(Xv=t,Zv()),qv=t},Tm=El,Sm=function(e){try{return{error:!1,value:e()}}catch(dF){return{error:!0,value:dF}}},bm=function(){this.head=null,this.tail=null};bm.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Cm=bm,km=El.Promise,Im="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Pm=!Im&&!zy&&"object"==typeof window&&"object"==typeof document,Dm=El,wm=km,Am=oc,Rm=of,xm=Ch,Om=mu,Lm=Pm,Nm=Im,Mm=Ec;wm&&wm.prototype;var Um=Om("species"),Bm=!1,Fm=Am(Dm.PromiseRejectionEvent),Hm={CONSTRUCTOR:Rm("Promise",(function(){var e=xm(wm),t=e!==String(wm);if(!t&&66===Mm)return!0;if(!Mm||Mm<51||!/native code/.test(e)){var i=new wm((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[Um]=n,!(Bm=i.then((function(){}))instanceof n))return!0}return!t&&(Lm||Nm)&&!Fm})),REJECTION_EVENT:Fm,SUBCLASSING:Bm},jm={},Vm=Nc,Km=TypeError,Gm=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw Km("Bad Promise constructor");t=e,i=n})),this.resolve=Vm(t),this.reject=Vm(i)};jm.f=function(e){return new Gm(e)};var Wm,Ym,zm,$m=ff,Xm=zy,qm=El,Zm=Pl,Qm=cd,Jm=Fg,e_=Zy,t_=iv,i_=Nc,n_=oc,r_=lc,o_=function(e,t){if(nv(t,e))return e;throw rv("Incorrect invocation")},a_=dv,s_=im.set,l_=Em,c_=function(e,t){var i=Tm.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},u_=Sm,h_=Cm,d_=Wh,f_=km,p_=jm,g_="Promise",y_=Hm.CONSTRUCTOR,v_=Hm.REJECTION_EVENT,m_=Hm.SUBCLASSING,__=d_.getterFor(g_),E_=d_.set,T_=f_&&f_.prototype,S_=f_,b_=T_,C_=qm.TypeError,k_=qm.document,I_=qm.process,P_=p_.f,D_=P_,w_=!!(k_&&k_.createEvent&&qm.dispatchEvent),A_="unhandledrejection",R_=function(e){var t;return!(!r_(e)||!n_(t=e.then))&&t},x_=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&&U_(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(C_("Promise-chain cycle")):(n=R_(i))?Zm(n,i,l,c):l(i)):c(o)}catch(dF){u&&!r&&u.exit(),c(dF)}},O_=function(e,t){e.notified||(e.notified=!0,l_((function(){for(var i,n=e.reactions;i=n.get();)x_(i,e);e.notified=!1,t&&!e.rejection&&N_(e)})))},L_=function(e,t,i){var n,r;w_?((n=k_.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),qm.dispatchEvent(n)):n={promise:t,reason:i},!v_&&(r=qm["on"+e])?r(n):e===A_&&c_("Unhandled promise rejection",i)},N_=function(e){Zm(s_,qm,(function(){var t,i=e.facade,n=e.value;if(M_(e)&&(t=u_((function(){Xm?I_.emit("unhandledRejection",n,i):L_(A_,i,n)})),e.rejection=Xm||M_(e)?2:1,t.error))throw t.value}))},M_=function(e){return 1!==e.rejection&&!e.parent},U_=function(e){Zm(s_,qm,(function(){var t=e.facade;Xm?I_.emit("rejectionHandled",t):L_("rejectionhandled",t,e.value)}))},B_=function(e,t,i){return function(n){e(t,n,i)}},F_=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,O_(e,!0))},H_=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw C_("Promise can't be resolved itself");var n=R_(t);n?l_((function(){var i={done:!1};try{Zm(n,t,B_(H_,i,e),B_(F_,i,e))}catch(dF){F_(i,dF,e)}})):(e.value=t,e.state=1,O_(e,!1))}catch(dF){F_({done:!1},dF,e)}}};if(y_&&(b_=(S_=function(e){o_(this,b_),i_(e),Zm(Wm,this);var t=__(this);try{e(B_(H_,t),B_(F_,t))}catch(dF){F_(t,dF)}}).prototype,(Wm=function(e){E_(this,{type:g_,done:!1,notified:!1,parent:!1,reactions:new h_,rejection:!1,state:0,value:void 0})}).prototype=Qm(b_,"then",(function(e,t){var i=__(this),n=P_(a_(this,S_));return i.parent=!0,n.ok=!n_(e)||e,n.fail=n_(t)&&t,n.domain=Xm?I_.domain:void 0,0==i.state?i.reactions.add(n):l_((function(){x_(n,i)})),n.promise})),Ym=function(){var e=new Wm,t=__(e);this.promise=e,this.resolve=B_(H_,t),this.reject=B_(F_,t)},p_.f=P_=function(e){return e===S_||undefined===e?new Ym(e):D_(e)},n_(f_)&&T_!==Object.prototype)){zm=T_.then,m_||Qm(T_,"then",(function(e,t){var i=this;return new S_((function(e,t){Zm(zm,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete T_.constructor}catch(dF){}Jm&&Jm(T_,b_)}$m({global:!0,constructor:!0,wrap:!0,forced:y_},{Promise:S_}),e_(S_,g_,!1),t_(g_);var j_={},V_=j_,K_=mu("iterator"),G_=Array.prototype,W_=Af,Y_=Bc,z_=Xl,$_=j_,X_=mu("iterator"),q_=function(e){if(!z_(e))return Y_(e,X_)||Y_(e,"@@iterator")||$_[W_(e)]},Z_=Pl,Q_=Nc,J_=qu,eE=Rc,tE=q_,iE=TypeError,nE=Pl,rE=qu,oE=Bc,aE=bp,sE=Pl,lE=qu,cE=Rc,uE=function(e){return void 0!==e&&(V_.Array===e||G_[K_]===e)},hE=bd,dE=dc,fE=function(e,t){var i=arguments.length<2?tE(e):t;if(Q_(i))return J_(Z_(i,e));throw iE(eE(e)+" is not iterable")},pE=q_,gE=function(e,t,i){var n,r;rE(e);try{if(!(n=oE(e,"return"))){if("throw"===t)throw i;return i}n=nE(n,e)}catch(dF){r=!0,n=dF}if("throw"===t)throw i;if(r)throw n;return rE(n),i},yE=TypeError,vE=function(e,t){this.stopped=e,this.result=t},mE=vE.prototype,_E=function(e,t,i){var n,r,o,a,s,l,c,u=i&&i.that,h=!(!i||!i.AS_ENTRIES),d=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),p=!(!i||!i.INTERRUPTED),g=aE(t,u),y=function(e){return n&&gE(n,"normal",e),new vE(!0,e)},v=function(e){return h?(lE(e),p?g(e[0],e[1],y):g(e[0],e[1])):p?g(e,y):g(e)};if(d)n=e.iterator;else if(f)n=e;else{if(!(r=pE(e)))throw yE(cE(e)+" is not iterable");if(uE(r)){for(o=0,a=hE(e);a>o;o++)if((s=v(e[o]))&&dE(mE,s))return s;return new vE(!1)}n=fE(e,r)}for(l=d?e.next:n.next;!(c=sE(l,n)).done;){try{s=v(c.value)}catch(dF){gE(n,"throw",dF)}if("object"==typeof s&&s&&dE(mE,s))return s}return new vE(!1)},EE=mu("iterator"),TE=!1;try{var SE=0,bE={next:function(){return{done:!!SE++}},return:function(){TE=!0}};bE[EE]=function(){return this},Array.from(bE,(function(){throw 2}))}catch(dF){}var CE=km,kE=Hm.CONSTRUCTOR||!function(e,t){if(!t&&!TE)return!1;var i=!1;try{var n={};n[EE]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(dF){}return i}((function(e){CE.all(e).then(void 0,(function(){}))})),IE=Pl,PE=Nc,DE=jm,wE=Sm,AE=_E;ff({target:"Promise",stat:!0,forced:kE},{all:function(e){var t=this,i=DE.f(t),n=i.resolve,r=i.reject,o=wE((function(){var i=PE(t.resolve),o=[],a=0,s=1;AE(e,(function(e){var l=a++,c=!1;s++,IE(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 RE=ff,xE=Hm.CONSTRUCTOR,OE=km,LE=hc,NE=oc,ME=cd,UE=OE&&OE.prototype;if(RE({target:"Promise",proto:!0,forced:xE,real:!0},{catch:function(e){return this.then(void 0,e)}}),NE(OE)){var BE=LE("Promise").prototype.catch;UE.catch!==BE&&ME(UE,"catch",BE,{unsafe:!0})}var FE=Pl,HE=Nc,jE=jm,VE=Sm,KE=_E;ff({target:"Promise",stat:!0,forced:kE},{race:function(e){var t=this,i=jE.f(t),n=i.reject,r=VE((function(){var r=HE(t.resolve);KE(e,(function(e){FE(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var GE=Pl,WE=jm;ff({target:"Promise",stat:!0,forced:Hm.CONSTRUCTOR},{reject:function(e){var t=WE.f(this);return GE(t.reject,void 0,e),t.promise}});var YE=qu,zE=lc,$E=jm,XE=function(e,t){if(YE(e),zE(t)&&t.constructor===e)return t;var i=$E.f(e);return(0,i.resolve)(t),i.promise},qE=ff,ZE=Hm.CONSTRUCTOR,QE=XE;hc("Promise"),qE({target:"Promise",stat:!0,forced:ZE},{resolve:function(e){return QE(this,e)}});var JE=ff,eT=km,tT=Sl,iT=hc,nT=oc,rT=dv,oT=XE,aT=cd,sT=eT&&eT.prototype;if(JE({target:"Promise",proto:!0,real:!0,forced:!!eT&&tT((function(){sT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=rT(this,iT("Promise")),i=nT(e);return this.then(i?function(i){return oT(t,e()).then((function(){return i}))}:e,i?function(i){return oT(t,e()).then((function(){throw i}))}:e)}}),nT(eT)){var lT=iT("Promise").prototype.finally;sT.finally!==lT&&aT(sT,"finally",lT,{unsafe:!0})}var cT=bl,uT=gf,hT=TypeError,dT=Object.getOwnPropertyDescriptor,fT=cT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(dF){return dF instanceof TypeError}}(),pT=Rc,gT=TypeError,yT=ff,vT=eu,mT=md,_T=pd,ET=bd,TT=fT?function(e,t){if(uT(e)&&!dT(e,"length").writable)throw hT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},ST=vf,bT=Zf,CT=Tf,kT=function(e,t){if(!delete e[t])throw gT("Cannot delete property "+pT(t)+" of "+pT(e))},IT=tp("splice"),PT=Math.max,DT=Math.min;yT({target:"Array",proto:!0,forced:!IT},{splice:function(e,t){var i,n,r,o,a,s,l=vT(this),c=ET(l),u=mT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=DT(PT(_T(t),0),c-u)),ST(c+i-n),r=bT(l,n),o=0;o<n;o++)(a=u+o)in l&&CT(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]:kT(l,s);for(o=c;o>c-n+i;o--)kT(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]:kT(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return TT(l,c-n+i),r}});var wT=pd,AT=Hp,RT=Ql,xT=RangeError,OT=ff,LT=Fl,NT=pd,MT=Gg,UT=function(e){var t=AT(RT(this)),i="",n=wT(e);if(n<0||n==1/0)throw xT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},BT=Sl,FT=RangeError,HT=String,jT=Math.floor,VT=LT(UT),KT=LT("".slice),GT=LT(1..toFixed),WT=function(e,t,i){return 0===t?i:t%2==1?WT(e,t-1,i*e):WT(e*e,t/2,i)},YT=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=jT(r/1e7)},zT=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=jT(n/t),n=n%t*1e7},$T=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=HT(e[t]);i=""===i?n:i+VT("0",7-n.length)+n}return i};OT({target:"Number",proto:!0,forced:BT((function(){return"0.000"!==GT(8e-5,3)||"1"!==GT(.9,0)||"1.25"!==GT(1.255,2)||"1000000000000000128"!==GT(0xde0b6b3a7640080,0)}))||!BT((function(){GT({})}))},{toFixed:function(e){var t,i,n,r,o=MT(this),a=NT(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw FT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return HT(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*WT(2,69,1))-69)<0?o*WT(2,-t,1):o/WT(2,t,1),i*=4503599627370496,(t=52-t)>0){for(YT(s,0,i),n=a;n>=7;)YT(s,1e7,0),n-=7;for(YT(s,WT(10,n,1),0),n=t-1;n>=23;)zT(s,1<<23),n-=23;zT(s,1<<n),YT(s,1,1),zT(s,2),c=$T(s)}else YT(s,0,i),YT(s,1<<-t,0),c=$T(s)+VT("0",a);return c=a>0?l+((r=c.length)<=a?"0."+VT("0",a-r)+c:KT(c,0,r-a)+"."+KT(c,r-a)):l+c}}),ff({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var XT=Sl,qT=El.RegExp,ZT=XT((function(){var e=qT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),QT=ZT||XT((function(){return!qT("a","y").sticky})),JT={BROKEN_CARET:ZT||XT((function(){var e=qT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:QT,UNSUPPORTED_Y:ZT},eS={},tS=bl,iS=Yu,nS=Wu,rS=qu,oS=tc,aS=Np;eS.f=tS&&!iS?Object.defineProperties:function(e,t){rS(e);for(var i,n=oS(t),r=aS(t),o=r.length,a=0;o>a;)nS.f(e,i=r[a++],n[i]);return e};var sS,lS=qu,cS=eS,uS=Nd,hS=Rh,dS=mv,fS=Ou,pS="prototype",gS="script",yS=Ah("IE_PROTO"),vS=function(){},mS=function(e){return"<"+gS+">"+e+"</"+gS+">"},_S=function(e){e.write(mS("")),e.close();var t=e.parentWindow.Object;return e=null,t},ES=function(){try{sS=new ActiveXObject("htmlfile")}catch(dF){}var e,t,i;ES="undefined"!=typeof document?document.domain&&sS?_S(sS):(t=fS("iframe"),i="java"+gS+":",t.style.display="none",dS.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(mS("document.F=Object")),e.close(),e.F):_S(sS);for(var n=uS.length;n--;)delete ES[pS][uS[n]];return ES()};hS[yS]=!0;var TS,SS,bS=Object.create||function(e,t){var i;return null!==e?(vS[pS]=lS(e),i=new vS,vS[pS]=null,i[yS]=e):i=ES(),void 0===t?i:cS.f(i,t)},CS=Sl,kS=El.RegExp,IS=CS((function(){var e=kS(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),PS=Sl,DS=El.RegExp,wS=PS((function(){var e=DS("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),AS=Pl,RS=Fl,xS=Hp,OS=ng,LS=JT,NS=bS,MS=Wh.get,US=IS,BS=wS,FS=Zc("native-string-replace",String.prototype.replace),HS=RegExp.prototype.exec,jS=HS,VS=RS("".charAt),KS=RS("".indexOf),GS=RS("".replace),WS=RS("".slice),YS=(SS=/b*/g,AS(HS,TS=/a/,"a"),AS(HS,SS,"a"),0!==TS.lastIndex||0!==SS.lastIndex),zS=LS.BROKEN_CARET,$S=void 0!==/()??/.exec("")[1];(YS||$S||zS||US||BS)&&(jS=function(e){var t,i,n,r,o,a,s,l=this,c=MS(l),u=xS(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=AS(jS,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=zS&&l.sticky,p=AS(OS,l),g=l.source,y=0,v=u;if(f&&(p=GS(p,"y",""),-1===KS(p,"g")&&(p+="g"),v=WS(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==VS(u,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),i=new RegExp("^(?:"+g+")",p)),$S&&(i=new RegExp("^"+g+"$(?!\\s)",p)),YS&&(n=l.lastIndex),r=AS(HS,f?i:l,v),f?r?(r.input=WS(r.input,y),r[0]=WS(r[0],y),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:YS&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),$S&&r&&r.length>1&&AS(FS,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=NS(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var XS=jS;ff({target:"RegExp",proto:!0,forced:/./.exec!==XS},{exec:XS});var qS=_p,ZS=cd,QS=XS,JS=Sl,eb=mu,tb=uh,ib=eb("species"),nb=RegExp.prototype,rb=function(e,t,i,n){var r=eb(e),o=!JS((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!JS((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[ib]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=qS(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=qS(e),l=t.exec;return l===QS||l===nb.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));ZS(String.prototype,e,l[0]),ZS(nb,r,l[1])}n&&tb(nb[r],"sham",!0)},ob=Xp.charAt,ab=function(e,t,i){return t+(i?ob(e,t).length:1)},sb=Fl,lb=eu,cb=Math.floor,ub=sb("".charAt),hb=sb("".replace),db=sb("".slice),fb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,pb=/\$([$&'`]|\d{1,2})/g,gb=Pl,yb=qu,vb=oc,mb=Kl,_b=XS,Eb=TypeError,Tb=function(e,t){var i=e.exec;if(vb(i)){var n=gb(i,e,t);return null!==n&&yb(n),n}if("RegExp"===mb(e))return gb(_b,e,t);throw Eb("RegExp#exec called on incompatible receiver")},Sb=vv,bb=Pl,Cb=Fl,kb=rb,Ib=Sl,Pb=qu,Db=oc,wb=Xl,Ab=pd,Rb=Td,xb=Hp,Ob=Ql,Lb=ab,Nb=Bc,Mb=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=pb;return void 0!==r&&(r=lb(r),l=fb),hb(o,l,(function(o,l){var c;switch(ub(l,0)){case"$":return"$";case"&":return e;case"`":return db(t,0,i);case"'":return db(t,a);case"<":c=r[db(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=cb(u/10);return 0===h?o:h<=s?void 0===n[h-1]?ub(l,1):n[h-1]+ub(l,1):o}c=n[u-1]}return void 0===c?"":c}))},Ub=Tb,Bb=mu("replace"),Fb=Math.max,Hb=Math.min,jb=Cb([].concat),Vb=Cb([].push),Kb=Cb("".indexOf),Gb=Cb("".slice),Wb="$0"==="a".replace(/./,"$0"),Yb=!!/./[Bb]&&""===/./[Bb]("a","$0");kb("replace",(function(e,t,i){var n=Yb?"$":"$0";return[function(e,i){var n=Ob(this),r=wb(e)?void 0:Nb(e,Bb);return r?bb(r,e,n,i):bb(t,xb(n),e,i)},function(e,r){var o=Pb(this),a=xb(e);if("string"==typeof r&&-1===Kb(r,n)&&-1===Kb(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=Db(r);l||(r=xb(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=Ub(o,a);if(null===d)break;if(Vb(h,d),!c)break;""===xb(d[0])&&(o.lastIndex=Lb(a,Rb(o.lastIndex),u))}for(var f,p="",g=0,y=0;y<h.length;y++){for(var v=xb((d=h[y])[0]),m=Fb(Hb(Ab(d.index),a.length),0),_=[],E=1;E<d.length;E++)Vb(_,void 0===(f=d[E])?f:String(f));var T=d.groups;if(l){var S=jb([v],_,m,a);void 0!==T&&Vb(S,T);var b=xb(Sb(r,void 0,S))}else b=Mb(v,a,m,_,T,r);m>=g&&(p+=Gb(a,g,m)+b,g=m+v.length)}return p+Gb(a,g)}]}),!!Ib((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Wb||Yb);var zb=lc,$b=Kl,Xb=mu("match"),qb=function(e){var t;return zb(e)&&(void 0!==(t=e[Xb])?!!t:"RegExp"==$b(e))},Zb=md,Qb=bd,Jb=Tf,eC=Array,tC=Math.max,iC=function(e,t,i){for(var n=Qb(e),r=Zb(t,n),o=Zb(void 0===i?n:i,n),a=eC(tC(o-r,0)),s=0;r<o;r++,s++)Jb(a,s,e[r]);return a.length=s,a},nC=vv,rC=Pl,oC=Fl,aC=rb,sC=qu,lC=Xl,cC=qb,uC=Ql,hC=dv,dC=ab,fC=Td,pC=Hp,gC=Bc,yC=iC,vC=Tb,mC=XS,_C=Sl,EC=JT.UNSUPPORTED_Y,TC=4294967295,SC=Math.min,bC=[].push,CC=oC(/./.exec),kC=oC(bC),IC=oC("".slice);aC("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=pC(uC(this)),r=void 0===i?TC:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!cC(e))return rC(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=rC(mC,h,n))&&!((a=h.lastIndex)>u&&(kC(l,IC(n,u,o.index)),o.length>1&&o.index<n.length&&nC(bC,l,yC(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&CC(h,"")||kC(l,""):kC(l,IC(n,u)),l.length>r?yC(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:rC(t,this,e,i)}:t,[function(t,i){var r=uC(this),o=lC(t)?void 0:gC(t,e);return o?rC(o,t,r,i):rC(n,pC(r),t,i)},function(e,r){var o=sC(this),a=pC(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=hC(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(EC?"g":"y"),h=new l(EC?"^(?:"+o.source+")":o,u),d=void 0===r?TC:r>>>0;if(0===d)return[];if(0===a.length)return null===vC(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=EC?0:p;var y,v=vC(h,EC?IC(a,p):a);if(null===v||(y=SC(fC(h.lastIndex+(EC?p:0)),a.length))===f)p=dC(a,p,c);else{if(kC(g,IC(a,f,p)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(kC(g,v[m]),g.length===d)return g;p=f=y}}return kC(g,IC(a,f)),g}]}),!!_C((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]})),EC);var PC=vh.PROPER,DC=Sl,wC=Wg,AC=ey.trim;ff({target:"String",proto:!0,forced:function(e){return DC((function(){return!!wC[e]()||"​…᠎"!=="​…᠎"[e]()||PC&&wC[e].name!==e}))}("trim")},{trim:function(){return AC(this)}});var RC=Rp.filter;ff({target:"Array",proto:!0,forced:!tp("filter")},{filter:function(e){return RC(this,e,arguments.length>1?arguments[1]:void 0)}});var xC=Pl,OC=qu,LC=Xl,NC=Td,MC=Hp,UC=Ql,BC=Bc,FC=ab,HC=Tb;rb("match",(function(e,t,i){return[function(t){var i=UC(this),n=LC(t)?void 0:BC(t,e);return n?xC(n,t,i):new RegExp(t)[e](MC(i))},function(e){var n=OC(this),r=MC(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return HC(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=HC(n,r));){var u=MC(s[0]);l[c]=u,""===u&&(n.lastIndex=FC(r,NC(n.lastIndex),a)),c++}return 0===c?null:l}]}));var jC=Wu.f,VC=bl,KC=El,GC=Fl,WC=of,YC=Kg,zC=uh,$C=ud.f,XC=dc,qC=qb,ZC=Hp,QC=cg,JC=JT,ek=function(e,t,i){i in e||jC(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},tk=cd,ik=Sl,nk=nu,rk=Wh.enforce,ok=iv,ak=IS,sk=wS,lk=mu("match"),ck=KC.RegExp,uk=ck.prototype,hk=KC.SyntaxError,dk=GC(uk.exec),fk=GC("".charAt),pk=GC("".replace),gk=GC("".indexOf),yk=GC("".slice),vk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,mk=/a/g,_k=/a/g,Ek=new ck(mk)!==mk,Tk=JC.MISSED_STICKY,Sk=JC.UNSUPPORTED_Y,bk=VC&&(!Ek||Tk||ak||sk||ik((function(){return _k[lk]=!1,ck(mk)!=mk||ck(_k)==_k||"/a/i"!=ck(mk,"i")})));if(WC("RegExp",bk)){for(var Ck=function(e,t){var i,n,r,o,a,s,l=XC(uk,this),c=qC(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===Ck)return e;if((c||XC(uk,e))&&(e=e.source,u&&(t=QC(d))),e=void 0===e?"":ZC(e),t=void 0===t?"":ZC(t),d=e,ak&&"dotAll"in mk&&(n=!!t&&gk(t,"s")>-1)&&(t=pk(t,/s/g,"")),i=t,Tk&&"sticky"in mk&&(r=!!t&&gk(t,"y")>-1)&&Sk&&(t=pk(t,/y/g,"")),sk&&(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=fk(e,n)))t+=fk(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:dk(vk,yk(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||nk(a,u))throw new hk("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=YC(ck(e,t),l?this:uk,Ck),(n||r||h.length)&&(s=rk(a),n&&(s.dotAll=!0,s.raw=Ck(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=fk(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+fk(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{zC(a,"source",""===d?"(?:)":d)}catch(dF){}return a},kk=$C(ck),Ik=0;kk.length>Ik;)ek(Ck,ck,kk[Ik++]);uk.constructor=Ck,Ck.prototype=uk,tk(KC,"RegExp",Ck,{constructor:!0})}ok("RegExp");var Pk="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function Dk(){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 wk(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 Ak(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(dF){return t}return t}function Rk(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];Pk&&(t=console).log.apply(t,["[logger]",e].concat(n))}function xk(){try{return Math.round(window.performance.now())}catch(dF){return(new Date).getTime()}}function Ok(){return(new Date).getTime()}function Lk(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=xk(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=Ak(s),a.connectTime=xk()-o,a.status=s.status,a.statusText=s.statusText,r=xk())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=xk()-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=xk()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=xk()-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(ds){n(ds)}}))}function Nk(e){return!e||window.location.href.indexOf(e)>-1}function Mk(e){return!!e&&/^blob:/.test(e)}var Uk={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function Bk(e){if(!e)return{};var t={};return Object.keys(Uk).map((function(i){if(e[i]||"string"!=typeof Uk[i]){if(!e[i]&&Uk[i]instanceof Array){var n=Uk[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[Uk[i]]||""})),t}function Fk(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Hk(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(ds){var i=e.className&&"object"===dl(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function jk(e){return"String"===Fk(e)?e.replace("P","p"):e?"Number"===Fk(e)?"".concat(e):void 0:""}function Vk(e){try{return JSON.stringify(e)}catch(ds){return""}}var Kk=0,Gk=1,Wk=2;function Yk(e,t){return Math.round(t/e*1e3*100)}var zk=[];"undefined"!=typeof window&&function(){try{var e=new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");zk.length>30&&zk.splice(0,zk.length-30);for(var i=0;i<t.length;i++)zk.push(t[i])}));e.observe({entryTypes:["resource"]})}catch(ds){console.warn("PerformanceObserver not support",ds)}}();var $k="videoplayer_oneplay",Xk="videoplayer_oneopera",qk="videoplayer_oneerror",Zk="videoplayer_oneevent",Qk="videoplayer_onetemp",Jk={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},eI={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},tI=0,iI=1,nI=2,rI=3,oI=4,aI=0,sI=1,lI=2,cI=3,uI=1,hI=2,dI=3,fI=4,pI=5,gI=6,yI=7,vI="error_retry",mI="oneerror",_I="oneevent",EI="onetemp",TI=0,SI=1,bI=864e5,CI=36e5,kI=["tag","subtag","device_type"],II={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var PI=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(ds){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(ds){return!0}}()?window.localStorage:{},DI="__xgplayerlogkey",wI={set:function(e){try{var t=this.get();t.push(e),PI.setItem(DI,JSON.stringify(t))}catch(dF){}},get:function(){try{var e=PI.getItem(DI);return e=e?JSON.parse(e):[]}catch(dF){return[]}},remove:function(){try{PI.removeItem(DI)}catch(dF){}},clear:function(){try{PI.clear()}catch(dF){}}},AI={},RI=Kl,xI=tc,OI=ud.f,LI=iC,NI="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];AI.f=function(e){return NI&&"Window"==RI(e)?function(e){try{return OI(e)}catch(dF){return LI(NI)}}(e):OI(xI(e))};var MI={},UI=mu;MI.f=UI;var BI=El,FI=nu,HI=MI,jI=Wu.f,VI=Pl,KI=hc,GI=mu,WI=cd,YI=ff,zI=El,$I=Pl,XI=Fl,qI=bl,ZI=bc,QI=Sl,JI=nu,eP=dc,tP=qu,iP=tc,nP=wu,rP=Hp,oP=Ll,aP=bS,sP=Np,lP=ud,cP=AI,uP=Bd,hP=Tl,dP=Wu,fP=eS,pP=Dl,gP=cd,yP=Zc,vP=Rh,mP=lu,_P=mu,EP=MI,TP=function(e){var t=BI.Symbol||(BI.Symbol={});FI(t,e)||jI(t,e,{value:HI.f(e)})},SP=function(){var e=KI("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=GI("toPrimitive");t&&!t[n]&&WI(t,n,(function(e){return VI(i,this)}),{arity:1})},bP=Zy,CP=Wh,kP=Rp.forEach,IP=Ah("hidden"),PP="Symbol",DP="prototype",wP=CP.set,AP=CP.getterFor(PP),RP=Object[DP],xP=zI.Symbol,OP=xP&&xP[DP],LP=zI.TypeError,NP=zI.QObject,MP=hP.f,UP=dP.f,BP=cP.f,FP=pP.f,HP=XI([].push),jP=yP("symbols"),VP=yP("op-symbols"),KP=yP("wks"),GP=!NP||!NP[DP]||!NP[DP].findChild,WP=qI&&QI((function(){return 7!=aP(UP({},"a",{get:function(){return UP(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=MP(RP,t);n&&delete RP[t],UP(e,t,i),n&&e!==RP&&UP(RP,t,n)}:UP,YP=function(e,t){var i=jP[e]=aP(OP);return wP(i,{type:PP,tag:e,description:t}),qI||(i.description=t),i},zP=function(e,t,i){e===RP&&zP(VP,t,i),tP(e);var n=nP(t);return tP(i),JI(jP,n)?(i.enumerable?(JI(e,IP)&&e[IP][n]&&(e[IP][n]=!1),i=aP(i,{enumerable:oP(0,!1)})):(JI(e,IP)||UP(e,IP,oP(1,{})),e[IP][n]=!0),WP(e,n,i)):UP(e,n,i)},$P=function(e,t){tP(e);var i=iP(t),n=sP(i).concat(QP(i));return kP(n,(function(t){qI&&!$I(XP,i,t)||zP(e,t,i[t])})),e},XP=function(e){var t=nP(e),i=$I(FP,this,t);return!(this===RP&&JI(jP,t)&&!JI(VP,t))&&(!(i||!JI(this,t)||!JI(jP,t)||JI(this,IP)&&this[IP][t])||i)},qP=function(e,t){var i=iP(e),n=nP(t);if(i!==RP||!JI(jP,n)||JI(VP,n)){var r=MP(i,n);return!r||!JI(jP,n)||JI(i,IP)&&i[IP][n]||(r.enumerable=!0),r}},ZP=function(e){var t=BP(iP(e)),i=[];return kP(t,(function(e){JI(jP,e)||JI(vP,e)||HP(i,e)})),i},QP=function(e){var t=e===RP,i=BP(t?VP:iP(e)),n=[];return kP(i,(function(e){!JI(jP,e)||t&&!JI(RP,e)||HP(n,jP[e])})),n};ZI||(gP(OP=(xP=function(){if(eP(OP,this))throw LP("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?rP(arguments[0]):void 0,t=mP(e),i=function(e){this===RP&&$I(i,VP,e),JI(this,IP)&&JI(this[IP],t)&&(this[IP][t]=!1),WP(this,t,oP(1,e))};return qI&&GP&&WP(RP,t,{configurable:!0,set:i}),YP(t,e)})[DP],"toString",(function(){return AP(this).tag})),gP(xP,"withoutSetter",(function(e){return YP(mP(e),e)})),pP.f=XP,dP.f=zP,fP.f=$P,hP.f=qP,lP.f=cP.f=ZP,uP.f=QP,EP.f=function(e){return YP(_P(e),e)},qI&&(UP(OP,"description",{configurable:!0,get:function(){return AP(this).description}}),gP(RP,"propertyIsEnumerable",XP,{unsafe:!0}))),YI({global:!0,constructor:!0,wrap:!0,forced:!ZI,sham:!ZI},{Symbol:xP}),kP(sP(KP),(function(e){TP(e)})),YI({target:PP,stat:!0,forced:!ZI},{useSetter:function(){GP=!0},useSimple:function(){GP=!1}}),YI({target:"Object",stat:!0,forced:!ZI,sham:!qI},{create:function(e,t){return void 0===t?aP(e):$P(aP(e),t)},defineProperty:zP,defineProperties:$P,getOwnPropertyDescriptor:qP}),YI({target:"Object",stat:!0,forced:!ZI},{getOwnPropertyNames:ZP}),SP(),bP(xP,PP),vP[IP]=!0;var JP=bc&&!!Symbol.for&&!!Symbol.keyFor,eD=ff,tD=hc,iD=nu,nD=Hp,rD=Zc,oD=JP,aD=rD("string-to-symbol-registry"),sD=rD("symbol-to-string-registry");eD({target:"Symbol",stat:!0,forced:!oD},{for:function(e){var t=nD(e);if(iD(aD,t))return aD[t];var i=tD("Symbol")(t);return aD[t]=i,sD[i]=t,i}});var lD=ff,cD=nu,uD=wc,hD=Rc,dD=JP,fD=Zc("symbol-to-string-registry");lD({target:"Symbol",stat:!0,forced:!dD},{keyFor:function(e){if(!uD(e))throw TypeError(hD(e)+" is not a symbol");if(cD(fD,e))return fD[e]}});var pD=ff,gD=hc,yD=vv,vD=Pl,mD=Fl,_D=Sl,ED=gf,TD=oc,SD=lc,bD=wc,CD=_v,kD=bc,ID=gD("JSON","stringify"),PD=mD(/./.exec),DD=mD("".charAt),wD=mD("".charCodeAt),AD=mD("".replace),RD=mD(1..toString),xD=/[\uD800-\uDFFF]/g,OD=/^[\uD800-\uDBFF]$/,LD=/^[\uDC00-\uDFFF]$/,ND=!kD||_D((function(){var e=gD("Symbol")();return"[null]"!=ID([e])||"{}"!=ID({a:e})||"{}"!=ID(Object(e))})),MD=_D((function(){return'"\\udf06\\ud834"'!==ID("\udf06\ud834")||'"\\udead"'!==ID("\udead")})),UD=function(e,t){var i=CD(arguments),n=t;if((SD(t)||void 0!==e)&&!bD(e))return ED(t)||(t=function(e,t){if(TD(n)&&(t=vD(n,this,e,t)),!bD(t))return t}),i[1]=t,yD(ID,null,i)},BD=function(e,t,i){var n=DD(i,t-1),r=DD(i,t+1);return PD(OD,e)&&!PD(LD,r)||PD(LD,e)&&!PD(OD,n)?"\\u"+RD(wD(e,0),16):e};ID&&pD({target:"JSON",stat:!0,arity:3,forced:ND||MD},{stringify:function(e,t,i){var n=CD(arguments),r=yD(ND?UD:ID,null,n);return MD&&"string"==typeof r?AD(r,xD,BD):r}});var FD=Bd,HD=eu;ff({target:"Object",stat:!0,forced:!bc||Sl((function(){FD.f(1)}))},{getOwnPropertySymbols:function(e){var t=FD.f;return t?t(HD(e)):[]}});var jD=ff,VD=bl,KD=El,GD=Fl,WD=nu,YD=oc,zD=dc,$D=Hp,XD=Wu.f,qD=Xd,ZD=KD.Symbol,QD=ZD&&ZD.prototype;if(VD&&YD(ZD)&&(!("description"in QD)||void 0!==ZD().description)){var JD={},ew=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:$D(arguments[0]),t=zD(QD,this)?new ZD(e):void 0===e?ZD():ZD(e);return""===e&&(JD[t]=!0),t};qD(ew,ZD),ew.prototype=QD,QD.constructor=ew;var tw="Symbol(test)"==String(ZD("test")),iw=GD(QD.valueOf),nw=GD(QD.toString),rw=/^Symbol\((.*)\)[^)]+$/,ow=GD("".replace),aw=GD("".slice);XD(QD,"description",{configurable:!0,get:function(){var e=iw(this);if(WD(JD,e))return"";var t=nw(e),i=tw?aw(t,7,-1):ow(t,rw,"$1");return""===i?void 0:i}}),jD({global:!0,constructor:!0,forced:!0},{Symbol:ew})}var sw=[{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)/}],lw=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}],cw=["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"];var uw=["Baiduspider","YandexBot"],hw=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];var dw="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=function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(cw.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=sw;/trident/.test(e)&&(u=lw);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=function(){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}}();d&&(o.name="360EE")}return o.name&&"Trident"!==o.name&&/(trident)/.exec(e)&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident"),o.isSpider=function(e,t){var i=!1;uw.map((function(t){t===e&&(i=!0)}));for(var n=0;n<hw.length;n++){var r=hw[n];if(-1!==t.indexOf(r)){i=!0;break}}return i}(o.name,e),o}(navigator.userAgent);function fw(){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"'))}var pw=[1,1,1,1,1];function gw(){return parseInt(pw.join(""),10)}pw[0]=dw.isSupportMP4?pw[1]+1:pw[1],pw[1]=fw()?pw[1]+1:pw[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(ds){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?pw[2]=pw[2]+1:pw[2]=1})).catch((function(){pw[2]=pw[2]-1}));var yw={range:"0-1048576",timer:6e4,timeout:15e3},vw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fl(this,e),Object.keys(yw).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=yw[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 gl(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=Bk(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)?Rk("task>>cant`t trigger url",this.ishangUp,this.intervalId):(Rk("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),Lk(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){Rk("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){Rk("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}(),mw="ProgressInfo";var _w=function(){function e(){fl(this,e),this._init()}return gl(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=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,Rk(mw,"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(),Rk(mw,"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){Rk(mw,"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=e.mediaType,r=this.curBitrate,o=this.nextBitrate,a=0,s=0;i?(a=1,s=i):t&&(s=t),this.cachedSize+=s,"video"===n&&(this.cachedVideoSize+=s,a>0&&(this.pcdnVideoCached+=s)),a>0&&(this.pcdnCached+=s);var l=o.start>=0?o:r;l.cdnSize+=s,a>0&&(l.pcdnSize+=s)}},{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 Ew="0.12.10";var Tw=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];Rk("xgVodLogger version is ".concat(Ew));var Sw,bw=(Sw="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(Sw,"]")}),Cw=1300,kw="__tea_cache_tokens_".concat(Cw),Iw="",Pw=null,Dw=function(){function e(t,i){var n=this;if(fl(this,e),yl(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===Fk(e)?e:"";"String"!==Fk(t)&&(t=""),n.urlLog={initial_url:t,initial_host:wk(t),initial_ip:""}})),yl(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())})),yl(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),yl(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),yl(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),yl(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),yl(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=xk(),n._endType="switch"})),yl(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),yl(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),Rk("onDefinitionChange from:".concat(t,", to:").concat(i))})),yl(this,"onDefiChangeSuccess",(function(){Rk("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),yl(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;Rk("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:xk(),operaType:"abr_switch",abrInfo:r})}})),yl(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=Ok(),Rk("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=jk(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})),yl(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),yl(this,"onCanplay",(function(){Rk("onCanplay","this.startStep:".concat(n.startStep," ").concat(Ok())),n.setVt()})),yl(this,"onLoadeddata",(function(){Rk("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(Ok())),n.setVt(),n.updateVideoSize()})),yl(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=Nk(n.player.currentSrc);n.triggerTask("start"),Rk("onLoadStart","this.startStep:".concat(n.startStep," ").concat(Ok()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),yl(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=Ok())}})),yl(this,"onPlayerInited",(function(){Rk("player init"),n._playerCreatedTime=Ok(),n.playlogs.rt=Ok()})),yl(this,"onNotAutoPlay",(function(){Rk("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),yl(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(Rk("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(dw.isSupportMP4," isPC:").concat(dw.isPC)),Rk("onPlayerError",e),n.load_state=cI,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),dw.isPC&&!dw.isSupportMP4||dw.isSpider)return t.errc=eI[5],t.errt=Jk.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&&Jk[e.errorType]?Jk[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&eI[e.errorCode]?eI[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&eI[e.code]?eI[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(uI),n.onOnePlay(uI),n.onOneTemp(uI),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:yI,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),yl(this,"onPlayInterfaceInfo",(function(e){Rk("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=xk()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),yl(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=function(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=zk||[],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&&"break"!==n(r);r--);return t}catch(ds){return t}}(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=Ak(a));var c=hl(hl({},l=Bk(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(hl(hl({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:wk(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:wk(u)},c,"error"===e.type?0:2)}})),yl(this,"onNext",(function(){if(Rk("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(hI))return;n.sendSwitchOpera(hI),n.onOnePlay(hI),n.onOneTemp(hI),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),yl(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=jk(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),yl(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){Rk("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=xk();Rk("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)}}})),yl(this,"onSeeking",(function(){if(!Nk(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;Rk("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=xk(),r.seekBefore=n.lastVideoTime.toString(),r.buf_include=n.checkInBuffer(n.player.currentTime)?1:0,r.intervalId=setTimeout((function(){n.isSeeking&&n.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),yl(this,"onSeeked",(function(){Nk(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),yl(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=sI;var e=xk();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),yl(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(Rk("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;n.merror.playCatch.push(hl({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.suspendSeekStatus("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:gI,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),yl(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;Rk("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(hl({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},Bk(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),yl(this,"onLog",(function(e){Rk("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case vI:break;case EI: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){var r,o;e[n]="append"===i?(r=e[n],o=t[n],!r||"string"!=typeof o&&"number"!=typeof o?o:"".concat(r," ").concat(o)):t[n]})),e}(n._templog,e.data,e.action),n._templog.preload_hit&&(n._cacheFile=SI);break;case mI: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 _I: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)}})),yl(this,"onPlay",(function(){Rk("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),yl(this,"onPause",(function(){Rk("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=xk()})),yl(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(Rk("onWaiting>","isSeeking:".concat(n.isSeeking," startStep:").concat(n.startStep," intervalId:").concat(n.stallIntervalId)),n.wait_buf_include=n.checkInBuffer(n.player.currentTime,-1e3)?1:0,n.isSeeking||0===n.playlogs.vt||n.inWaitingStart>0||(n.stallIntervalId&&(window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null),n.inWaitingStart=xk(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;Rk("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(xk()-n.inWaitingStart)),n._endType="wait",n.load_state=lI,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,xk()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),yl(this,"onEnded",(function(){if(n.initial_url){Rk("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:xk(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(dI),n.onOnePlay(dI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(dI),n.sendEventsQueue(),n.playlogs.lc++}})),yl(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(fI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(fI)||(n.sendSwitchOpera(fI),n.onOnePlay(fI,!0)))})),yl(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),yl(this,"onDestroy",(function(){Rk("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(pI),n.startStep>0&&n.initial_url&&(n.onOneTemp(pI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:xk(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(dI),n.sendEventsQueue(),dw.isPC?window.removeEventListener("beforeunload",n.onUnload):(dw.isMobile||dw.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()})),yl(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(Rk("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=Ok();n.getBufferTime(s);var p=n.getFrameInfo(),g=n.getPerformance(),y=i.errc,v=n._progressInfo,m=v.playedSize,_=v.cachedSize,E=v.pcdnCached,T=v.cachedVideoSize,S=v.pcdnVideoCached,b=n._progressInfo.getFileSize(s.duration),C=n.seekLog,k=C.sc,I=C.sat,P={bc:Yk(d,n.bc),bu_acu_t:Yk(d,n.bu_acu_t),sc:Yk(d,k),sat:Yk(d,I)};n.setExt();var D=n._getCompatibilityInfo();n.setNovv(null,e);var w=hl(hl(hl(hl({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||Ok(),vt:n.vt,lt:n.lt,lpt:n.lpt,fvt:n.fvt,nvt:n.nvt,bft:n.bft,sc:k,sat:I,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,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,switch_resolution_c:n.switchResolutionCount,is_start_play_automatically:n.isAutoplay,start_time:n.start_time,finish:n.finish,errt:i.errt,errc:y,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:b.video,audio_length:b.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:Vk(n.merror),ex:Vk(n.exInfo),perf:Vk(g),bufs:Vk(n.buffers.allBuffer),vds:_,pvds:E,vps:m,vvds:T,pvvds:S,pcdn:Vk(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:Vk(n.encryptedInfo),per100_info:Vk(P)},D);0!==n.vt&&(w.et=f);var A=n._logstrcache||n._getLogCache();0===w.fvt&&A&&(w.log=A,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=Vk(n.abrInfo);var R=D.is_support_mp4&&D.is_support_mse_mp4;if(D.is_spider||dw.isPC&&!R&&0===n.fvt)Rk("is_spider",D.is_spider,"is_support_mp4",D.is_support_mp4);else if(t){var x=!n._options.disableLocalCache;n.reportLog($k,w,x?1:0)}else n.reportLog($k,w)}})),yl(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;Rk("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=hl(hl({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:xk()-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:Vk(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,y=g.currentTime,v=g.duration-y;if(r.indexOf("waitstart")>=0&&v<=1){var m=p.local_time,_=p.v,E=p.cost_time,T=p.cdn_url,S=p.first_frame_interval,b=p.cur_play_pos,C=p.video_ready_s,k=p.video_seeking,I=p.video_paused,P=p.bufs,D=p.bc,w=p.preload_hit;n.reportLog(Zk,hl({end_type:"longwait",local_time:m,v:_,cost_time:E,cdn_url:T,first_frame_interval:S,cur_play_pos:b,video_ready_s:C,video_seeking:k,video_paused:I,bufs:P,bc:D,preload_hit:w},h),c)}if("waitstart"===r&&"function"==typeof n._options.getPageFPS){var A=n._options.getPageFPS();p.cur_fps=A.curFPS||0,p.avg_fps=A.avgFPS||0}r.indexOf("wait")>-1&&(p.buf_include=n.wait_buf_include),r.indexOf("timeout")>-1&&p.cost_time>CI&&(p.cost_time=CI);var R=n.player;R&&R.dashState&&(p.dash_state=n.player.dashState),Object.keys(l).forEach((function(e){p[e]=l[e]})),p.ex=Vk(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog(Zk,p,c)})),yl(this,"onOneTemp",(function(){if(Rk("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=hl(hl(hl({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>bI?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>bI?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:Vk(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=Ok()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,s)})),n.reportLog(Qk,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 vw),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 _w,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),Rk("logger constructor:".concat(this.player.video))}catch(ds){console.error(ds)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return gl(e,[{key:"resetLoggerParams",value:function(){Rk("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:Ok(),vt:0,rt:this.isEnded?Ok():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._novv={log_pt:Ok()},this.initializeLogDatas(),this.initializeUrlLog()}},{key:"setNovv",value:function(e,t){!this._novv||this.fvt>0||(e&&(this._novv.errc=e.code,this._novv.errt=e.errorType,this._novv.errorMessage=e.message),this._novv.end_state=t,this._novv.novv_pt||(this._novv.novv_pt=Ok(),this._novv.novv_lpt=Ok()-this._novv.log_pt),this.player&&(this._novv.vtype=this.player.vtype,this.player.novv=this._novv))}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=-1,this.lastEventTime=-1,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:xk(),seekBefore:0,sat:0,sc:0,buf_include:0},this.resLogs={lastSwitchStartTime:-1,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:dw.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=aI,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=TI}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(kw).web_id||"0"}catch(dF){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(ds){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),Rk("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 Pw("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?Cw:1300===Cw?323254:Cw,channel:i,log:!1,disable_sdk_monitor:!0,disable_heartbeat:!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:Ew,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:dw.isPad?"pad":dw.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:gw(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};Rk("commonParams ",this.commonParams,a);var s=hl({evtParams:this.commonParams,disable_auto_pv:!0},a);!dw.name||dw.isChrome||dw.isSafari||(s.browser=dw.name,dw.appVersion&&(s.browser_version=dw.appVersion)),this.line_user_id&&(s.user_unique_id=this.line_user_id,!t.enableTeaWebId&&(s.web_id=this.line_user_id)),t.referrer&&(s.referrer=t.referrer,s.referrer_host=wk(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),Rk("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=wI.get();wI.remove(),t.map((function(t){Object.keys(t).map((function(i){if(Rk("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._options.enableBeacon&&e===$k?this.tracker.beaconEvent(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:"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:"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:"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;Rk(">>>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;return(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache)}},{key:"addIfExist",value:function(e,t,i){if(bw(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=jk(t),i=jk(i),l.ldet=xk(),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:Dk(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=xk(),o=-1===n?-1: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(){dw.isPC?window.addEventListener("beforeunload",this.onUnload):(dw.isMobile||dw.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]:{};Rk("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},hl({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>bI?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?II.FULLSCREEN_TYPE:this.player.isCssfullScreen?II.CSS:II.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:Vk(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount};"seek"===i&&(c.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var 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(Xk,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];Rk("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=Bk(t.headers||{}),u=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=this._getCompatibilityInfo();this.setNovv(t,t.endState||uI);var f=hl(hl(hl({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:Vk(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||uI,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:Vk(this.exInfo),pref:Vk(u),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0},d);s&&s.dashState&&(f.dash_state=s.dashState);var p=this.player.currentSrc,g=Mk(p)?Mk(t.url)?this.initial_url:t.url:p,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:Mk(p)?1:0};if(n&&"String"===Fk(g)){var v={};Lk(g,{range:"0-8",timeout:2e3}).then((function(e){Rk("getXhr>>check result ",e);var t=Bk(e.headers||{});f.server_ip=t.x_response_sinfo,v=hl(hl({},y),{},{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=hl(hl({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=function(e){if(!e||"String"!==Fk(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)?Gk:Wk:Kk}catch(ds){return Kk}}(g);v.isexpired=t,f.net=Vk(v),e.reportLog(qk,f,i)}))}else f.net=Vk(y),this.reportLog(qk,f,i)}},{key:"_getCompatibilityInfo",value:function(){var e=function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return{support:!1,message:"MediaSource API not support"};for(var e=!1,t="",i=0;i<cw.length;i++){var n='video/mp4; codecs="'.concat(cw[i],'"'),r=MediaSource.isTypeSupported(n);t+="".concat(n," is ").concat(r," "),r&&(e=!0)}return{support:e,message:t}}();return{is_spider:dw.isSpider?1:0,is_support_mp4:dw.isSupportMP4?1:0,is_support_hevc:fw()?1:0,is_support_mse_mp4:e.support?1:0,support_mse_mp4:e.message}}},{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"===Fk(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(i.abtest_tag=a);var c=this._options;i.codec_type=this.codecType,bw(c)&&(kI.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=Vk(this._envInfo||{}),i.support=gw(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0;var u=function(){if(1===n){var e={};return e[t]=i,void wI.set(e)}2!==n?(r.player&&r.player.emit("abLog",t,i),r._track(t,i)):r.addEventsQueue(t,i)};if("function"==typeof o.onReportLog){var h=o.onReportLog(t,i);null!=h&&h.then?h.finally((function(){return u()})):u()}else u()}},{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;Rk("triggerTask>>",e),!Nk(t=t||this.player.src)&&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)}Rk("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=xk(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(Rk("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=sI,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=xk()-i.lastSeekStartTime;Rk("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>CI?0:o,n.sc++,n.sat+=o>CI?0:o,o>CI&&(o=CI),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=Ok(),Rk("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=Ok(),Rk("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(){var e=this.playlogs.bu_acu_t;return e>bI?0:e}},{key:"pt",get:function(){return this.playlogs.pt||Ok()}},{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:n,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(ds){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:Nk(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:wk(Nk(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?Bk(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 Hk(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return Hk(this.player.root,"xgplayer-ended")||Hk(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return Hk(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return Hk(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&&(Rk("lt init",this.playlogs.lt),e=Ok()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?rI:this.isStop?tI:this.isPause?nI:this.isLoading?oI:iI}},{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:Dk(t.played);return i>=0?i>bI?bI: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=xk()-this.inWaitingStart;return e>CI?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),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 hl({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},vl(e,Tw))}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];Rk("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)}Rk("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(Dk(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);Rk("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 Rk("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return Cw},set:function(e){kw="__tea_cache_tokens_".concat(Cw=e)}},{key:"AB_SDK_VERSION",get:function(){return Iw},set:function(e){Iw="Array"===Fk(e)?e.join(","):e}},{key:"Collector",set:function(e){Pw=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:{},enableTeaWebId:!1,enableBeacon:!1}}}]),e}();const ww=null==(e=nl())?void 0:e.__LOG_TEA_ID__;function Aw(e){let t={};const i=(i,n)=>{const r=(e=>Object.assign({},t,null!=e?e:{}))(n);ss.log("veplayer sendLog",i,r),e(i,r)};function n(e,t){i(e,t)}return n.init=e=>{},n.config=e=>{const i=null==e?void 0:e.evtParams;i&&"object"==typeof i&&(t=c({},i))},n.start=()=>{},n.event=(e,t)=>{i(e,t)},n.beaconEvent=(e,t)=>{i(e,t)},n}function Rw(){var e;const t=null==(e=mB.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}Dw.TEA_ID=ww,Dw.Collector=function(e){const t=Rw();if(t)return Aw(t);const i=Fs();return i?new i(e):void 0};const xw="beforePlayerCreate.authtoken.getVideoInfo.getVideos",Ow=`${xw}.getDramaInfoViaJSB.perfInfo`,Lw={prepareCost:`${Ow}.prepareCost`,requestCost:`${Ow}.requestCost`,parseCost:`${Ow}.parseCost`,totalCost:`${Ow}.totalCost`};function Nw(e,t){var i;const n=null==(i=null==e?void 0:e.timingMap)?void 0:i[t];return Number.isFinite(n)?n:0}const Mw=function(e){if(e&&e.player){const t=(t,i)=>d(this,null,(function*(){var n,r,o;const a=e.player;i.player_sum_num=function(e){var t,i;let n=0;return null==(i=null==(t=null==e?void 0:e.instManager)?void 0:t.forEach)||i.call(t,(()=>(n++,!0))),n}(a),i.is_mse=Ns(a),i.drm_encrypt_type=sl(a)||"",i.initial_url=Ur.isBlob(i.initial_url)&&a.config.url||i.initial_url,i.album_id=a.config.albumId||"",i.episode_id=a.config.episodeId||"",i.client_key=(null==(n=mB.ttDramaEnv)?void 0:n.clientKey)||"";const s=function(e){var t,i;return null==(i=null==(t=null==e?void 0:e.sdk)?void 0:t.getCreatePlayerPerfReport)?void 0:i.call(t)}(a),l=Nw(s,xw);const c=function(e){const t=null==e?void 0:e.totalDuration;return Number.isFinite(t)?t:0}(s);if(i.server_fetch_duration=l,Object.assign(i,function(e){return{server_fetch_prepare_cost:Nw(e,Lw.prepareCost),server_fetch_request_cost:Nw(e,Lw.requestCost),server_fetch_parse_cost:Nw(e,Lw.parseCost),server_fetch_total_cost:Nw(e,Lw.totalCost)}}(s)),i.create_player_total_duration=c,i.prepare_play=c-l,i.is_preload_enabled=2===mB.preloaderStatus,t===$k||t===qk){const e=null==a?void 0:a.veError;0!==i.errc&&e?(i.ve_error_code=(null==e?void 0:e.veErrorCode)||0,i.ve_error_type=(null==e?void 0:e.veErrorType)||"",i.ve_error_message=(null==e?void 0:e.veErrorMessage)||"",i.ve_error_ext=JSON.stringify((null==e?void 0:e.ext)||"")):(i.ve_error_code=0,i.ve_error_type="",i.ve_error_message="",i.ve_error_ext=""),i.licenseStatus=(null==(r=null==a?void 0:a.licenseLogInfo)?void 0:r.licenseStatus)||"",i.licenseType=(null==(o=null==a?void 0:a.licenseLogInfo)?void 0:o.licenseType)||""}})),i=Object.assign({onReportLog:t},e.player.config.vodLogOpts||{});e.player.vodLogger=new Dw(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new Dw(this,this.config.vodLogOpts||{})};Mw.pluginName="__xgVodLogger",Mw.playerConfig={},Mw.Collector=Dw.Collector,Mw.setABSdkVersion=e=>{Dw.AB_SDK_VERSION=e};const Uw=Ui((function(e,t,i){Ii(e,t,i)}));class Bw{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const Fw={"@byted/streamprobe":"1.0.2","@byted/volcengine-vestrategy":"1.1.0-rc.71","@byted/volcengine-vestrategy-adapt-range":"1.1.0-rc.0","@byted/volcengine-vestrategy-h265":"1.1.0-rc.0","@byted/volcengine-vestrategy-preload":"1.1.0-rc.3","@byted/xgplayer-encrypt":"3.5.29-rc.1","@byted/xgplayer-encrypt-hls":"4.2.0","@byted/xgplayer-encrypt-mp4":"3.0.31-alpha.1","@byted/xgplayer-vod-abralgo":"1.0.5","@byted/xgplayer-vod-preload":"1.0.9-rc.3","@byted/xgplayer-xgvideo":"0.2.5-rc.3","xgplayer-flv":"3.0.23-rc.6","xgplayer-hls":"3.0.24-rc.18"};var Hw=(e=>(e.HLS="hls",e.HLSJS="hlsjs",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.VeStrategyPreload="vestrategy_preload",e.VeStrategyAdaptRange="vestrategy_adapt_range",e.DashAbralgo="DashAbralgo",e.Preloader="preloader",e.HLSjsPro="hlsjsPro",e))(Hw||{});const jw={[Hw.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${Fw["xgplayer-hls"]}/dist/index.min.js`},[Hw.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${Fw["xgplayer-flv"]}/dist/index.min.js`},[Hw.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${Fw["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[Hw.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Fw["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[Hw.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${Fw["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[Hw.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${Fw["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[Hw.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${Fw["@byted/streamprobe"]}/dist/index.min.js`},[Hw.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${Fw["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[Hw.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${Fw["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[Hw.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${Fw["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[Hw.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${Fw["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[Hw.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${Fw["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[Hw.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${Fw["@byted/xgplayer-vod-preload"]}/dist/index.min.js`},[Hw.HLSjsPro]:{name:"EncryptHlsjsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Fw["@byted/xgplayer-encrypt-hls"]}/dist/hlsjs.min.js`}},Vw={h265:Hw.VeStrategyH265,preload:Hw.VeStrategyPreload,adaptRange:Hw.VeStrategyAdaptRange},Kw={setImportedPlugins(e,t){e.importedPlugins=t},prepareStrategyLoad(e){"undefined"!=typeof window&&window.VeStrategy&&(window.__VESTRATEGY_BASE__||(window.__VESTRATEGY_BASE__=window.VeStrategy),window.__VESTRATEGY_STRATEGY_PRELOAD__||e.clearPluginCache(Hw.VeStrategyPreload))},loadVeStrategy(e){return d(this,null,(function*(){return e.loadPlugins(Hw.VeStrategy)}))},loadStrategy(e,t){return d(this,null,(function*(){return e.loadPlugins(Vw[t])}))},loadPreloader(e){return d(this,null,(function*(){return e.loadPlugins(Hw.Preloader)}))},loadMp4Encrypt(e){return d(this,null,(function*(){return e.loadPlugins(Hw.MP4Encrypt)}))},loadHlsjsPro(e){return d(this,null,(function*(){return e.loadPlugins(Hw.HLSjsPro)}))}};let Gw=!1;class Ww extends Bw{constructor(e){super(e)}applyAbrPluginConfig(e,t){e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Hw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){Gw=!0;const{playList:t=[]}=e||{};return[...t||[]]}useNativeAbr(){return!1}canOpenAbr(e){var t;if(this.playerData.isVidPlay()&&e){const{playList:t=[]}=e;if(!(t.length>1))return Gw&&ss.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether there are more than 1 video."),Gw=!1,!1}return!((null==(t=Kr.os)?void 0:t.isIos)&&!Js())}canAdaptRangeEnable(){var e;return!((null==(e=Kr.os)?void 0:e.isIos)&&!Js())}adaptRangeDefaultOptions(){return{maxTargetCacheDur:30,minTargetCacheDur:12,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{adaptRange:c(c(c({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.Mp4EncryptPlayer)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t;const{configs:i,openSoftDecoding:n,isVidEncrypt:r,drmType:o}=this.playerData,a=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(o);if(i.enableMp4MSE||r||(null==(t=null==i?void 0:i.autoBitrateOpts)?void 0:t.enable)||n||a){return[yield Kw.loadMp4Encrypt(e)]}return[]}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,u=!!r.kid,{autoBitrateOpts:h,Mp4EncryptPlayer:d,enableMp4MSE:f}=this.playerData.configs,p=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(u||(null==h?void 0:h.enable)||d||f){const{kid:e,secretKey:t}=r,h=null==(i=this.playerData.configs)?void 0:i.Mp4EncryptPlayer,d="object"==typeof h?h:{};if(u){if(p)this.playerData.options.Mp4EncryptPlayer=c({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,preferMMS:!0,secretKey:t},d);else if(a&&s){const t=Es(a),i=parseInt(""+t["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.Mp4EncryptPlayer=c({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,retryCount:3,drmKeyToken:a,useUnionInfoDRM:l,keyTokenExpiredDuration:r,preferMMS:!0,sessionId:s,playDomain:o.playDomain||this.playerData.playDomain},d)}}else this.playerData.options.Mp4EncryptPlayer=c({vid:n,retryCount:3,preferMMS:!0},d)}}}let Yw=!1;class zw extends Bw{applyAbrPluginConfig(e,t){e.DASHPlugin=u(c({},e.DASHPlugin),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Hw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}useNativeAbr(){return!1}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>2&&t&&i))return Yw&&ss.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),Yw=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=Kr.os)?void 0:e.isIos)}generatePlaylistFromServer(e){Yw=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===vs.VIDEO))}adaptRangeDefaultOptions(){return{maxTargetCacheDur:60,minTargetCacheDur:50,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){var i;e.DASHPlugin=u(c({},null!=(i=e.DASHPlugin)?i:{}),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.DASHPlugin=u(c({},e.DASHPlugin),{adaptRange:c(c(c({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.DASHPlugin)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t,i;const n=yield e.loadPlugins(Hw.DASH);return(null==(i=null==(t=null==n?void 0:n.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[n]:(ss.warn("current browser is not supported DASHPlugin"),[])}))}setPluginConfigInVid(e,t){var i;const{vid:n,playList:r=[],dashOpts:o,defaultDefinitionData:a}=e||{},{config:s,privateDrmAuthToken:l,sessionId:u,useUnionInfoDRM:h}=t,d=c({},(null==(i=this.playerData.configs)?void 0:i.DASHPlugin)||{}),{kid:f,secretKey:p}=a,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE,y=o.Data.PlayInfoList.reduce(((e,t)=>{const i=t.Definition||t.Quality;let n="";const o=r.find((e=>e.Definition===i||e.Quality===i));return o&&(n=o.definition),e[i]=n,e}),{});if(this.playerData.dashOpts=o,g)this.playerData.options.DASHPlugin=c({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:n,definitionText:y,defaultDefinition:a.definition,kid:f,dashOpts:o,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:p,sessionId:this.playerData.encryptSessionId,playDomain:s.playDomain||this.playerData.playDomain},d);else if(l&&u&&this.playerData.drmType!==or.DRM_ENCRYPT){const e=Es(l),t=parseInt(""+e["X-Expires"]),i=isNaN(t)?30:t;this.playerData.options.DASHPlugin=c({playInfoType:"TOP",vid:n,dashOpts:o,defaultFormat:"dash",definitionText:y,defaultDefinition:a.definition,useUnionInfoDRM:h,kid:f,keyTokenExpiredDuration:i,sessionId:u,drmKeyToken:l,playDomain:s.playDomain||this.playerData.playDomain,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}else this.playerData.options.DASHPlugin=c({vid:n,dashOpts:o,playInfoType:"TOP",defaultFormat:"dash",definitionText:y,defaultDefinition:a.definition,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}}var $w=/\s/;var Xw=/^\s+/;function qw(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&$w.test(e.charAt(t)););return t}(e)+1).replace(Xw,""):e}var Zw=NaN,Qw=/^[-+]0x[0-9a-f]+$/i,Jw=/^0b[01]+$/i,eA=/^0o[0-7]+$/i,tA=parseInt;function iA(e){if("number"==typeof e)return e;if(Cn(e))return Zw;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qw(e);var i=Jw.test(e);return i||eA.test(e)?tA(e.slice(2),i?2:8):Qw.test(e)?Zw:+e}const nA=function(){return _.Date.now()};var rA="Expected a function",oA=Math.max,aA=Math.min;function sA(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(rA);function f(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function p(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function g(){var e=nA();if(p(e))return y(e);s=setTimeout(g,function(e){var i=t-(e-l);return h?aA(i,o-(e-c)):i}(e))}function y(e){return s=void 0,d&&n?f(e):(n=r=void 0,a)}function v(){var e=nA(),i=p(e);if(n=arguments,r=this,l=e,i){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?f(e):a}(l);if(h)return clearTimeout(s),s=setTimeout(g,t),f(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=iA(t)||0,A(i)&&(u=!!i.leading,o=(h="maxWait"in i)?oA(iA(i.maxWait)||0,t):o,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=r=s=void 0},v.flush=function(){return void 0===s?a:y(nA())},v}const lA=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(Hw).includes(t))throw new Error(`Unknown UMD key: ${t}`);if(void 0===i)throw new Error(`Registered UMD module ${t} must not be undefined`)}Object.assign(lA.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete lA.jsLoadMap[t],delete lA.jsLoadPromiseMap[t]}constructor(){this.umdMap=jw,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=nl(this.userRegion,this.region))?void 0:e.__UMD_PRE_PATH__)}updateBackupMap(e){this.backupUmdUrlMap=e}loadExtraCdn(e,t=!0){return new Promise(((i,n)=>{const r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),r.onerror=()=>{n(`url: ${e}`)},r.onload=r.onreadystatechange=function(){(null==this?void 0:this.readyState)&&"loaded"!==(null==this?void 0:this.readyState)&&"complete"!==(null==this?void 0:this.readyState)||(r.onload=r.onreadystatechange=null,i())},document.body.appendChild(r)}))}loadPlugins(e,t){return new Promise((i=>{var n;const r=`${this.pluginPublicPath}_${e}_load`;if(Object.prototype.hasOwnProperty.call(lA.registeredModules,e))return this.triggerSuccessCallback(t),i(lA.registeredModules[e]);if(Reflect.get(lA.jsLoadMap,r))return i(lA.jsLoadMap[r]);const o=this.umdMap[e];if((null==(n=this.importedPlugins)?void 0:n.length)>0&&o.pluginName){const e=this.importedPlugins.find((e=>e.pluginName===o.pluginName));if(e)return i(e)}if(!o)return ss.error(`${e} umd info not exit`),this.handleLoadError(e,void 0,i);const{name:a,devPath:s}=o,l=a?Vn(window,a):null;if(l)return lA.jsLoadMap[r]=l,this.triggerSuccessCallback(t),i(l);const c=`${this.pluginPublicPath}/${e+".js"}`;let u=lA.jsLoadPromiseMap[r];ss.log(`umdLoader cache hit ${r}=${!!u}`),u||(u=Zs((()=>this.loadExtraCdn(c,!0)),2),lA.jsLoadPromiseMap[r]=u),u.then((()=>this.handleLoadSuccess(r,a,t,i))).catch((n=>this.handleLoadCatch(n,e,r,a,t,i)))}))}handleLoadSuccess(e,t,i,n){const r=t?Vn(window,t):null;lA.jsLoadMap[e]=null==r||r,this.triggerSuccessCallback(i),null==n||n(r)}handleLoadError(e,t,i){this.failCallback&&"function"==typeof this.failCallback&&this.failCallback(e,t),i(null)}handleLoadCatch(e,t,i,n,r,o){const a=this.backupUmdUrlMap[t];a?this.loadBackupUrl(a,t,i,n,r,o):(ss.error(`load ${t} error, ${e}`),this.handleLoadError(t,e,o))}loadBackupUrl(e,t,i,n,r,o){if(!((a=e)&&a.indexOf&&/^(?:http|data:|\/)/.test(a)))return ss.error(`umdMap.${t} isn't a valid url`),this.handleLoadError(t,void 0,o);var a;this.loadExtraCdn(e).then((()=>this.handleLoadSuccess(i,n,r,o))).catch((e=>{ss.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let cA=lA;cA.jsLoadMap={},cA.jsLoadPromiseMap={},cA.registeredModules={};const uA=new cA;var hA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(hA||{});function dA(e){if(!e||"boolean"==typeof e)return{config:{}};const t=e,{Strategy:i,disabled:n,config:r}=t,o=h(t,["Strategy","disabled","config"]);return u(c({},e),{config:c(c({},o),null!=r?r:{})})}var fA=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(fA||{});class pA{constructor(e){this.strategyKey=hA.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new cA}init(e){return d(this,null,(function*(){var t,i,n,r,o,a,s,l,h;const f=null==(t=null==e?void 0:e.strategies)?void 0:t[hA.PRELOAD],p="boolean"==typeof f;if(!f||!p&&(null==f?void 0:f.disabled))return this.preloaderStatus=0,!1;const g=null==(i=dA(f))?void 0:i.config,y=null==(a=null==(o=null==(r=null==(n=this._strategyManager.config)?void 0:n.strategies)?void 0:r[hA.PRELOAD])?void 0:o.Strategy)?void 0:a.preloader;if(!(null==y?void 0:y.register))return this.preloaderStatus=3,!1;y.init((()=>d(this,null,(function*(){ss.log("preloader init");const[e,t]=yield Promise.all([Kw.loadPreloader(this.sdkUmdLoader),p||"hls"!==(null==f?void 0:f.format)?Kw.loadMp4Encrypt(this.sdkUmdLoader):Kw.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void ss.error("preloader init error");const i=(null==t?void 0:t.Mp4Preloader)||(null==t?void 0:t.HlsPreloader);return u(c({},g),{PreloaderModule:e.PreloaderManager,loaders:[i].filter((e=>!!e)),playPlugins:[t]})}))));const v=yield y.prepare();if(!v)return this.preloaderStatus=3,void ss.warn("preloader prepare fail",v);this.preloaderStatus=2,null==(h=null==(l=null==(s=y.inst)?void 0:s.call(y))?void 0:l.on)||h.call(l,"prf_data_size",(e=>{var t,i;null==(i=null==(t=this._strategyManager.tea)?void 0:t.event)||i.call(t,"veplayer_preload_prf_data_size",c({},e))})),this.preloader=y,this.initPreloaderConfig()}))}addPreloadList(e){if(1===this.preloaderStatus)return this.preloadCacheList=this.preloadCacheList.concat(null!=e?e:[]),void ss.log("preloader add preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(1===this.preloaderStatus)return this.preloadCacheList=null!=e?e:[],void ss.log("preloader set preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.setPreloadList(null!=e?e:[])}))}setPreloadScene(e,t){if([1,0].includes(e))return 1===this.preloaderStatus?(this.preloadCacheScene!==e&&(this.preloadCacheList=[],ss.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=c(c({},this.preloadCacheConfig),null!=t?t:{}),void ss.log("preloader set preload cache config",this.preloadCacheScene,this.preloadCacheConfig)):void(2!==this.preloaderStatus||this.preloader.setPreloadScene(e,t))}initPreloaderConfig(){var e,t,i,n;"undefined"!==this.preloadCacheScene&&this.preloader.setPreloadScene(this.preloadCacheScene,null!=(e=this.preloadCacheConfig)?e:{}),(null==(t=this.preloadCacheList)?void 0:t.length)&&(this.preloader.setPreloadList(this.preloadCacheList),null==(n=(i=this.preloader).checkPreloadData)||n.call(i),this.preloadCacheList=[])}}class gA{constructor(e){this.strategyKey=hA.H265,this._strategyManager=e}init(){return d(this,null,(function*(){return!0}))}isHevcRecommended(){var e,t;return!!(null==(t=null==(e=this._strategyManager.getStrategyRecommendations().result)?void 0:e[hA.H265])?void 0:t.enableH265Hardware)}}const yA=new class{constructor(){var e,t;this.teaId=null==(e=nl())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=nl())?void 0:t.__LOG_CHANNEL__,this.status=0,this.initUmdLoader()}get preloader(){var e;return null==(e=this.preloadWrapper)?void 0:e.preloader}get preloaderStatus(){var e,t;return null!=(t=null==(e=this.preloadWrapper)?void 0:e.preloaderStatus)?t:fA.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new cA}fetchWebId(){return d(this,null,(function*(){var e,t;return(null==(e=this.config)?void 0:e.deviceId)?Promise.resolve(null==(t=this.config)?void 0:t.deviceId):new Promise((e=>{var t;return(null==(t=this.tea)?void 0:t.getToken)?this.tea.getToken((t=>e(null==t?void 0:t.web_id))):e("default_web_id")})).then((e=>(this.config=u(c({},this.config),{deviceId:e}),this.webId)))}))}initTea(e){var t,i;const n=this.collector;n&&(e&&(this.teaId=null==(t=nl(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=nl(e))?void 0:i.__LOG_CHANNEL__),this.tea=new n(`${this.teaId}_vestrategy_tracker`),this.tea.init({app_id:this.teaId,channel:this.teaChannel}),this.tea.start())}fetchVeStrategy(){return d(this,null,(function*(){if(this.config.Module)return;const e=yield Kw.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=u(c({},this.config),{Module:e}))}))}fetchStrategies(){return d(this,null,(function*(){const e={};return Kw.prepareStrategyLoad(this.sdkUmdLoader),yield Promise.all(Object.keys(this.config.strategies).map((t=>d(this,null,(function*(){if(!this.config.strategies[t])return;!0===this.config.strategies[t]&&(this.config.strategies[t]={});const{Strategy:i}=this.config.strategies[t];if(i)e[t]=this.config.strategies[t];else{const i=t;if(!["h265","preload","adaptRange"].includes(i))return;const n=yield Kw.loadStrategy(this.sdkUmdLoader,i);n&&(e[t]=u(c({},this.config.strategies[t]),{Strategy:n}))}e[t]=dA(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return d(this,null,(function*(){if(!e||!e.appId)return;this.collector=Fs(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(ds){}const{appId:t,deviceId:i,Module:n}=this.config;if(t&&i&&n){this.Module=n;const e=this.collector;yield n.bootstrap(u(c(u(c({},this.config),{strategies:this.config.strategies}),e?{tracker:{Collector:e,enableABVersion:!1}}:{}),{log:{logger:ss}})),this.status=2,this.preloadWrapper=new pA(this),this.h265Wrapper=new gA(this)}else this.status=3;return this.isReady()}))}init(e){return d(this,null,(function*(){var t,i;const n=e;return this.initPromise?(null==(i=this.config)?void 0:i.serviceConfigMode)&&(null==n?void 0:n.serviceConfigMode)&&this.config.serviceConfigMode!==n.serviceConfigMode&&ss.warn("[VeStrategy] Ignoring conflicting serviceConfigMode after initialization has started."):((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&Kw.setImportedPlugins(this.sdkUmdLoader,e.plugins),this.initPromise=this.initOnce(n).then((t=>d(this,null,(function*(){var i,n;return t&&(yield Promise.all([null==(i=this.preloadWrapper)?void 0:i.init(e),null==(n=this.h265Wrapper)?void 0:n.init()])),t}))))),this.initPromise}))}addPreloadList(e){this.preloadWrapper&&this.preloadWrapper.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(this.preloadWrapper)return this.preloadWrapper.setPreloadList(e)}))}setPreloadScene(e,t){this.preloadWrapper&&this.preloadWrapper.setPreloadScene(e,t)}prepare(){return this.initPromise||Promise.resolve(this.isReady())}getDeviceId(){var e;return null==(e=this.config)?void 0:e.deviceId}isReady(){return 2===this.status}getStrategyRecommendations(e=void 0,t=void 0){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=this.config.Module.rec(e,t)||{};return ss.log("strategy recommendations:",i),i}getStrategyRecommendationsAsync(e=void 0,t=void 0){return d(this,null,(function*(){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=yield this.config.Module.recAsync(e,t);return ss.log("strategy recommendations:",i),i}))}isHevcRecommended(){var e,t;return this.h265Wrapper?this.h265Wrapper.isHevcRecommended():!!(null==(t=null==(e=this.getStrategyRecommendations().result)?void 0:e[hA.H265])?void 0:t.enableH265Hardware)}};let vA=!1;class mA extends Bw{constructor(e){super(e)}applyAbrPluginConfig(e,t){var i;e.EncryptHlsPlugin=u(c({},e.EncryptHlsPlugin),{autoBitrateOpts:t,maxBufferLength:(null==(i=e.EncryptHlsPlugin)?void 0:i.maxBufferLength)||40})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;!e.isOpenABR()||(null==n?void 0:n.module)||this.useNativeAbr()||e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Hw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,n,r;vA=!0;const{vid:o,playList:a=[],enableAdaptive:s,adaptiveBitrateStreamingInfo:l}=e||{};if(t&&(null==l?void 0:l.MainPlayUrl))return[{vid:o,url:null==l?void 0:l.MainPlayUrl,_mainURL:l.MainPlayUrl,_backupURL:l.BackupPlayUrl,streamType:l.AbrFormat,backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],isMasterM3u8:!0}];const c=[...a||[]];if(this.useNativeAbr()&&(null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.autoBitrateOpts)?void 0:r.enable)&&s&&l&&c.length){const e={url:l.MainPlayUrl,definition:"auto",streamType:"hls",format:"hls",backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],vid:o};c.push(e)}return c}useNativeAbr(){return Kr.os.isIos||"safari"===Kr.browser&&this.playerData.drmType===or.DRM_ENCRYPT}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>1&&t&&i))return vA&&ss.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),vA=!1,!1}return!0}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(e){return d(this,null,(function*(){var t,i,n;if(null==(i=null==(t=yA.config)?void 0:t.strategies)?void 0:i[hA.PRELOAD]){return[yield e.loadPlugins(Hw.HLSjsPro)]}const{configs:r,options:o,useHlsPluginForSafari:a,enableHlsJs:s,isVidEncrypt:l,isLive:c,openSoftDecoding:u,isMobile:h,drmType:d}=this.playerData,f=d===or.DRM_ENCRYPT,p=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(d),g=$s(r,"EncryptHlsPlugin");if(!!(null==g?void 0:g.keyToken)||l&&!f||p||this.playerData.isOpenABR()&&!(null==(n=null==this?void 0:this.useNativeAbr)?void 0:n.call(this))){return[yield e.loadPlugins(Hw.HLSEncrypt)]}{const t=$s(o,"Subtitle"),i=c&&t,n=(Qs()||window.WebAssembly)&&u,l=r.enableHlsMSE,d=r.enableMobileHlsPlugin&&(Kr.os.isAndroid&&Qs()||Kr.os.isIos&&Js()),p=f&&Kr.os.isAndroid,g=f&&il,y=h&&!document.createElement("video").canPlayType("application/vnd.apple.mpegurl");if(h&&(n||i||l||d||p||y)||!(h||il&&!a||g)){return[yield e.loadPlugins(s?Hw.HLSjsPro:Hw.HLS)]}}}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,{playDomain:u,keyToken:h,getKeyType:d}=o,f=!!r.kid,p=this.playerData.drmType===or.DRM_ENCRYPT,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(f&&!p){const e=null==(i=this.playerData.configs)?void 0:i.EncryptHlsPlugin,t="object"==typeof e?e:{},{kid:o,secretKey:f}=r;if(h)this.playerData.options.EncryptHlsPlugin=c({keyToken:h,playDomain:u||this.playerData.playDomain,getKeyType:d||"TOP",preferMMS:!0,preferMMSStreaming:!0},t);else if(g)this.playerData.options.EncryptHlsPlugin=c({vid:n,kid:o,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:f,preferMMS:!0,preferMMSStreaming:!0},t);else if(a&&s){const e=Es(a),i=parseInt(""+e["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.EncryptHlsPlugin=c({vid:n,kid:o,keyTokenExpiredDuration:r,drmKeyToken:a,useUnionInfoDRM:l,sessionId:s,playDomain:u||this.playerData.playDomain,preferMMS:!0,preferMMSStreaming:!0},t)}}}}class _A extends Bw{applyAbrPluginConfig(e,t){}needAbrAutoDefinition(){return!1}prepareAbrModule(e,t){}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e,...t){const{playList:i=[]}=e||{};return[...i||[]]}useNativeAbr(){return!1}canOpenAbr(){return!1}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(){return Promise.resolve([])}setPluginConfigInVid(){}}var EA=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(EA||{}),TA=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(TA||{}),SA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(SA||{}),bA=(e=>(e[e.LICENSE_STATUS_INVALID=0]="LICENSE_STATUS_INVALID",e[e.LICENSE_STATUS_OK=1]="LICENSE_STATUS_OK",e[e.LICENSE_STATUS_EXPIRED=2]="LICENSE_STATUS_EXPIRED",e[e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH=401]="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e))(bA||{});const CA={setLicenseConfig:e=>d(exports,null,(function*(){})),checkLicense:()=>d(exports,null,(function*(){return"premium_edition"})),checkModuleList:()=>d(exports,null,(function*(){return Object.values(SA)})),checkLicenseStatus:()=>d(exports,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>d(exports,null,(function*(){return!0})),renderLogo:e=>{}};class kA{constructor(e,t){var i,n;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:tr.UNKNOWN,kid:"",secretKey:"",drmType:void 0},this.strategiesPlugins=[],this.strategiesPluginConfigs={},this.urlCheckData={enableUrlExpireCheck:!1,urlExpireTimestamp:qa,urlExpireDiff:60,urlCheckExpireInterval:400},this.isAutoBitrateEnable=!1,this.isVidEncrypt=!1,this.drmType=void 0;const r=e,{options:o,type:a,isLive:s,id:l,root:c,plugins:u=[],defaultConfig:d,languages:f,codec:p,isMobile:g=!1,enableH265Degrade:y=!1,onMediaExpired:v,onTokenExpired:m,unionId:_,isMusic:E=!1,sdkPlugins:T=[],useHlsPluginForSafari:S=!0,enableHlsJs:b=!0,enableMenu:C=!1,region:k={}.__DEFAULT_REGION__,userRegion:I,debug:P=!1,licensSupportModuleList:D=Object.values(SA),encryptSessionId:w}=r,A=h(r,["options","type","isLive","id","root","plugins","defaultConfig","languages","codec","isMobile","enableH265Degrade","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableHlsJs","enableMenu","region","userRegion","debug","licensSupportModuleList","encryptSessionId"]);this.configs=e,this.sdk=t,P&&(ss.config.debug=3),this.options=Object.assign({},o,A),this.options.poster="string"==typeof this.options.poster?function(e){const t=""+e,i=cl.exec(t);if(!i)return t;let n,r,o="",a=0;for(r=i.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&#x27;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}a!==r&&(o+=t.substring(a,r)),a=r+1,o+=n}return a!==r?o+t.substring(a,r):o}(this.options.poster):this.options.poster,this.options.icons=(e=>{const t={};return e&&Object.entries(e).forEach((([e,i])=>{i&&"string"!=typeof i&&(t[e]=i)})),t})(this.options.icons),this.id=l,this.root=c,this.type=a,this.isLive=!!(null!=s?s:"live"===a),this.defaultConfig=d,this.languageData=this.initI18nData(f),this.isMobile=g||"mobile"===Kr.device,this.openSoftDecoding=null==(i=this.configs)?void 0:i.useSoftDecoding,this.enableH265Degrade=y,this.codec=p||tr.UNKNOWN,this.onMediaExpired=v,this.onTokenExpired=m,null==(n=this.setVodPlayListConfig)||n.call(this,this.configs),this.current=hr.observe(this.current),this.plugins=[...u],this.isMusic=E,this.unionId=_,this.sdkPlugins=T,this.useHlsPluginForSafari=S,this.enableHlsJs=b,this.enableMenu=C,C&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=k,this.userRegion=I,this.setVodTeaId(),this.playDomainDegrade=!1,this.dashOpts=null,this.encryptSessionId=w,this.initPlayData(this.configs),hr.subscribeProperty(this.current,"definition",this.updateCheckExpireData.bind(this))}initPlayData(e){const t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}initPlaylistAndGetCurrent(e){var t,i;const{url:n,playList:r=[],streamType:o="",definitionText:a,definitionTextKey:s,urlExpireTimestamp:l,playAuth:h,playAuthId:d}=e,f=e.defaultDefinition||this.configs.defaultDefinition,p=e.codec||tr.UNKNOWN;(null==e?void 0:e.autoBitrateOpts)&&this.updateConfigs({autoBitrateOpts:c(c({},null!=(t=this.configs.autoBitrateOpts)?t:{}),e.autoBitrateOpts)});let g=null;const y=fi([...r].filter((e=>e.url)).map(((e,t)=>u(c({},e),{bitrate:e.bitrate||e.Bitrate||1e3*(t+1),secretKey:e.playAuth,kid:e.playAuthId}))));if(n)if(0===y.length){const e=c(u(c({},this.current),{url:n,streamType:o,definitionTextKey:s,codec:p,secretKey:h,kid:d,urlExpireTimestamp:l}),s||a?{definition:a}:{definition:"HD"});this.playList=[e],this.defaultDefinition=e.definition}else{this.playList=y;const e=this.getUrlList({url:n});e.length>0?g=e[0]:ss.warn("default url is not match Playlist")}else this.playList=y;e.drmType&&this.setDrmType(e.drmType);let v=this.getCurrentByDefaultConfig();v?this.defaultDefinition=v.definition:(v=g||(f&&(null==(i=this.getUrlList({definition:f}))?void 0:i[0])||this.playList[0]),this.defaultDefinition=null==v?void 0:v.definition);const m=this.getTargetStreamType(v);if(this.adapter=function(e,t){const i=u(c({},t),{streamType:e});switch(null==e?void 0:e.toLowerCase()){case"mp4":case"m4a":return new Ww(i);case"dash":return new zw(i);case"hls":return new mA(i);default:return ss.log(`no adapter match ${e}, use others adapter by default`),new _A(i)}}(m,{configs:this.configs,playerData:this}),this.isAutoBitrateEnable=this.checkAutoBitratePlayList(),this.isOpenABR()){const e=this.getABRStreamInfo(m,v);v=e.defaultStream,this.playList=e.playList,this.defaultDefinition=e.defaultDefinition}return this.playList.forEach((e=>{(null==e?void 0:e.streamType)&&(e.vtype=e.streamType.toUpperCase()),(null==e?void 0:e.codec)&&(e.codecType=e.codec)})),v}checkAutoBitratePlayList(){var e,t;return!(Kr.os.isIos&&this.adapter.needAbrAutoDefinition()&&!(null==(t=null==(e=this.playList)?void 0:e.find((e=>this.isAutoDefinition(null==e?void 0:e.definition))))?void 0:t.url))}getABRStreamInfo(e,t){var i,n,r,o,a;let s=this.defaultDefinition;const l=(null==(n=null==(i=this.playList)?void 0:i.concat)?void 0:n.call(i))||[];let c=t;const u=l.findIndex((e=>this.isAutoDefinition(null==e?void 0:e.definition))),h=-1!==u?l.splice(u,1)[0]:void 0,d={definition:null!=(r=null==h?void 0:h.definition)?r:"auto",bitrate:void 0,definitionTextKey:(null==h?void 0:h.definitionTextKey)||(null==(a=null==(o=this.configs)?void 0:o.autoBitrateOpts)?void 0:a.definitionTextKey)||"DEFINITION_AUTO",url:(null==h?void 0:h.url)||"__auto__",name:"auto",streamType:e||this.configs.streamType};return this.isAutoDefinition(this.configs.defaultDefinition)||(d.bitrate=null==c?void 0:c.bitrate,s=null==c?void 0:c.definition),this.isPlayAutoDefinition()&&(c=d,this.adapter.setAbrDefaultDefiWithAuto()&&(s=d.definition)),l.push(d),{defaultDefinition:s,defaultStream:c,playList:l}}isCurrentH265(){if(this.codec){return this.codec.replace(".","").toLowerCase()===tr.H265}return!1}setDrmType(e){this.drmType=e}getCurrentByDefaultConfig(){if(!this.defaultConfig)return;const{type:e,isLive:t,lineId:i="",definition:n=""}=this.defaultConfig;if((null!=t?t:"live"===e)!==this.isLive)return;if(!i&&!n)return ss.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const r=this.getUrlList({lineId:i,definition:n});return r.length>0?(this.isHitDefault=!0,r[0]):(ss.warn("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}initCurrent(e){var t,i,n;Object.keys(this.current).forEach((t=>{this.current[t]=null==e?void 0:e[t]}));const r=null==e?void 0:e.codec;this.codec=r&&Object.values(tr).includes(r)?r:tr.UNKNOWN,(null==(t=this.current)?void 0:t.drmType)&&this.setDrmType(null==(i=this.current)?void 0:i.drmType),this.isVidEncrypt=!!(null==(n=this.current)?void 0:n.kid),this.initCheckExpireData()}initCheckExpireData(){const{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}=this.configs;Uw(this.urlCheckData,{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}),this.updateCheckExpireData()}updateCheckExpireData(){var e;const t=null==(e=this.getCurrentStreams())?void 0:e[0];if(t){const{url:e,urlExpireTimestamp:i}=t;if(!e)return;const n=al(""+(i||this.configs.urlExpireTimestamp));n?this.urlCheckData.urlExpireTimestamp=n:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=qa,ss.warn("not provide urlExpireTimestamp, url expire check will not work")),ss.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[Ja,es],i=e&&Object.entries(e).reduce(((e,[i,n])=>(za.includes(i)?e.push({LANG:"zh"===i?"zh-cn":i,TEXT:n}):t.push({LANG:i,TEXT:n}),e)),[]);return{extraLangList:t,extendLangList:i}}getCurrentUrl(){var e;return null==(e=this.getCurrentStreams()[0])?void 0:e.url}getTargetStreamType(e){var t;return e?e.streamType||this.configs.streamType||Ws(e.url):this.configs.streamType||Ts(null==(t=this.configs)?void 0:t.getVideoByToken)}getCurrentStreamType(){const e=this.getCurrentStreams();if(e.length){const{url:t,streamType:i}=e[0];return i||this.configs.streamType||Ws(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||Ts(null==(e=this.configs)?void 0:e.getVideoByToken)}isOpenABR(){var e,t,i,n,r;if(!this.isAutoBitrateEnable||!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.enable)||!(null==(i=this.configs)?void 0:i.isLive)&&!(null==(r=null==(n=this.configs)?void 0:n.licensSupportModuleList)?void 0:r.includes(SA.ABR)))return!1;const o=this.sdk.getSdkPlugin("AuthToken");return this.adapter.canOpenAbr(null==o?void 0:o.playInfo)}showRealDefinition(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.showRealDefinition)}isAutoDefinition(e){return["auto","自动"].includes(e)}isPlayAutoDefinition(e=""){var t;return this.isAutoDefinition(e||this.defaultDefinition)||(null==(t=this.configs.autoBitrateOpts)?void 0:t.startWithAuto)}isDefinitionMatch(e,t){return!(!this.isAutoDefinition(e)||!this.isAutoDefinition(t))||e===t}getCurrentStreams(){const e=this.current;return this.getUrlList(e)}getLineList(){return fi(er(this.playList,"lineId"))}getLineListByLineId(e){return this.playList.filter((t=>{var i;return(null==e?void 0:e.toString())===(null==(i=t.lineId)?void 0:i.toString())}))}getDefinitionListByLineId(e){return fi(er(this.getLineListByLineId(e),"definition"))}getUrlList(e){return this.playList.filter((t=>Object.keys(e).every((i=>{var n,r;if("url"===i){const i=null==e?void 0:e.url,n=null==t?void 0:t.url;return"string"==typeof i?i===(null==n?void 0:n.toString()):!(!Array.isArray(i)||!Array.isArray(n))&&i.map((e=>e.src)).join("")===n.map((e=>e.src)).join("")}{const o=(null==(n=e[i])?void 0:n.toString())===(null==(r=t[i])?void 0:r.toString()),a=!e[i];return o||a}}))))}getNextDefinition(e=!0,t){var i,n,r;const o=e?"next":"prev",{definition:a,lineId:s}=this.current;if(!a)return;const l=null==(i=this.getCurrentStreams())?void 0:i[0],c="auto"===a?l.mapDefinition:a,u=(e=>(null==e?void 0:e.length)&&e.reduce(((t,i,n)=>(t[i]={next:n+1>=e.length?null:e[n+1],pre:0===n?null:e[n-1]},t)),{}))(t)||Ya;if(!Object.keys(u).includes(c))return;let h=null==(n=u[c])?void 0:n[o];const d=this.getDefinitionListByLineId(s);for(;0===d.filter((e=>e.definition===h)).length&&h;)h=null==(r=u[h])?void 0:r[o];if(h)return"auto"===a&&h&&(l.mapDefinition=h),this.getUrlList({lineId:s,definition:h});ss.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=mB.ttDramaEnv)?void 0:e.channel,n={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},r={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let o,a=t;"byteplus"===i&&n?(o=n,a="sg"):"volcengine"===i&&r?(o=r,a=o[t]?t:"cn"):o={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}};const s=o[this.region]||o[a];return{playDomain:s.__PLAY_DOMAIN__,backupPlayDomain:null==s?void 0:s.__BACKUP_PLAY_DOMAIN__}}get playDomain(){var e;return this.playDomainDegrade&&null!=(e=this.apiMap.backupPlayDomain)?e:this.apiMap.playDomain}setVodTeaId(){const e=nl(this.userRegion,this.region);!function(e){Dw.TEA_ID=e}(this.configs.logTeaAppId||e.__LOG_TEA_ID__||4951)}getMergedConfigs(e){const t=fi(this.configs);return Bi(t,fi(e),((e,t)=>{if(ge(e))return t})),t}updateConfigs(e){Bi(this.configs,fi(e),((e,t)=>{if(ge(e))return t}))}updatePlayList(){const{url:e,playList:t=[],urlExpireTimestamp:i}=this.configs,n=[...t].filter((e=>e.url));if(e&&!n.length){const t=u(c({},this.current),{url:e,urlExpireTimestamp:i});this.playList=[t]}else this.playList=n}isVidPlay(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}}class IA{}IA.isSupported=()=>!1,IA.isSupportedH264=e=>!1;var PA=function(){function e(t){gr(this,e),this.config=t.config,this.parent=t.root,this.root=Ur.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="touch"===this.config.domEventType?"touchend":"click";this._delegates=ba.delegate.call(this,this.root,"li",n,this.onItemClick)}return vr(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(Ur.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&&Ur.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Ur.addClass(t,"selected"),n&&Ur.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(){Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}},{key:"hide",value:function(){Ur.removeClass(this.root,"active"),Ur.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}(),DA="side",wA="middle",AA="default",RA="click",xA="hover";var OA="mobile"===Kr.device,LA=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),mr(Sr(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===RA?n.toggle(!n.isActive):n.toggle(!0)})),mr(Sr(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==DA&&n.isActive&&n.toggle(!1)})),mr(Sr(n),"onListEnter",(function(e){n.enterType=2})),mr(Sr(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 vr(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(),(OA=OA||"touch"===this.domEventType)&&"mobile"===Kr.device&&t.listType===AA&&(t.listType=DA),t.hidePortrait&&Ur.addClass(this.root,"portrait"),this.on([Ro,Io],(function(){e._resizeList()})),this.once(no,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),OA&&this.on(ho,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),OA?(t.toggleMode=RA,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===RA?"click":"mouseenter",t.toggleMode===RA?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",Ur.createDom("span","",{},"icon-text")),Ur.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Ur.addClass(this.root,"show")}},{key:"hide",value:function(){Ur.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||Ur.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===pr(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&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===DA?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===DA?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||OA||n===DA)&&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===DA?s===ma.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:OA?"touch":"mouse"},root:n.listType===DA?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===wA?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new PA(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===wA?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===RA?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:ma.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:xA,heightLimit:!0}}}]),i}();const NA={READY:"ready",COMPLETE:"complete",URL_CHANGE:"urlchange",PLAYER_FOCUS:"focus",PLAYER_BLUR:"blur",FULLSCREEN_CHANGE:"fullscreen_change",CSS_FULLSCREEN_CHANGE:"cssFullscreen_change",MINI_STATE_CHANGE:"mini_state_change",DESTROY:"destroy",REPLAY:"replay",RETRY:"retry",DEFINITION_CHANGE:"definition_change",Before_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:"after_definition_change",VIDEO_RESIZE:"video_resize",PIP_CHANGE:"pip_change",ROTATE:"rotate",SHORTCUT:"shortcut",SEI_PARSED:"SEI_PARSED",USER_ACTION:"user_action",AUTOPLAY_STARTED:"autoplay_started",AUTOPLAY_PREVENTED:"autoplay_was_prevented",READY_CREATE_PLAYER:"ready_create_player",PLAYER_CREATED_FINISH:"player_create_finish",CREATE_PLAYER_PERF:"create_player_perf",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",PLAYNEXT:"playnext",URL_NULL:"urlNull",LEAVE_PLAYER:"leaveplayer",ENTER_PLAYER:"enterplayer",RESET:"reset",SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success",LICENSE_STATUS_WARNING:"license_status_warning",AUDIO_TRACKS_UPDATED:"audio_tracks_updated",AUDIO_TRACK_CHANGE:"audio_track_change"},MA=u(c({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"},{}),{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",PLAY_NEXT_START:"play_next_start",PLAY_NEXT_END:"play_next_end",ABR_AUTO_DESC_CHANGE:"ABR_AUTO_DESC_CHANGE",CORE_EVENT:"core_event",PRELOAD_INFO:"PRELOAD_INFO"}),UA=c(c(c({},{ABORT:"abort",CANPLAY:"canplay",CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPITED:"empited",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_META_DATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"}),NA),MA),BA={SDKEvents:NA,PluginEvents:MA},FA=UA,HA=70,jA=30,VA=50,KA=60,GA=20,WA=e=>class extends e{constructor(e){super(e),this._playTimer=null,this.handleABRDescChange=(...e)=>{this._autoRealDefinition=e[1]||void 0,this.refreshDefinitionList()},this.handleResourceReady=(e=[])=>{var t,i;const{list:n}=this.getCurrentDefinitionInfo(this.player),r=n.filter((t=>{var i;const n=t&&e.find((e=>this.playerData.isDefinitionMatch(e.definition,t.definition)));return n&&"dash"===(null==(i=this.playerData.getStreamType())?void 0:i.toLowerCase())&&(t.url=n.url),n})),o=e.find((e=>null==e?void 0:e.selected))||this.playerData.current,a=r.find((e=>this.playerData.isDefinitionMatch(e.definition,null==o?void 0:o.definition)));this.playerData.playList=r,(null==a?void 0:a.definition)&&(null==(t=this.playerData.current)?void 0:t.definition)!==a.definition&&(this.playerData.current.definition=null==a?void 0:a.definition),null==(i=this.refreshDefinitionList)||i.call(this)},this.getAutoDefRealLevel=()=>{var e;if(this.playerData.isAutoDefinition(null==(e=this.playerData.current)?void 0:e.definition)){const{videoWidth:e,videoHeight:t}=this.player.media;if(e&&t){const{list:i=[]}=this.getCurrentDefinitionInfo(this.player),n=i.find((i=>{const n=i.vwidth||i.width,r=i.vheight||i.height;return n&&r&&n===e&&r===t}));(null==n?void 0:n.definition)&&this._autoRealDefinition!==n.definition&&(this._autoRealDefinition=n.definition,this.refreshDefinitionList(),"mobile"===Kr.device&&(null==this||this.updatePanel()))}}},this.clientType=e.clientType,this.playerData=e.player.config.playerData,this.toastInfo={},this.dataMonitoring()}afterCreate(){var e,t,i,n,r;super.afterCreate(),this._autoRealDefinition=void 0,null==(e=this.refreshDefinitionList)||e.call(this),(this.playerData.isOpenABR()||"dash"===(null==(t=this.playerData.getStreamType())?void 0:t.toLowerCase()))&&this.on("resourceReady",this.handleResourceReady),this.playerData.isOpenABR()&&(this.on("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),((null==(r=null==(n=null==(i=this.playerData)?void 0:i.adapter)?void 0:n.useNativeAbr)?void 0:r.call(n))||this.player.plugins.dashplugin||this.player.plugins.mp4encryptplayer)&&(this.autoDefDetectTimer=new js,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(MA.PLAY_NEXT_START,(()=>{this.definitionSubscribeId&&hr.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&hr.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(MA.PLAY_NEXT_END,(()=>{var e,t;null==(e=this.dataMonitoring)||e.call(this),null==(t=this.refreshDefinitionList)||t.call(this)}))}getShowText(e={},t,i){var n,r;if(t)return this.playerData.isOpenABR()&&this.playerData.isAutoDefinition(t.definition)?(null==(r=null==(n=this.playerData.configs)?void 0:n.autoBitrateOpts)?void 0:r.autoDefinitionText)||e[t.definitionTextKey]||t.definition:e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}getCurrentDefinitionInfo(e){const t={list:[],defaultDefinition:""},i=e.config.playerData,{current:{lineId:n,definition:r}}=i,o=i.getDefinitionListByLineId(n);return Array.isArray(o)&&o.length>0&&(t.list=o.map((t=>(t.text||(t.text=this.getShowText(e.i18n,t,t.definition)),t)))),t.defaultDefinition=r,t}showToast(e,t){var i,n;const r=null==(i=this.player)?void 0:i.getPlugin("sdkToastPlugin");if(!r)return;const o=this.getShowText(this.i18n,e,t);this.toastInfo&&(clearTimeout(this.toastInfo.timer),null==(n=null==r?void 0:r.remove)||n.call(r,this.toastInfo.id),this.player.off(Ao,this.toastInfo.remove),this.player.off(Qr,this.toastInfo.remove)),this.toastInfo={id:r.add(`${this.langText.switching} ${o}...`,0,!0),showTime:Date.now(),delayClose:!1},this.toastInfo.timer=setTimeout((()=>{r.remove(this.toastInfo.id),clearTimeout(this.toastInfo.timer)}),2e3),this.toastInfo.remove=()=>{if(!this.toastInfo.id)return;Date.now()-this.toastInfo.showTime>2e3?r.remove(this.toastInfo.id):this.toastInfo.delayClose=!0},this.player.once(Ao,this.toastInfo.remove),this.player.once(Qr,this.toastInfo.remove)}selectDefinition(e){var t,i,n;const r=null==(n=null==(i=null==(t=this.renderList)?void 0:t.find)?void 0:i.call(t,(t=>this.playerData.isDefinitionMatch(t.definition,e.definition))))?void 0:n.definitionTextKey;this.config.showToastOnManualClick&&this.showToast(u(c({},e),{definitionTextKey:r}),e.definition),this.playerData.current.definition=e.definition,this.playerData.isAutoDefinition(e.definition)||(this._autoRealDefinition=void 0)}showRealDefinition(e){return e.selected&&this.playerData.isAutoDefinition(e.definition)&&this.playerData.showRealDefinition()&&this._autoRealDefinition&&!this.playerData.isAutoDefinition(this._autoRealDefinition)}dataMonitoring(){this.playerData&&(this.definitionSubscribeId=hr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e&&t&&e!==t&&this.player){const{list:i}=this.getCurrentDefinitionInfo(this.player),n=i.find((e=>e.definition===t));n&&n.url&&(this.player.changeDefinition(u(c({kid:n.playAuthId},n),{secretKey:n.secretKey,definition:t,url:n.url})),"MOBILE"===this.clientType&&this.updatePanel(),this.player.emit(MA.INNER_DEFINITION_CHANGE,{from:e,to:t,url:n.url}),this.player.emit(MA.PlAY_URL_CHANGE,{url:n.url,from:MA.INNER_DEFINITION_CHANGE}),"PC"===this.clientType&&this.renderItemList(t),this.player.config.isLive&&(this._playTimer=setTimeout((()=>{this.player.ended?this.player.replay():this.player.paused&&this.player.play()}),1e3)))}})),this.playListSubscribeId=hr.subscribeProperty(this.playerData,"playList",(()=>{this.refreshDefinitionList()})))}onItemClick(...e){super.onItemClick(...e)}destroy(){clearTimeout(this.toastInfo.timer),clearTimeout(this._playTimer),this.autoDefDetectTimer&&(this.autoDefDetectTimer.clear(),this.autoDefDetectTimer=null,this.getAutoDefRealLevel=null),this.off("resourceReady",this.handleResourceReady),this.off("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange)}};class YA extends(WA(LA)){constructor(e){const t=e.config.className;super(u(c({},e),{config:c(c({},e.config),t?{className:`${t} xgplayer-definition-plugin-pc`}:{}),clientType:"PC"})),this.onItemClick=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return A(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),sA(e,t,{leading:n,maxWait:t,trailing:r})}(this.onItemClick.bind(this),1e3,{trailing:!0})}static get pluginName(){return"sdkDefinitionPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.CONTROLS_RIGHT,index:jA,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition xgplayer-definition-plugin-pc",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}registerLanguageTexts(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0);const{defaultDefinition:t,list:i}=this.getCurrentDefinitionInfo(this.player);this.config.defaultDefinition=t,this.config.list=i.map(((e,t)=>u(c({},e),{itemIndex:t}))),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.config.alwaysShowDefinition?(this.renderItemList(),this.show()):this.hide():(this.renderItemList(),this.show()))}show(){var e;!this.config.list||(null==(e=this.config.list)?void 0:e.length)<2&&!this.config.alwaysShowDefinition||Ur.addClass(this.root,"show")}afterPlayerInit(){}renderItemList(e){if(Array.isArray(e))return;const{list:t,defaultDefinition:i}=this.config;let n=0;const r=t.map(((t,r)=>{var o;const a={url:t.url,definition:t.definition||"",definitionTextKey:t.definitionTextKey,showText:this.getShowText(this.i18n,t,t.definition),isCurrent:!1,selected:!1,isDefinitionAuto:!1},s="string"==typeof e?t.definition===e:void 0===e&&t.definition===i;if(!Ur.isUndefined(t.definition)&&s&&(a.isCurrent=!0,a.selected=!0,n=r),this.showRealDefinition(a)){const e=null==(o=this.renderList)?void 0:o.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);a.showText=t?`${a.showText}(${t})`:a.showText}return a.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition),a}));this.renderList=r,super.renderItemList(r,n)}onItemClick(e,t){var i;if(t.to.definition!==this.playerData.current.definition){const n=null==(i=this.playerData.getCurrentStreams())?void 0:i[0];this.emitUserAction(e,"change_definition",{from:n,to:t.to}),this.selectDef(t.to)}}selectDef(e){this.selectDefinition(e),"ontouchstart"in window&&this.optionsList.hide()}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}destroy(){super.destroy()}}function zA(e){const t={};for(const i of["lang","name"]){const n=e[i];void 0!==n&&(t[i]=n)}return t}function $A(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function XA(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(zA(t));else{const{id:i,lang:n,name:r}=t,o=e.audioTracks.find((e=>e.id===i&&((void 0===n||e.lang===n)&&(void 0===r||e.name===r))));if(!o||e.audioTrack===o.id)return;e.audioTrack=o.id}}const qA={zh:"中文","zh-cn":"普通话","zh-hk":"粤語","zh-tw":"繁體中文","zh-sg":"普通话",en:"English",ja:"日本語",ko:"한국어",th:"ภาษาไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",fil:"Filipino",tl:"Filipino",my:"မြန်မာဘာသာ",km:"ភាសាខ្មែរ",lo:"ພາສາລາວ",hi:"हिन्दी",bn:"বাংলা",ta:"தமிழ்",te:"తెలుగు",mr:"मराठी",ur:"اردو",fr:"Français",de:"Deutsch",es:"Español","es-419":"Español (Latinoamérica)",it:"Italiano",pt:"Português","pt-br":"Português (Brasil)","pt-pt":"Português (Portugal)",nl:"Nederlands",sv:"Svenska",da:"Dansk",no:"Norsk",fi:"Suomi",ca:"Català",ru:"Русский",pl:"Polski",uk:"Українська",cs:"Čeština",sk:"Slovenčina",ro:"Română",hu:"Magyar",bg:"Български",hr:"Hrvatski",sr:"Српски",sl:"Slovenščina",el:"Ελληνικά",ar:"العربية",fa:"فارسی",he:"עברית",tr:"Türkçe",az:"Azərbaycan",kk:"Қазақша",mn:"Монгол",sw:"Kiswahili"};function ZA(e){var t;return null!=(t=qA[e.toLowerCase()])?t:e.toUpperCase()}function QA(e,t){var i;const n=null!=(i=e.name)?i:"",r=e.lang?ZA(e.lang):"";return[r||n||`Track ${e.id+1}`,!1!==(null==t?void 0:t.showNameSuffix)&&r&&n?`(${n})`:""].filter(Boolean).join(" ")}function JA(e,t,i){var n;const r=null!=(n=e.label)?n:"",o=e.language?ZA(e.language):"";return[o||r||`Track ${t+1}`,!1!==(null==i?void 0:i.showNameSuffix)&&o&&r?`(${r})`:""].filter(Boolean).join(" ")}class eR extends LA{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._nativeChangeRaf=null}static get pluginName(){return"AudioTrack"}static get defaultConfig(){return u(c({},LA.defaultConfig),{position:ba.POSITIONS.CONTROLS_RIGHT,index:HA,list:[],className:"xgplayer-audio-track",hidePortrait:!1,isShowIcon:!0,showNameSuffix:!0})}registerIcons(){return{}}afterPlayerInit(){var e;super.afterPlayerInit(),this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{this._updateSelection(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t?this.hide():this._initNativeAudioTracks()}onItemClick(e,t){if(super.onItemClick(e,t),this._nativeMode){const e=this._getNativeTrackList();if(!e)return;$A(e,t.to.id)}else{const e=this._getHls();if(!e)return;XA(e,t.to)}}destroy(){var e;null!==this._nativeChangeRaf&&cancelAnimationFrame(this._nativeChangeRaf),this._unbindNativeAudioTracks(),null==(e=super.destroy)||e.call(this)}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{null===this._nativeChangeRaf&&(this._nativeChangeRaf=requestAnimationFrame((()=>{this._nativeChangeRaf=null,this._onNativeTrackEnabled()})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1?this._onNativeTracksChanged():this.hide())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1?this.hide():(this._renderNativeTracks(e),this.show())}_onNativeTrackEnabled(){const e=this._getNativeTrackList();e&&this._renderNativeTracks(e)}_renderNativeTracks(e){const t={showNameSuffix:!1!==this.config.showNameSuffix},i=[];for(let r=0;r<e.length;r++){const n=e[r],o=JA(n,r,t);i.push({id:r,name:o,showText:o,iconText:o,selected:n.enabled,default:n.enabled})}const n=i.findIndex((e=>e.selected));this.config.list=i,super.renderItemList(i,n>-1?n:0)}_onAudioTracksUpdated(e){!e||e.length<=1?this.hide():(this._renderTracks(e),this.show())}_updateSelection(e){const t=this._getHls();t&&this._renderTracks(t.audioTracks,e)}_renderTracks(e,t){var i;const n=this._getHls(),r=null!=(i=null!=t?t:null==n?void 0:n.audioTrack)?i:-1,o={showNameSuffix:!1!==this.config.showNameSuffix},a=e.find((e=>e.default)),s=e.map((e=>u(c({},e),{showText:QA(e,o),iconText:QA(e,o),selected:e.id===r})));if(-1===r&&a){const e=s.findIndex((e=>e.id===a.id));e>-1&&(s[e].selected=!0)}const l=s.findIndex((e=>e.selected));this.config.list=s,super.renderItemList(s,l>-1?l:0)}}function tR(){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}const{isWeixin:iR,os:nR,device:rR}=Kr,oR=nR.isAndroid,aR=nR.isIos,sR="mobile"===rR;let lR=0,cR=!1;class uR extends ba{constructor(e){super(e),this.state={mode:0,showUnmuteBt:!1},this.wxCanPlayFn=()=>{window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(()=>{this.wxTimer=setTimeout((()=>{this.wxTimer&&clearTimeout(this.wxTimer);const e=this.player.play();e&&e.then?e.then((()=>{ss.log("wechat autoplay success")})).catch((e=>{ss.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):ss.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():oR?this.player.once(no,this.wxCanPlayFn):aR&&this.player.once(mo,this.wxCanPlayFn)},this.userClickPlay=()=>{if(cR)return;const e=this.player.play();e&&e.then?e.then((()=>{ss.log("user action autoplay success"),cR=!0})).catch((e=>{ss.warn("user action autoplay fail:",e)})):(ss.warn("no play promise"),cR=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(ss.warn("unmute autoplay fail"),this.player.emit(MA.AUTOPLAY_FAILED,{mode:"unmute"}),oR&&iR?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(ss.warn("mute autoplay fail"),this.player.emit(MA.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(MA.AUTOPLAY_FAILED,{mode:"noSupport"}),void ss.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(MA.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(MA.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(MA.AUTOPLAY_SUCCESS,{mode:"unmute"})},this.handleVolumechange=()=>{this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())},this.cancelUnmute=e=>{const t=Date.now();t-lR>200&&(lR=t,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emitUserAction(e,"cancel_mute"))}}static get pluginName(){return"AutoplayPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1,showUnmuteBtn:!0}}afterCreate(){this.initState(),this.initEvents(),this.setWXAutoPlay()}registerLanguageTexts(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"},muted:{jp:"ミュート",en:"muted",zh:"已静音","zh-hk":"已靜音"}}}registerIcons(){return{muted:{icon:tR,class:"xgplayer-muted-svg"}}}updateLang(){this.renderUnmuteBt()}initState(){const{enableDegradeMuteAutoplay:e,enableWxJsBridgeAutoplay:t,enableUserActionAutoplay:i}=this.player.config;e&&(this.config.enableDegradeMuteAutoplay=!0),t&&(this.config.enableWxJsBridgeAutoplay=!0),i&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}initEvents(){this.player.on(vo,this.handleAutoplayPrevented),this.player.on(yo,this.handleAutoplayStart),this.player.on(oo,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){iR&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay,!1))}setUserActionAutoPlay(){var e;(null==(e=this.config)?void 0:e.enableUserActionAutoplay)&&this.player.once(MA.AUTOPLAY_FAILED,(()=>{this.hasSetUserAutoplay=!0;(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).addEventListener("click",this.userClickPlay,!1)}))}changeMuteMode(){this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((()=>{this.timer&&clearTimeout(this.timer);const e=this.player.play();e&&e.then?e.then((()=>{ss.log("degrade mute autoplay success")})).catch((e=>{ss.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):ss.warn("no play promise")}))}renderUnmuteBt(){var e,t,i;const n=this.root;if(n&&(n.innerHTML="",this.state.showUnmuteBt&&this.config.showUnmuteBtn)){const r=this.langText.unmute||(null==(i=null==(t=null==(e=this.registerLanguageTexts)?void 0:e.call(this))?void 0:t.unmute)?void 0:i.en),o=Ur.createDom("div",r,void 0,"xgplayer-unmute-bt");n.appendChild(o),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute)}}destroy(){if(this.player.off(vo,this.handleAutoplayPrevented),this.player.off(yo,this.handleAutoplayStart),this.player.off(oo,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=sR?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}render(){return'<div class="xgplayer-unmute"></div>'}}const hR=void 0;function dR(){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}class fR extends ba{constructor(e){super(e),this.panel=null,this.panelContainer=null}static get pluginName(){return"MoreButtonPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){this.renderMoreIcon()}updateLang(e){if(!this.panelContainer)return;const t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),i=this.getAndSplitList().extraList;t.forEach((t=>{var n,r;const o=Number(t.getAttribute("plugin-index"));(null==(r=null==(n=i[o])?void 0:n.textTips)?void 0:r[e])&&(t.innerHTML=i[o].textTips[e])}))}registerIcons(){return{more:{icon:dR,class:"xgplayer-more-svg"}}}getAndSplitList(){var e;let t,i;const n=(null!=(e=this.player.config.ignores)?e:[]).map((e=>e.toLowerCase())),r=this.config.iconPlugins.filter((e=>!n.includes(e.pluginName.toLowerCase())));return r.length>this.config.maxShowNum+1?(t=r.slice(0,this.config.maxShowNum),i=r.slice(-(r.length-this.config.maxShowNum))):t=[...r],{list:null!=t?t:[],extraList:null!=i?i:[]}}children(){const e=this.getAndSplitList().list,t={};return e.forEach((e=>{t[e.pluginName]={plugin:e,options:{root:this.root}}})),t}renderMoreIcon(){const e=this.getAndSplitList().extraList;if(0===e.length)return;const t=this.root,i=Ur.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const n=Ur.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),t.appendChild(n)}renderPanel(e){this.panelContainer||(this.panelContainer=Ur.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,n;const r=Ur.createDom("div","",{},"panel-icon-bt"),o=Ur.createDom("div","",{},"panel-icon-svg");r.appendChild(o),this.registerExtraPlugin(e,o);const a="zh-cn"===this.player.lang?"zh":this.player.lang,s=null!=(n=null==(i=e.textTips)?void 0:i[a])?n:e.pluginName;r.appendChild(Ur.createDom("span",s,{"plugin-index":t},"panel-icon-bt-text")),this.panelContainer.appendChild(r)}))),this.player.panel.showPanel(this.panelContainer)}registerExtraPlugin(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}destroy(){}render(){return'<div class="xgplayer-rightTop-iconList"></div>'}}function pR(){return(new DOMParser).parseFromString('<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40ZM34.75 34.05C34.75 35.7897 33.5747 37.2 32.125 37.2C30.6753 37.2 29.5 35.7897 29.5 34.05C29.5 32.3103 30.6753 30.9 32.125 30.9C33.5747 30.9 34.75 32.3103 34.75 34.05ZM40.2276 43.7334C36.2145 43.7334 32.6052 45.4732 30.1709 48.2331C29.5316 48.9579 29.6009 50.0638 30.3258 50.7031C31.0506 51.3424 32.1565 51.2731 32.7958 50.5483C34.5802 48.5252 37.2407 47.2334 40.2276 47.2334C43.2213 47.2334 45.8871 48.531 47.6715 50.562C48.3094 51.288 49.4152 51.3594 50.1412 50.7215C50.8673 50.0836 50.9387 48.9778 50.3008 48.2518C47.8663 45.481 44.2498 43.7334 40.2276 43.7334ZM47.8352 37.2C49.2849 37.2 50.4602 35.7897 50.4602 34.05C50.4602 32.3103 49.2849 30.9 47.8352 30.9C46.3854 30.9 45.2102 32.3103 45.2102 34.05C45.2102 35.7897 46.3854 37.2 47.8352 37.2Z" fill="#ffffff" fill-opacity="0.15"/>\n</svg>\n',"image/svg+xml").firstChild}var gR=(e=>(e.NETWORK="NETWORK",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_FORBIDDEN="NETWORK_FORBIDDEN",e.NETWORK_NOTFOUND="NETWORK_NOTFOUND",e.NETWORK_RANGE_NOT_SATISFIABLE="NETWORK_RANGE_NOT_SATISFIABLE",e.NETWORK_PROTOCOL="NETWORK_PROTOCOL",e.NETWORK_URL_EXPIRE="NETWORK_URL_EXPIRE",e.NETWORK_URL_SIGN="NETWORK_URL_SIGN",e.NETWORK_ENCRYPT_HLS_ERR="NETWORK_ENCRYPT_HLS_ERR",e.MEDIA_ERR="MEDIA_ERR",e.MEDIA_ERR_ABORTED="MEDIA_ERR_ABORTED",e.MEDIA_ERR_NETWORK="MEDIA_ERR_NETWORK",e.MEDIA_ERR_DECODE="MEDIA_ERR_DECODE",e.MEDIA_ERR_SRC_NOT_SUPPORTED="MEDIA_ERR_SRC_NOT_SUPPORTED",e.MEDIA_ERR_NOT_SUPPORTED="MEDIA_ERR_NOT_SUPPORTED",e.MEDIA_ERR_URL_EMPTY="MEDIA_ERR_URL_EMPTY",e.MEDIA_ERR_FILE_NOT_SUPPORTED="MEDIA_ERR_FILE_NOT_SUPPORTED",e.MEDIA_ERR_PLAY_ERR="MEDIA_ERR_PLAY_ERR",e.MEDIA_SOURCE_CANNOT_PLAY_TYPE="MEDIA_SOURCE_CANNOT_PLAY_TYPE",e.BUSINESS_DRM_NOT_SUPPORT="BUSINESS_DRM_NOT_SUPPORT",e.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD="BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",e.BUSINESS_DRM_LACK_MEDIA_KEY="BUSINESS_DRM_LACK_MEDIA_KEY",e.BUSINESS_DRM_LACK_KEY_SESSION="BUSINESS_DRM_LACK_KEY_SESSION",e.BUSINESS_DRM_GENERATE_REQUEST_FAIL="BUSINESS_DRM_GENERATE_REQUEST_FAIL",e.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH="BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",e.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH="BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",e.BUSINESS_DRM_LICENSE_FAIL="BUSINESS_DRM_LICENSE_FAIL",e.BUSINESS_DRM_KEY_ERROR="BUSINESS_DRM_KEY_ERROR",e.BUSINESS_DRM_CERT_FAIL="BUSINESS_DRM_CERT_FAIL",e.PRIVATE_DRM_KEY_GET_FAILED="PRIVATE_DRM_KEY_GET_FAILED",e.PRIVATE_DRM_CRYPTO_NOT_SUPPORT="PRIVATE_DRM_CRYPTO_NOT_SUPPORT",e.PRIVATE_DRM_RSA_FAIL="PRIVATE_DRM_RSA_FAIL",e.OTHER="OTHER",e.VOD_LOG_NOT_CONFIGURED="VOD_LOG_NOT_CONFIGURED",e.PLAY_AUTH_TOKEN_EXPIRED="PLAY_AUTH_TOKEN_EXPIRED",e.HLS_KEY_TOKEN_EXPIRED="HLS_KEY_TOKEN_EXPIRED",e.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED="THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED",e.GET_PLAY_INFO_ERR="GET_PLAY_INFO_ERR",e.GET_HLS_DECRYPTION_KEY_ERR="GET_HLS_DECRYPTION_KEY_ERR",e.LICENSE_VALIDATE_FAIL="LICENSE_VALIDATE_FAIL",e.DEFINITION_AUTO="DEFINITION_AUTO",e.LICENSE_STATUS_INVALID="LICENSE_STATUS_INVALID",e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e.BASE_LICENSE_NOT_SUPPORT_265="BASE_LICENSE_NOT_SUPPORT_265",e.BASE_LICENSE_NOT_SUPPORT_ABR="BASE_LICENSE_NOT_SUPPORT_ABR",e.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.BASE_LICENSE_NOT_SUPPORT_PRELOAD="BASE_LICENSE_NOT_SUPPORT_PRELOAD",e.EXPIRED_LICENSE_NOT_SUPPORT_265="EXPIRED_LICENSE_NOT_SUPPORT_265",e.EXPIRED_LICENSE_NOT_SUPPORT_ABR="EXPIRED_LICENSE_NOT_SUPPORT_ABR",e.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD="EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD",e.DRAMA_INVALID_PARAM="DRAMA_INVALID_PARAM",e.DRAMA_NO_INFO_FOUND="DRAMA_NO_INFO_FOUND",e.DRAMA_NOT_SUBMITTED="DRAMA_NOT_SUBMITTED",e.DRAMA_UNDER_REVIEW="DRAMA_UNDER_REVIEW",e.DRAMA_FAILED_REVIEW="DRAMA_FAILED_REVIEW",e.DRAMA_WITHDRAWN_REVIEW="DRAMA_WITHDRAWN_REVIEW",e.DRAMA_FAILED_TO_QUERY="DRAMA_FAILED_TO_QUERY",e.DRAMA_INVALID_TTOP_TOKEN="DRAMA_INVALID_TTOP_TOKEN",e.DRAMA_NOT_ON_SHELF="DRAMA_NOT_ON_SHELF",e.DRAMA_FAILED_GET_EPISODE_INFO="DRAMA_FAILED_GET_EPISODE_INFO",e))(gR||{});const yR={NETWORK:{code:2100,message:"Network error",textKey:gR.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:gR.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:gR.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:gR.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:gR.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:gR.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:gR.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:gR.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:gR.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:gR.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:gR.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:gR.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:gR.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:gR.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:gR.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:gR.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:gR.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:gR.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:gR.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:gR.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:gR.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:gR.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:gR.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:gR.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:gR.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:gR.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:gR.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:gR.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:gR.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:gR.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:gR.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:gR.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},vR={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:gR.BASE_LICENSE_NOT_SUPPORT_265},BASE_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12112,message:"The basic license does not support ABR",textKey:gR.BASE_LICENSE_NOT_SUPPORT_ABR},BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12113,message:"The basic license does not support dynamic buffer",textKey:gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},BASE_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12114,message:"The basic license does not support preload",textKey:gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD},EXPIRED_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12211,message:"Expired license does not support H265",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_265},EXPIRED_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12212,message:"Expired license does not support ABR",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR},EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12213,message:"The expired license does not support dynamic buffer",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12214,message:"Expired license does not support preloading",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}};var mR=(e=>(e[e.manifest=1]="manifest",e[e.network=2]="network",e[e.demux=3]="demux",e[e.remux=4]="remux",e[e.media=5]="media",e[e.decoder=6]="decoder",e[e.drm=7]="drm",e[e.other=8]="other",e[e.runtime=9]="runtime",e[e.token=10]="token",e[e.serve=11]="serve",e[e.license=12]="license",e[e.ad=13]="ad",e))(mR||{});const _R={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:gR.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:gR.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:gR.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:gR.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:gR.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:gR.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:gR.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:gR.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:gR.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:gR.DRAMA_FAILED_GET_EPISODE_INFO}};const ER={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},TR=1002305;class SR{constructor(){this.actions={}}addMiddleware(e,t){this.actions[e]?this.actions[e].push(t):this.actions[e]=[t]}removeMiddleware(e,t){const i=this.actions[e]||[],n=i.findIndex((e=>e===t));n>-1&&(i.splice(n,1),this.actions[e]=i)}removeAllMiddlewareByKey(e){this.actions[e]=[]}removeAllMiddleware(){this.actions={}}applyMiddleware(e){const t=this;return function(i,n){return d(this,null,(function*(){const{eventName:r}=i,o=t.actions[e]||[],a=[];o.forEach((e=>{try{const t=e(i);a.push(Ys(t))}catch(t){throw a.push(Ys(null)),t}})),Promise.all([...a]).then((e=>{e.every((e=>!e))&&n(r,i)})).catch((e=>{ss.error(e),n(r,e)}))}))}}}const bR="xgplayer-error-analysing",CR="xgplayer-error-retrying",kR="ve_error",IR={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},PR={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},DR="http:",wR="https:";let AR=null;function RR(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(DR)&&i===wR){if(new URL(e).protocol===DR)return xR.getVeErrorInfo(yR.NETWORK_PROTOCOL)}}class xR{constructor(e,t){this.retryTimestamps=[],this.totalRetryCount=0,this.retrying=!1,this.retryTimer=null,this.userInvokedPlay=!1,this._playIntentHook=()=>{this.userInvokedPlay=!0},this._onError=e=>d(this,null,(function*(){var t;this.player.addClass(bR);const i=yield this.transformToVeError(e);this.player.veError=i,ss.error("error: ",i),this.player.removeClass(bR),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?ss.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit(kR,i)})),this.player=e,this.config={},t&&Object.keys(xR.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=xR.defaultConfig[e]:this.config[e]=t[e]})),this.init()}static get defaultConfig(){return{oriErrRetryCount:3,oriErrRetryCycle:1e4,oriErrRetryBaseDelay:500,oriErrMaxTotalRetry:0,enableOriErrRetry:!0,needSyncAnalyzeError:!0,analyzeTimeout:3e3,ignoreErrorCodes:[],clientKey:void 0}}createVeError(e={}){var t,i;const{errorType:n,errorCode:r=0,errorMessage:o="",originError:a="",ext:s={},mediaError:l=null}=e,h=(null==(i=null==(t=this.player)?void 0:t.i18n)?void 0:i.ERROR_TYPES)||{},d=this.player.media;if(d){const t=l||d.error||{},{duration:i,currentTime:h,ended:f,src:p,currentSrc:g}=this.player,{readyState:y,networkState:v}=d;let m=r||t.code;IR[m]&&(m=IR[m]);const{code:_,message:E,textKey:T}=e.veError||{},S=o||t.message,b=_||m,C=xR.getErrorType(e),k=E||S,I=T||(e=>{for(const[t,{code:i,textKey:n}]of Object.entries(yR))if(i===e)return n})(b)||function(e){for(const t of Object.values(_R))if(t.code===e)return t.textKey}(b),P=this.player.i18n[I]||k||this.player.i18n[gR.MEDIA_ERR]||"unknown error",D=this.player.config,w=this.config.clientKey?{clientKey:this.config.clientKey}:{},A=this.config.clientKey?{albumId:D.albumId||D.album_id,episodeId:D.episodeId||D.episode_id||D.episodeID}:{};return u(c({playerVersion:"1.18.0",currentTime:h,duration:i,ended:f,readyState:y,networkState:v,src:p||g,errorType:n,errorCode:m,httpCode:e.httpCode,message:S,mediaError:t,originError:a?a.stack:"",host:Ur.getHostFromUrl(p||g),veErrorCode:b,veErrorType:C,veErrorMessage:k,displayMessage:P},w),{videoInfo:c({isMSE:Ns(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:sl(this.player)||"",vid:D.vid},A),ext:s})}if(arguments.length>1){const e={playerVersion:"1.18.0",domain:document.domain,ex:null},t=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"];for(let i=0;i<arguments.length;i++)e[t[i]]=arguments[i];return e.ex=h?(h[arguments[0]]||{}).msg:"",e}}static getErrorType(e){const{veError:t,mediaError:i}=e||{},n=t||(null==i?void 0:i.veError);if(null==n?void 0:n.code){const e=n.code+"";return n.code>=1e4?mR[e.slice(0,2)]:mR[e.slice(0,1)]}if(null==i?void 0:i.code)return PR[i.code]||"other"}static getVeErrorInfo(e,t){const{code:i,message:n,textKey:r}=e;return{code:i,message:t||n,textKey:r}}init(){var e,t;AR||(AR=this.player.errorHandler),function(e,t){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}(this.player,(e=this.player,t=this,{errorHandler(i,n){var r;ss.log("errorHandler, err: ",n);const o=e;if(o.media&&(o.media.error||n)){let e=o.media.error||n;const a=e.code?Wr[e.code]:"other";let s=e.message;"xg-video"===(null==(r=null==o?void 0:o.config)?void 0:r.mediaType)||o.media.currentSrc||o.media.srcObject||(s="empty_src",e={code:6,message:s}),o.emit(i,t.createVeError({errorType:a,errorCode:e.code,errorMessage:e.message||"",mediaError:e,veError:n.veError,originError:n}))}}})),this.setErrorEventMiddleWare(),this.player.on(Qr,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(Qr,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(CR))}shouldOriRetryReloadOnly(){var e;if(this.userInvokedPlay)return!1;const t=this.player.config;if(!t||t.autoplay||t.autoplayMuted)return!1;const i=this.player.media;return!!i&&0===(null==(e=i.played)?void 0:e.length)}setErrorEventMiddleWare(){this.eventMiddleware=new SR,this.eventMiddleware.addMiddleware(Qr,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(Qr)})}defaultErrorMiddleWare(e){return d(this,null,(function*(){var t,i;if(!Ur.isMSE(this.player.media)){const{error:n}=e||{};if(!n)return ss.error("invalid media error: ",e),!1;const{code:r}=n||{};if((2===r||3===r||4===r)&&(null==(i=null==(t=this.player)?void 0:t.config)?void 0:i.url)){const t=Date.now();this.retryTimestamps=this.retryTimestamps.filter((e=>t-e<=this.config.oriErrRetryCycle));const{oriErrRetryCount:i,oriErrMaxTotalRetry:n}=this.config,o=n>0&&this.totalRetryCount>=n,a=this.retryTimestamps.length>=i,s=!1!==this.config.enableOriErrRetry;if(s&&!o&&!a)return this.oriVideoRetry(!this.shouldOriRetryReloadOnly());if(s&&(o?ss.warn(`max total retry count ${n} reached, stop retrying`):ss.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===r)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=ol(ll(this.player));if(t){const i=RR(t);if(i)return e.error.veError=i,!1;this.config.needSyncAnalyzeError&&(e.error.veError=yield this.analyseNet(t,e.error,this.config.analyzeTimeout))}}}}return!1}))}oriVideoRetry(e=!0){if(this.retrying)return!0;this.retrying=!0;const t=this.config.oriErrRetryBaseDelay*Math.pow(2,this.retryTimestamps.length);return ss.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(CR),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(CR),this.retrying=!1}),t),!0}oriVideoReloadWithoutPlay(){const e=this.player;e.removeClass("xgplayer-is-error"),e.addClass("xgplayer-isloading"),e.runHooks("retry",(()=>{const t=e.currentTime,i="string"==typeof e.config.url?e.config.url:"",n=Ur.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,e.config.isLive||(e.currentTime=t)}))}analyseNet(e,t,i){return d(this,null,(function*(){const n=t.code||t.errorCode,r=t.message||t.errorMessage||t.msg;try{const t=yield Ls(e,{range:"0-8",timeout:i});ss.log("xhr result",t);const{status:o,response:a}=t;if(403===o){if("string"==typeof a){if(a.includes("expire"))return xR.getVeErrorInfo(yR.NETWORK_URL_EXPIRE);if(a.includes("sign"))return xR.getVeErrorInfo(yR.NETWORK_URL_SIGN)}return xR.getVeErrorInfo(yR.NETWORK_FORBIDDEN)}if(416===o)return xR.getVeErrorInfo(yR.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return xR.getVeErrorInfo(yR.NETWORK_NOTFOUND);if(o===Os.TIMEOUT)return xR.getVeErrorInfo(yR.NETWORK_TIMEOUT);if(o===Os.ERROR)return xR.getVeErrorInfo(yR.NETWORK,r);if(200===o||206===o){if(4===n)return r?xR.getVeErrorInfo(yR.MEDIA_ERR_PLAY_ERR,r):xR.getVeErrorInfo(yR.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===n)return xR.getVeErrorInfo(yR.MEDIA_ERR_DECODE,r);if(2===n)return xR.getVeErrorInfo(yR.MEDIA_ERR_NETWORK,r);if(1===n)return xR.getVeErrorInfo(yR.MEDIA_ERR_ABORTED,r);if(-9996===n){return sl(this.player)===or.PRIVATE_ENCRYPT_UPGRADE?xR.getVeErrorInfo(yR.PRIVATE_DRM_GET_KEY_FAILED):xR.getVeErrorInfo(yR.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(o){return ss.warn("Failed to analyze the network. If the domain of the video address has been configured with CORS, it means that the playback error is caused by the failure of the video request. If the domain of the video address is not configured with CORS, the real reason for the playback error cannot be determined because the video request cannot be analyzed."),xR.getVeErrorInfo(yR.NETWORK)}}))}analyseStream(){return d(this,null,(function*(){}))}handle2100Error(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,response:n,finalMessage:r}){const o={errorType:mR.network,errorCode:t,httpCode:i,errorMessage:r,originError:e};if(i){if(404===i)o.veError=xR.getVeErrorInfo(yR.NETWORK_NOTFOUND);else if(416===i)o.veError=xR.getVeErrorInfo(yR.NETWORK_RANGE_NOT_SATISFIABLE);else if(403===i){try{const e=yield function(e){return(t=e)&&"object"==typeof t&&"responseText"in t&&"status"in t&&"statusText"in t?e.responseText:function(e){return!(!e||"object"!=typeof e)&&"json"in e&&"text"in e&&"status"in e}(e)?e.text():e;var t}(n);if("string"==typeof e)return e.includes("expire")?o.veError=xR.getVeErrorInfo(yR.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=xR.getVeErrorInfo(yR.NETWORK_URL_SIGN):o.veError=xR.getVeErrorInfo(yR.NETWORK_FORBIDDEN),this.createVeError(o)}catch(a){ss.warn("get response text error")}return o.veError=xR.getVeErrorInfo(yR.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=ol(ll(this.player));if(e){const t=RR(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:n}){return this.createVeError({errorType:mR.serve,errorCode:t||yR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:xR.getVeErrorInfo(yR.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:n}){try{const r=ol(ll(this.player)),o=yield this.analyseNet(r,e,3e3);return o?this.createVeError({errorType:mR.network,errorCode:t||yR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:o}):this.createVeError({errorCode:t||yR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:xR.getVeErrorInfo(yR.NETWORK_ENCRYPT_HLS_ERR)})}catch(r){return ss.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||yR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:xR.getVeErrorInfo(yR.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:n}){const r={errorType:mR.network,errorCode:t,httpCode:i,errorMessage:n,originError:e},{currentTime:o,duration:a,buffered:s}=this.player,l=!s||0===s.length||!a,c=this.player.checkBuffer(o,{startDiff:0,endDiff:.1});if(l||!c)return r.veError=xR.getVeErrorInfo(yR.NETWORK),this.createVeError(r);this.createVeError(r)}transformToVeError(e){return d(this,null,(function*(){if((null==e?void 0:e.veErrorCode)&&!this.player.getPlugin("Mp4EncryptPlayer"))return e;const{httpCode:t,errorMessage:i,message:n,msg:r,response:o}=e||{},a=(null==e?void 0:e.code)||(null==e?void 0:e.errorCode),s=i||n||("string"==typeof r?r:"other error");if(2100===a)return this.handle2100Error({error:e,errorCode:a,httpCode:t,response:o,finalMessage:s});if(-9991===a)this.handle9991Error({error:e,errorCode:a,httpCode:t,finalMessage:s});else{if([2103,5104,5102].includes(a)&&this.player.getPlugin("Mp4EncryptPlayer")||-9996===a&&this.player.getPlugin("EncryptHlsPlugin"))return this.handleNetError({error:e,errorCode:a,httpCode:t,finalMessage:s});if([9002,9003].includes(a))return this.handleStuckError({error:e,errorCode:a,httpCode:t,finalMessage:s})}return this.createVeError(c({errorCode:a||yR.OTHER.code,httpCode:t,errorMessage:s,originError:e},e||{}))}))}}const OR=new Set(Object.values(_R).map((e=>e.code)));let LR=class extends ba{constructor(e){super(e),this._errDetailList=[],this._errorDomMode=null,this.state={showError:!1,retryTimes:0,idx:0},this.handleError=e=>d(this,null,(function*(){this.isVodLogConError=(null==e?void 0:e.errorCode)===yR.VOD_LOG_NOT_CONFIGURED.code,this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)})),this.handleEnd=()=>{},this.handleRefreshClick=()=>{var e,t;null==(e=this.player)||e.emit(MA.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(Pa.PAUSED),this.closeError(),null==(t=this.player)||t.retry()},this.closeError=()=>{this.state.showError&&(this.state.showError=!1,this.renderError())},this.playerData=e.player.config.playerData}static get pluginName(){return"sdkErrorPlugin"}static get defaultConfig(){return{showError:!0,errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedCopyButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:ba.POSITIONS.ROOT}}afterCreate(){var e,t,i;this.initEvents();const n=Object.values(yR).reduce(((e,t)=>{const{code:i,textKey:n}=t;return e[i]=this.i18n[n],e}),{});this.errNoteMap=c({other:null!=(i=null==(t=null==(e=this.i18n.ERROR_TYPES)?void 0:e.other)?void 0:t.msg)?i:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE},n)}registerLanguageTexts(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"},errorCode:{jp:"コード",en:"code",zh:"错误码","zh-hk":"錯誤碼"},did:{jp:"デバイスID",en:"deviceID",zh:"设备 ID","zh-hk":"設備 ID"},playTime:{jp:"遊び時間",en:"playTime",zh:"播放时间","zh-hk":"播放時間"},copyError:{jp:"コピーエラー",en:"Copy error",zh:"复制错误信息","zh-hk":"複製錯誤訊息"},copySuccess:{jp:"コピー成功",en:"Copy success",zh:"复制成功","zh-hk":"複製成功"}}}registerIcons(){return{errorImg:{icon:pR,class:"xgplayer-error-svg"}}}updateLang(){var e,t;if(!this.$errorDom)return;const i=this.$errorDom.querySelector(".xgplayer-error-tips");if(i){const n=null!=(t=null==(e=this.config.errorTipsText)?void 0:e[this.lang])?t:this.langText.errorTips;i.innerHTML=n}const n=this.$errorDom.querySelector(".xgplayer-error-button");n&&(n.innerHTML=this.langText.clickButton)}initEvents(){this.player.on(kR,this.handleError),this.on(no,this.closeError),this.on(Xr,this.closeError)}getRetryList(){var e;const t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url,...null!=(e=null==t?void 0:t.backUrlList)?e:[]]}changeMainOrBackup(){this.player.addClass(Pa.ENTER);const e=this.getRetryList(),t=this.config.retryLoopNum*e.length,i=(e.indexOf(this.player.config.url)+1)%e.length;this.state.idx=i;const n=e[i];if(!n||this.state.retryTimes===t)return this.player.removeClass(Pa.ENTER),this.state.retryTimes===t&&this.player.emit(MA.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),ss.log(`retry times: ${this.state.retryTimes}`,n),this.player.emit(MA.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:n,retryTimes:this.state.retryTimes}),this.changeUrl(n),this.state.retryTimes=this.state.retryTimes+1}changeUrl(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(MA.PlAY_URL_CHANGE,{url:e,from:MA.PLAY_BACKUP_CHANGE})}resetTimes(){this.state.retryTimes=0,this.state.idx=0}renderError(e){if(!this.config.showError)return;const t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(MA.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}addErrDetail(e){Array.isArray(e)?this._errDetailList=[...this._errDetailList,...e]:this._errDetailList.push(e)}getErrorInfo(e){var t,i,n,r,o;const a=e.veErrorCode||e.errorCode,s=null==(t=this.player)?void 0:t.vodLogger,l=(null==(o=null==(r=null==(n=null==(i=null==s?void 0:s.tracker)?void 0:i.getConfig)?void 0:n.call(i))?void 0:r.user)?void 0:o.user_unique_id)||(null==s?void 0:s.line_user_id);return{code:a,appId:null==s?void 0:s.line_app_id,did:l||"unknown",playTime:cs().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:n}=this.getErrorInfo(e),r=Ur.createDom("div","",void 0,"xgplayer-error-info-wrap"),o=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.errorCode||"code"}</span>\n <span class="xgplayer-error-info-content">${t}</span>\n </p>`;r.appendChild(Ur.createDomFromHtml(o));const a=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.did||"deviceID"}</span>\n <span class="xgplayer-error-info-content">${i}</span>\n </p>`;r.appendChild(Ur.createDomFromHtml(a));const s=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.playTime||"playTime"}</span>\n <span class="xgplayer-error-info-content">${n}</span>\n </p>`;return r.appendChild(Ur.createDomFromHtml(s)),r}handleCopyBtnClick(e){const{did:t,playTime:i,appId:n}=this.getErrorInfo(e);try{const r=JSON.stringify(u(c({},e),{playTime:i,deviceID:t,appId:n}));navigator.clipboard.writeText(r).then((()=>{!function(e,t=1e3){const i=document.createElement("div");i.className="veplayer-toast",i.textContent=e,document.body.appendChild(i),setTimeout((()=>i.classList.add("show")),10),setTimeout((()=>{i.classList.remove("show"),setTimeout((()=>null==i?void 0:i.remove()),300)}),t)}(this.langText.copySuccess||"copySuccess")}))}catch(r){ss.error("copy error info err ",r)}}getActionDom(e){const t=e.errorType,i=Ur.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),n=!(t&&[mR[10],mR[11],mR[12]].includes(t));if(this.config.isNeedRefreshButton&&n){const e=Ur.createDom("div",this.langText.clickButton||"Refresh",void 0,"xgplayer-error-button refresh-button");this.bind(".refresh-button","click",this.handleRefreshClick),i.appendChild(e)}if(this.config.isNeedCopyButton){const t=Ur.createDom("div",this.langText.copyError||"CopyError",void 0,"xgplayer-error-button copy-button");this.bind(".copy-button","click",this.handleCopyBtnClick.bind(this,e)),i.appendChild(t)}return i}getErrorDom(e){var t,i,n,r,o,a;const{errorCode:s,message:l,displayMessage:c}=e,u=null!=(t=null==e?void 0:e.veErrorCode)?t:null==e?void 0:e.errorCode,h=!!mB.ttDramaEnv,d="number"==typeof u&&OR.has(u);if("drama"===(h&&d?"drama":"normal")){if(!this.$errorDom){this.$errorDom=Ur.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=Ur.createDom("div","Video isn't available",void 0,"xgplayer-drama-error-toast");this.$errorDom.appendChild(e),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}if(!this.$errorDom){if(this.$errorDom=Ur.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=Ur.createDom("div","",void 0,"xgplayer-error-img");e.appendChild(this.icons.errorImg),this.$errorDom.appendChild(e)}if(this.config.errorTips){let t="";t=(null==(n=null==(i=this.config)?void 0:i.errorTipsText)?void 0:n[this.lang])?null==(r=this.config.errorTipsText)?void 0:r[this.lang]:e?c||this.errNoteMap[s]||this.player.errorNote&&this.i18n[this.player.errorNote]||l||this.errNoteMap.other||"error":this.langText.errorTips;const o=Ur.createDom("div",t,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(o)}this.$errorDom.appendChild(this.getErrorInfoDom(e)),this.$errorDom.appendChild(this.getActionDom(e)),(null==(o=this._errDetailList)?void 0:o.length)&&(null==(a=this._errDetailList)||a.forEach((e=>{const t="function"==typeof e?e():e;if(t){const e=Ur.createDom("div",`${t.label}: ${t.value}`,void 0,"xgplayer-error-detail-info");this.$errorDom.appendChild(e)}}))),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}destroy(){this.player.off(Qr,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};function NR(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 MR(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?NR(Object(i),!0).forEach((function(t){jR(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):NR(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function UR(e){return(UR="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 BR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FR(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,ex(n.key),n)}}function HR(e,t,i){return t&&FR(e.prototype,t),i&&FR(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function jR(e,t,i){return(t=ex(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function VR(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&&GR(e,t)}function KR(e){return(KR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function GR(e,t){return(GR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function WR(){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(ds){return!1}}function YR(e,t,i){return(YR=WR()?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&&GR(r,i.prototype),r}).apply(null,arguments)}function zR(e){var t="function"==typeof Map?new Map:void 0;return zR=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 YR(e,arguments,KR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),GR(n,e)},zR(e)}function $R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XR(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 $R(e)}function qR(e){var t=WR();return function(){var i,n=KR(e);if(t){var r=KR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return XR(this,i)}}function ZR(){return ZR="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=KR(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},ZR.apply(this,arguments)}function QR(e){return function(e){if(Array.isArray(e))return JR(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 JR(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 JR(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 JR(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 ex(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 tx=["b","i","u","span","c","ruby","rt","v","lang"],ix=["br"];var nx=/^WEBVTT/i,rx=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,ox=/^STYLE+$/,ax=/^\:\:cue/,sx=/^}+$/,lx=/^\[Script Info\].*/,cx=[/[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,3}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}\s*-->\s*[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}/],ux=/^Format:\s/,hx=/^Style:\s/,dx=/^Dialogue:\s/,fx=/^([0-5]?\d)[.,](\d{1,3})$/;function px(e){var t=fx.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function gx(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+px(e[2]):2===t?60*Number(e[0])+px(e[1]):px(e[0])}function yx(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function vx(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function mx(e,t){return e>=0&&e<t.length?t[e]:""}function _x(e){return t=function(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}(e),tx.includes(t)||ix.includes(t);var t}var Ex=function(){function e(){BR(this,e)}return HR(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);try{var r;i({format:n,list:(r="ass"===n?e.parseASS(t):e.parseVTT(t)).list,styles:r.styles})}catch(dF){console.error(dF),i({format:n},dF)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},n="";try{var r=t.length-e.length;return n=vx(n=(n=r>0?t.splice(e.length-1,r+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,"")),t[e.length-1]=n,e.map((function(e,n){"end"===e||"start"===e?i[e]=gx(t[n].split(":")):"text"===e?i[e]=[t[n]]:"layer"===e?(i[e]=[t[n]],i.textTag=[t[n]]):i[e]="style"===e?[t[n]]:Number(t[n])?Number(t[n]):t[n]})),i}catch(dF){return console.error(dF),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(ux.test(i[r]))s=(s=i[r].replace(ux,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(hx.test(i[r]))a.push(i[r].replace(hx,"").replace(/\s+/g,""));else if(dx.test(i[r])){var c=e.parseASSItem(i[r].replace(dx,""),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(dF){console.error(dF)}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,styles:[]}}},{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(nx,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=mx(n,t).trim();if(!h||a&&yx(h))a=!h;else if(ax.test(h)&&ox.test(mx(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)sx.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 y=o,v=y.text,m=y.textTag,_=this.parseVttText(t[n]);v.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<cx.length&&!(i=cx[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){if(_x(n=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:vx(e.replace(/\\n+/g,"<br/>"))};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:vx(i.replace(/\\n+/g,"<br/>"))}}},{key:"parseVttTime",value:function(e){var t=e.split("--\x3e"),i=0,n=0;if(2===t.length){var r=t[0].split(":"),o=t[1].split(":");i=gx(r),n=gx(o)}return{start:i,end:n,time:e}}},{key:"isVTT",value:function(e){return nx.test(e)}},{key:"isASS",value:function(e){return lx.test(e)}},{key:"checkFormat",value:function(e){return e?nx.test(e)?"vtt":lx.test(e)?"ass":rx.test(e)?"srt":"":""}}]),e}(),Tx=[{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"}],Sx=function(e){VR(i,zR(Error));var t=qR(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return BR(this,i),e||(e=Tx[r||7].msg),(n=t.call(this,e)).code=r||7,n.message=e,n.type=Tx[r||7].msg,n.orgError=o||null,n.data=a||null,n}return HR(i)}();function bx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={code:Tx[e].code,msg:Tx[e].msg,message:Tx[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var Cx=HR((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 BR(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("&"))}}))})),kx=function(){function e(){var t,i;BR(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 HR(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function Ix(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"===UR(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function Px(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):Ix(e,t)||(e.className&&"object"===UR(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function Dx(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 wx(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 Ax(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Rx(){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 xx(e){return e&&e instanceof window.HTMLMediaElement}function Ox(e,t,i){if(i||(i=new kx),"json"===t){var n=Ex.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&Ex.parse(e,(function(e,t){if(t){var n=bx(2,t);i.reject(n,{format:e.format})}else if(e.format||e.list&&0!==e.list.length)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=bx(3);i.reject(r)}}));return i}function Lx(e,t){t||(t=new kx);var i=[];"String"===Ax(e.url)?i=[e.url]:"Array"===Ax(e.url)&&(i=QR(e.url));return function n(){var r=i.shift();if(r)new Cx({url:r,type:"text"}).then((function(i){Ox(i.res.response,"string").then((function(i){t.resolve(MR(MR({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)n();else{var a=bx(1,MR({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:r},e));t.reject(a)}}));else{var o=bx(1,MR({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function Nx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"==typeof e)return Number.isFinite(e)?Math.trunc(e):t;if("string"==typeof e){var i=e.trim();if(!i)return t;var n=parseInt(i,10);return Number.isNaN(n)?t:n}return t}function Mx(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function Ux(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function Bx(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var Fx=function(){function e(){var t=this;BR(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return HR(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(dF){console.error(dF)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),Hx=null;var jx="resize",Vx="change",Kx="off",Gx="update",Wx="error",Yx=/^[A-Za-z0-9_-]+$/,zx=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function $x(e,t){t&&String(t).split(/(?:\\[nN]|\r\n|\r|\n)+/).forEach((function(t,i){i>0&&e.appendChild(document.createElement("br")),t&&e.appendChild(document.createTextNode(t))}))}function Xx(e){var t=e.slice(1,-1).trim();if(!t||"!"===t[0]||"?"===t[0])return null;if("/"===t[0]){var i=/^\/\s*([A-Za-z][\w:-]*)/.exec(t),n=i&&i[1].toLowerCase();return n&&tx.includes(n)?{closing:!0,tagName:n}:null}var r=/\/\s*$/.test(t),o=t.replace(/\/\s*$/,""),a=/^([A-Za-z][\w:-]*(?:\.[^\s/>.]+)*)([\s\S]*)$/.exec(o);if(!a)return null;var s=a[1].split("."),l=s.shift().toLowerCase();if(!tx.includes(l)&&!ix.includes(l))return null;var c,u=function(e){var t=e.trim(),i={};if(!t||!/(?:^|\s)[^\s=]+\s*=/.test(t))return{attrs:i,annotation:t};for(var n=/([^\s=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,r=n.exec(t);r;)i[r[1].toLowerCase()]=r[2]||r[3]||r[4]||"",r=n.exec(t);return{attrs:i,annotation:""}}(a[2]),h=u.attrs;return{attrs:h,annotation:u.annotation,closing:!1,className:(c="".concat(s.join(" ")," ").concat(h.class||""),String(c||"").split(/\s+/).filter((function(e){return Yx.test(e)})).join(" ")),selfClosing:r,tagName:l}}function qx(e){var t="c"===e.tagName||"v"===e.tagName||"lang"===e.tagName?"span":e.tagName,i=document.createElement(t);e.className&&(i.className=e.className);var n=function(e){var t=String(e||"").trim();return zx.test(t)?t:""}(e.attrs.lang||("lang"===e.tagName?e.annotation:""));return n&&i.setAttribute("lang",n),"v"===e.tagName&&e.annotation&&i.setAttribute("data-voice",e.annotation),i}function Zx(e,t){for(var i=function(e){return null==e?"":String(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&amp;/g,"&")}(t),n=[{dom:e,tagName:""}],r=/<[^>]*>/g,o=0,a=r.exec(i);a;){$x(n[n.length-1].dom,i.slice(o,a.index));var s=a[0],l=Xx(s);if(l)if(l.closing){var c=n.map((function(e){return e.tagName})).lastIndexOf(l.tagName);c>0?n.length=c:$x(n[n.length-1].dom,s)}else if("br"===l.tagName)n[n.length-1].dom.appendChild(document.createElement("br"));else{var u=qx(l);n[n.length-1].dom.appendChild(u),l.selfClosing||n.push({dom:u,tagName:l.tagName})}else $x(n[n.length-1].dom,s);o=r.lastIndex,a=r.exec(i)}$x(n[n.length-1].dom,i.slice(o))}function Qx(e){var t=[];if(e&&"String"===Ax(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===Ax(e)){if(0===e.length)return t;"String"===Ax(e[0])?t.push({url:QR(e),index:0,start:-1,end:-1}):e.forEach((function(e,i){t.push({url:e.url||e.src||"",index:i,start:e.start||-1,end:e.end||-1})}))}return t}var Jx=!1,eO=function(e){VR(i,Rr);var t=qR(i);function i(e){var n,r,o,a,s,l,c;return BR(this,i),jR($R(n=t.call(this)),"_onPause",(function(){n.stopRender()})),jR($R(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),jR($R(n),"_onTimeupdate",(function(){if(n._isOpen){if(n.config.domRender){var e=n.player.media?n.player.media:n.player,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)))}})),jR($R(n),"_onResize",(function(e){var t=$R(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=Nx(a/o*100)}n.__startResize(e)}})),jR($R(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)}})),jR($R(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=$R(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))}})),jR($R(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),Jx=/(?: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={},n.seiTime=0,n.lastSeiTime=0,n._curTexts=[],n._curRenderTask=[],n._renderIntervalId=-1,n._lastTimeStamp=-1,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"===Ax(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.setSubTitles(e.subTitles,n.config.defaultOpen),n):XR(n)}return HR(i,[{key:"version",get:function(){return"3.0.25-rc.11"}},{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(),!t||t.length<1?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=Qx(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",r),r&&(this.currentText||(this.currentText=this.textTrack[0]),this.switch().catch((function(t){e.emitError(t),e._log("[switch]",t)}))),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})).catch((function(t){e.emitError(t),e._log("[_loadTrack] error",t)})),this.emit("reset",{type:"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(Mx(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=Mx(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=Qx(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.head||document.getElementsByTagName("head")[0],r="xg-text-track-style",o=document.getElementById(r);if(o||((o=document.createElement("style")).type="text/css",o.id=r,n.appendChild(o)),o.styleSheet){var a=function(){try{o.styleSheet.cssText=(o.styleSheet.cssText||"")+i}catch(ds){}};o.styleSheet.disabled?setTimeout(a,10):a()}else{var s=document.createTextNode(i);o.appendChild(s)}}(t,".xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e&&e!==this.player){this.player&&this.detachPlayer();var i,n,r=this.config,o=r.fontColor,a=r.mode,s=r.fitVideo,l=r.domRender;if(this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&Px(this.root,"text-track-hide"),!s&&Px(this.root,"text-track-no-fitvideo"),a&&Px(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&&this.player.root.appendChild(this.root),this.player.root&&(i=e.root,n=this._onResize,Hx||(Hx=new Fx),Hx.addObserver(i,n))),xx(this.player))this.player.addEventListener("timeupdate",this._onTimeupdate),this.player.addEventListener("pause",this._onPause),this.player.addEventListener("play",this._onPlay);else{if("function"!=typeof this.player.on)return;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&&(xx(i)?(i.removeEventListener("timeupdate",this._onTimeupdate),i.removeEventListener("pause",this._onPause),i.removeEventListener("play",this._onPlay)):"function"==typeof i.off&&(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,Hx&&Hx.unObserver(e,t),this.root&&i.root.contains(this.root)&&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)return e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),void i({message:"switch default subtitle success",code:0});var r=new Sx("no default subtitle",5);return e.emitError(r),void n(r)}if(e.currentText&&Mx(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(bx(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var a=0;a<e.textTrack.length;a++)if(Mx(t,e.textTrack[a])){o=e.textTrack[a];break}if(e._log("nextSubtitle",o),o)e._emitPlayerSwitch(e.currentText,o),o.list?(e._loadingTrack={},e._updateCurrent(o),e.switchOn(),i(bx(0))):(e._log("this._loadTrack",o),e._updateCurrent(o),e._loadTrack(o).then((function(r){if(e.addStyles(r),e._loadingTrack.id===o.id||e._loadingTrack.language===r.language)e._loadingTrack={},e._updateCurrent(r),e.switchOn(),i(bx(0));else{var a=new Sx("check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(r.id),6,null,t);e.emitError(a),n(a)}})).catch((function(t){e.emitError(t),n(t)})));else{var s=new Sx("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]"),4,null,t);e.emitError(s),n(s)}}}))}},{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(Mx(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!Mx(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(bx(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(bx(0))}))}},{key:"emitError",value:function(e){this.emit(Wx,{type:Wx,error:e})}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show();var e=this.currentText||{},t=e.id,i=e.language;this.emit(Vx,{type:Vx,isOpen:!0,id:t,language:i,texts:[]})}},{key:"switchOff",value:function(){if(this._isOpen=!1,this.hide(),this.currentText){var e=this.currentText,t=e.id,i=e.language;this.emit(Kx,{type:Kx,id:t,language:i,texts:[],isOpen:!1})}}},{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 kx,n="",r="";if(e.json?(n="json",r=e.json):!e.stringContent||e.url&&0!==e.url.length||(n="string",r=e.stringContent),r)return Ox(r,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):(Lx(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>0&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=MR({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&"function"==typeof this.player.emit&&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){Lx(MR(MR({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.styles,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){if(!t||0===t.length)return e;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=Dx(e,this.currentText.list,this._gid);if(n>-1&&(i=wx(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(Gx,this.getUpdateData(this._curTexts,0,this.currentText))}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=Dx(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=wx(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),this._cids=[],this._curTexts.length>0&&this.emit(Gx,this.getUpdateData([],e,this.currentText)),void(this._curTexts=[]);if(this._cids.join("")!==n.join("")||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._curTexts=a,this.emit(Gx,this.getUpdateData(a,e,this.currentText)),this.__render(a,e)}}}},{key:"getUpdateData",value:function(e,t,i){var n=i.id,r=i.language;return{type:Gx,currentTime:0|t,id:n,language:r,texts:e,isOpen:this._isOpen}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return Nx(1e3*(void 0===e?0:e)+1e3*this.seiTime-1e3*this.lastSeiTime)/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}}))};Mx(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=Nx(h*e)/100,i=e):(d=t,i=Nx(t/h*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;p=Nx(h>120?(f=a)*d/1080:(f=o)*i/1920);var g=Jx?s:l,y={fontSize:p=p<g?g:p>f?f:p},v=Nx((t-d)/2),m=Nx((e-i)/2),_=Nx(d*u)/100;this._videoMeta.vBottom=v,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(y.bottom=v+_,y.left=y.right=m),Object.keys(y).map((function(e){n.root.style[e]="".concat(y[e],"px")})),this.emit(jx,{vLeft:m,vBottom:v,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=Rx("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=Rx("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),Zx(l,r),setTimeout((function(){e._renderByWords(s,o,t.start,t.end,r)}),600)}else Zx(s,r)}))}))}},{key:"_renderByWords",value:function(e,t,i,n,r){var o=document.createTextNode("");e.appendChild(o);var a,s,l=function(e){for(var t=e.split(""),i=[],n=!1,r=0;r<t.length;r++){var o=t[r];if(Ux(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(/^[ ]*$/)||Bx(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;s>=0?i[s]="".concat(i[s]).concat(o):i.push(o)}else n=!1,i.push(o)}return i}((a=r,Zx(s=document.createElement("span"),a),s.textContent||"")),c=this._getPlayerCurrentTime(),u=Nx(1e3*(n-c));if(!(c>=n)){i>=c&&(c=i),u>300&&(u-=50);var h={dom:o,ids:t,wordList:l,interval:u/l.length,start:c,end:n,duration:u,lastTime:0};this._log(">>>>_renderByWords",u,h);for(var d=this._curRenderTask,f=-1,p=0;p<d.length;p++)if(d[p].ids===t){f=p;break}f>-1&&d.slice(f,1),d.push(h),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)})):Ix(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===UR(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(Px(this.root,"text-track-hide"),this.innerRoot&&(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=ZR(KR(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=ZR(KR(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=ZR(KR(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=ZR(KR(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){ZR(KR(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.vBottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}();class tO extends Rr{constructor(e){super(),this._onChange=e=>{const t=this._media.textTracks;if(!t||0===t.length)return;const i=[],n=[];let r=-1;for(let o=0;o<t.length;o++){const e=t[o];"subtitles"===e.kind&&(i.push({id:e.id||e.language,language:e.language,text:e.label,isDefault:"showing"===e.mode}),-1===r&&"showing"===e.mode&&(r=o),n.push(e.language))}n.join("|")!==this._languages?(this._languages=n.join("|"),this.emit("reset",{list:i,isOpen:r>-1})):-1===r?this.emit("off"):this.curIndex!==r&&this.emit("change",i[r]),this.curIndex=r},this._media=e,this._list=[],this._languages="",this.curIndex=-1,this._init()}_init(){const e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):ss.warn("current browser not support native subtitle")}switch(e){return new Promise(((t,i)=>{if(!e)return i({code:1,message:"no subtitle data"});const n=this._media.textTracks;for(let r=0;r<n.length;r++){const t=n[r];t.language===e.language?t.mode="showing":"showing"===t.mode&&(t.mode="disabled")}return t({code:0})}))}switchOff(){const e=this._media.textTracks;for(let t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}destroy(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}function iO(){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 nO(){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}const{POSITIONS:rO}=ba,oO="mobile"===Kr.device,aO="text-close";function sO(e=[]){let t=-1;return e.map(((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}class lO extends ba{constructor(e){super(e),this.isOpenState=!0,this.optionList=null,this.currentLang="",this._onOff=()=>{this.noShowSubtitle()},this._onChange=e=>{const t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)},this._onListReset=e=>{this.updateList(e)},this.handleButtonChange=e=>{e.preventDefault(),e.stopPropagation(),e.delegateTarget||(oO?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle().then((()=>this.showList())))},this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.showList()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.hideList()},this.handlerClickSwitch=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.subTitles&&(t.type===aO?this.switchOffSubtitle():this.switchSubTitle({language:t.language,id:t.id}))},this.onPlayerFocus=e=>{this.subTitles&&this.config.style.follow&&this.rePosition()},this.onPlayerBlur=e=>{this.subTitles&&this.config.style.follow&&!this.playerConfig.marginControls&&this.subTitles.root&&(this.subTitles.root.style.transform="translate(0, 0)")};const{player:t,config:i}=e;t.config.isLive&&(e.config.updateMode="live",Kr.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:rO.CONTROLS_RIGHT,index:KA,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"}}afterCreate(){const{list:e=[]}=this.config;this.curIndex=-1,this.curItem=null;const t=sO(e);super.afterCreate(),"native"===this.config.mode?this._initNativeSubtitle(t):this._initExtSubTitle(t),e.length||this.hide()}_initNativeSubtitle(e){const{player:t}=this;t._subTitles||(t._subTitles=new tO(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),this._renderList(e)}_initExtSubTitle(e){const{list:t=[],style:i,isDefaultOpen:n,updateMode:r,renderMode:o}=this.config,a={subTitles:t,defaultOpen:n,debugger:!1,renderMode:o,updateMode:r};this.isOpenState=n,Object.keys(i).map((e=>{a[e]=i[e]}));!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(ho,this.onPlayerFocus),this.on(fo,this.onPlayerBlur));const{player:s}=this;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new eO(a),s._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=s._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),i.follow&&this.subTitles.root&&Ur.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}_renderList(e){const{list:t=[],isDefaultOpen:i}=this.config;t.length&&(e<0?(t[0].isDefault=!0,this.curIndex=0,this.curItem=t[0]):(this.curIndex=e,this.curItem=t[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?Ur.addClass(this.root,"isOpen"):Ur.addClass(this.root,"isClose"),!1===this.config.isShowIcon&&this.hide()}updateCurItem(e,t){this.curIndex=e,this.curItem=this.config.list[e],this.renderItemList(),this.emit("subtitle_change",c({off:!1,isListUpdate:!1,list:[]},t))}initEvents(){this.bind(["click"],this.handleButtonChange),this.bind(["mouseenter"],this.onEnter),this.bind(["mouseleave"],this.onLeave),this._delegates=[]}showList(){var e;!oO&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!oO&&this.isOpenState&&(null==(e=this.optionList)||e.hide())}openSubtitle(){return this.curIndex<0&&(this.curIndex=0,this.curItem=this.config.list[0]),this.curIndex>-1&&this.curItem?this.switchSubTitle(this.curItem):Promise.resolve(void 0)}getSubTitleIndex(e,t={id:"",language:""}){let i=-1;return t&&(t.id||t.language)?(e.forEach(((e,n)=>{e.id!==t.id&&e.language!==t.language||(i=n)})),i):i}registerIcons(){return{vttSubOpen:{icon:iO,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:nO,class:"xgplayer-vttsub-close-svg"}}}registerLanguageTexts(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}creatOptionList(){if(oO)return;const e={config:{data:this.getList(),className:"",onItemClick:(e,t)=>{this.handlerClickSwitch(e,null==t?void 0:t.to)}},root:this.root};this.optionList=new PA(e)}getList(){return this.config.list.map(((e,t)=>(t===this.curIndex&&this.isOpenState?(e.isCurrent=!0,e.selected=!0):(e.isCurrent=!1,e.selected=!1),e.showText=this.getTextByLang(e),e)))}renderOptionList(){this.optionList.renderItemList(this.getList())}switchSubTitle(e={id:"",language:""}){let t=-1;return e&&(e.id||e.language)?(this.config.list.map(((i,n)=>{i.id+""==e.id+""&&i.language+""==e.language+""&&(t=n)})),t<0||this.isOpenState&&t===this.curIndex?Promise.resolve(void 0):this.subTitles.switch(e).then((i=>{0===i.code&&(e.off=!1,e.isListUpdate=!1,e.list=[],this.curIndex=t,this.curItem=this.config.list[t],this.isOpenState=!0,Ur.removeClass(this.root,"isClose"),Ur.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>ss.error("switch subtitle err: ",e)))):Promise.resolve(void 0)}switchOffSubtitle(){this.subTitles.switchOff(),this.noShowSubtitle()}noShowSubtitle(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,Ur.addClass(this.root,"isClose"),Ur.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null==(e=this.optionList)||e.hide()}renderItemList(){oO?this.updatePanel():this.renderOptionList()}updateSubtitles(e=[],t=!0){if(!e)return;const i=this.curIndex>-1||this.config.isDefaultOpen;this.updateList({list:e,isOpen:i}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,i,t)}updateList(e={}){var t,i,n,r;if(!e.list)return;e.list.length>0&&!1!==this.config.isShowIcon&&this.show();const o=[];e.list.map((e=>{o.push(e)}));const a=sO(o);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?o[a]:null,Ur.removeClass(this.root,"isClose"),Ur.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,Ur.removeClass(this.root,"isOpen"),Ur.addClass(this.root,"isClose"),this.changeTipText(),null==(t=this.optionList)||t.hide()),this.config.list=o,o.length>0?oO||null==(i=this.optionList)||i.hide():(this.switchOffSubtitle(),oO?this.showMobilePanel():null==(n=this.optionList)||n.show(),oO||null==(r=this.optionList)||r.hide(),this.hide()),this.renderItemList()}changeTipText(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}showMobilePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.showPanel(t,this.langText.sub,!0)}updatePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.updatePanel(t)}renderPanel(){const e=[...this.config.list],t=Ur.createDom("div","",{},"ai-panel-content");e.map(((e,i)=>{const n=c({language:e.language||e.srclang,"data-id":e.id,selected:this.isOpenState&&this.curIndex===i,showText:this.getTextByLang(e)},e),r=this.renderPanelItem(n);t.appendChild(r)}));const i={showText:this.langText.subClose,"data-type":aO,selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,n=Ur.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item "+(i?"select-in":""));n.innerHTML=t;const r=oO?"touchend":"click",o=ba.delegate(n,".panel-Item",r,(t=>{e["data-type"]===aO?(t.stopPropagation(),t.preventDefault(),this.switchOffSubtitle()):this.handlerClickSwitch(t,e)}));return this._delegates.push(o),n}getTextByLang(e,t,i){if(void 0===e)return"";const{list:n}=this.config;return!i&&(i=this.player.lang),t=!t||Ur.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]),"object"==typeof e[t]?e[t][i]||e[t].zh:e[t]||""}rePosition(){const{fitVideo:e}=this.config.style,t=0-this.player.controls.root.getBoundingClientRect().height;if(!e)return void(this.subTitles.root.style.transform=`translate(0, ${t}px)`);const{video:i,root:n}=this.player,{height:r,width:o}=n.getBoundingClientRect(),{videoHeight:a,videoWidth:s}=i;let l=parseInt(a/s*100,10)*o/100;l>r&&(l=r);const c=(r-l)/2-t;c<0&&(this.subTitles.root.style.transform=`translate(0, ${c}px)`)}destroy(){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)||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((e=>{Array.isArray(e)&&e.map((e=>{e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),super.destroy()}render(){var e;return`\n <xg-icon class="xgplayer-vttsub"${!1===this.config.isShowIcon||!(null==(e=this.config.list)?void 0:e.length)?' style="display: none;"':""}>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">${this.langText.subOpen}</div>\n </xg-icon>\n `}}const cO=class extends ba{constructor(e){super(e),this.toastNumber=0,this.toastMaps={}}static get pluginName(){return"sdkToastPlugin"}static get defaultConfig(){return{index:5}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){}destroy(){}add(e,t=2e3,i=!1){const n=this.toastNumber+1;this.toastNumber=n;const r=this.renderToast(e,i,n);return this.root.appendChild(r),this.toastMaps[n]=r,t&&setTimeout((()=>{this.remove(n)}),t),n}remove(e){const t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}renderToast(e,t,i){const n=Ur.createDom("div","",void 0,"toast-container"),r=Ur.checkIsObject(e)?e:Ur.createDom("div",e,void 0,"toast-txt");if(n.appendChild(r),t){const e=Ur.createDom("span","×",void 0,"toast-close-bt");e.addEventListener("click",(()=>{this.remove(i)})),n.appendChild(e)}return n}render(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}};function uO(){return(new Date).getTime()}var hO="loadstart",dO="loadeddata",fO="firstFrame",pO="waitingStart",gO="waitingEnd",yO="seekStart",vO="seekEnd",mO=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Nr.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),mr(Sr(e),"_onAutoplayStart",(function(){Nr.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),mr(Sr(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=uO(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Ur.clearTimeout(Sr(e),e._waitTimer),e._waittTimer&&Ur.clearTimeout(Sr(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),mr(Sr(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=uO(),e.emitLog(yO,{start:uO()}))})),mr(Sr(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),mr(Sr(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=uO(),e.fixedWaitingStart=uO(),e._waitType=1,e.emitLog(pO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),mr(Sr(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=uO(),e._waitTimer=Ur.setTimeout(Sr(e),(function(){e._isWaiting&&(e.waitingStart=uO(),Ur.clearTimeout(Sr(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(pO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),mr(Sr(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),mr(Sr(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=uO(),this.loadedCostTime=0,this.startCostTime=0,this.on(co,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=uO()-e.newPointTime,Nr.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(hO,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=uO(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(ao,(function(){e.vt=uO(),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;Nr.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(dO,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Jr,this._onSeeking),this.on(eo,this._onSeeked),this.on(Eo,(function(){e.endState("destroy")})),this.on(To,(function(){e.endState("urlChange"),Nr.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Xr,no],this._onPlaying),this.on(io,this._onWaiting),this.on(Qr,this._onError),this.on(Fo,(function(){Nr.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(yo,this._onAutoplayStart),this.off(to,this._onTimeupdate),this.once(yo,this._onAutoplayStart),this.once(to,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=uO();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Nr.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Nr.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(fO,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Ur.clearTimeout(this,this._waittTimer),this._waittTimer=Ur.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Ur.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=uO(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(vO,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Ur.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Ur.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=uO(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(gO,{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(Uo,fr({t:uO(),host:Ur.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}();function _O(){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 EO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"registerIcons",value:function(){return{replay:_O}}},{key:"afterCreate",value:function(){var e=this;ba.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(qr,(function(){if(e.playerConfig.loop||Ur.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($r,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Ur.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){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}();function TO(){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 SO(){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 bO={};function CO(e){e?window.clearTimeout(e):Object.keys(bO).map((function(e){window.clearTimeout(bO[e].id),delete bO[e]}))}var kO=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),Ur.removeClass(n.root,e),n.show()})),mr(Sr(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";Ur.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return vr(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(po,(function(){i&&(i.lang&&"en"===i.lang?Ur.addClass(t.root,"lang-is-en"):"jp"===i.lang&&Ur.addClass(t.root,"lang-is-jp"))})),this.on(yo,this.onAutoplayStart),this.on(vo,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Ur.removeClass(e.root,t),e.show()})),this.on($r,(function(){e.toggleTo("play")})),this.on(Zr,(function(){e.toggleTo("pause")})),this.on(Fo,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;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:TO,class:"xg-icon-play"},startPause:{icon:SO,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(){Ur.addClass(this.root,"hide")}},{key:"show",value:function(e){Ur.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Ur.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Ur.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 bO[e]&&window.clearTimeout(bO[e].id),bO[e]={},i.start&&i.start(),bO[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(bO[e].id),delete bO[e]}),t),bO[e].id}("pauseplay",400,{start:function(){Ur.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Ur.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){Ur.removeClass(this.root,"interact"),CO(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<Na.READY)||(this.player.paused||t.state!==Na.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<Na.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),CO(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}(),IO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=Ur.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}();function PO(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(ds){return'<div class="xg-tips hide"></div>'}}var DO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(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:ma.CONTROLS_RIGHT,index:10}}}]),i}();function wO(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var AO=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],RO=AO.length;function xO(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===pr(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<RO;t++)e[AO[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<RO;r++){var o=AO[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=wO(t.width);!1!==g&&(i.width=g+(p?0:l+d));var y=wO(t.height);return!1!==y&&(i.height=y+(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 OO(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var LO="dragStart",NO="dragMove",MO="dragEnded",UO={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},BO=function(e){_r(i,Rr);var t=Cr(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gr(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):br(n)}return vr(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)]),UO[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=UO[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=OO(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=OO(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=OO(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=xO(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(LO,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(MO)),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(NO,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=xO(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(),FO=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;gr(this,i),mr(Sr(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),mr(Sr(n),"onCenterClick",(function(e){var t=Sr(n).player;t.paused?t.play():t.pause()})),mr(Sr(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(Ur.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=Sr(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 vr(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(Zr,(function(){e.setAttr("data-state","pause")})),this.on($r,(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(DO,i,DO.pluginName)}var n=Ur.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new BO(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:TO,class:"xg-icon-play"},pause:{icon:SO,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={},Ur.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(Do,!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;Ur.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(Do,!1),this.isMini=t.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Ur.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(PO(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}(),HO={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},jO=["videoClick","videoDbClick"],VO=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),mr(Sr(e),"onMouseEnter",(function(t){var i=Sr(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(Co)})),mr(Sr(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({ignorePaused:!0})),e.emit(bo)})),mr(Sr(e),"onVideoClick",(function(t){var i=Sr(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--,la(Sr(e),jO[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),mr(Sr(e),"onVideoDblClick",(function(t){var i=Sr(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(),la(Sr(e),jO[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 vr(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,jO.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Kr.device&&!Kr.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(HO).map((function(t){n.addEventListener(t,e[HO[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(HO).map((function(t){n.removeEventListener(t,e[HO[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),KO="press",GO="pressend",WO="doubleclick",YO="click",zO="touchmove",$O="touchstart",XO="touchend",qO={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},ZO={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function QO(e){return e&&e.length>0?e[e.length-1]:null}var JO=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};gr(this,e),mr(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=QO(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($O,e)})),mr(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),mr(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(GO,e),i.trigger(XO,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),mr(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=QO(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(GO,e),t.press=!1,t.moving=!0,i.trigger(zO,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?ZO:qO,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return vr(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(KO,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(WO,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(YO,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(dF){console.error("trigger>>:".concat(e),dF)}}))}},{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 eL(){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 tL="auto",iL="seeking",nL="playbackrate",rL=["videoClick","videoDbClick"],oL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onTouchStart",(function(e){var t=Sr(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,n.timer&&clearTimeout(n.timer),Ur.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=Ur.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}})),mr(Sr(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=Sr(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;n.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),mr(Sr(n),"onTouchEnd",(function(e){var t=Sr(n),i=t.player,r=t.pos,o=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),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):r.time=0,r.scope=-1,n.resetPos(),Ur.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(tL)}})),mr(Sr(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),mr(Sr(n),"onRootTouchEnd",(function(e){n.pos.scope>-1&&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 vr(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:eL,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;rL.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(),Ur.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Ur.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new JO(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),n.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var o=this.player.controls;o&&o.center&&(o.center.addEventListener("touchmove",this.onRootTouchMove,!0),o.center.addEventListener("touchend",this.onRootTouchEnd,!0),o.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(ro,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([no,qr],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var a={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(a).map((function(t){e.touch.on(t,(function(i){e[a[t]](i)}))})),!i.disableActive){var s=n.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){s.addCallBack(t,(function(){e.changeAction(tL)}))})))}}},{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,n=e.timePreviewStyle,r=e.curTimeColor,o=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),n){var a=this.find(".time-preview");Object.keys(n).forEach((function(e){a.style[e]=n[e]}))}var s=r||t,l=o;s&&(this.find(".xg-cur").style.color=s),l&&(this.find(".xg-dur").style.color=l),this.config.disableTimeProgress&&Ur.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:Kr.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(tL)}},{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<Na.RUNNING?n.closeVideoClick||(this.sendUseAction(Ur.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(Ur.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=Na.RUNNING&&(this.sendUseAction(Ur.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;la(this,rL[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;la(this,rL[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(nL))}},{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(tL))}},{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){var t=this.pos,i=this.config,n=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var 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(iL);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Ur.format(this.duration),this.find(".xg-cur").innerHTML=Ur.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Ur.removeClass(this.find(".xg-seek-show"),"xg-back"):Ur.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<Na.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{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),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",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 class="xg-separator">/</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}();function aL(e){e.preventDefault(),e.returnValue=!1}function sL(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var lL=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=Sr(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||sL(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!sL(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),mr(Sr(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),mr(Sr(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=Sr(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)}})),mr(Sr(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return vr(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:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{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=Ur.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=Ur.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=Object.keys(this.keyCodeMap),r=0;r<n.length;r++){var o=this.keyCodeMap[n[r]],a=o.action,s=o.keyCode,l=o.disable,c=o.pressAction,u=o.disablePress;if(s===e){if(!(l||i&&u)){var h=i&&c||a;"function"==typeof h?a(t,this.player,i):"string"==typeof h&&"function"==typeof this[h]&&this[h](t,this.player,i),this.emit(Mo,fr({key:n[r],target:t.target,isPress:i},this.keyCodeMap[n[r]]))}aL(t),t.stopPropagation();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}();function cL(){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 uL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"registerIcons",value:function(){return{loadingIcon:cL}}},{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:ma.ROOT}}}]),i}(),hL=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],dL=function(){function e(t){gr(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 vr(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"!==Ur.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"!==Ur.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(Ur.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++)Ur.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Ur.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=Ur.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=Ur.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),hL.forEach((function(t){o.appendChild(Ur.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}(),fL={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},pL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=Sr(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){Ur.event(e);var l=Ur.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)})),mr(Sr(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),mr(Sr(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),mr(Sr(n),"_mouseUpHandler",(function(e,t){Sr(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),mr(Sr(n),"_mouseMoveHandler",(function(e,t){var i=Sr(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)})),mr(Sr(n),"onMouseDown",(function(e){var t=Sr(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=Ur.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(),Ur.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Ur.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Ur.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,Ur.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.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}r.play()}})),mr(Sr(n),"onMouseUp",(function(e){var t=Sr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;if(o){e.stopPropagation(),e.preventDefault(),Ur.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Ur.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Ur.event(e),Ur.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;var c=e.type;"touchend"===c||"touchcancel"===c?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",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)),Ur.setTimeout(Sr(n),(function(){n.resetSeekState()}),1),i.focus()}})),mr(Sr(n),"onMouseMove",(function(e){var t=Sr(n),i=t._state,r=t.pos,o=t.player,a=t.config;Ur.checkTouchSupport()&&e.preventDefault(),Ur.event(e);var s=Ur.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)}})),mr(Sr(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),mr(Sr(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),mr(Sr(n),"onMouseEnter",(function(e){var t=Sr(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),Ur.event(e);var o=Ur.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),mr(Sr(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),mr(Sr(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,"boolean"==typeof n.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),n.config.isDraggingSeek=n.config.isDragingSeek),n}return vr(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(e){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=fr(fr({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new dL(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(){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 e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===Kr.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(ro,(function(){e.onMouseLeave()})),this.on(to,(function(){e.onTimeupdate()})),this.on(eo,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(lo,(function(){e.onCacheUpdate()})),this.on(qr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(uo,(function(){e.onReset()})),this.on(Ro,(function(){e.onVideoResize()}))}},{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"===pr(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(dF){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),dF)}}))}},{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.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),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.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(),Ur.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Ur.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.isDraggingSeek&&"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,Number.isNaN(d)&&(d=this.player.currentTime/this.offsetDuration);var f=parseInt(d*this.offsetDuration*1e3,10)/1e3;return{percent:d,currentTime:f,seekTime:Ur.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=Ur.adjustTimeByDuration(o,n,e),this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=Ur.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(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:ma.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:fL.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return fL}}]),i}(),gL=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),mr(Sr(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return vr(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(),yL=function(e){_r(i,gL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=Sr(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return vr(i,[{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([$r,Zr,Qr,uo],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:TO,class:"xg-icon-play"},pause:{icon:SO,class:"xg-icon-pause"}}}},{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(){kr(Er(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(PO(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:0,disable:!1}}}]),i}();function vL(){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 mL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(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:vL,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Ur.addClass(this.root,"show")}},{key:"hide",value:function(){Ur.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:ma.ROOT_TOP,index:0}}}]),i}();function _L(){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 EL(){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 TL=function(e){_r(i,gL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(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 vr(i,[{key:"afterCreate",value:function(){var e=this;kr(Er(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=Ur.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(Io,(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:mL,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Kr.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:_L,class:"xg-get-fullscreen"},exitFullscreen:{icon:EL,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Kr.device?"touchend":"click",this.handleFullscreen),"mobile"===Kr.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 instanceof Event&&(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(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{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:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(ds){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(ds){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(),SL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).isActiving=!1,n}return vr(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.player.controls.config.mode;this.mode="flex"===e?"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.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([ro,eo,to],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(qr,(function(){e.onTimeUpdate(!0)})),this.on(uo,(function(){e.onReset()}))}},{key:"show",value:function(e){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=Ur.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=Ur.format(n))):(this.timeDom.innerHTML=this.minWidthTime(Ur.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=Ur.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(0)),this.centerDurDom.innerHTML=Ur.format(0)):(this.timeDom.innerHTML=this.minWidthTime(Ur.format(0)),this.durationDom.innerHTML=Ur.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Ur.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=Ur.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),this.extraEls=[this.centerCurDom,this.centerDurDom]}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Ur.hide(this.durationDom),Ur.hide(this.timeDom),Ur.hide(this.find(".time-separator")),Ur.show(this.find(".time-live-tag"))):Ur.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Ur.hide(this.durationDom),Ur.hide(this.timeDom),Ur.hide(this.find(".time-separator")),Ur.show(this.find(".time-live-tag"))):(Ur.hide(this.find(".time-live-tag")),Ur.show(this.find(".time-separator")),Ur.show(this.durationDom),Ur.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(Ur.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(Ur.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(eo,i),t.isSeeking&&t.media.seeking?this.once(eo,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:ma.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(),bL=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(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=Ur.getIndexByTime(i,n),o=Ur.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),mr(Sr(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=Ur.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),mr(Sr(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=Ur.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=Ur.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()}}})),mr(Sr(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=Ur.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),mr(Sr(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 vr(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(ro,this._onDurationChange),this.on(ao,this._onLoadedData),this.on(to,this._onTimeupdate),this.on(Jr,this._onSeeking),this.on($r,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}();function CL(){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 kL(){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 IL(){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 PL=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=Sr(e).player,n=e.find(".xgplayer-bar");Ur.event(t);var r=n.getBoundingClientRect(),o=Ur.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})),mr(Sr(e),"onBarMouseMove",(function(t){var i=Sr(e)._d;if(i.isStart){var n=Sr(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),Ur.event(t);var a=Ur.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),mr(Sr(e),"onBarMouseUp",(function(t){Ur.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=Sr(e)._d;i.isStart=!1,i.isMoving=!1})),mr(Sr(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),mr(Sr(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),mr(Sr(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 vr(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:kL,class:"xg-volume-small"},volumeLarge:{icon:CL,class:"xg-volume"},volumeMuted:{icon:IL,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"!==Kr.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(oo,this.onVolumeChange),this.once(ao,this.onVolumeChange),"Number"!==Ur.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.round(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),Ur.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&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Ur.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),Ur.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&&(Ur.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"===Kr.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:ma.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}();function DL(){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>\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>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var wL=function(e){_r(i,gL);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return vr(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){kr(Er(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(Ro,(function(){e.rotateDeg&&e.config.innerRotate&&Ur.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(){kr(Er(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},y=t?s:o,v=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],v&&v.root&&(v.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(Oo,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:DL}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}();function AL(){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 RL(){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 xL="picture-in-picture",OL="inline",LL="fullscreen",NL=function(e){_r(i,gL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(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 vr(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()&&(kr(Er(i.prototype),"afterCreate",this).call(this),this.pMode=OL,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(mo,(function(){e.config.showIcon&&(Ur.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:AL,class:"xg-get-pip"},pipIconExit:{icon:RL,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;Ur.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(xo,!1)},this.enterPIPCallback=function(i){t.emit(xo,!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===LL&&n!==LL&&t.onFullscreenChange(null,!1),e.pMode=n,n===xL?e.enterPIPCallback(i):n===OL&&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=Ir(document.styleSheets).map((function(t){try{return Ir(t.cssRules).map((function(e){return e.cssText})).join("")}catch(ds){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"===Ur.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===xL}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===Ur.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===Ur.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Ur.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){kr(Er(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(PO(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:ma.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}();function ML(){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 UL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"playNext",(function(e){var t=Sr(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(No,n.idx+1)):(n.nextHandler(),t.emit(No))})),n.idx=-1,n}return vr(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:ML}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Kr.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(PO(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(),BL={exports:{}};BL.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):E(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var y=0,v=new Uint8Array(c.length),m=v.length;y<m;++y)v[y]=c.charCodeAt(y);c=new f([v],{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 E(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)E(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return E("data:"+l+";base64,"+a.btoa(r))}catch(T){return E("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){E(this.result)},o.readAsDataURL(r)}return!0};const FL=lr(BL.exports);function HL(){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 jL=function(e){_r(i,gL);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===Ur.typeOf(t)?i=t:"Array"===Ur.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);FL(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 vr(i,[{key:"afterCreate",value:function(){kr(Er(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:HL}}},{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(){kr(Er(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(PO(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(),VL=function(e){_r(i,gL);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){kr(Er(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(Ro,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,n=document.createElement("a");n.href=e,n.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}catch(ds){console.error("MouseEvent unsupported",ds)}i&&n.dispatchEvent(i)}},{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(Lo,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,y=u.width/u.height,v=o.media.videoWidth,m=o.media.videoHeight;g>y?(f=u.width,p=u.width/g,h=0,d=Math.round((u.height-p)/2)):g===y?(f=u.width,p=u.height,h=0,d=0):g<y&&(f=u.height*g,p=u.height,h=Math.round((u.width-f)/2),d=0),c.drawImage(o.media,0,0,v,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(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Ro,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:ma.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(),KL=function(e){_r(i,LA);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return vr(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;kr(Er(i.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(wo,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Ur.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=fr(fr({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));kr(Er(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;kr(Er(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 fr(fr({},LA.defaultConfig),{},{position:ma.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(),GL=function(e){_r(i,LA);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).curRate=1,n}return vr(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;kr(Er(i.prototype),"afterCreate",this).call(this),this.on(so,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&kr(Er(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){kr(Er(i.prototype),"onItemClick",this).call(this,e,t);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}));kr(Er(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(){kr(Er(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return fr(fr({},LA.defaultConfig),{},{position:ma.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}();function WL(){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 YL(){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 zL=function(e){_r(i,gL);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(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;kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Po,(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:WL,class:"xg-get-cssfull"},exitCssFullscreen:{icon:YL,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){kr(Er(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(PO(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(),$L=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(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(Qr,(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}(),XL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(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.showPrompt.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:"showPrompt",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;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),Ur.addClass(this.root,"show"),"arrow"===i.mode&&Ur.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),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var o=i.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){Ur.removeClass(this.root,"show"),Ur.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Pa.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}(),qL={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function ZL(e){Object.keys(qL).map((function(t){void 0===e[t]&&(e[t]=qL[t])}))}var QL={_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?Ur.addClass(t,"mini"):Ur.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&&(ZL(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=Ur.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=Ur.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 JL={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},eN=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(Ur.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||Ur.hasClass(e.target,"xg-spot-content"))&&(Ur.event(e),e.stopPropagation()))})),mr(Sr(n),"onMousedown",(function(e){n.config.disable||(n._state.f||Ur.hasClass(e.target,"xg-spot-content"))&&(Ur.event(e),e.stopPropagation())})),mr(Sr(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))}})),mr(Sr(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()}})),mr(Sr(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&Ur.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 vr(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(Ur.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(QL).map((function(t){e[t]=QL[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return ZL(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(ro,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Ro,(function(){e.positionDots()}))}(this),this.on(ro,(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(JL).map((function(i){e[JL[i]]=e[JL[i]].bind(e),t.addCallBack(i,e[JL[i]])})),"mobile"!==Kr.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(n){n.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,n),t&&t.onMouseUp(n)},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&&Ur.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Ur.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||Ur.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&&Ur.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"!==Kr.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){Ur.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&Ur.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=Ur.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Ur.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")),Ur.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Ur.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Ur.addClass(this.root,"no-timepoint"),e&&(Ur.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Ur.addClass(this.root,"product"),this.tipText.textContent=e):(Ur.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){Ur.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Ur.removeClass(this.find(".xg-spot-content"),"show-text"),Ur.removeClass(this.root,"product")}},{key:"hide",value:function(){Ur.addClass(this.root,"hide")}},{key:"show",value:function(e){Ur.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(JL).map((function(i){t.removeCallBack(i,e[JL[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"===Kr.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}(),tN=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([ro],(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,Ur.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;t&&i?t/i<s/l?p=(g=i)*(s/l):g=(p=t)/(s/l):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=Ur.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}();function iN(e){return e?"background:".concat(e,";"):""}var nN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=Sr(e).offsetDuration,n=e.currentTime;n=Ur.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return vr(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(to,this.onTimeupdate),this.on(uo,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{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(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,n=i.mode,r=i.height,o={cached:iN(t.cachedColor),played:iN(t.playedColor),progress:iN(t.progressColor),height:r>0&&2!==r?"height: ".concat(r,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(o.progress," ").concat(o.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(o.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(o.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(),rN="realtime",oN="firstframe",aN="poster";var sN=null,lN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(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(to,e.renderOnTimeupdate),e.on(to,e.renderOnTimeupdate))})),mr(Sr(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),mr(Sr(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(to,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),mr(Sr(e),"start",(function(t,i){var n=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(ds){return(new Date).getTime()}}(),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===rN||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Ur.setTimeout(Sr(e),e.start,i):Ur.requestAnimationFrame(e.start))})),mr(Sr(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Ur.clearTimeout(Sr(e),e.frameId):Ur.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return vr(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!==rN&&this.interval>=1e3?"timer":"animation",this.once(mo,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==aN&&(r!==oN&&(this.on(uo,(function(){e.stop()})),this.on($r,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Zr,(function(){e.stop()}))),this.on(ao,this.onLoadedData),this.on(co,(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(ds){Nr.logError("plugin:DynamicBg",ds)}}},{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"!==Kr.browser||!Ur.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"===Ur.typeOf(e)?e:"String"===Ur.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!==oN&&e!==aN}},{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(ds){Nr.logError("plugin:DynamicBg",ds)}}},{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 sN?sN:sN=function(){try{return!!document.createElement("canvas").getContext}catch(ds){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Kr.browser||"firefox"===Kr.browser)}}]),i}(),cN="info",uN=Ko,hN=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(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[cN].push(fr(fr({type:"userAction"},i),{},{payload:n}))})),mr(Sr(e),"_onReset",(function(){e.reset()})),mr(Sr(e),"_recordInfo",(function(t){e.info(t)})),mr(Sr(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 vr(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Bo,this._recordUserActions),this.on(uN.STATS_INFO,this._recordInfo),this.on(uN.STATS_DOWNLOAD,this._downloadStats),this.on(uN.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[cN].push(fr(fr({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=fr({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=(mr(e={},cN,[]),mr(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[cN].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(dF){console.log("err",dF)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[cN].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),dN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Sr(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 vr(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(io,this.onGapJump),this.on($r,(function(){e.hasPlayed=!0})),this.on(Jr,(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}();dN.BROWSER_GAP_TOLERANCE=.001;var fN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Sr(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),mr(Sr(e),"onJump",(function(){var t=Sr(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||(e.jumpCnt++,i.currentTime=r)}})),e}return vr(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(io,this.onWaiting),this.on([Xr,no],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on($r,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(),pN="cdn",gN=["cdn"],yN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pN;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)})),mr(Sr(e),"startTimer",(function(){Ur.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),mr(Sr(e),"initSpeedList",(function(){e.speedListCache={},gN.forEach((function(t){e.speedListCache[t]=[]}))})),mr(Sr(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||pN)})),mr(Sr(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(ds){console.error(ds)}}}})),mr(Sr(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pN;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=Sr(e).player;r&&(i===pN?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),mr(Sr(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pN,i=e.getSpeed(t),n=Sr(e).player;if(n)if(t===pN)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(So,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(So,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&gN.push.apply(gN,Ir(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([ao,_o],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([ao,_o],this.startTimer),gN.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}(),vN=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,n=t.media||t.video;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled)||n.getVideoPlaybackQuality&&(this.on($r,(function(){e._startTick()})),this.on(Zr,(function(){e._stopTick()})),this.on(qr,(function(){e._stopTick()})),this.on(uo,(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:"_checkBuffer",value:function(e,t){for(var i=!1,n=[],r=0;r<t.length;r++){var o=t.start(r),a=t.end(r);if(n.push({start:o,end:a}),o<=e&&e<=a-1){i=!0;break}}return{enoughBuffer:i,buffers:n}}},{key:"_checkStuck",value:function(e,t,i,n){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,l=r.currentTime,c=r.buffered;if(!(o||a||s<4)){var u=this._checkBuffer(l,c),h=u.enoughBuffer,d=u.buffers;h&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:d,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:n}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(Go,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,n=t.droppedVideoFrames,r=performance.now();if(i&&this._lastCheckPoint){var o=i-this._lastDecodedFrames,a=r-this._lastCheckPoint;this._checkStuck(o,i,n,a)}this._lastDecodedFrames=i,this._lastCheckPoint=r}}},{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}();const mN=class extends ba{static get pluginName(){return"poster"}static get defaultConfig(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}set isEndedShow(e){this.config.isEndedShow=e}get isEndedShow(){return this.config.isEndedShow}hide(){Ur.addClass(this.root,"hide")}show(){return Ur.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(qr,(()=>{this.isEndedShow&&Ur.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(to,(()=>{this.onTimeUpdate()})),this.on(To,(()=>{Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"xg-showplay"),this.once(to,(()=>{this.onTimeUpdate()}))}))):this.on($r,(()=>{Ur.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?Ur.removeClass(this.root,"xg-showplay"):this.once(to,(()=>{this.onTimeUpdate()}))}update(e){e&&(this.config.poster=e,this.root.style.backgroundImage=`url(${e})`)}setConfig(e){"string"==typeof e?this.config.poster=e:"object"==typeof e&&Object.keys(this.config).forEach((t=>{Object.keys(e).includes(t)&&(this.config[t]=e[t])})),this.update(this.config.poster)}getBgSize(e){let t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;case"fixWidth":t="100% auto";break;default:t=""}return t?`background-size: ${t};`:""}render(){const{poster:e,hideCanplay:t,fillMode:i,notHidden:n}=this.config,r=this.getBgSize(i);return`<xg-poster class="xgplayer-poster ${n?"xg-not-hidden":t?"xg-showplay":""} ${e?"active":""}" style="${e?`background-image:url(${e});${r}`:r}">\n </xg-poster>`}};La.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:"直播"}});class _N{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:n}=t,r=[...n?[]:[bL,pL,nN,eN,SL],yL,TL,wL,UL,KL,GL,jL,VL,PL,NL],o=[EO,mN,kO,uL,IO,$L,XL,tN,FO];this.plugins=[hN,mO,...r,...o,dN,fN];const a=i?"mobile":Kr.device;switch(a){case"pc":this.plugins.push(lL,VO,zL,yN,vN);break;case"mobile":this.plugins.push(oL);break;default:this.plugins.push(lL,VO,zL)}(Kr.os.isIpad||"pc"===a)&&this.plugins.push(lN),this.ignores=[],this.i18n=[]}}function EN(e,t){return d(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:n,playerData:r},o){const a=[_N,TN()],{openSoftDecoding:s,isMusic:l}=r,c=[],u=[];if(i?a.push(function({isLive:e,playerData:t}){const i=["error","playbackRate"],n=t.configs,r=$s(n,"EncryptHlsPlugin");(null==r?void 0:r.playAuthToken)||i.push("definition");const o=[fR];return class{constructor(){this.plugins=o,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})):a.push(function({isLive:e,playerData:t}){const i=["cssfullscreen"],n=[eR],r=t.configs,o=$s(r,"EncryptHlsPlugin");(null==o?void 0:o.playAuthToken)||(i.push("definition"),n.push(YA));return class{constructor(){this.plugins=n,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})),"flv"===t)u.push((()=>d(this,null,(function*(){if(i){if(Qs()||Js()||s){const e=yield o.sdkUmdLoader.loadPlugins(Hw.FLV);c.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(Hw.FLV);c.push(e)}})))());$s(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&c.push(lO);const[h,f]=yield Promise.all([n(),SN({playerData:o.playerData},o),...u]);return{presets:a,softDecodingOption:h,plugins:[...c,...f].filter(Boolean)}}))}function TN(e){const t=[LR,cO,uR];return class{constructor(){this.plugins=t,this.ignores=["error"]}}}function SN(e,t){return d(this,arguments,(function*({playerData:e},t){var i,n,r;const o=[];e.options,e.drmType,or.DRM_ENCRYPT;const a=(yield null==(r=null==(n=null==(i=t.playerData)?void 0:i.adapter)?void 0:n.getPlugins)?void 0:r.call(n,t.sdkUmdLoader))||[];return o.push(...a),Boolean(Rw()||Fs())&&o.push(Mw),e.enableMenu&&o.push(hR),o}))}function bN(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function CN(){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 kN(){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 IN(){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 PN(){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 DN(){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}const wN=u(c({startPlay:kN,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:CN,refresh: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="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}},{}),{volumeLarge:IN,volumeMuted:PN,volumeSmall:DN}),AN={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:Xs(),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:c({},wN),flv:{retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}},RN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},xN={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}};const ON=u(c({startPlay:kN,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" viewBox="0 0 20 20" 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>\n',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" 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>\n',"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:CN,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}},{}),{volumeLarge:IN,volumeMuted:PN,volumeSmall:DN}),LN=u(c({width:"100%",height:"100%",lang:Xs(),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"}},{}),{cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:c({},ON),flv:{innerDegrade:1,retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{innerDegrade:1,retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}}),NN={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}},MN={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"}};const{POSITIONS:UN}=ba,BN=e=>{const t="mobile"===Kr.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:n=(t?"inner":"normal"),position:r=UN.CONTROLS_LEFT,icon:o=bN,index:a=1,hideAtFullScreen:s=!0,tips:l={jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}}=e;return class extends ba{static get isExtendPlugin(){return!0}static get type(){return n}static get textTips(){return l}static get pluginName(){return i}static get defaultConfig(){return{position:r,index:a}}afterCreate(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),s&&(null==(e=this.player)?void 0:e.fullscreen)&&this.handleFullScreenChange()}registerIcons(){return{[i]:{icon:o,class:"xgplayer-extendicon-svg"}}}updateIcons(e){const t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}registerLanguageTexts(){return{[i]:l}}initEvents(){var e;this.handleCallback=sA(this.handleCallback.bind(this),200);const t="mobile"===Kr.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),s&&(null==(e=this.player)||e.on(Io,this.handleFullScreenChange.bind(this)))}handleFullScreenChange(){var e;const t=this.player;null==(e=this.player)||e.changePluginsIcon(i,!(null==t?void 0:t.fullscreen))}handleCallback(e){const{player:t}=this;t&&(e.preventDefault(),e.stopPropagation(),t.emit(MA.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),s&&(null==(e=this.player)||e.off(Io,this.handleFullScreenChange.bind(this)))}render(){return`\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="${i}">${this.langText[i]}</div>\n </xg-icon>\n `}}};class FN{constructor(e){var t,i,n;const{config:r,root:o,player:a}=e;this.config=r,this.parent=o,this.player=a;let s=null!=(t=null==r?void 0:r.mode)?t:$a.INNER;Object.values($a).includes(s)||(s=$a.INNER),this.mode=s,this.isAutoChange=null!=(i=null==r?void 0:r.isAutoChange)&&i,this.isShow=!1,this.showCancelBtn=null!=(n=null==r?void 0:r.showCancelBtn)&&n,this.initEvents(),this.renderPanel()}initEvents(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.on(Io,this.handleOrientationChange.bind(this)))}handleOrientationChange(){var e,t,i;const n=[90,-90,"90","-90"].includes(window.orientation);(null==(e=this.player)?void 0:e.fullscreen)&&n?this.changeMode($a.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:$a.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(MA.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["normal","inner","fullscreen"][this.mode]}`;switch(this.root=Ur.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case $a.NORMAL:{const e=Ur.createDom("div","",{},"xg-mobile-panel-content "+(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(e),this.showCancelBtn){const e="zh-cn"===this.player.lang?"zh":this.player.lang,t=Ur.createDom("div",Za[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case $a.INNER:this.container=this.root;break;case $a.FULLSCREEN:{const e=Ur.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(e),this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}}}showPanel(e,t="",i=!1){return d(this,null,(function*(){if(i&&Ur.addClass(e,"item-list-panel-content"),this.setTitle(t),this.children)return yield this.hide(),void setTimeout((()=>{this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}));this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}))}updatePanel(e){this.children&&Ur.hasClass(this.children,"item-list-panel-content")&&Ur.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))}setTitle(e){e&&this.mode!==$a.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return Ur.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}hide(){this.isShow=!1,Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}handleHide(e){e.stopPropagation(),e.preventDefault(),this.hide()}bind(e,t,i=!1){this.root&&`on${e}`in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}destroy(){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)||e.off(Io,this.handleOrientationChange.bind(this))}}function HN(){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}const{POSITIONS:jN}=ba;class VN extends(WA(ba)){constructor(e){super(u(c({},e),{clientType:"MOBILE"})),this.handleButtonChange=()=>{const e=this.renderItemList();this.renderPanel(e)}}static get pluginName(){return"DefinitionMobilePlugin"}static get textTips(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}static get defaultConfig(){return{position:jN.CONTROLS_RIGHT,index:3,showToastOnManualClick:!0,alwaysShowDefinition:!1}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;const{current:{lineId:t}}=this.playerData,i=this.playerData.getDefinitionListByLineId(t);(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0),i.length>1||this.config.alwaysShowDefinition?(this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()):this.hide(),this.renderItemList()}registerIcons(){return{definition:{icon:HN,class:"xgplayer-definition-svg"}}}registerLanguageTexts(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterPlayerInit(){}initEvents(){this.unbind(["click"],this.handleButtonChange),this.bind(["click"],this.handleButtonChange)}renderItemList(){const{defaultDefinition:e,list:t}=this.getCurrentDefinitionInfo(this.player),i=Ur.createDom("div","",{},"definition-panel-content");return t.forEach((t=>{t.selected=e===t.definition,t.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition);const n=this.renderItem(t);i.appendChild(n)})),this.renderList=t,i}renderItem(e){var t;const{current:{definition:i}}=this.playerData,n=Ur.createDom("div","",{},"panel-Item "+(i===e.definition?"select-in":""));let r=this.getShowText(this.i18n,e,i);if(this.showRealDefinition(e)){const e=null==(t=this.renderList)?void 0:t.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),i=this.getShowText(this.i18n,e,null==e?void 0:e.definition);r=i?`${r}(${i})`:r}return n.innerHTML=r,n.addEventListener("click",(t=>{var n;if(t.stopPropagation(),t.preventDefault(),e.definition!==this.playerData.current.definition){const r=null==(n=this.playerData.getCurrentStreams())?void 0:n[0];this.emitUserAction(t,"change_definition",{from:r,to:e}),this.config.showToastOnManualClick&&this.showToast(e,i),this.playerData.current.definition=e.definition}})),n}selectDef(e){this.selectDefinition(e)}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.definitionSelect,!0)}updatePanel(){var e,t,i,n,r,o,a;if((null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&(null==(r=null==(n=null==(i=this.player)?void 0:i.panel)?void 0:n.title)?void 0:r.innerHTML)!==this.langText.definitionSelect)return;const s=this.renderItemList();null==(a=null==(o=this.player)?void 0:o.panel)||a.updatePanel(s)}destroy(){super.destroy(),this.unbind(["click"],this.handleButtonChange)}render(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function KN(){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}const{POSITIONS:GN}=ba;class WN extends ba{constructor(e){super(e),this.playerData=e.player.config.playerData,this.dataMonitoring()}static get pluginName(){return"LineMobilePlugin"}static get textTips(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}static get defaultConfig(){return{position:GN.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&hr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e!==t&&this.player){const e=this.playerData.getCurrentUrl();this.player.changeDefinition({definition:t,url:e}),this.updatePanel(),setTimeout((()=>{this.player.paused&&this.player.play()}),1e3)}}))}registerIcons(){return{line:{icon:KN,class:"xgplayer-line-svg"}}}registerLanguageTexts(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.handleButtonChange.bind(this))}handleButtonChange(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=this.playerData.getLineList(),t=Ur.createDom("div","",{},"line-panel-content");return e.forEach((e=>{const i=this.renderItem(e);t.appendChild(i)})),t}renderItem(e){const{current:{lineId:t}}=this.playerData,i=Ur.createDom("div","",{},"panel-Item "+(t===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.player.emit(MA.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(NA.PLAYER_REBUILD)})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.lineSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}destroy(){this.unbind(["click"],this.handleButtonChange.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function YN(){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}const{POSITIONS:zN}=ba;class $N extends ba{constructor(e){super(e),this.state={currentRate:1,isSupport:!0},this.playerData=e.player.config.playerData}static get pluginName(){return"PlaybackRateMobilePlugin"}static get textTips(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}static get defaultConfig(){return{position:zN.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:YN,class:"xgplayer-rate-svg"}}}registerLanguageTexts(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.renderList.bind(this)),this.on(so,(()=>{var e,t;this.state.currentRate!==this.player.playbackRate&&(this.state.currentRate=this.player.playbackRate,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this.updatePanel(),this.changeIconText())}))}renderList(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=Ur.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((t=>{const i=this.renderItem(t);e.appendChild(i)})),e}renderItem(e){const t=A(e)?e:{textKey:e+"X",value:e},i=Ur.createDom("div","",{},"panel-Item "+(this.state.currentRate===t.value?"select-in":""));return i.innerHTML=this.i18n[t.textKey]||t.textKey,i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const i={playbackRate:{from:this.player.playbackRate,to:t.value}};this.emitUserAction(e,"change_rate",{props:i}),this.state.currentRate=t.value,this.player.playbackRate=t.value,this.updatePanel(),this.changeIconText()})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.rateSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}changeIconText(){let e;const 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}const n=this.find(".icon-text");n.style.transform=`scale(${e})`,n.innerHTML=i}destroy(){this.unbind(["click"],this.renderList.bind(this))}render(){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 '}}function XN(){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.8881 11.8208C16.812 11.6153 16.5213 11.6153 16.4452 11.8208L16.0985 12.7579C15.8115 13.5334 15.2001 14.1448 14.4246 14.4318L13.4875 14.7786C13.2819 14.8546 13.2819 15.1454 13.4875 15.2214L14.4246 15.5682C15.2001 15.8551 15.8115 16.4666 16.0985 17.2421L16.4452 18.1792C16.5213 18.3847 16.812 18.3847 16.8881 18.1792L17.2348 17.2421C17.5218 16.4666 18.1332 15.8551 18.9087 15.5682L19.8458 15.2214C20.0514 15.1454 20.0514 14.8546 19.8458 14.7786L18.9087 14.4318C18.1332 14.1448 17.5218 13.5334 17.2348 12.7579L16.8881 11.8208Z" fill="white"/>\n<rect x="9.5" y="2" width="1.5" height="16" rx="0.75" fill="white"/>\n<rect x="5.75" y="5" width="1.5" height="10" rx="0.75" fill="white"/>\n<rect x="2" y="7" width="1.5" height="6" rx="0.75" fill="white"/>\n<path d="M16.5 7.75C16.5 7.33579 16.8358 7 17.25 7C17.6642 7 18 7.33579 18 7.75V9.18934C18 9.85752 17.1921 10.1921 16.7197 9.71967C16.579 9.57902 16.5 9.38825 16.5 9.18934V7.75Z" fill="white"/>\n<path d="M12.75 5.75C12.75 5.33579 13.0858 5 13.5 5C13.9142 5 14.25 5.33579 14.25 5.75V11.3229C14.25 11.4394 14.2229 11.5542 14.1708 11.6584C13.8169 12.3662 12.75 12.1144 12.75 11.3229V5.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:qN}=ba;class ZN extends ba{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._clickHandler=null,this._nativePanelUpdateRaf=null}static get pluginName(){return"AudioTrackMobile"}static get textTips(){return{en:"Audio",zh:"音频","zh-hk":"音頻",jp:"オーディオ"}}static get defaultConfig(){return{position:qN.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:XN,class:"xgplayer-audiotrack-svg"}}}afterPlayerInit(){var e;this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{var t,i;(null==(i=null==(t=this.player)?void 0:t.panel)?void 0:i.isShow)&&this._updateHlsPanel(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t||this._initNativeAudioTracks()}destroy(){this._clickHandler&&this.unbind(["click"],this._clickHandler),null!==this._nativePanelUpdateRaf&&cancelAnimationFrame(this._nativePanelUpdateRaf),this._unbindNativeAudioTracks()}render(){return this.config.isShowIcon?'\n <xg-icon class="xgplayer-mobile-audiotrack">\n <div class="xgplayer-icon"></div>\n </xg-icon>\n ':""}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_onAudioTracksUpdated(e){!e||e.length<=1||this._bindClickOnce()}_renderList(){this._nativeMode?this._renderNativePanel():this._renderHlsPanel()}_getLabelOpts(){return{showNameSuffix:!1!==this.config.showNameSuffix}}_renderHlsPanel(){var e,t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=null!=(e=n.audioTrack)?e:-1,a=r.find((e=>e.default)),s=this._getLabelOpts(),l=Ur.createDom("div","",{},"audiotrack-panel-content");r.forEach((e=>{let t=e.id===o;t||-1!==o||(null==a?void 0:a.id)!==e.id||(t=!0);const i=Ur.createDom("div","",{},"panel-Item "+(t?"select-in":""));i.innerHTML=QA(e,s),i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this._switchHlsTrack(n,e)})),l.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(l,this._panelTitle(),!0)}_updateHlsPanel(e){var t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=this._getLabelOpts(),a=Ur.createDom("div","",{},"audiotrack-panel-content");r.forEach((t=>{const i=Ur.createDom("div","",{},"panel-Item "+(t.id===e?"select-in":""));i.innerHTML=QA(t,o),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this._switchHlsTrack(n,t)})),a.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.updatePanel(a)}_switchHlsTrack(e,t){XA(e,t)}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{var e,t;(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&null===this._nativePanelUpdateRaf&&(this._nativePanelUpdateRaf=requestAnimationFrame((()=>{var e,t;this._nativePanelUpdateRaf=null,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this._renderNativePanel(!0)})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1&&this._onNativeTracksChanged())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_bindClickOnce(){this._clickHandler||(this.appendChild(".xgplayer-icon",this.icons.audiotrack),this._clickHandler=this._renderList.bind(this),this.bind(["click"],this._clickHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1||this._bindClickOnce()}_renderNativePanel(e=!1){var t;const i=this._getNativeTrackList();if(!i)return;const n=this._getLabelOpts(),r=Ur.createDom("div","",{},"audiotrack-panel-content");for(let a=0;a<i.length;a++){const e=i[a],t=JA(e,a,n),o=Ur.createDom("div","",{},"panel-Item "+(e.enabled?"select-in":""));o.innerHTML=t,o.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=this._getNativeTrackList();t&&$A(t,a)})),r.appendChild(o)}const o=null==(t=this.player)?void 0:t.panel;e?null==o||o.updatePanel(r):null==o||o.showPanel(r,this._panelTitle(),!0)}_panelTitle(){var e;return null!=(e=ZN.textTips[this.player.lang||"en"])?e:ZN.textTips.en}}class QN{constructor(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=e,this.pluginName="",this.__init(e)}static defineGetterOrSetter(e,t){for(const i in t)Object.defineProperty(e,i,t[i])}static get pluginName(){return"pluginName"}beforeCreate(){}afterCreate(){}beforePlayerCreate(){}afterPlayerCreate(){}destroy(){}__init(e){QN.defineGetterOrSetter(this,{sdk:{get:()=>e.sdk,configurable:!0},player:{get:()=>e.sdk.getPlayerInstance(),configurable:!0},playerData:{get:()=>e.sdk.playerData,configurable:!0},pluginName:{get:()=>e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),configurable:!0},_emitter:{get:()=>e.sdk._emitter,configurable:!0}})}__destroy(){const e=this.sdk,t=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((e=>{Object.defineProperty(this,e,{writable:!0})})),Object.keys(this).map((e=>{this[e]=null,delete this[e]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete e._sdkPlugins[t]}}const JN=18e5,eM=1e3,tM="media_info",iM="ttdrama_media_info",nM="[mediaInfoCache]";let rM=c({},{enable:!1,expireTime:JN,cacheType:"memory",maxEntries:100});const oM=new Map,aM=new Map;function sM(e,t={}){ss.log(`${nM} ${e}`,t)}function lM(e){var t;return{vid:null==e?void 0:e.vid,playListLength:(null==(t=null==e?void 0:e.playList)?void 0:t.length)||0,hasValidPlayUrl:dM(e)}}function cM(){return c({},rM)}function uM(){const e=oM.size,t=aM.size;oM.clear(),aM.clear();const i=function(){const e=mM();if(!e)return 0;const t=[`${Ps}${tM}_`,`${Ps}${iM}_`],i=[];for(let n=0;n<e.length;n++){const r=e.key(n);r&&t.some((e=>r.startsWith(e)))&&i.push(r)}return i.forEach((t=>e.removeItem(t))),i.length}();sM("clear success",{memoryCacheCount:e,prefetchedCacheCount:t,localStorageCacheCount:i})}function hM(e){return"string"==typeof e?e.trim():""}function dM(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function fM(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function pM(e){const t=gM(e);return t.playAuthTokenHash?fM(JSON.stringify(t)):""}function gM(e){const t=hM(e.playAuthToken);return{playAuthTokenHash:t?fM(t):"",reqParams:yM(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function yM(e){if(!e)return;const t=c({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const vM={getItem:e=>oM.get(e)||null,setItem(e,t){oM.delete(e),oM.set(e,t)},removeItem(e){oM.delete(e)}};function mM(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(ds){return}}function _M(e){return e.startsWith(`${Ps}${tM}_`)||e.startsWith(`${Ps}${iM}_`)}function EM(){if("memory"===rM.cacheType)return Array.from(oM.keys()).filter(_M);const e=mM();return e?function(e){const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);n&&_M(n)&&t.push(n)}return t}(e):[]}function TM(){return"memory"===rM.cacheType?vM:mM()}function SM(e){try{return JSON.parse(e)}catch(ds){return}}function bM(e){const t=hM(e.moduleName),i=hM(e.cacheKey);return t&&i?`${Ps}${t}_${i}`:""}function CM(e){const t=(e.playList||[]).map((e=>function(e){const t=Number(e);if(Number.isFinite(t)&&!(t<=0))return t>s(10,12)?t:1e3*t}(e.urlExpireTimestamp||e.MainUrlExpire||e.mainUrlExpire||e.main_url_expire))).filter((e=>!!e));if(t.length)return Math.min(...t)}function kM(e,t){const i=Date.now()+t,n=CM(e);return n?Math.min(i,n-eM):i}function IM(e){const t=hM(e.moduleName),i=hM(e.cacheKey);return t&&i?`${t}:${i}`:""}function PM(e){const t=IM(e),i=t?aM.get(t):void 0;if(i){if(!(Date.now()>=i.expireAt))return i.lastAccessedAt=Date.now(),i.mediaInfo;aM.delete(t)}}function DM(e,t){const i=IM(e);if(!i||!dM(t))return;const n=kM(t,rM.expireTime);n<=Date.now()||(aM.set(i,{mediaInfo:t,expireAt:n,lastAccessedAt:Date.now()}),function(){const e=aM.size-rM.maxEntries;e<=0||[...aM.entries()].sort((([,e],[,t])=>e.lastAccessedAt-t.lastAccessedAt)).slice(0,e).forEach((([e])=>aM.delete(e)))}())}function wM(e){return{moduleName:hM(e.moduleName),cacheKey:hM(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:rM.cacheType}}function AM(e){const t=TM(),i=bM(e),n=wM(e);if(!t)return void sM("get skip no storage",n);if(!i)return void sM("get skip empty storage key",n);const r=t.getItem(i)||"";if(!r)return void sM("get miss empty cache",n);const o=SM(r);if(!o)return void sM("get miss parse failed",n);const a=null==o?void 0:o.mediaInfo;if(a&&o.expireAt)return Date.now()>=o.expireAt?(t.removeItem(i),void sM("get miss expired and removed",u(c({},n),{expireAt:o.expireAt,now:Date.now()}))):(sM("get hit",c(u(c({},n),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),lM(a))),function(e,t,i,n){try{e.setItem(t,JSON.stringify(u(c({},i),{lastAccessedAt:Date.now()})))}catch(dF){sM("touch failed",u(c({},n),{error:dF}))}}(t,i,o,n),a);sM("get miss invalid cache payload",n)}function RM(e,t,i=JN){const n=TM(),r=bM(e),o=wM(e);if(!n)return void sM("set skip no storage",c(c({},o),lM(t)));if(!r)return void sM("set skip empty storage key",c(c({},o),lM(t)));if(!dM(t))return void sM("set skip invalid media info",c(c({},o),lM(t)));const a=kM(t,i);if(a<=Date.now())return void sM("set skip expired media info",c(u(c({},o),{expireTime:i,expireAt:a}),lM(t)));const s={createdAt:Date.now(),expireAt:a,lastAccessedAt:Date.now(),cacheKeyInfo:e.cacheKeyInfo,mediaInfo:t};try{n.setItem(r,JSON.stringify(s)),function(e){const t=EM(),i=rM.maxEntries;if(t.length<=i)return;const n=t.map((t=>{const i=SM(e.getItem(t)||"");return{key:t,lastAccessedAt:(null==i?void 0:i.lastAccessedAt)||(null==i?void 0:i.createdAt)||0}})).sort(((e,t)=>e.lastAccessedAt-t.lastAccessedAt)),r=t.length-i;n.slice(0,r).forEach((t=>e.removeItem(t.key))),sM("prune success",{removeCount:r,maxEntries:i,cacheType:rM.cacheType})}(n),sM("set success",c(u(c({},o),{cacheKeyInfo:s.cacheKeyInfo,expireTime:i,expireAt:a}),lM(t)))}catch(dF){sM("set failed",c(u(c({},o),{error:dF}),lM(t)))}}function xM(e){if(rM.enable)return function(e){return AM({moduleName:tM,cacheKey:pM(e),cacheKeyInfo:gM(e)})}(e)}function OM(e){return PM({moduleName:tM,cacheKey:pM(e),cacheKeyInfo:gM(e)})||xM(e)}function LM(e,t){rM.enable&&function(e,t,i=JN){RM({moduleName:tM,cacheKey:pM(e),cacheKeyInfo:gM(e)},t,i)}(e,t,rM.expireTime)}const NM=[["format","format"],["codec","codec"],["definition","definition"],["fileType","file_type"],["needThumbs","need_thumbs"],["needBarrageMask","need_barrage_mask"],["unionInfo","union_info"],["quality","quality"],["drmKek","drm_kek"],["jsPlayer","js_player"]];function MM(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function UM(e){if(!e)return;const t={};return NM.forEach((([i,n])=>{const r=e[i];"string"==typeof r&&(t[n]=r)})),t}function BM(e){return fM(JSON.stringify(UM(e)||{}))}function FM(e){return!0===(null==e?void 0:e.canIUseGetDramaInfoTranscodeParam)}function HM(e){switch(e){case ER.NOT_SUBMITTED:return"NOT_SUBMITTED";case ER.UNDER_REVIEW:return"UNDER_REVIEW";case ER.FAILED_REVIEW:return"FAILED_REVIEW";case ER.WITHDRAWN:return"WITHDRAWN_REVIEW";case ER.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}}function jM(e,t){return void 0!==t?HM(t):(null==e?void 0:e.includes("not found"))||(null==e?void 0:e.includes("未查询"))?"NO_INFO_FOUND":(null==e?void 0:e.includes("query"))||(null==e?void 0:e.includes("查询"))?"FAILED_TO_QUERY":"FAILED_GET_EPISODE_INFO"}function VM(e,t){return e&&t?`${e}${-1===e.indexOf("?")?"?":"&"}${i=t,Object.entries(i).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}`:e;var i}function KM(e,t=10,i=0){const n=parseInt(`${e}`,t);return Number.isNaN(n)?i:n}function GM(e){var t;return hM(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function WM(e){var t,i;const n="sg",r={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},o={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let a={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},s=n;return"byteplus"===e&&r?(a=r,s="sg"):"volcengine"===e&&o&&(a=o,s=a[n]?n:"cn"),(null==(t=null==a?void 0:a[n])?void 0:t.__PLAY_DOMAIN__)||(null==(i=null==a?void 0:a[s])?void 0:i.__PLAY_DOMAIN__)||""}function YM(e){return hM(e.albumId||e.album_id)}function zM(e){return hM(e.episodeId||e.episode_id||e.episodeID)}function $M(e,t){const i={episodeId:zM(e)};return!MM(e,"transcodeParam")||t&&!FM(t)||(i.transcodeParam=e.transcodeParam),i}function XM(e){const t=hM(e.episodeId);return t?MM(e,"transcodeParam")?`${t}_${BM(e.transcodeParam||{})}`:t:""}function qM(e){const t={episodeId:hM(e.episodeId)};return MM(e,"transcodeParam")&&(t.transcodeParamHash=BM(e.transcodeParam||{})),t}function ZM(e){const t={moduleName:iM,cacheKey:XM(e),cacheKeyInfo:qM(e)};return PM(t)||function(e){if(rM.enable)return AM(e);sM("get skip disabled",u(c({},wM(e)),{config:cM()}))}(t)}function QM(e,t){!function(e,t){rM.enable?RM(e,t,rM.expireTime):sM("set skip disabled",c(u(c({},wM(e)),{config:cM()}),lM(t)))}({moduleName:iM,cacheKey:XM(e),cacheKeyInfo:qM(e)},t)}function JM(e){return OM(eU(e))}function eU(e){const t=e.getVideoByToken||{};return u(c({},t),{defaultDefinition:GM(e),reqParams:c({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function tU(e,t){const i=eU(e);return u(c({},i),{playDomain:i.playDomain||WM(null==t?void 0:t.channel)})}function iU(e,t={}){var i,n,r;const o=(e,t,i)=>{for(const n of t)if(e&&void 0!==e[n])return e[n];return i},a=o(e,["PlayInfoList","playInfoList","play_info_list"],[]),s=o(e,["PosterUrl","posterUrl","poster_url"],""),l=o(e,["Vid","vid"],""),h=o(e,["Duration","duration"],0),d=o(e,["BarrageMaskUrl","barrageMaskUrl","barrage_mask_url"],""),f=o(e,["ThumbInfoList","thumbInfoList","thumb_info_list"],[]),p=o(e,["EnableAdaptive","enableAdaptive","enable_adaptive"],void 0),g=o(e,["AdaptiveBitrateStreamingInfo","adaptiveBitrateStreamingInfo","adaptive_bitrate_streaming_info"],void 0),y=null==t?void 0:t.urlQueryParams,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}=t||{},E=a.map((e=>{const t=(t,i)=>o(e,t,i),i=t(["MainPlayUrl","mainPlayUrl","main_play_url"],""),n=t(["BackupPlayUrl","backupPlayUrl","backup_play_url"],""),r=VM(i,y),a=VM(n,y),s=t(["Format","format"],"");return c(c({vid:l,url:r,_mainURL:r,_backupURL:a,streamType:s,backupUrl:a,backUrlList:[a],fileType:t(["FileType","fileType","file_type"]),format:s,bitrate:t(["Bitrate","bitrate"]),size:t(["Size","size"]),kid:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuthId:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuth:t(["PlayAuth","playAuth","play_auth"]),secretKey:t(["PlayAuth","playAuth","play_auth"]),vwidth:t(["Width","width"]),vheight:t(["Height","height"]),vtype:null==s?void 0:s.toLocaleUpperCase(),codec:t(["Codec","codec"]),urlExpireTimestamp:KM(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,qa),drmType:t(["DrmType","drmType","drm_type"])},e),Hs(e,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}))})).sort(bs);return{playList:E,type:(null==(i=E[0])?void 0:i.Format)||(null==(n=E[0])?void 0:n.format)||(null==(r=E[0])?void 0:r.streamType),poster:s||"",vid:l,duration:h||0,dashOpts:{Data:u(c({},e),{VideoID:l})},thumbs:f||[],barrageMaskUrl:d||"",enableAdaptive:p,adaptiveBitrateStreamingInfo:g}}function nU(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function rU(e,t){var i,n;const r=GM(t),o=function(e,t){const i=e.playList||[];return t&&i.find((e=>{var i;const n=e.mapDefinition||e.definition||e.Definition;return(null==(i=null==n?void 0:n.toLocaleLowerCase)?void 0:i.call(n))===t.toLocaleLowerCase()}))||i[0]}(e,r),a=nU(null==o?void 0:o.url);if(!o||!a)return;const s=o.mapDefinition||o.definition||o.Definition||r,l=o.streamType||o.format||o.Format||e.type||"",c=(o.codec||(null==(n=null==(i=o.Codec)?void 0:i.toLowerCase)?void 0:n.call(i))||tr.H264).toLowerCase();return{vid:e.vid||o.vid||t.vid||"",url:a,definition:s,streamType:l,codec:c,bitrate:KM(o.bitrate||o.Bitrate),duration:KM(o.duration||o.Duration||e.duration),size:KM(o.size||o.Size)}}let oU=!1;const aU=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function sU(e,t){if(!e)return e;const i=e.indexOf("#"),n=-1===i?"":e.slice(i),r=-1===i?e:e.slice(0,i),o=r.indexOf("?"),a=-1===o?r:r.slice(0,o),s=-1===o?"":r.slice(o+1),l=s?s.split("&").filter((e=>{const t=e.split("=")[0];try{return"t"!==decodeURIComponent(t||"")}catch(ds){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${a}?${l.join("&")}${n}`}function lU(e,t){return"string"==typeof e?sU(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?sU(e,t):e&&"object"==typeof e&&"string"==typeof e.src?u(c({},e),{src:sU(e.src,t)}):e)):e}function cU(e,t=Date.now()){if(!oU||!e)return e;const i=c({},e);return aU.forEach((e=>{i[e]&&(i[e]=lU(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>lU(e,t)))),i}function uU(e,t=Date.now()){return oU&&e?u(c({},e),{playList:(e.playList||[]).map((e=>cU(e,t)))}):e}const hU=[{id:1,tag:"cmn-Hans-CN",label:"简体中文"},{id:2,tag:"eng-US",label:"English"},{id:3,tag:"jpn-JP",label:"日本語"},{id:4,tag:"kor-KR",label:"한국어"},{id:5,tag:"cmn-Hans-CN|eng-US",label:"中英双语"},{id:6,tag:"rus-RU",label:"Русский"},{id:7,tag:"fra-FR",label:"Français"},{id:8,tag:"por-PT",label:"Português"},{id:9,tag:"spa-ES",label:"Español"},{id:10,tag:"vie-VN",label:"Tiếng Việt"},{id:11,tag:"afr-ZA",label:"Afrikaans"},{id:12,tag:"ben-BD",label:"বাংলা"},{id:13,tag:"bul-BG",label:"Български"},{id:14,tag:"mya-MM",label:"မြန်မာဘာသာ"},{id:15,tag:"ces-CZ",label:"Čeština"},{id:16,tag:"dan-DK",label:"Dansk"},{id:17,tag:"hrv-HR",label:"Hrvatski"},{id:18,tag:"nld-NL",label:"Nederlands"},{id:19,tag:"fin-FI",label:"Suomi"},{id:20,tag:"deu-DE",label:"Deutsch"},{id:21,tag:"ell-GR",label:"Ελληνικά"},{id:22,tag:"hun-HU",label:"Magyar"},{id:23,tag:"ind-ID",label:"Bahasa Indonesia"},{id:24,tag:"gle-IE",label:"Gaeilge"},{id:25,tag:"isl-IS",label:"Íslenska"},{id:26,tag:"ita-IT",label:"Italiano"},{id:27,tag:"nor-NO",label:"Norsk"},{id:28,tag:"pol-PL",label:"Polski"},{id:29,tag:"swe-SE",label:"Svenska"},{id:30,tag:"tha-TH",label:"ภาษาไทย"},{id:31,tag:"tur-TR",label:"Türkçe"},{id:32,tag:"ukr-UA",label:"Українська"},{id:33,tag:"urd-PK",label:"اردو"},{id:34,tag:"ara-SA",label:"العربية"},{id:35,tag:"fra-CA",label:"Français (Canada)"},{id:36,tag:"cmn-Hant-CN",label:"繁體中文"},{id:37,tag:"msa-MY",label:"Bahasa Melayu"},{id:38,tag:"heb-IL",label:"עברית"},{id:39,tag:"jva-ID",label:"Basa Jawa"},{id:40,tag:"ron-RO",label:"Română"},{id:41,tag:"fil-PH",label:"Filipino"},{id:42,tag:"hin-IN",label:"हिन्दी"},{id:43,tag:"ben-IN",label:"বাংলা (ভারত)"},{id:44,tag:"khm-KH",label:"ភាសាខ្មែរ"},{id:45,tag:"bos-PH",label:"Bosanski"},{id:46,tag:"est-EE",label:"Eesti"},{id:47,tag:"lav-LV",label:"Latviešu"},{id:48,tag:"slk-SK",label:"Slovenčina"},{id:49,tag:"lit-LT",label:"Lietuvių"},{id:50,tag:"uyg-CN",label:"ئۇيغۇرچە"}],dU=new Map,fU=new Map;for(const fF of hU)dU.set(fF.id,fF.label),fU.set(fF.tag.toLowerCase(),fF.label);function pU(...e){for(const t of e){if("string"!=typeof t)continue;const e=t.trim();if(e)return e}return null}function gU(e){return{albumId:pU(null==e?void 0:e.album_id,null==e?void 0:e.albumId),episodeId:pU(null==e?void 0:e.episode_id,null==e?void 0:e.episodeId,null==e?void 0:e.episodeID)}}const yU=xR.getVeErrorInfo,vU={playAuthToken:"",needDefinitionList:!0},mU=(e,t,i,n=!1)=>{for(const r of t){const t=null==e?void 0:e[r];if(void 0!==t&&(!n||""!==t))return t}return i},_U=(e,t="")=>null==e?t:`${e}`;class EU extends QN{constructor(e){super(e),this.isPlayByToken=!1,this.isEncrypt=!1,this.config=null,this.useUnionInfoDRM=!0,this.retryCount=1,this.init()}static get pluginName(){return"AuthToken"}beforePlayerCreate(){return d(this,null,(function*(){if(this.isPlayByToken){const e=yield this.getVideoInfo();e&&this.playerData.initPlayData(e)}}))}getVideoInfo(e){return d(this,null,(function*(){var t;const i=null==(t=this.sdk)?void 0:t._createPlayerPerf,n=()=>d(this,null,(function*(){var t,n,r,o,a,s,l,c,u,h,f,p,g;try{const y=this.isMinisDramaMode&&(null==(t=null==mB?void 0:mB.ttDramaEnv)?void 0:t.canIUseGetDramaInfo);if(!y&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkPlayAuthTokenValid",(()=>this.checkPlayAuthTokenValid())):this.checkPlayAuthTokenValid()))return;if(!!this.keyTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkKeyTokenValid",(()=>this.checkKeyTokenValid())):this.checkKeyTokenValid()))return;if(!!this.thirdPartyDrmAuthTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkDrmAuthTokenValid",(()=>this.checkDrmAuthTokenValid())):this.checkDrmAuthTokenValid()))return;const v=((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos",(()=>d(this,null,(function*(){return yield this.getVideos(e)})))):yield this.getVideos(e))||{};if(!(null==(n=null==v?void 0:v.playList)?void 0:n.length))return void ss.error("get no media info");ss.log("getVideo res: ",v);const{type:m,poster:_,vid:E,dashOpts:T,thumbs:S,barrageMaskUrl:b}=v||{},C=v.playList||[];null==(o=null==(r=this.sdk)?void 0:r.assertLiteConfig)||o.call(r,{type:m,playList:C,rtm:v.rtm}),this.playInfo=v,this.setSubtitleConfig(v);const k=m||Ts(this.config);this.getPrivateDrmInfo&&((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo",(()=>d(this,null,(function*(){return yield this.getPrivateDrmInfo(C,E,k)})))):yield this.getPrivateDrmInfo(C,E,k)),this.playerData.options.vid=E;if(_&&(this.config.needPoster||this.isMinisDramaMode)&&("string"==typeof this.playerData.options.poster?this.playerData.options.poster=_:"object"==typeof this.playerData.options.poster?this.playerData.options.poster.poster=_:this.playerData.options.poster=_),this.config.needThumbs&&S.length>0&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(S))):this.getThumbnailConfig(S)),C.length>0){(null==(a=C[0])?void 0:a.drmType)&&this.playerData.setDrmType(C[0].drmType);const t=(null==(l=null==(s=this.playerData)?void 0:s.adapter)?void 0:l.generatePlaylistFromServer(v,this.config.useMasterM3u8))||[...C],n=this.config.defaultDefinition||(null==e?void 0:e.defaultDefinition)||this.playerData.configs.defaultDefinition;let r=t[0];if(n){const e=t.find((e=>(e.mapDefinition||e.definition||e.Definition).toLocaleLowerCase()===n.toLocaleLowerCase()));e&&(r=e)}const o=this.config.needDefinitionList?t:[r];this.isEncrypt=!!(null==o?void 0:o[0].kid);const d=(null==(c=C[0])?void 0:c.codec)||(null==(h=null==(u=C[0])?void 0:u.Codec)?void 0:h.toLowerCase())||(null==(p=null==(f=this.tokenInfo)?void 0:f.Codec)?void 0:p.toLowerCase())||tr.H264,y={vid:E,dashOpts:T,codec:d,playList:o,defaultDefinitionData:r};return(null==i?void 0:i.measure)?(i.measure("beforePlayerCreate.authtoken.getVideoInfo.getDrmConfig",(()=>this.getDrmConfig(y))),i.measure("beforePlayerCreate.authtoken.getVideoInfo.setPluginConfigInVid",(()=>{var e;return null==(e=this.playerData.adapter)?void 0:e.setPluginConfigInVid(y,this)}))):(this.getDrmConfig(y),null==(g=this.playerData.adapter)||g.setPluginConfigInVid(y,this)),{vid:E,playList:o,codec:d,defaultDefinition:r.definition}}ss.error("get no media info")}catch(y){if(ss.error(y),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==y?void 0:y.code))throw y}}));return(null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo",n):yield n()}))}getDramaInfoViaJSB(e){return d(this,null,(function*(){var t,i;const n=mB.ttDramaEnv,r=e||(null==(t=this.playerData)?void 0:t.configs)||{},{albumId:o,episodeId:a}=gU(r),s=r.vid||"";if((null==n?void 0:n.getDramaInfo)&&o&&a)return new Promise((e=>{const t={clientKey:n.clientKey,albumId:o,episodeId:a,vid:s};!0===n.canIUseGetDramaInfoTranscodeParam&&Object.prototype.hasOwnProperty.call(r,"transcodeParam")&&(t.transcodeParam=UM(r.transcodeParam)||{});const i=t=>{var i;ss.error("getDramaInfo error:",t);const n={errorType:"drama",errorCode:_R.FAILED_GET_EPISODE_INFO.code,veError:yU({code:_R.FAILED_GET_EPISODE_INFO.code,message:_R.FAILED_GET_EPISODE_INFO.message,textKey:_R.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:_R.FAILED_GET_EPISODE_INFO.message,ext:{originError:t},originError:t};null==(i=this.sdk)||i.delayError.push(n),e(void 0)};try{n.getDramaInfo((t=>{var n,r,l,c;try{if(ss.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:o,episodeId:a,vid:s}),!(null==t?void 0:t.is_success)){ss.error("getDramaInfoViaJSB invalid response:",t);const i=jM(null==(n=null==t?void 0:t.error)?void 0:n.error_msg,void 0),o=_R[i]||_R.FAILED_GET_EPISODE_INFO,a={errorType:"drama",errorCode:o.code,veError:yU({code:o.code,message:o.message,textKey:o.textKey}),errorMessage:o.message,ext:{jsbError:null==t?void 0:t.error},originError:t};return null==(r=this.sdk)||r.delayError.push(a),void e(void 0)}const{data:i}=t;if((null==i?void 0:i.status)!==ER.SUCCESS){ss.error("getDramaInfoViaJSB invalid response:",t);const n=HM(null==i?void 0:i.status),r=_R[n]||_R.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:r.code,veError:yU({code:r.code,message:r.message,textKey:r.textKey}),errorMessage:r.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(l=this.sdk)||l.delayError.push(o),void e(void 0)}if(!(null==i?void 0:i.video_info)){ss.error("getDramaInfoViaJSB invalid response:",t);const n={errorType:"drama",errorCode:_R.FAILED_TO_QUERY.code,veError:yU({code:_R.FAILED_TO_QUERY.code,message:_R.FAILED_TO_QUERY.message,textKey:_R.FAILED_TO_QUERY.textKey}),errorMessage:_R.FAILED_TO_QUERY.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(c=this.sdk)||c.delayError.push(n),void e(void 0)}ss.log("videoInfoRes before transformDramaVideoInfoToRes",i.video_info);const u=this.transformDramaVideoInfoToRes(i.video_info,this.config);ss.log("videoInfoRes after transformDramaVideoInfoToRes",u),e(u)}catch(u){i(u)}}),t)}catch(l){i(l)}}));{const e=_R.INVALID_PARAM;null==(i=this.sdk)||i.delayError.push({errorType:mR.network,errorCode:e.code,veError:yU({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return HM(e)}mapDramaErrorCode(e,t){return jM(e,t)}transformDramaVideoInfoToRes(e,t){return iU(e,t)}callOnGetMediaInfo(e,t){var i,n,r;if(e)try{null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.onGetMediaInfo)||r.call(n,{data:e,fromCache:t})}catch(o){ss.error("onGetMediaInfo callback error:",o)}}reportGetDramaInfoPerf(e,t){var i,n,r,o;const a=null==(i=null==e?void 0:e.data)?void 0:i.perf_info;a&&(null==(o=null==(n=this.sdk)?void 0:n.recordGetDramaInfoPerf)||o.call(n,{perfInfo:a,albumId:t.albumId,episodeId:t.episodeId,vid:t.vid,isSuccess:!!(null==e?void 0:e.is_success),status:null==(r=null==e?void 0:e.data)?void 0:r.status,fromCache:!1,timestamp:Date.now()}))}getVideos(e){return d(this,null,(function*(){var t,i,n,r,o,a;const s=null==(t=this.sdk)?void 0:t._createPlayerPerf;if(ss.log("tt drama info: ",this.isMinisDramaMode,null==mB?void 0:mB.ttDramaEnv),this.isMinisDramaMode&&(null==(i=null==mB?void 0:mB.ttDramaEnv)?void 0:i.canIUseGetDramaInfo)){const t=u(c({},e||(null==(n=this.playerData)?void 0:n.configs)||{}),{defaultDefinition:(null==e?void 0:e.defaultDefinition)||(null==(o=null==(r=this.playerData)?void 0:r.configs)?void 0:o.defaultDefinition)||(null==(a=this.config)?void 0:a.defaultDefinition),getVideoByToken:this.config}),i=ZM($M(t,mB.ttDramaEnv));if(i){const e=uU(i);return this.callOnGetMediaInfo(e,!0),e}const l=e=>{QM($M(t,mB.ttDramaEnv),e);const i=uU(e);return this.callOnGetMediaInfo(i,!1),i};if(null==s?void 0:s.measureAsync){return l(yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB",(()=>d(this,null,(function*(){return yield this.getDramaInfoViaJSB(e)})))))}return l(yield this.getDramaInfoViaJSB(e))}const l=e=>{var t,i,n;try{const i=JSON.parse(e.response);if(100006===Vn(i,"ResponseMetadata.Error.CodeN")){ss.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:yU(yR.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken,config:this.config},originError:e};return null==(t=this.sdk)?void 0:t.delayError.push(i)}}catch(o){ss.log(o)}null==(i=this._emitter)||i.emit(MA.GET_PLAY_URL_ERR,e);const r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:yU(yR.GET_PLAY_INFO_ERR),ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken},originError:e};null==(n=this.sdk)||n.delayError.push(r)},h=e=>d(this,null,(function*(){if(!this.config.playDomain&&502===(null==e?void 0:e.status)&&this.playerData.apiMap.backupPlayDomain)return this.playerData.playDomainDegrade=!0,yield ks((()=>Cs(c({playDomain:this.playerData.playDomain},this.config))),this.retryCount,(e=>502===e.status),l);l(e)})),f=()=>d(this,null,(function*(){var e,t;const i=c({playDomain:this.config.playDomain||this.playerData.playDomain},this.config),n=pM(i),r=OM(i);if(r){ss.log("[mediaInfoCache] authToken use cached media info",{cacheKey:n,vid:r.vid,playListLength:(null==(e=r.playList)?void 0:e.length)||0});const t=uU(r);return this.callOnGetMediaInfo(t,!0),t}ss.log("[mediaInfoCache] authToken request media info",{cacheKey:n,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield ks((()=>Cs(i)),this.retryCount,(e=>502===e.status),h);LM(i,o);const a=uU(o);return ss.log("[mediaInfoCache] authToken request finished",{cacheKey:n,vid:null==o?void 0:o.vid,playListLength:(null==(t=null==o?void 0:o.playList)?void 0:t.length)||0,mediaInfo:o}),this.callOnGetMediaInfo(a,!1),a}));return(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getPlayInfoByAuthToken",f):yield f()}))}getPrivateDrmInfo(e,t,i){return d(this,null,(function*(){var n,r,o,a;const s=null==(n=this.sdk)?void 0:n._createPlayerPerf;if(this.config.getDrmAuthToken&&"function"==typeof this.config.getDrmAuthToken&&this.playerData.unionId){let n;if(this.sessionId=(new Date).getTime().toString(),"hls"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.hlsEncrypt",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(Hw.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Hw.HLSEncrypt);n=null==(r=null==e?void 0:e.updateUnionInfo)?void 0:r.call(e,this.playerData.unionId,this.sessionId)}else if("dash"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.dash",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(Hw.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Hw.DASH);n=null==(o=null==e?void 0:e.updateUnionInfo)?void 0:o.call(e,this.playerData.unionId,this.sessionId)}else if(["mp4","m4a"].includes(i)){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.mp4Encrypt",(()=>d(this,null,(function*(){return yield Kw.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield Kw.loadMp4Encrypt(this.sdk.sdkUmdLoader);n=null==(a=null==e?void 0:e.updateUnionInfo)?void 0:a.call(e,this.playerData.unionId,this.sessionId)}if(!n)return void ss.error("updateUnionInfo fail");const c=[...new Set(e.map((e=>e.kid)))].join(",");try{const i=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.getDrmAuthToken",(()=>d(this,null,(function*(){return yield qs(Ys(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield qs(Ys(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");if(i&&"string"==typeof i){this.privateDrmAuthToken=i;const t=Es(i);(null==t?void 0:t.DrmType)&&(this.useUnionInfoDRM="webdevice"===(null==t?void 0:t.DrmType)),e.forEach((e=>{e.drmKeyToken=this.privateDrmAuthToken}))}}catch(l){ss.error("get privaterDrmToken fail")}}}))}getThumbnailConfig(e){const t=e[0],i=c({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=c({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},i)}getBarrageMaskUrl(e){var t,i;const n=null==(t=this.playerData.configs)?void 0:t.DanmuPlugin,r="object"==typeof n?n:{},o=c({},(null==r?void 0:r.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.maskActive=null==(i=r.maskActive)||i,this.playerData.options.DanmuPlugin.maskConfig=c({maskUrl:e},o)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:c({maskUrl:e},o)}}setSubtitleConfig(e){var t,i,n,r,o,a,s,l,h;if(!(null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.autoSubtitle)||!e)return;const d=this.getAutoSubtitleList(e),f=null==(n=this.playerData.options)?void 0:n.Subtitle,p=null==(r=this.playerData.configs)?void 0:r.Subtitle,g="object"==typeof f&&f?f:"object"==typeof p&&p?p:{};this.playerData.options.Subtitle=u(c({},g),{list:d}),null==(h=null==(l=null==(s=null==(a=null==(o=this.sdk)?void 0:o.player)?void 0:a.plugins)?void 0:s.subtitle)?void 0:l.updateSubtitles)||h.call(l,d)}getAutoSubtitleList(e){const t=this.getSubtitleSourceData(e),i=mU(t,["SubtitleInfoList","subtitleInfoList","subtitle_info_list"],[]);if(!Array.isArray(i))return[];const n=i.map(((e,t)=>this.getAutoSubtitleItem(e,t))).filter((e=>Boolean(e)));return n.some((e=>void 0!==e._subtitleOrder))&&n.sort(((e,t)=>{var i,n;return(null!=(i=e._subtitleOrder)?i:1/0)-(null!=(n=t._subtitleOrder)?n:1/0)})),n.forEach((e=>{delete e._subtitleOrder})),n}getSubtitleSourceData(e){const t=null==e?void 0:e.dashOpts;return(null==t?void 0:t.Data)||(null==t?void 0:t.data)||e}getAutoSubtitleItem(e,t){const i="string"==typeof e?this.getStringAutoSubtitleItem(e,t):this.getObjectAutoSubtitleItem(e,t);if(i)return this.formatAutoSubtitleItem(i,e,t)}getStringAutoSubtitleItem(e,t){const i=`${t+1}`;return c({id:`${t}`,language:`${t}`,label:i,text:i},!/\n/.test(n=e)&&(/^(https?:)?\/\//.test(n)||/^data:/.test(n)||/\.(vtt|srt)([?#].*)?$/i.test(n))?{url:e}:{stringContent:e});var n}getObjectAutoSubtitleItem(e,t){if(!e||"object"!=typeof e)return;const i=mU(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),n=mU(e,["StringContent","stringContent","string_content"],"",!0),r=mU(e,["List","list"]);if(!i&&!n&&!r)return;const o=function(e,t){const i="string"==typeof e?parseInt(e,10):e;if("number"==typeof i&&!isNaN(i)){const e=dU.get(i);if(e)return e}if(t){const e=fU.get(t.toLowerCase());if(e)return e}}(mU(e,["LanguageId","languageId","language_id"],void 0,!0),mU(e,["Language","language"],"",!0)),a=o||_U(mU(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),s=_U(mU(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),l=_U(mU(e,["Language","language","LanguageId","languageId","language_id","srclang"],`${t}`,!0),`${t}`);return c(c(c(u(c({},e),{id:s,language:l,label:a,text:a}),i?{url:i}:{}),n?{stringContent:n}:{}),r?{list:r}:{})}formatAutoSubtitleItem(e,t,i){var n,r;const o=null==(r=null==(n=this.playerData)?void 0:n.configs)?void 0:r.formatAutoSubtitleItem;if("function"!=typeof o)return e;const a=o(t,i);if(!1!==a&&null!==a){if(!0===a||void 0===a)return e;if("string"==typeof a||"number"==typeof a){const t=`${a}`;return u(c({},e),{label:t,text:t})}if("object"==typeof a){if(!1===a.show||!1===a.visible)return;const t=Object.prototype.hasOwnProperty.call(a,"order"),i=Object.prototype.hasOwnProperty.call(a,"label")||Object.prototype.hasOwnProperty.call(a,"text")?(()=>{var t;const i=_U(null!=(t=a.label)?t:a.text,"");return u(c({},e),{label:i,text:i})})():e;t&&(i._subtitleOrder=a.order);const n=Object.prototype.hasOwnProperty.call(a,"isDefault"),r=Object.prototype.hasOwnProperty.call(a,"default");return(n||r)&&(i.isDefault=n?Boolean(a.isDefault):Boolean(a.default)),i}return e}}getDrmConfig(e){var t,i,n,r,o,a,s,l;const{thirdPartyDrmAuthToken:u,serverCertificatePath:h}=this.config;if(u)try{const{vid:u,playList:d}=e,{kid:f,codec:p}=null==d?void 0:d[0];if(!f||!u)return void ss.warn("get kid or vid fail");const g=null==(t=this.playerData.configs)?void 0:t.drm,y="object"==typeof g?g:{},{playDomain:v}=this.config,m=v||this.playerData.playDomain,_=function(e,t="GetPlayInfoToken"){const i=ms(window.atob(e));return i?i[t]:""}(this.config.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken"),E=c({ignoreLicenseHeader:!1,unRecord:null!=(i=this.config.unRecord)&&i,contentType:ir[p],initDataType:"cenc",[Qa.FAIRPLAY]:{serverProcessSPCPath:Is(Qa.FAIRPLAY,f,m,_),serverCertificatePath:h},[Qa.WIDEVINE]:{serverProcessSPCPath:Is(Qa.WIDEVINE,f,m,_)},[Qa.PLAYREADY]:{serverProcessSPCPath:Is(Qa.PLAYREADY,f,m,_)}},y);(null==(o=null==(r=null==(n=this.sdk)?void 0:n.player)?void 0:r.plugins)?void 0:o.drm)&&(null==(l=null==(s=null==(a=this.sdk)?void 0:a.player)?void 0:s.plugins)||l.drm.updateConfig(E)),this.playerData.options.drm=E}catch(d){ss.error("generate drm config error:",d)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=mB.ttDramaEnv;return!!(null==e?void 0:e.getDramaInfo)}init(){const e=this.playerData.configs,{getVideoByToken:t={}}=e;this.initConfig(t)}initConfig(e,t){var i;const n=t||(null==(i=this.playerData)?void 0:i.configs)||{},{albumId:r,episodeId:o}=gU(n),a=!(!r||!o),s=!!mB.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||s&&a,this.isPlayByToken&&(this.config=Object.assign({},vU,e),Object.prototype.hasOwnProperty.call(n,"definitionMap")&&(this.config.definitionMap=n.definitionMap),e.playAuthToken)){if(this.tokenInfo=_s(e.playAuthToken),e.keyToken){const t=(l=e.keyToken,/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(l)?window.atob(e.keyToken):e.keyToken);this.keyTokenInfo=Es(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=_s(e.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken")),e.retryCount&&(this.retryCount=e.retryCount)}var l}updateDramaEpisode(e,t){return d(this,null,(function*(){var i,n,r;const o=t||(null==(i=this.playerData)?void 0:i.configs)||{},a=o.getVideoByToken||{},s={config:this.config,isPlayByToken:this.isPlayByToken,tokenInfo:this.tokenInfo,keyTokenInfo:this.keyTokenInfo,thirdPartyDrmAuthTokenInfo:this.thirdPartyDrmAuthTokenInfo,retryCount:this.retryCount};this.initConfig(a,o);const l=yield this.getVideoInfo(o);if(!l)throw this.config=s.config,this.isPlayByToken=s.isPlayByToken,this.tokenInfo=s.tokenInfo,this.keyTokenInfo=s.keyTokenInfo,this.thirdPartyDrmAuthTokenInfo=s.thirdPartyDrmAuthTokenInfo,this.retryCount=s.retryCount,new Error("Failed to get drama media info");if(t&&(this.playerData.configs=t),e)this.playerData.initPlayData(l);else{const e=this.playerData.current.definition,t=(null==(n=l.playList)?void 0:n.find((t=>{var i,n;const r=t.mapDefinition||t.definition||t.Definition;return(null==(i=null==r?void 0:r.toLocaleLowerCase)?void 0:i.call(r))===(null==(n=null==e?void 0:e.toLocaleLowerCase)?void 0:n.call(e))})))||(null==(r=l.playList)?void 0:r[0]),i=(null==t?void 0:t.mapDefinition)||(null==t?void 0:t.definition)||(null==t?void 0:t.Definition);this.playerData.updateConfigs(u(c({},l),{defaultDefinition:i})),this.playerData.updatePlayList(),t&&this.playerData.initCurrent(t),this.playerData.updateCheckExpireData()}}))}updateAuthToken(e,t){return d(this,null,(function*(){const i=Object.assign({},this.config,e);this.initConfig(i);const n=yield this.getVideoInfo();n&&(t?this.playerData.initPlayData(n):(this.playerData.updateConfigs(u(c({},n),{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()))}))}checkPlayAuthTokenValid(){var e,t;if(!this.tokenInfo)return!1;if(Ss(this.tokenInfo)){ss.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:NA.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:yU(yR.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{playAuthToken:this.config.playAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkKeyTokenValid(){var e,t;if(Ss(this.keyTokenInfo)){ss.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:NA.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:yU(yR.HLS_KEY_TOKEN_EXPIRED),errorMessage:"keyToken for hls encrypt play has expired",ext:{keyToken:this.config.keyToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkDrmAuthTokenValid(){var e,t;if(Ss(this.thirdPartyDrmAuthTokenInfo)){ss.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:NA.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:yU(yR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED),ext:{thirdPartyDrmAuthToken:this.config.thirdPartyDrmAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}}class TU extends QN{static get pluginName(){return"Abr"}constructor(e){super(e)}static get defaultConfig(){return{autoDefiText:"",isOpenAutoDefi:!1,interval:1e3,hurryThreshold:.25,lowThreshold:.4,highThreshold:.7,noStallCheckTime:5,isOpenHint:!1,method:31}}beforePlayerCreate(){return d(this,null,(function*(){return yield this.prepareAbrModule()}))}prepareAbrModule(){return d(this,null,(function*(){var e,t;return null==(t=null==(e=this.sdk.playerData)?void 0:e.adapter)?void 0:t.prepareAbrModule(this.playerData,this.sdk.sdkUmdLoader)}))}adaptAbrOptions(){var e;const t=null==(e=this.playerData.configs)?void 0:e.autoBitrateOpts;if(t){const e=this.playerData.defaultDefinition;return u(c(c({},TU.defaultConfig),t),{autoDefiText:t.autoDefinitionText||"",isOpenAutoDefi:this.playerData.isOpenABR(),isPlayAutoDefi:this.playerData.isPlayAutoDefinition(e)})}}applyAbrConfig(e){var t,i;const n=this.adaptAbrOptions();n&&(null==(i=null==(t=this.sdk.playerData)?void 0:t.adapter)||i.applyAbrPluginConfig(e,n))}}class SU extends QN{static get pluginName(){return"AdaptRange"}constructor(e){super(e)}adaptRangeOptions(){var e,t,i,n,r,o,a,s;const l=null!=(t=null==(e=this.playerData.configs)?void 0:e.adaptRange)?t:void 0;if(!(null==l?void 0:l.enable)||!(null==(n=null==(i=this.playerData.adapter)?void 0:i.canAdaptRangeEnable)?void 0:n.call(i)))return;const h=this.playerData.adapter.adaptRangeDefaultOptions();return u(c(c({},null!=h?h:{}),l),{minTargetCacheDur:null!=(r=l.minCacheDuration)?r:null==h?void 0:h.minTargetCacheDur,maxTargetCacheDur:null!=(o=l.maxCacheDuration)?o:null==h?void 0:h.maxTargetCacheDur,rangeMinDuration:null!=(a=l.minRangeDuration)?a:null==h?void 0:h.rangeMinDuration,rangeMaxDuration:null!=(s=l.maxRangeDuration)?s:null==h?void 0:h.rangeMaxDuration})}applyRangeConfig(e){const t=this.adaptRangeOptions();t&&e&&this.playerData.adapter.applyAdaptRangePluginConfig(e,t)}}class bU extends QN{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,n,r;if(yA.isReady()){const o=this.playerData.configs.duration||(null==(i=null==(t=this.playerData.playList)?void 0:t[0])?void 0:i.duration)||-1,a=o>0&&o<=180?"svideo":o>180&&o<=1800?"mvideo":"lvideo",s={vtype:null==(n=this.playerData.adapter)?void 0:n.streamType,duration:o,videoLabel:a},l=yA.getStrategyRecommendations(void 0,s),{result:c}=l;ss.log("VodLogCommon Final StrategyConfig:",c);const u=null==c?void 0:c[hA.ADAPT_RANGE];(null==u?void 0:u.enable)&&(null==u?void 0:u.options)&&(null==(r=this.playerData.adapter)||r.applyAdaptRangeStrategy(e,u.options))}}}const CU={init(e){var t;if(!e)return;const i=e.playerData.sdkPlugins;(null==(t=e.playerData)?void 0:t.isLive)?e.sdkPlugins=[...i]:e.sdkPlugins=[EU,TU,SU,bU,...i],e._sdkPlugins={}},registerPlugin(e,t){if(!e||!t)return;let i=null,n=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),n.sdk=t;const r=n.pluginName||i.pluginName;if(!r)throw new Error("The property pluginName is necessary");const o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);const e=new i(n);return o[r.toLowerCase()]=e,o[r.toLowerCase()].func=i,e&&"function"==typeof e.afterCreate&&e.afterCreate(),e}catch(a){ss.error(a)}},unRegister(e,t){if(e&&t){e=e.toLowerCase();try{const i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(i){ss.error(i)}}},beforePlayerCreate(e){if(!e)return;e._sdkPlugins||this.init(e);const t=e._sdkPlugins,i=null==e?void 0:e._createPlayerPerf,n=[];for(const r of Object.keys(t))if(t[r]&&t[r].beforePlayerCreate)try{const e=()=>Ys(t[r].beforePlayerCreate());(null==i?void 0:i.measureAsync)?n.push(i.measureAsync(`beforePlayerCreate.${r}`,e)):n.push(e())}catch(ds){throw n.push(Ys(null)),ds}return new Promise(((e,t)=>{Promise.all([...n]).then((()=>{e(null)})).catch((i=>{ss.error(i),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"!==(null==i?void 0:i.code)?e(null):t(i)}))}))},afterPlayerCreate(e){if(!e)return;const t=e._sdkPlugins;for(const i of Object.keys(t))if(t[i]&&t[i].beforePlayerCreate)try{t[i].afterPlayerCreate()}catch(ds){throw ds}},destroy(e){if(!e)return;const t=e._sdkPlugins;if(t){for(const i of Object.keys(t))this.unRegister(i,e);delete e._sdkPlugins}}},kU=CU,IU={[gR.NETWORK]:"Network error",[gR.NETWORK_TIMEOUT]:"Network timeout",[gR.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[gR.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[gR.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[gR.NETWORK_URL_EXPIRE]:"The video URL has expired",[gR.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[gR.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[gR.MEDIA_ERR]:"Media error",[gR.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[gR.MEDIA_ERR_NETWORK]:"Network error",[gR.MEDIA_ERR_DECODE]:"Decoding error",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[gR.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[gR.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[gR.MEDIA_ERR_PLAY_ERR]:"Video playback error",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[gR.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[gR.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[gR.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[gR.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[gR.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[gR.OTHER]:"Other error",[gR.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[gR.GET_PLAY_INFO_ERR]:"Failed to get media information",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[gR.LICENSE_VALIDATE_FAIL]:"License validation failed",[gR.DEFINITION_AUTO]:"Auto",[gR.LICENSE_STATUS_INVALID]:"License validation is invalid",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[gR.DRAMA_INVALID_PARAM]:"Invalid parameter",[gR.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[gR.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[gR.DRAMA_UNDER_REVIEW]:"Episode is under review",[gR.DRAMA_FAILED_REVIEW]:"Episode failed review",[gR.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[gR.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[gR.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[gR.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},PU={[gR.NETWORK]:"网络错误",[gR.NETWORK_TIMEOUT]:"网络超时",[gR.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[gR.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[gR.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[gR.NETWORK_URL_EXPIRE]:"视频地址已过期",[gR.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[gR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[gR.MEDIA_ERR]:"播放错误",[gR.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[gR.MEDIA_ERR_NETWORK]:"网络错误",[gR.MEDIA_ERR_DECODE]:"解码错误",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[gR.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[gR.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[gR.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[gR.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[gR.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[gR.BUSINESS_DRM_KEY_ERROR]:"解密错误",[gR.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[gR.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[gR.OTHER]:"其他错误",[gR.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[gR.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[gR.LICENSE_VALIDATE_FAIL]:"license 校验失败",[gR.DEFINITION_AUTO]:"自动",[gR.LICENSE_STATUS_INVALID]:"license 校验无效",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[gR.DRAMA_INVALID_PARAM]:"参数错误",[gR.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[gR.DRAMA_NOT_SUBMITTED]:"剧集未送审",[gR.DRAMA_UNDER_REVIEW]:"剧集审核中",[gR.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[gR.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[gR.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[gR.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[gR.DRAMA_NOT_ON_SHELF]:"视频未上架",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},DU={[gR.NETWORK]:"ネットワークエラー",[gR.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[gR.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[gR.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[gR.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[gR.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[gR.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[gR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[gR.MEDIA_ERR]:"再生エラー",[gR.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[gR.MEDIA_ERR_NETWORK]:"ネットワークエラー",[gR.MEDIA_ERR_DECODE]:"デコードエラー",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[gR.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[gR.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[gR.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[gR.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[gR.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[gR.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[gR.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[gR.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[gR.OTHER]:"その他のエラー",[gR.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[gR.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[gR.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[gR.DEFINITION_AUTO]:"自動",[gR.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[gR.DRAMA_INVALID_PARAM]:"パラメータが無効です",[gR.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[gR.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[gR.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[gR.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[gR.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[gR.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[gR.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[gR.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},wU=[{LANG:"en",TEXT:IU},{LANG:"zh",TEXT:PU},{LANG:"zh-hk",TEXT:{[gR.NETWORK]:"網路錯誤",[gR.NETWORK_TIMEOUT]:"網路逾時",[gR.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[gR.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[gR.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[gR.NETWORK_URL_EXPIRE]:"視頻地址已過期",[gR.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[gR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[gR.MEDIA_ERR]:"播放錯誤",[gR.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[gR.MEDIA_ERR_NETWORK]:"網路錯誤",[gR.MEDIA_ERR_DECODE]:"解碼錯誤",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[gR.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[gR.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[gR.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[gR.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[gR.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[gR.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[gR.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[gR.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[gR.OTHER]:"其他錯誤",[gR.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[gR.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[gR.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[gR.DEFINITION_AUTO]:"自動",[gR.LICENSE_STATUS_INVALID]:"license 校驗無效",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[gR.DRAMA_INVALID_PARAM]:"參數錯誤",[gR.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[gR.DRAMA_NOT_SUBMITTED]:"劇集未送審",[gR.DRAMA_UNDER_REVIEW]:"劇集審核中",[gR.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[gR.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[gR.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[gR.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[gR.DRAMA_NOT_ON_SHELF]:"影片未上架",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"}},{LANG:"jp",TEXT:DU}],AU="ignoreServicePreloadConfigEnable";class RU extends Error{constructor(e,t){super(t),this.code=e}}const xU=new Map;function OU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LU(e){return!!(e&&YM(e)&&zM(e))}function NU(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function MU(e,t){return e instanceof RU?e:new RU(t.code,t.message)}function UU(e,t,i){const n=`${t.cacheOptions.moduleName}:${t.cacheOptions.cacheKey}`,r=xU.get(n);if(r)return r;const o="ttDrama"===t.kind?function(e,t){const i=YM(t),n=zM(t);if(!(null==e?void 0:e.getDramaInfo)||!i||!n){const e=_R.INVALID_PARAM;return Promise.reject(new RU(e.code,e.message))}const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return FM(e)&&OU(t,"transcodeParam")&&(r.transcodeParam=UM(t.transcodeParam)||{}),new Promise(((i,n)=>{try{e.getDramaInfo((r=>{var o,a,s,l;try{if(!(null==r?void 0:r.is_success)){const e=jM(null==(o=null==r?void 0:r.error)?void 0:o.error_msg,void 0),t=_R[e];return void n(new RU(t.code,t.message))}if((null==(a=r.data)?void 0:a.status)!==ER.SUCCESS){const e=HM(null==(s=r.data)?void 0:s.status),t=_R[e];return void n(new RU(t.code,t.message))}if(!(null==(l=r.data)?void 0:l.video_info)){const e=_R.FAILED_TO_QUERY;return void n(new RU(e.code,e.message))}const c=iU(r.data.video_info,tU(t,e));if(!dM(c)){const e=_R.FAILED_TO_QUERY;return void n(new RU(e.code,e.message))}i(c)}catch(dF){n(MU(dF,_R.FAILED_GET_EPISODE_INFO))}}),r)}catch(dF){n(MU(dF,_R.FAILED_GET_EPISODE_INFO))}}))}(i,e):function(e,t){return d(this,null,(function*(){const i=tU(e,t);try{const e=_s(i.playAuthToken);if(Ss(e)){const e=yR.PLAY_AUTH_TOKEN_EXPIRED;throw new RU(e.code,e.message)}const t=yield Cs(i);if(!dM(t))throw new RU(yR.GET_PLAY_INFO_ERR.code,yR.GET_PLAY_INFO_ERR.message);return t}catch(dF){throw MU(dF,yR.GET_PLAY_INFO_ERR)}}))}(e,i);xU.set(n,o);const a=()=>{xU.get(n)===o&&xU.delete(n)};return o.then(a,a),o}function BU(e,t){return d(this,null,(function*(){try{const i=function(e,t){if(LU(e)&&!0===(null==t?void 0:t.canIUseGetDramaInfo)){const i=$M(e,t);return{kind:"ttDrama",cacheOptions:{moduleName:iM,cacheKey:XM(i),cacheKeyInfo:qM(i)}}}if(NU(e)){const t=eU(e);return{kind:"playAuthToken",cacheOptions:{moduleName:tM,cacheKey:pM(t),cacheKeyInfo:gM(t)}}}if(LU(e)){const e=_R.INVALID_PARAM;throw new RU(e.code,e.message)}throw new RU(8e3,"Unsupported media info source")}(e,t),n=function(e,t,i){const n=PM(t.cacheOptions);return n||("ttDrama"===t.kind?ZM($M(e,i)):JM(e))}(e,i,t);if(n)return{status:"fulfilled",source:e,data:n,fromCache:!0};const r=yield UU(e,i,t);return DM(i.cacheOptions,r),{status:"fulfilled",source:e,data:r,fromCache:!1}}catch(dF){const i=MU(dF,yR.OTHER);return{status:"rejected",source:e,error:{code:i.code,message:i.message}}}}))}function FU(e,t){const i=tU(e,t);return i.playAuthToken?Cs(i).catch((()=>{})):Promise.resolve(void 0)}function HU(e,t){return d(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return jU(e,t);const i=function(e,t){const i=ZM($M(e,t));return i?rU(i,e):void 0}(e,t);if(i)return cU(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return jU(e,t);const n=yield function(e,t){const i=YM(t),n=zM(t);if(!i||!n)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return FU(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return FM(e)&&OU(t,"transcodeParam")&&(r.transcodeParam=UM(t.transcodeParam)||{}),new Promise((i=>{try{e.getDramaInfo((n=>{try{if(!(null==n?void 0:n.is_success))return ss.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const{data:r}=n;if((null==r?void 0:r.status)!==ER.SUCCESS||!(null==r?void 0:r.video_info))return ss.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const o=iU(r.video_info,tU(t,e));i(o)}catch(ds){ss.error("[ttdrama] getDramaInfo invalid response",n),i(void 0)}}),r)}catch(n){ss.error("[ttdrama] getDramaInfo call failed",n),i(void 0)}}))}(t,e);return n?(QM($M(e,t),n),cU(rU(n,e))):void 0}))}function jU(e,t){return d(this,null,(function*(){const i=function(e){const t=JM(e);return t?rU(t,e):void 0}(e);if(i)return cU(i);const n=yield FU(e,t);var r;return n?(r=n,LM(eU(e),r),cU(rU(n,e))):void 0}))}function VU(e,t){return d(this,null,(function*(){if(nU(e.url))return e;if(LU(e)){const i=yield HU(e,t);return i||t||NU(e)?i:e}return NU(e)?jU(e,t):e}))}function KU(e,t){return d(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(Kr.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const n of e)i.push(yield VU(n,t))}else i=yield Promise.all(e.map((e=>VU(e,t))));return i.filter(Boolean)}))}const GU=["live","rtm","music","danmu","ad"],WU=["configs","options","defaultConfig","current"],YU=["url","src","playUrl","playURL"],zU=["plugins","sdkPlugins","strategiesPlugins","presets"];class $U extends Error{constructor(e){var t;super(`[VEPLAYER_LITE_UNSUPPORTED_FEATURE] ${e} 功能不受精简版支持,请改用 ${function(e){const t=(e||"").toUpperCase();return t.includes("BYTEPLUS")?"@byteplus/veplayer":t.includes("VOLCENGINE")?"@volcengine/veplayer":"@byted-vcloud/veplayer"}("undefined"==typeof process||null==(t=process.env)?void 0:t.LUX_REGION)}。`),this.code="VEPLAYER_LITE_UNSUPPORTED_FEATURE",this.name="VePlayerLiteUnsupportedFeatureError",this.feature=e,Object.setPrototypeOf(this,$U.prototype)}}class XU extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,XU.prototype)}}function qU(e){return"object"==typeof e&&null!==e||"function"==typeof e}function ZU(e,t){if(qU(e))try{return e[t]}catch(ds){return}}function QU(e){try{return Array.isArray(e)}catch(ds){return!1}}function JU(e){if(!QU(e))return[];const t=ZU(e,"length");if("number"!=typeof t||t<0||t>4294967295||Math.floor(t)!==t)return[];const i=[];for(let n=0;n<t;n+=1)i.push(ZU(e,String(n)));return i}function eB(e){return null!=e&&!1!==e}function tB(e){return"string"==typeof e?e.toLowerCase():""}function iB(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function nB(e){return YU.some((t=>function(e){const t=[e],i=new WeakSet;for(let n=0;n<t.length;n+=1){const e=t[n];if(iB(e))return!0;if(qU(e)&&!i.has(e))if(i.add(e),QU(e))for(const i of JU(e))t.push(i);else for(const i of YU)t.push(ZU(e,i))}return!1}(ZU(e,t))))}function rB(e){if("string"==typeof e)return[e];if(!qU(e))return[];const t=[],i=ZU(e,"pluginName"),n=ZU(e,"name");return"string"==typeof i&&t.push(i),"string"==typeof n&&t.push(n),t}function oB(e,t){return zU.some((i=>JU(ZU(e,i)).some((e=>function(e){const t=rB(e);return t.push(...rB(ZU(e,"plugin"))),t.push(...rB(ZU(e,"preset"))),t}(e).some((e=>function(e,t){const{compact:i,parts:n}=function(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[\s_]+/g,"-").replace(/-+/g,"-");return{compact:t.replace(/-/g,""),parts:t.split("-")}}(t);switch(e){case"live":return"timeshiftplugin"===i||"liveinfopanel"===i||i.startsWith("livesubtitles");case"rtm":return"rtm"===i||"rtmplugin"===i;case"music":return i.includes("music");case"danmu":return i.includes("danmu");case"ad":return n.some((e=>"ad"===e||"ads"===e))||["ad","ads","adplugin","adsplugin"].includes(i)}}(t,e)))))))}function aB(e,t){switch(t){case"live":return!0===ZU(e,"isLive")||"live"===tB(ZU(e,"type"))||eB(ZU(e,"TimeShiftPlugin"))||eB(ZU(e,"LiveInfoPanel"))||eB(ZU(e,"LiveSubtitlesPlugin"))||eB(ZU(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===tB(ZU(e,"streamType"))||eB(ZU(e,"rtm"))||nB(e);case"music":return!0===ZU(e,"isMusic")||eB(ZU(e,"music"));case"danmu":{const t=ZU(e,"getVideoByToken");return eB(ZU(e,"DanmuPlugin"))||!0===ZU(e,"needBarrageMask")||!0===ZU(t,"needBarrageMask")}case"ad":return eB(ZU(e,"AdsPlugin"))||eB(ZU(e,"AdPlugin"))}}function sB(e){const t=function(e){const t=[],i=[e],n=new WeakSet;for(let r=0;r<i.length;r+=1){const e=i[r];if(qU(e)&&!n.has(e)){n.add(e),t.push(e);for(const t of WU)i.push(ZU(e,t));for(const t of JU(ZU(e,"playList")))i.push(t)}}return t}(e);for(const i of GU)if(t.some((e=>aB(e,i)||oB(e,i))))throw new $U(i)}const lB=()=>Ur.generateSessionId(),cB=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0?e:0,uB=e=>c({},e),hB=(e,t)=>t.lastEnteredPlayingAt-e.lastEnteredPlayingAt||t.sequence-e.sequence,dB=(e,t)=>t.lastPlaybackAt-e.lastPlaybackAt||t.sequence-e.sequence,fB=(e,t)=>t.createdAt-e.createdAt||t.sequence-e.sequence,pB=(e,t,i="creating")=>({playbackSessionId:t,playbackState:i,isEnded:!1,isPaused:!1,isBeforePlayerCreate:!0,albumId:e.albumId,episodeId:e.episodeId,duration:0,currentTime:0});const gB=new class{constructor(e=Date.now,t=lB){this.now=e,this.createPlaybackSessionId=t,this.sessions=new Map,this.transactionResolvers=new WeakMap,this.historical=null,this.sequence=0}register(e,t){const i=this.now(),n=++this.sequence,r=this.createPlaybackSessionId();this.sessions.set(e,{vePlayer:e,playbackSessionId:r,pendingPlaybackSessionId:null,identity:c({},t),pendingIdentity:null,identitySwitchCore:null,pendingTransaction:null,identitySwitchArmed:!1,identitySwitchIsSameCore:!1,useStableSnapshot:!1,core:null,state:"creating",creationFailed:!1,hasEverPlayed:!1,isBuffering:!1,createdAt:i,lastEnteredPlayingAt:0,lastPlaybackAt:0,sequence:n,lastStableSnapshot:pB(t,r)})}has(e){return this.sessions.has(e)}beginCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="creating",i.creationFailed=!1,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&(i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1)))}failCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="error",i.creationFailed=!0,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&this.rollbackIdentitySwitch(e,t)))}attachCore(e,t,i){var n;const r=this.sessions.get(e);if(r&&(this.matchesPendingTransaction(r,i)||!r.pendingTransaction)){r.core=t,r.state="ready",r.creationFailed=!1,r.isBuffering=!1,this.matchesPendingTransaction(r,i)&&(r.identitySwitchCore=t,r.identitySwitchArmed=!0,r.identitySwitchIsSameCore=!1);for(const i of["play","playing","waiting","canplay","timeupdate","pause","ended","error"])null==(n=t.on)||n.call(t,i,(()=>this.handleCoreEvent(e,t,i)))}}handleCoreEvent(e,t,i){const n=this.sessions.get(e);if(n&&n.core===t&&("error"!==i&&"canplay"!==i||!n.pendingTransaction||n.identitySwitchArmed||n.identitySwitchCore!==t)){if("play"===i||"playing"===i){const e="playing"!==n.state,t=this.now();return n.hasEverPlayed=!0,n.isBuffering=!1,n.state="playing",n.lastPlaybackAt=t,void(e&&(n.lastEnteredPlayingAt=t))}if("waiting"!==i){if(n.isBuffering=!1,"canplay"===i)return n.pendingTransaction?n.identitySwitchArmed&&n.identitySwitchCore===t&&this.commitIdentitySwitch(e,n.pendingTransaction):(n.useStableSnapshot=!1,n.lastStableSnapshot=null),void(n.hasEverPlayed||(n.state="ready"));if("timeupdate"!==i)if("pause"!==i){if("ended"===i)return n.hasEverPlayed=!0,n.lastPlaybackAt=this.now(),void(n.state="ended");n.state="error",n.pendingTransaction&&n.identitySwitchArmed&&n.identitySwitchCore===t&&this.rollbackIdentitySwitch(e,n.pendingTransaction)}else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state="paused");else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state=t.paused?"paused":"playing")}else n.hasEverPlayed&&(n.isBuffering=!0,n.state="buffering")}}beginIdentitySwitch(e,t,i,n=!1,r){const o=this.sessions.get(e);if(!o)return null;if(!!o.pendingIdentity||!!o.pendingPlaybackSessionId){if(!this.matchesPendingTransaction(o,r))return null}else o.lastStableSnapshot=this.snapshotSession(o,null!=i?i:o.core).snapshot,o.identitySwitchCore=null!=i?i:o.core,o.identitySwitchArmed=!1,o.identitySwitchIsSameCore=!0,o.pendingTransaction=this.createIdentitySwitchTransaction();return o.pendingIdentity=c({},t),n&&!o.pendingPlaybackSessionId&&(o.pendingPlaybackSessionId=this.createPlaybackSessionId()),o.useStableSnapshot=!0,o.pendingTransaction}armIdentitySwitch(e,t,i){const n=this.sessions.get(e);return!(!n||n.core!==i||!this.matchesPendingTransaction(n,t))&&(n.identitySwitchCore=i,n.identitySwitchArmed=!0,n.identitySwitchIsSameCore=!0,!0)}hasActiveIdentitySwitch(e){var t;return!!(null==(t=this.sessions.get(e))?void 0:t.pendingTransaction)}commitIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!i.pendingIdentity&&!i.pendingPlaybackSessionId||!this.matchesPendingTransaction(i,t))return;i.pendingIdentity&&(i.identity=i.pendingIdentity),i.pendingPlaybackSessionId&&(i.playbackSessionId=i.pendingPlaybackSessionId),i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const n=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!1,i.lastStableSnapshot=null,this.settleTransaction(n)}rollbackIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!this.matchesPendingTransaction(i,t))return;const n=!i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore,r=i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore;i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const o=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!r&&!!i.lastStableSnapshot,r&&(i.lastStableSnapshot=null),n&&(i.core=null),this.settleTransaction(o)}destroy(e,t){const i=this.sessions.get(e);if(!i)return;const n=i.useStableSnapshot&&i.lastStableSnapshot?this.rank(i,uB(i.lastStableSnapshot)):this.snapshotSession(i,null!=t?t:i.core);n.snapshot=u(c({},n.snapshot),{playbackState:"destroyed",isBeforePlayerCreate:!1}),n.state="destroyed",this.settleTransaction(i.pendingTransaction),this.sessions.delete(e),n.hasEverPlayed&&(!this.historical||dB(n,this.historical)<0)&&(this.historical=n)}query(e){const t=[];for(const o of this.sessions.values()){if((o.pendingIdentity||o.pendingPlaybackSessionId||o.useStableSnapshot)&&o.lastStableSnapshot){t.push(this.rank(o,uB(o.lastStableSnapshot)));continue}const i=e.find((e=>e===o.core&&e.sdk===o.vePlayer));try{const e=this.snapshotSession(o,null!=i?i:null);o.lastStableSnapshot=uB(e.snapshot),t.push(e)}catch(ds){o.lastStableSnapshot&&t.push(this.rank(o,uB(o.lastStableSnapshot)))}}const i=t.filter((e=>"playing"===e.state||"buffering"===e.state)).sort(hB)[0];if(i)return uB(i.snapshot);const n=t.filter((e=>e.hasEverPlayed)).concat(this.historical?[this.historical]:[]).sort(dB)[0];if(n)return uB(n.snapshot);const r=t.sort(fB)[0];return r?uB(r.snapshot):null}resetForTests(){this.sessions.clear(),this.historical=null,this.sequence=0}createIdentitySwitchTransaction(){let e;const t={settled:new Promise((t=>{e=t}))};return this.transactionResolvers.set(t,e),t}settleTransaction(e){if(!e)return;const t=this.transactionResolvers.get(e);t&&(this.transactionResolvers.delete(e),t())}matchesPendingTransaction(e,t){return!!t&&e.pendingTransaction===t}snapshotSession(e,t){if(!t){const t=e.creationFailed?"error":"creating";return this.rank(e,pB(e.identity,e.playbackSessionId,t))}const i=!!t.paused,n=!!t.ended;let r;return r=t.isError||"error"===e.state?"error":n||"ended"===e.state?"ended":e.hasEverPlayed&&i?"paused":e.hasEverPlayed&&e.isBuffering?"buffering":e.hasEverPlayed?"playing":"ready",this.rank(e,{playbackSessionId:e.playbackSessionId,playbackState:r,isEnded:n,isPaused:i,isBeforePlayerCreate:!1,albumId:e.identity.albumId,episodeId:e.identity.episodeId,duration:cB(t.duration),currentTime:cB(t.currentTime)})}rank(e,t){return{snapshot:t,state:t.playbackState,hasEverPlayed:e.hasEverPlayed,createdAt:e.createdAt,lastEnteredPlayingAt:e.lastEnteredPlayingAt,lastPlaybackAt:e.lastPlaybackAt,sequence:e.sequence}}};window.Player||(window.Player=Wa);const yB=class{constructor(e){this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._lastSelectedAudioTrack=null,this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null,this._playNextPending=!1,this._isCollectingCreatePlayerPerf=!1,this._getDramaInfoPerfRecords=[],this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this._publicPlayNextOperation=null,this._lifecycleGeneration=0,this._isVolcengine=!1,this._originConfigs={},this.delayEvents=[],this.createPlayer=e=>d(this,null,(function*(){const t=this._lifecycleGeneration||0;gB.beginCoreCreate(this,e);try{const i=yield this._createPlayer(e,t);return this._isStaleLifecycleGeneration(t)?void this._discardStalePlayer(i):i}catch(dF){throw gB.failCoreCreate(this,e),dF}})),this._createPlayer=(e,...t)=>d(this,[e,...t],(function*(e,t=this._lifecycleGeneration||0){var i,n,r,o,a,s,l;this._createPlayerPerf=new Us,this._isCollectingCreatePlayerPerf=!0;const f=this._createPlayerPerf;if(yield f.measureAsync("destroyPlayer",(()=>d(this,null,(function*(){yield this._destroyPlayer()})))),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(yield this.beforePlayerCreate(),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();sB(this.playerData);const{options:p,plugins:g,isMobile:y,openSoftDecoding:v,configs:m,strategiesPlugins:_,strategiesPluginConfigs:E}=this.playerData,T=!1,S=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),b=this.playerData.getCurrentStreamType()||Ts(null==m?void 0:m.getVideoByToken);$s(m,"EncryptHlsPlugin")||S&&b||this.playerData.isOpenABR()||(ss.warn(`url is empty or streamType is empty (url:${S}, streamType: ${b})`),this.renderPoster());const C=()=>d(this,null,(function*(){const e=ol(S);return yield this.getSoftDecodingOption(v,e,b)})),k=yield f.measureAsync("createSDKPreset",(()=>d(this,null,(function*(){return yield EN({isLive:T,isMobile:y,streamType:b,playerData:this.playerData,getSoftOptionTask:C},this)}))));if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();const{presets:I,softDecodingOption:P,plugins:D}=k,w=y?function(e=!1){const t=c({},LN),i=c({},e?NN:MN);return c(c({},t),i)}(T):function(e=!1){const t=c({},AN),i=c({},e?RN:xN);return c(c({},t),i)}(T),{basicPlugins:A=[],iconPlugins:R=[]}=this._analyzeExtendPlugins(),x=P||{},{plugins:O=[]}=x,L=h(x,["plugins"]),N=this.getDefinitionConfig(),M=Ur.deepMerge(w,p),U=u(c(u(c(c(c({},{errorKey:kR}),M),L||{}),{definition:N,icons:c(c(c({},w.icons),{}),null!=(i=null==p?void 0:p.icons)?i:{}),MoreButtonPlugin:{iconPlugins:[...null!=(r=null==(n=p.MoreButtonPlugin)?void 0:n.iconPlugins)?r:[],...R,$N,VN,ZN]}}),E),{playerData:this.playerData});this.playerData.getLineList().length>1&&U.MoreButtonPlugin.iconPlugins.push(WN),this.setDefaultConfigOptions(U);const B=function(e){const t=[];return e.forEach((e=>{t.find((t=>{var i,n;return(null==(i=null==t?void 0:t.pluginName)?void 0:i.toLowerCase())===(null==(n=null==e?void 0:e.pluginName)?void 0:n.toLowerCase())}))||t.push(e)})),t}([...A,...g,...D,...O,..._]),F=(null!=(o=null==U?void 0:U.ignores)?o:[]).some((e=>"sdkunmuteplugin"===(e+"").toLowerCase()));U.ignores=[...null!=(a=null==U?void 0:U.ignores)?a:[],...F?["AutoplayPlugin"]:[]],this._isFirstCreated?this._isFirstCreated=!1:(U.autoplayMuted=!1,U.ignores=[...null!=(s=null==U?void 0:U.ignores)?s:[],"sdkUnmutePlugin"]),this.setPluginConfig(U);const H={},j=null==(l=yB.ttDramaEnv)?void 0:l.videoSecurityModule;if(null==j?void 0:j.generateSignature){const e=yield f.measureAsync("videoSecuritySignature",(()=>d(this,null,(function*(){return yield j.generateSignature()}))));e&&(H["data-tt-sign"]=e)}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();this._emitter.emit(NA.READY_CREATE_PLAYER);let V,K={};if(yB.shouldCheckLicense()){const e=yield yB.checkLicenseStatus();e!==bA.LICENSE_STATUS_OK&&e!==bA.LICENSE_STATUS_EXPIRED&&(K={progress:{closeMoveSeek:!0,isCloseClickSeek:!0},sdkErrorPlugin:{isNeedRefreshButton:!1}})}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(f.measure("instantiatePlayer",(()=>{var e;V=new Wa(u(c(c({el:this.playerContainer,presets:I,url:S,isLive:!1},U),K),{videoAttributes:c(c({},null!=(e=U.videoAttributes)?e:{}),H),plugins:[...B]}))})),this._isStaleLifecycleGeneration(t))return this._discardStalePlayer(V),this._cancelStalePlayerCreation();this.player=V,V.playerData=this.playerData,V.sdk=this,gB.attachCore(this,V,e);const G=f.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=G,this.emit(NA.CREATE_PLAYER_PERF,G),ss.log("createPlayer perf: ",G),this._emitter.emit(NA.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),V})),this._onMp4PreloadInfo=e=>{this.emit(MA.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(FA.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:n,mediaError:r}=e||{};if(Ur.isMSE(null==(t=this.player)?void 0:t.media))n+""!="403"&&i+""!="9203"||this._emitExpireEvent("error",e);else if(4===(null==r?void 0:r.code)||2===(null==r?void 0:r.code)){const t=ol(this.playerData.getCurrentUrl());t&&Ls(t,{range:"0-8",timeout:2e3}).then((t=>{ss.log("xhr result",t);const{status:i,response:n}=t;403===i&&"string"==typeof n&&n.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{ss.log("xhr error",e)}))}},this._onNativeAddTrack=()=>{var e,t;if(this._getHlsInstance())return;this._playNextPending=!1;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(!i)return;const n=[];for(let r=0;r<i.length;r++){const e=i[r];n.push({id:e.id,name:e.label||e.language||e.id,lang:e.language,default:e.enabled,selected:e.enabled})}this._applyAudioPreferenceNative(i),this._emitter.emit(NA.AUDIO_TRACKS_UPDATED,{audioTracks:n})},this._onNativeTrackChange=()=>{var e,t;if(this._getHlsInstance())return;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(i)for(let n=0;n<i.length;n++){const e=i[n];if(e.enabled){const t={id:n,name:e.label||e.language||String(n),lang:e.language,default:e.enabled,selected:!0};this._playNextPending||(this._lastSelectedAudioTrack=t),this._emitter.emit(NA.AUDIO_TRACK_CHANGE,{id:n,audioTrack:t});break}}},function(e){if(!e)throw new XU}(Boolean(yB.ttDramaEnv)),this.assertLiteConfig(e),gB.register(this,gU(e)),this._init(e)}static getPlayerPlaybackState(){var e,t,i;const n=null!=(i=null==(t=null==(e=Wa.instManager)?void 0:e.findAll)?void 0:t.call(e,(e=>!!(null==e?void 0:e.sdk)&&gB.has(e.sdk))))?i:[];return gB.query(n)}static registerModules(e){cA.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){!function(e=!0){oU=!!e}(e)}static getAppendVideoUrlTimestamp(){return oU}static setTTDramaEnv(e){var t;ss.log("TTDramaEnv: ",e);yB.ttDramaEnv=u(c({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){!function(e){e?("boolean"==typeof e.enable&&(rM.enable=e.enable),e.cacheType&&(rM.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?rM.expireTime=e.expireTime:void 0!==e.expireTime&&sM("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:rM.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?rM.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&sM("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:rM.maxEntries}),sM("config updated",cM())):sM("config skip empty config",{currentConfig:cM()})}(e)}static getMediaInfoCacheConfig(){return cM()}static clearMediaInfoCache(){uM()}static prefetchMediaInfo(e){return function(e,t){return d(this,null,(function*(){if(!Array.isArray(e))throw new TypeError("sources must be an array");if(!e.length)return[];if(Kr.os.isAndroid&&!0===(null==t?void 0:t.canIUseGetDramaInfo)&&!t.canAndroidBatchGetDramaInfo){const i=[];for(const n of e)i.push(yield BU(n,t));return i}return Promise.all(e.map((e=>BU(e,t))))}))}(e,yB.ttDramaEnv)}static setDebug(e){!function(e){ss.config.debug=e?3:1}(e)}static setCollector(e){Bs=e}static shouldCheckLicense(){return!1}static prepare(e){return d(this,null,(function*(){let t=e;const i=Boolean(yB.ttDramaEnv);!(null==t?void 0:t.appId)&&i&&(t=u(c({},t),{appId:TR}));const n=null==t?void 0:t.serviceConfigMode,r=function(e,t){return"remote"===e||"local-only"===e?e:t?"local-only":"remote"}(n,i);void 0!==n&&"remote"!==n&&"local-only"!==n&&ss.warn("[VePlayer.prepare] Invalid serviceConfigMode; using the environment default.");const o=function(e){var t,i;const n=null==(t=null==e?void 0:e.strategies)?void 0:t.preload,r="boolean"==typeof n;if(!n||!r&&(null==n?void 0:n.disabled))return e;const o=r?{}:n;return u(c({},e),{strategies:u(c({},e.strategies),{preload:u(c({},o),{[AU]:!0,config:u(c({},null!=(i=null==o?void 0:o.config)?i:{}),{[AU]:!0})})})})}(u(c({},t),{serviceConfigMode:r}));if(yB.shouldCheckLicense())try{yB.hasInitVeStrategy=!0;const e=yield yB.checkLicenseStatus(),t=yield yB.checkLicense();if(e===bA.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===EA.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(dF){return void ss.error(dF.message)}else yB.hasInitVeStrategy=!0;yield yA.init(o)}))}static setPreloadScene(e,t){return yA.setPreloadScene(e,t)}static get preloader(){return yA.preloader}static get preloaderStatus(){return yA.preloaderStatus}static addPreloadList(e){return KU(e,yB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||ss.warn("[addPreloadList] resolved preloadList is empty"),yA.addPreloadList(e))))}static setPreloadList(e){return KU(e,yB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||ss.warn("[setPreloadList] resolved preloadList is empty"),ss.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),yA.setPreloadList(e))))}static setLicenseConfig(e){return CA.setLicenseConfig(e)}static checkLicense(){return CA.checkLicense()}static checkModuleList(){return CA.checkModuleList()}static checkLicenseStatus(){return CA.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return CA.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return d(this,null,(function*(){try{const i={hls:Hw.HLSEncrypt,mp4:Hw.MP4Encrypt,dash:Hw.DASH};if(!t||!i[t])return void ss.warn("param of streamType is invalid");const n=(new Date).getTime().toString(),r="mp4"===t?yield Kw.loadMp4Encrypt(uA):yield uA.loadPlugins(i[t]);return null==r?void 0:r.generateEncryptInfo(e,n)}catch(i){ss.error("generate encrypt info error: ",i)}}))}assertLiteConfig(e){sB(e)}_init(e,t){return d(this,null,(function*(){var i;if(yB.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new Rr,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const n=yB.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield yB.checkModuleList():Object.values(SA);this.playerData=hr.observe(new kA(u(c({},e),{licensSupportModuleList:n}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(NA.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins();this.createPlayer(t).catch((e=>{if("VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))return ss.error("createPlayer error:",e),void this.emit(FA.ERROR,e);throw e})),this._initI18N(this.playerData.languageData),this._originConfigs={autoBitrateOpts:{enable:null==(i=null==e?void 0:e.autoBitrateOpts)?void 0:i.enable},useSoftDecoding:null==e?void 0:e.useSoftDecoding}}))}_initSdkPlugins(){kU.init(this);[...this.sdkPlugins].map((e=>kU.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new js,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(MA.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new cA,this.updateUmdLoader(this.sdkUmdLoader,e)}updateUmdLoader(e,t){const{umdUrlMap:i,region:n,userRegion:r,pluginPublicPath:o,plugins:a=[]}=t;e.failCallback=(e,t)=>this.umdLoadErr(e,t),i&&"object"==typeof i&&e.updateBackupMap(t.umdUrlMap),e.region=n,e.userRegion=r,o&&"string"==typeof o&&(e.customPluginPublicPath=o),e.importedPlugins=a}checkVodLogOptions(){var e;const{isLive:t,configs:i}=this.playerData,n=$s(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=yB.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==n?void 0:n.line_app_id)){const e={errorType:"log",errorCode:yR.VOD_LOG_NOT_CONFIGURED.code,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0};this.delayError.push(e)}}}umdLoadErr(e,t){this.emit(NA.UMD_LOAD_FAIL,{name:e,error:t})}_onRepeat(){const{urlExpireTimestamp:e,urlExpireDiff:t=60}=this.playerData.urlCheckData;Math.round((new Date).getTime()/1e3)>=e-t&&(this.playerData.urlCheckData.urlExpireTimestamp=qa,this._emitExpireEvent("time"))}_emitExpireEvent(e="error",t){const i=Math.round((new Date).getTime()/1e3),n={errorCode:-499897,errorType:"network",errorMessage:"url expire",url:this.playerData.getCurrentUrl(),httpCode:403,version:"1.18.0",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,ss.warn("media is expired, ",n),this.emit(FA.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,ss.warn("media is expired, ",n),this.emit(FA.MEDIA_EXPIRED,n))}on(e,t){this._emitter.on(e,t)}emit(e,t){this._emitter.emit(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}renderDom({id:e,root:t}){const i=document.createElement("div");this.playerContainer=i;const n=t||document.querySelector(`#${e}`);n&&(n.appendChild(i),this.mountingDom=n)}renderPoster(){if(!this.playerContainer)return;const{poster:e="",width:t,height:i}=this.playerData.options;("string"==typeof e?e:null==e?void 0:e.poster)&&(this.playerContainer.style.cssText=`background: url("${e}");\n background-size: cover;\n width:${t?t+"px":"100%"};\n height:${i?i+"px":"100%"};\n `)}getDefinitionConfig(){var e;const{current:{lineId:t},isVidEncrypt:i,configs:n,options:r}=this.playerData,o="hls"===(this.playerData.getCurrentStreamType()||Ts(null==n?void 0:n.getVideoByToken))&&i&&!!(null==(e=$s(r,"EncryptHlsPlugin"))?void 0:e.keyToken);let a=this.playerData.getDefinitionListByLineId(t).map((e=>o?function(e,t){const i=c({},e);return t.forEach((e=>delete i[e])),i}(e,["secretKey","playAuth"]):e)),s=this.playerData.current.definition;return this.playerData.isOpenABR()&&(s=this.playerData.defaultDefinition,a=(null==a?void 0:a.length)&&!this.adapter.needAbrAutoDefinition()?a.filter((e=>!this.playerData.isAutoDefinition(e.definition))):a),{defaultDefinition:s,list:a}}checkLicenseCallback(){return d(this,null,(function*(){var e,t,i,n,r,o,a,s,l,h,d,f,p;const g=yield yB.checkLicense(),y=yield yB.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:y,licenseType:g},y===bA.LICENSE_STATUS_EXPIRED)CA.renderLogo(this.playerContainer),!this.playerData.isOpenABR()&&(null==(t=null==(e=null==this?void 0:this._originConfigs)?void 0:e.autoBitrateOpts)?void 0:t.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(n=null==(i=this.playerData.configs)?void 0:i.adaptRange)?void 0:n.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===yB.hasInitVeStrategy&&this.emit(NA.LICENSE_STATUS_WARNING,vR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(y!==bA.LICENSE_STATUS_OK){null==(r=this.player.plugins.controls)||r.destroy(),null==(o=this.player.plugins.play)||o.destroy(),null==(a=this.player.plugins.sdkdefinitionplugin)||a.hide(),null==(s=this.player.plugins.definitionmobileplugin)||s.destroy(),null==(l=this.player.media)||l.removeAttribute("src");const e=u(c({errorType:mR.license},y===bA.LICENSE_STATUS_INVALID?{errorCode:yR.LICENSE_STATUS_INVALID.code,errorMessage:yR.LICENSE_STATUS_INVALID.message}:{errorCode:yR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:yR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else g===EA.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(d=null==(h=this._originConfigs)?void 0:h.autoBitrateOpts)?void 0:d.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(p=null==(f=this.playerData.configs)?void 0:f.adaptRange)?void 0:p.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===yB.hasInitVeStrategy&&this.emit(NA.LICENSE_STATUS_WARNING,vR.BASE_LICENSE_NOT_SUPPORT_PRELOAD))}))}setPluginConfig(e){var t,i,n,r,o;const{apiMap:a,configs:s,unionInfo:l,playList:h,useHlsPluginForSafari:d,isMobile:f}=this.playerData,p=this.playerData.getCurrentStreamType()||Ts(null==s?void 0:s.getVideoByToken),g=$s(s,"EncryptHlsPlugin"),y=$s(e,"EncryptHlsPlugin"),v=$s(s,"Mp4EncryptPlayer"),m=$s(e,"Mp4EncryptPlayer"),_=$s(s,"DASHPlugin"),E=$s(e,"DASHPlugin"),T=$s(s,"vodLogOpts"),S=(null==(t=yB.ttDramaEnv)?void 0:t.clientKey)?{appVersion:yB.ttDramaEnv.appVersion,clientKey:yB.ttDramaEnv.clientKey,line_app_id:TR,line_user_id:Rs(yB.ttDramaEnv.clientKey)}:{},b=!!(null==(i=null==h?void 0:h[0])?void 0:i.kid)||!!g;g&&(e.EncryptHlsPlugin=c(c(c({playDomain:a.playDomain,getKeyType:"TOP",preferMMS:!0,preferMMSStreaming:!0},f||!il||d?{}:{useHls:!1}),y||{}),g)),v&&(e.Mp4EncryptPlayer=c(c({playDomain:a.playDomain,preferMMS:!0,getKeyType:"TOP"},m||{}),v)),_&&(e.DASHPlugin=c(c({playDomain:a.playDomain,getKeyType:"TOP"},E||{}),_));const{vid:C}=s,{encryptSessionId:k,current:I,drmType:P}=this.playerData,{kid:D,secretKey:w}=I;if(P===or.PRIVATE_ENCRYPT_UPGRADE&&k&&w&&("hls"===p?e.EncryptHlsPlugin=c(c({vid:C,kid:D,useUnionInfoDRM:!0,sessionId:k,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:w,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===p?e.DASHPlugin=c(c({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:C,kid:D,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,sessionId:k},E||{}),_||{}):"mp4"===p&&(e.Mp4EncryptPlayer=c(c({vid:C,kid:D,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:k,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,preferMMS:!0},m||{}),v||{}))),s.privateDrmAuthToken&&s.kid&&l&&("hls"===p?e.EncryptHlsPlugin=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===p?e.DASHPlugin=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain},E||{}),_||{}):"mp4"===p&&(e.Mp4EncryptPlayer=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0},m||{}),v||{}))),T||S.clientKey){ss.log("codec",this.playerData.codec);const t=nl(this.userRegion,this.region),i=null==t?void 0:t.__LOG_CUSTOM_REGION__,n=null==t?void 0:t.__LOG_CHANNEL_DOMAIN__;e.vodLogOpts=c(c(u(c(c({vtype:(p||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:b?1:0,playerVersion:"1.18.0",channel:null==t?void 0:t.__LOG_CHANNEL__,needXhrCheck:!0,enableTeaWebId:!0},i?{trackerConfig:{log_from_region:null==t?void 0:t.__LOG_CUSTOM_REGION__}}:{}),n?{channelDomain:n}:{}),{ext:this.vodLogCommon}),S),T||{})}null==(n=this.getSdkPlugin("Abr"))||n.applyAbrConfig(e),null==(r=this.getSdkPlugin("AdaptRange"))||r.applyRangeConfig(e),null==(o=this.getSdkPlugin("Strategy"))||o.applyFinalStrategy(e)}detectCodec(e){return d(this,null,(function*(){var t;try{const{LoadProbe:i}=(yield this.sdkUmdLoader.loadPlugins(Hw.StreamProbe))||{};if(i){const n=yield null==(t=new i)?void 0:t.parseUrl(e),{codec:r}=n||{};"bytevc1"===r?this.playerData.codec=tr.H265:"avc"===r&&(this.playerData.codec=tr.H264)}}catch(ds){ss.warn("detect codec error: ",ds)}}))}setDefaultConfigOptions(e){if(!this._isFirstCreated)return;const{defaultConfig:t,isHitDefault:i}=this.playerData;if(!t)return;const{volume:n,startTime:r,DanmuPlugin:o,LiveSubtitlesIconPlugin:a}=null!=t?t:{};n&&(e.volume=e.volume?u(c({},e.volume),{default:n}):n),i&&r&&(e.startTime=r)}getCurrentPlayerConfig(){var e,t;const{isLive:i,current:{lineId:n,definition:r}}=this.playerData,o={type:i?"live":"vod",isLive:i,definition:r,lineId:n,volume:null!=(e=this.player.volume)?e:.6};return i||(o.startTime=null!=(t=this.player.currentTime)?t:0),c({},o)}getStreamType(){var e,t;return this.playerData.getCurrentStreamType()||Ts(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken)}_analyzeExtendPlugins(){var e;const{options:t}=this.playerData,i=t.extendPlugin||[],n=null!=(e=null==t?void 0:t.ignore)?e:[],r=[],o=[];return i.forEach((e=>{const t=BN(e);"inner"!==t.type||n[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}beforePlayerCreate(){return d(this,null,(function*(){const e=this._createPlayerPerf;e?yield e.measureAsync("beforePlayerCreate",(()=>d(this,null,(function*(){yield Promise.all([e.measureAsync("beforePlayerCreate.sdkPlugins",(()=>d(this,null,(function*(){yield kU.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>d(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([kU.beforePlayerCreate(this),this.prepareStrategies()]),this.updateConfigByStrategy())}))}getCreatePlayerPerfReport(){return this._lastCreatePlayerPerfReport}recordGetDramaInfoPerf(e){var t,i,n;if(null==e?void 0:e.perfInfo){this._getDramaInfoPerfRecords=this._getDramaInfoPerfRecords||[],this._getDramaInfoPerfRecords.push(e),this._markGetDramaInfoClientPerf(e);try{null==(n=null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.onGetDramaInfoPerf)||n.call(i,e)}catch(r){ss.error("onGetDramaInfoPerf callback error:",r)}}}getDramaInfoPerfRecords(){return[...this._getDramaInfoPerfRecords||[]]}getLastDramaInfoPerf(){const e=this._getDramaInfoPerfRecords||[];return e[e.length-1]}_markGetDramaInfoClientPerf(e){if(!this._isCollectingCreatePlayerPerf||!this._createPlayerPerf)return;const t=e.perfInfo,i=(e,t)=>{var i;"number"==typeof t&&(null==(i=this._createPlayerPerf)||i.markDuration(`beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB.perfInfo.${e}`,t))};i("prepareCost",t.prepare_cost),i("requestCost",t.request_cost),i("parseCost",t.parse_cost),i("totalCost",t.total_cost)}prepareStrategies(){return d(this,null,(function*(){if(yield yA.prepare()){const{plugins:e,pluginConfiguration:t}=yA.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(yA.isReady()){const e=yA.getStrategyRecommendations(),{result:t}=e;if(ss.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[hA.H265]){const{configs:e}=this.playerData;if(!e)return;const{url:i,codec:n}=e,r=this.playerData.playList||[],o=r.filter((e=>!e.codec||e.codec===tr.UNKNOWN)),a=r.filter((e=>e.codec===tr.H264)),s=r.filter((e=>e.codec===tr.H265)),l=t[hA.H265].enableH265Hardware,h=er(l?s.concat(a).concat(o):a.concat(o).concat(s),"definition"),d=!l&&!!i&&n===tr.H265&&h.length>0;this.playerData.initPlayData(u(c({},this.playerData.configs),{url:d?null:i,codec:d?tr.UNKNOWN:n,playList:h})),ss.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;yB.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),kU.afterPlayerCreate(this)}_setVeError(){var e;const t=this.playerData.configs,i={oriErrRetryCount:t.oriErrRetryCount,oriErrRetryCycle:t.oriErrRetryCycle,oriErrRetryBaseDelay:t.oriErrRetryBaseDelay,oriErrMaxTotalRetry:t.oriErrMaxTotalRetry,enableOriErrRetry:t.enableOriErrRetry,needSyncAnalyzeError:t.needSyncAnalyzeError,analyzeTimeout:t.analyzeTimeout,clientKey:null==(e=yB.ttDramaEnv)?void 0:e.clientKey};this.veErrorIns=new xR(this.player,i)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(FA.ERROR,e)})),this.delayError=[]}_emitDelayEvent(){this.player&&this.delayEvents.forEach((e=>{const{name:t,payload:i}=e||{};t&&this.emit(t,i)})),this.delayEvents=[]}_setPlayerInfo(){this.player&&(this.player.playerVersion="1.18.0",this.player.vtype=this.getVtype())}getVtype(){var e,t,i;const n=this.getStreamType()||Ts(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),r=Ur.isMSE(this.player.media);return!this.player.playerType&&(this.player.playerType=n,"hls"===(null==n?void 0:n.toLowerCase())&&(null==(i=this.player)?void 0:i.vodLogger))?r?"HLS_MSE":"HLS":n.toUpperCase()}_mountingPlayerPanel(e){var t;const{options:i,isLive:n}=this.playerData;this.player&&e&&(this.mobilePanel=new FN({config:null!=(t=i.panel)?t:{mode:n?$a.INNER:$a.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_onPlayerRebuild(){if(!this._publicPlayNextOperation&&!gB.hasActiveIdentitySwitch(this))return this.createPlayer()}_getPlayerRebuildListener(){return this._playerRebuildListener||(this._playerRebuildListener=()=>this._onPlayerRebuild()),this._playerRebuildListener}_bindPlayerEvents(){var e;if(!this.player)return;this.player.on(NA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.once(FA.READY,this._emitDelayError.bind(this)),this.player.once(FA.READY,this._emitDelayEvent.bind(this)),this.player.on(FA.ERROR,this._onError),this.player.on(kR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(MA.PRELOAD_INFO,this._onMp4PreloadInfo)}_onMediaExpiredAction(){var e,t;if(this.emitExpireTimestamp=Math.round((new Date).getTime()/1e3),(null==(e=this.playerData)?void 0:e.onMediaExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onMediaExpired)){const e=Ys(this.playerData.onMediaExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateMediaSource(e)))}}updateMediaSource(e){try{this.assertLiteConfig(e)}catch(r){return Promise.reject(r)}const{url:t,playList:i,getVideoByToken:n}=e||{};return t||(null==i?void 0:i.length)?new Promise(((t,n)=>{this.playerData.updateConfigs(e),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData();const r=this.playerData.getCurrentUrl();if(this.player.isError||this.player.state<6&&Kr.isWeixin&&Kr.os.isIos){if(!(null==i?void 0:i.length))return this.playNext(c({},e),!1);{const t=this.playerData.current.definition,n=i.find((e=>e.definition===t));if(n&&n.url)return this.playNext(u(c({},e),{url:n.url}),!1)}}else{this.player.setConfig(u(c({},e),{url:r,definition:this.getDefinitionConfig()}));const i=this.player.switchURL(r,{seamless:!0});i&&i.then?(i.then((()=>t(void 0))),i.catch((()=>n()))):t(void 0)}})):(null==n?void 0:n.playAuthToken)?this.updateAuthToken(n):void 0}onTokenExpiredAction(){var e,t;if((null==(e=this.playerData)?void 0:e.onTokenExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onTokenExpired)){const e=Ys(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(Wo).filter((e=>e!==Qr)),t=[...Object.values(MA),...Object.values(NA),...e];[...new Set(t.filter((e=>"string"==typeof e)))].forEach((e=>{"string"==typeof e&&this.player.on(e,((...t)=>{this._emitter.emit(e,...t)}))})),this.player.on("hlsAudioTracksUpdated",(e=>{this._applyAudioPreference(e.audioTracks),this._emitter.emit(NA.AUDIO_TRACKS_UPDATED,e)})),this.player.on("hlsAudioTrackSwitched",(e=>{var t,i,n,r,o;const a=this._getHlsInstance(),s=null==(t=null==a?void 0:a.audioTracks)?void 0:t.find((t=>t.id===e.id));if(this._suppressAudioTrackMemory)this._clearSuppressAudioTrackMemory();else{s&&(this._lastSelectedAudioTrack=s);const e=null!=(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.audioTrackSwitchSeekOffset)?r:.1,t=null==(o=this.player)?void 0:o.media;e>0&&t&&!t.paused&&isFinite(t.currentTime)&&(t.currentTime+=e)}this._emitter.emit(NA.AUDIO_TRACK_CHANGE,u(c({},e),{audioTrack:s}))})),this._bindNativeAudioTrackEvents()}_bindNativeAudioTrackEvents(){var e,t;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;i&&(i.addEventListener("addtrack",this._onNativeAddTrack),i.addEventListener("change",this._onNativeTrackChange),i.addEventListener("removetrack",this._onNativeAddTrack))}_mountingExtendMethods(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}_getHlsInstance(){var e,t,i;const n=null==(e=this.player)?void 0:e.plugins;return(null==(t=null==n?void 0:n.encrypthlsplugin)?void 0:t.hls)||(null==(i=null==n?void 0:n.hls)?void 0:i.hls)}_applyAudioPreference(e){var t,i,n,r;if(!(null==e?void 0:e.length))return;const o=this._getHlsInstance();if(!o)return;const a=null!=(r=null!=(n=this._lastSelectedAudioTrack)?n:null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference)?r:{};if(0===Object.keys(a).length)return;this._setSuppressAudioTrackMemory();const s=o;if("function"==typeof s.setAudioOption)s.setAudioOption(zA(a));else{const t=a.lang;if(!t)return void this._clearSuppressAudioTrackMemory();const i=e.findIndex((e=>{var i;return(null==(i=e.lang)?void 0:i.toLowerCase())===t.toLowerCase()}));-1!==i&&o.audioTrack!==i?o.audioTrack=i:this._clearSuppressAudioTrackMemory()}}_setSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!0,null!==this._suppressAudioTrackMemoryTimer&&clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=setTimeout((()=>{this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null}),2e3)}_clearSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!1,null!==this._suppressAudioTrackMemoryTimer&&(clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=null)}_applyAudioPreferenceNative(e){var t,i,n;if(!(null==e?void 0:e.length))return;const r=[this._lastSelectedAudioTrack,null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference];for(const o of r){if(!o)continue;const t=o.id,i=o.lang,r=o.name;if(void 0===t&&!i&&!r)continue;let a=-1;for(let o=0;o<e.length;o++){const s=e[o];if((void 0===t||o===Number(t))&&!(i&&(null==(n=s.language)?void 0:n.toLowerCase())!==i.toLowerCase()||r&&s.label!==r)){a=o;break}}if(-1!==a)return void $A(e,a)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(NA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.off(FA.ERROR,this._onError),this.player.off(kR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(MA.PRELOAD_INFO,this._onMp4PreloadInfo)}changePluginsIcon(e,t){var i;if(!this.player)return;const n=this.player.getPlugin(e);if(!n||!(null==n?void 0:n.root))return;const r=Ur.hasClass(null==n?void 0:n.parent,"panel-icon-svg")?null==(i=null==n?void 0:n.parent)?void 0:i.parentNode:null==n?void 0:n.root;r&&(t?Ur.show(r,"block"):Ur.hide(r))}getSdkPlugin(e){var t;const i=null==(t=this._sdkPlugins)?void 0:t[e.toLowerCase()];return i&&i.pluginName?i:null}switchAuthToken(e,t=!0){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}return this._performAuthTokenSwitch(e,t)}_switchAuthToken(e,t,i){return this._performAuthTokenSwitch(e,t,i).then((()=>{i&&gB.commitIdentitySwitch(this,i)})).catch((e=>{throw i&&gB.rollbackIdentitySwitch(this,i),e}))}_performAuthTokenSwitch(e,t,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken");return r&&this.player?this._runDestroyableSourceSwitch((o=>r.updateAuthToken(e,t).then((()=>(o(),this._playerPlayNext(n,i)))).then((()=>{})))):(ss.error("current is not playAuthToken play or player not created"),Promise.reject())}updateAuthToken(e){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}const t=this.getSdkPlugin("AuthToken");return new Promise(((i,n)=>{t&&this.player?t.updateAuthToken(e,!1).then((()=>{if(this.player.isError)this._playerPlayNext(this.player.currentTime).then((()=>i())).catch((()=>n()));else{const e=this.playerData.getCurrentUrl();this.player.setConfig({url:e,definition:this.getDefinitionConfig()});const t=this.player.switchURL(e,{seamless:!0});t&&t.then?(t.then((()=>i())),t.catch((()=>n()))):i()}})).catch((e=>n(e))):(ss.error("current is not playAuthToken play or player not created"),n())}))}_playerPlayNext(e=0,t){const i=this.player;return new Promise(((n,r)=>{var o,a,s;const l=i.paused&&!i.isError;i.addClass(Pa.ENTER);const h=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),d=u(c(c({},this.playerData.options),this._getDramaConfigPatchForPlayer()),{definition:this.getDefinitionConfig(),startTime:e,autoplay:!0,url:h});d.poster&&i.plugins.poster&&i.plugins.poster.update(d.poster),this.setPluginConfig(d);let f=!t,p=!1,g=()=>{};const y=[],v=(e,t)=>{y.push([e,t]),i.once(e,t)},m=e=>{p||(p=!0,g(),(()=>{for(const[e,t]of y)i.off(e,t);y.length=0})(),e())};g=this._registerSourceSwitchAborter((e=>{m((()=>r(e)))}));const _=(e,t)=>{const i=(...n)=>{f?m((()=>t(...n))):v(e,i)};v(e,i)};_(FA.ERROR,(e=>r(e))),_(FA.CANPLAY,(()=>{l&&i.pause(),n(!0)})),v(FA.EMPTIED,(()=>{!f&&t&&(f=gB.armIdentitySwitch(this,t,i))}));try{if(i.plugins.dashplugin){const e=c(c({},$s(i.config,"DASHPlugin")),this.playerData.options.DASHPlugin||{});e.dashOpts=this.playerData.dashOpts,e.vid=null==(a=null==(o=this.playerData.dashOpts)?void 0:o.Data)?void 0:a.Vid,i.plugins.drm&&(null==(s=i.plugins.drm)||s.restart()),i.setConfig(d),i.plugins.dashplugin.next(i.currentTime,"NEXT",e)}else i.playNext(d)}catch(dF){m((()=>r(dF)))}}))}get src(){var e,t;return(null==(e=this.player)?void 0:e.currentSrc)||(null==(t=this.player)?void 0:t.src)}set src(e){this.player&&(this.player.src=e)}switchURL(e){try{this.assertLiteConfig({url:e})}catch(n){return Promise.reject(n)}const t=this.player.switchURL(e,!1),i=this.player.currentTime;return t&&t.then?t:new Promise((e=>{const t=this.player.paused&&!this.player.isError,n=()=>{this.player.currentTime=i,t&&this.player.once(FA.CANPLAY,(()=>{this.player.pause()})),e()};Kr.os.isAndroid?this.once(FA.TIME_UPDATE,(()=>{n()})):this.once(FA.CANPLAY,(()=>{n()})),this.player.play()}))}next(e,t=!0){try{this.assertLiteConfig(e)}catch(i){return Promise.reject(i)}return this._publicPlayNextOperation||gB.hasActiveIdentitySwitch(this)?Promise.reject(this._createPlayNextInProgressError()):this._next(e,t)}_next(e,t=!0,i){var n;const r=this._lifecycleGeneration||0,o=t?0:this.player.currentTime,a=this.playerData.configs,s=this._applyIncomingIdentityAliases(c(u(c({},a),{startTime:o,autoplay:!0}),e),e);(null==(n=null==e?void 0:e.getVideoByToken)?void 0:n.playAuthToken)&&(s.streamType=Ts(null==e?void 0:e.getVideoByToken)||nr.MP4);const l=gB.beginIdentitySwitch(this,gU(s),this.player,t,i);return l?this._teardown(!0).then((()=>{if(this._isStaleLifecycleGeneration(r))throw this._createDestroyedPlaybackSwitchError();return this._init(s,l)})).catch((e=>{if(gB.rollbackIdentitySwitch(this,l),this._isDestroyedPlaybackSwitchError(e))throw e;if(ss.error("next_error",e),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))throw e})):Promise.reject(this._createPlayNextInProgressError())}playNext(e,t=!0){try{this.assertLiteConfig(e)}catch(s){return Promise.reject(s)}if(this._publicPlayNextOperation||gB.hasActiveIdentitySwitch(this))return Promise.reject(this._createPlayNextInProgressError());const i={};this._publicPlayNextOperation=i;const n=this.player;try{n.emit(MA.PLAY_NEXT_START)}catch(s){return this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null),Promise.reject(s)}let r,o=null;try{const i=this._createDramaPlayNextCandidateConfig(e);if(o=gB.beginIdentitySwitch(this,gU(i),this.player,t),!o)throw this._createPlayNextInProgressError();this._lastSelectedAudioTrack=null,this._clearSuppressAudioTrackMemory(),this._playNextPending=!0,r=this._playNext(e,t,o)}catch(s){o&&gB.rollbackIdentitySwitch(this,o),r=Promise.reject(s)}const a=r.catch((e=>{throw o&&gB.rollbackIdentitySwitch(this,o),e}));return o?o.settled.then((()=>{this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null)})):a.finally((()=>{this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null)})).catch((()=>{})),a.finally((()=>{n.emit(MA.PLAY_NEXT_END)})).catch((()=>{})),a}_createPlayNextInProgressError(){return new Error("VePlayer playNext is already in progress")}_registerSourceSwitchAborter(e){this._sourceSwitchAborters||(this._sourceSwitchAborters=new Set);const t=this._sourceSwitchAborters;return t.add(e),()=>{t.delete(e),0===t.size&&this._sourceSwitchAborters===t&&(this._sourceSwitchAborters=void 0)}}_abortSourceSwitches(){const e=this._sourceSwitchAborters;if(this._sourceSwitchAborters=void 0,!e)return;const t=this._createDestroyedPlaybackSwitchError();for(const i of e)i(t)}_runDestroyableSourceSwitch(e){return new Promise(((t,i)=>{let n=!1,r=()=>{};const o=()=>{if(n)throw this._createDestroyedPlaybackSwitchError()},a=e=>{n||(n=!0,r(),e())};r=this._registerSourceSwitchAborter((e=>{a((()=>i(e)))}));try{Promise.resolve(e(o)).then((e=>a((()=>t(e)))),(e=>a((()=>i(e)))))}catch(dF){a((()=>i(dF)))}}))}_createDestroyedPlaybackSwitchError(){return new Error("VePlayer destroyed during playback switch")}_isDestroyedPlaybackSwitchError(e){return e instanceof Error&&"VePlayer destroyed during playback switch"===e.message}_isStaleLifecycleGeneration(e){return e!==(this._lifecycleGeneration||0)}_cancelStalePlayerCreation(){this._isCollectingCreatePlayerPerf=!1}_discardStalePlayer(e){var t;if(e){this.player===e&&(this.player=null);try{const i=null==(t=e.destroy)?void 0:t.call(e);(null==i?void 0:i.catch)&&i.catch((()=>{}))}catch(i){}}}updatePlayNextSubtitleConfig(e,t){var i,n,r,o;const a=$s(e,"Subtitle"),s=Array.isArray(null==a?void 0:a.list);if(!s&&!t)return;const l=s?a.list:[],h=u(c(c(c({},$s(this.playerData.options,"Subtitle")||{}),$s(this.playerData.configs,"Subtitle")||{}),a||{}),{list:l});e.Subtitle=h,this.playerData.updateConfigs({Subtitle:h}),this.playerData.options.Subtitle=h,null==(o=null==(r=null==(n=null==(i=this.player)?void 0:i.plugins)?void 0:n.subtitle)?void 0:r.updateSubtitles)||o.call(r,l)}_playNext(e,t=!0,i){var n,r,o;if(!e)return Promise.reject();const{url:a,playList:s,getVideoByToken:l}=e,h=this.player.paused&&!this.player.isError,d=t?0:this.player.currentTime;if(a||(null==s?void 0:s.length)){this._applyIncomingIdentityAliases(this.playerData.configs,e),this.playerData.updateConfigs(e),this.playerData.initPlayData(e);const n=this.adapter.canOpenAbr()&&this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),r=this.player,o=r.state,a=this.getDefinitionConfig(),s=u(c({startTime:d},e),{url:n,definition:a});return this.updatePlayNextSubtitleConfig(s,t),this.setPluginConfig(s),new Promise(((e,t)=>{let n=!1,a=!1,l=()=>{};const c=[],u=(e,t)=>{const i=(...i)=>{n||e===FA.EMPTIED?t(...i):u(e,t)};c.push([e,i]),r.once(e,i)},d=e=>{a||(a=!0,l(),(()=>{var e;for(const[t,i]of c)null==(e=r.off)||e.call(r,t,i);c.length=0})(),e())};l=this._registerSourceSwitchAborter((e=>{d((()=>t(e)))})),u(FA.ERROR,(e=>{d((()=>t(e)))})),u(FA.CANPLAY,(()=>{d((()=>{6===o&&h?r.pause():6!==o&&r.config.autoplay&&r.play(),e(void 0)}))}));const f=()=>{n||(n=!i||gB.armIdentitySwitch(this,i,r))};c.push([FA.EMPTIED,f]),r.once(FA.EMPTIED,f);try{r.playNext(s)}catch(p){d((()=>t(p)))}}))}if(yB.ttDramaEnv){if(null==(n=e.getVideoByToken)?void 0:n.playAuthToken){if((this.playerData.getCurrentStreamType()||Ts(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||Ts(null==e?void 0:e.getVideoByToken)||"mp4"))return this._next(e,t,i)}const o=this._createDramaPlayNextCandidateConfig(e);return i?this.switchDramaEpisode(o,t,i):this.switchDramaEpisode(o,t)}if(null==l?void 0:l.playAuthToken){return(this.playerData.getCurrentStreamType()||Ts(null==(o=this.playerData.configs)?void 0:o.getVideoByToken))!==(e.streamType||Ts(null==e?void 0:e.getVideoByToken)||"mp4")?this._next(e,t,i):(this.playerData.updateConfigs(e),this._switchAuthToken(l,t,i))}return this._next(e,t,i)}_applyIncomingIdentityAliases(e,t){const i=e,n=t;for(const r of[["albumId","album_id"],["episodeId","episode_id","episodeID"]]){if(r.some((e=>Object.prototype.hasOwnProperty.call(n,e)))){for(const e of r)delete i[e];for(const e of r)Object.prototype.hasOwnProperty.call(n,e)&&(i[e]=n[e])}}return e}_createDramaPlayNextCandidateConfig(e){const t=this._applyIncomingIdentityAliases(this.playerData.getMergedConfigs(e),e);return Object.prototype.hasOwnProperty.call(e,"transcodeParam")&&(t.transcodeParam=e.transcodeParam),t}_getDramaConfigPatchForPlayer(){const e=this.playerData.configs,t=["albumId","album_id","episodeId","episode_id","episodeID"],i={};for(const n of t){const t=e[n];null!=t&&""!==t&&(i[n]=t)}return i}_buildDramaInvalidParamError(){const e=_R.INVALID_PARAM;return{errorType:mR.network,errorCode:e.code,veError:xR.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){return gU(e).albumId||""}_getDramaEpisodeIdFromConfig(e){return gU(e).episodeId||""}switchDramaEpisode(e,t=!0,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken"),o=gB.beginIdentitySwitch(this,gU(e),this.player,t,i);return o?r&&this.player?this._runDestroyableSourceSwitch((i=>r.updateDramaEpisode(t,e).then((()=>(i(),this._playerPlayNext(n,o)))).then((()=>{})))).then((()=>{gB.commitIdentitySwitch(this,o)})).catch((e=>{throw gB.rollbackIdentitySwitch(this,o),e})):(gB.rollbackIdentitySwitch(this,o),ss.error("switchDramaEpisode: AuthToken plugin or player not available"),Promise.reject(new Error("AuthToken plugin or player not available"))):Promise.reject(this._createPlayNextInProgressError())}_destroyPlayer(){return d(this,null,(function*(){var e,t,i;this._offPlayerEvents(),null==(e=this.veErrorIns)||e.destroy(),this.veErrorIns=null,yield null==(t=this.mobilePanel)?void 0:t.destroy(),yield null==(i=this.player)?void 0:i.destroy(),this.player=null}))}getPlayerInstance(){return this.player}getSoftDecodingOption(e,t,i){return d(this,null,(function*(){var n,r;const{enableH265Degrade:o,codec:a,configs:s,isLive:l}=this.playerData,c=function(e){var t,i;if(!(null==e?void 0:e.playAuthToken))return!1;const n=_s(null==e?void 0:e.playAuthToken),r=null!=(i=null==(t=null==n?void 0:n.FileType)?void 0:t.toLowerCase())?i:"video";return!!n&&("evideo"===r||"eaudio"===r)}(null==s?void 0:s.getVideoByToken),u=!!(s.enableMp4MSE||$s(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(a===tr.H265||c||(null==(n=null==s?void 0:s.autoBitrateOpts)?void 0:n.enable)));if(yB.shouldCheckLicense()&&(null==(r=this._originConfigs)?void 0:r.useSoftDecoding)&&!l)try{const e=yield yB.checkLicenseStatus();if(!(yield yB.checkLicenseModuleAuth(TA.SDK_VOD_PLAY,SA.H265)))throw this.emit(NA.LICENSE_STATUS_WARNING,e===bA.LICENSE_STATUS_EXPIRED?vR.EXPIRED_LICENSE_NOT_SUPPORT_265:vR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(dF){return void ss.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(Hw.XGVideo);if(null==e?void 0:e.isSupported()){if(a&&e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),u){const e=yield Kw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:tr.H264}}{this.emit(NA.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),ss.error("soft decode is not support by current browser")}}else if(o&&!a&&t&&(yield this.detectCodec(t)),this.playerData.isCurrentH265()&&!function(){const e=window.navigator.userAgent.toLocaleLowerCase(),t=/(iphone)/.test(e)||/(ipad)/.test(e);if(/(VivoBrowser)/.test(e)){const t=e.match(/VivoBrowser\/(\d+)?/);if((null==t?void 0:t[1])>=22)return!0}return!!(t||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"')))}())if(o){if(yB.shouldCheckLicense()&&!l)try{const e=yield yB.checkLicenseStatus();if(!(yield yB.checkLicenseModuleAuth(TA.SDK_VOD_PLAY,SA.H265)))throw this.emit(NA.LICENSE_STATUS_WARNING,e===bA.LICENSE_STATUS_EXPIRED?vR.EXPIRED_LICENSE_NOT_SUPPORT_265:vR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(dF){return void ss.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(Hw.XGVideo);if(null==e?void 0:e.isSupported()){if(null==e||e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,u){const e=yield Kw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:tr.H264}}{this.emit(NA.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),ss.error("soft decode is not support by current browser")}}else{this.emit(NA.NOT_SUPPORT_HARDWARE_DECODER);const e={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"};this.delayError.push(e),ss.error("h265 hardware decode is not supported by this browser")}return{}}))}setH265SoftPlayList(){if(this.playerData.isCurrentH265()){const e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((e=>{var t;return(null==(t=null==e?void 0:e.codec)?void 0:t.toLowerCase())===tr.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}changeDefinition(e){var t,i,n,r,o,a;if((null==(t=this.getDefinitionList())?void 0:t.length)<=1)return;const{sdkdefinitionplugin:s,definitionmobileplugin:l}=(null==(i=this.player)?void 0:i.plugins)||{};if(s||l)e!==this.playerData.current.definition&&(s?null==s||s.changeDefinition(e):l&&(null==l||l.changeDefinition(e)));else{let t;const{current:{lineId:i}}=this.playerData;t=this.playerData.getDefinitionListByLineId(i).find((t=>t.definition===e)),t||(t=null==(a=null==(o=null==(r=null==(n=this.player)?void 0:n.config)?void 0:r.definition)?void 0:o.list)?void 0:a.find((t=>(null==t?void 0:t.definition)===e))),t&&(this.player.changeDefinition(t),t.definition!==this.playerData.current.definition&&(this.playerData.current.definition=t.definition))}}getDefinitionList(){var e;const{sdkdefinitionplugin:t,definitionmobileplugin:i}=(null==(e=this.player)?void 0:e.plugins)||{};return t||i?(null==t?void 0:t.renderList)||(null==i?void 0:i.renderList):this.player.definitionList.map((e=>{var t;const i=this.playerData.isDefinitionMatch(e.definition,null==(t=this.player.curDefinition)?void 0:t.definition),n=e.url===this.player.url,r=e.url===this.player.src;return u(c({},e),{isDefinitionAuto:this.playerData.isAutoDefinition(e.definition),selected:i||(this.playerData.isOpenABR()&&Kr.os.isIos?r:n)})}))}getAudioTracks(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack;return n.audioTracks.map((t=>u(c({},t),{selected:t.id===e})))}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!(null==r?void 0:r.length))return[];const o=[];for(let a=0;a<r.length;a++){const e=r[a];o.push({id:a,name:e.label||e.language||String(a),lang:e.language,default:e.enabled,selected:e.enabled})}return o}getCurrentAudioTrack(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack,t=n.audioTracks.find((t=>t.id===e));return t?u(c({},t),{selected:!0}):null}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!r)return null;for(let o=0;o<r.length;o++){const e=r[o];if(e.enabled)return{id:o,name:e.label||e.language||String(o),lang:e.language,default:!0,selected:!0}}return null}switchAudioTrack(e){var t,i;const{id:n}=e,r=this._getHlsInstance();if(r)return void XA(r,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&$A(o,n)}get preLoadData(){var e;if(!this.player||!this.player.plugins)return{hit:0};const t=this.player.plugins.mp4encryptplayer;if(t&&t.preLoadData)return{hit:!0===t.hitpreload?1:0,duration:t.preLoadData.duration,length:t.preLoadData.byteLength};const i=(null==(e=this.player)?void 0:e.stat)||{};if(i.preLoadData){const{length:e,duration:t}=i.preLoadData,n={hit:e>0?1:0,length:e,duration:0};return t>=0&&(n.duration=t),n}return{hit:0,duration:0,length:0}}_initI18N(e){const{extraLangList:t,extendLangList:i}=e;null==t||t.forEach((e=>{La.use(e)})),La.extend(wU),i&&La.extend(i)}get musicMode(){}set musicMode(e){}get musicTimeScale(){}set musicTimeScale(e){}get musicList(){}set musicList(e){}musicAdd(e){}musicRandom(){}musicNext(){}musicPrev(){}musicSetIndex(e){}musicForward(){}musicBackward(){}musicRemove(e){}musicSetAbCycle(e,t,i,n){}musicRemoveAbCycle(){}getLogUserId(){var e,t,i;const n=null==(e=this.player)?void 0:e.vodLogger;if(n){const e=(null==(t=null==n?void 0:n.tracker)?void 0:t.getConfig())||{};return null==(i=null==e?void 0:e.user)?void 0:i.user_unique_id}}get region(){return this.playerData.region}get userRegion(){return this.playerData.userRegion}getPlugin(e){var t;return null==(t=this.player)?void 0:t.getPlugin(e)}getSubtitleList(){var e,t;const i=this.getPlugin("subtitle");return null!=(t=null==(e=null==i?void 0:i.config)?void 0:e.list)?t:[]}switchSubtitle(e){const t=this.getPlugin("subtitle");return t?t.switchSubTitle(e):Promise.reject(new Error("subtitle plugin is not registered"))}showSubtitle(){var e,t;const i=this.getPlugin("subtitle");if(i)if(i.curIndex>-1&&i.curItem)i.switchSubTitle(i.curItem);else{const n=null!=(t=null==(e=i.config)?void 0:e.list)?t:[];n.length>0&&i.switchSubTitle(n[0])}}hideSubtitle(){var e;const t=this.getPlugin("subtitle");null==(e=null==t?void 0:t.switchOffSubtitle)||e.call(t)}_teardown(e){return d(this,null,(function*(){var t;const i=this.player;e||(this._lifecycleGeneration=(this._lifecycleGeneration||0)+1,this._abortSourceSwitches(),gB.destroy(this,i)),yield this._destroyPlayer(),this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null,this._onRepeat=null),this.mountingDom&&this.mountingDom.contains(this.playerContainer)&&this.mountingDom.removeChild(this.playerContainer),null==(t=this._emitter)||t.removeAllListeners(),this._emitter=null,kU.destroy(this)}))}destroy(){return d(this,null,(function*(){yield this._teardown(!1)}))}};let vB=yB;vB.isMSESupported=Qs,vB.veStrategy=yA,vB.sdkVersion="1.18.0",vB.ttDramaEnv=null,vB.isMMSSupported=Js,vB.isRTMSupported=IA.isSupported,vB.hasInitVeStrategy=!1;const mB=vB;function _B(){return La}const EB="function"==typeof Buffer,TB=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),SB=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),bB=(e=>{let t={};return SB.forEach(((e,i)=>t[e]=i)),t})(),CB=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,kB=String.fromCharCode.bind(String),IB=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),PB=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),DB=e=>{let t,i,n,r,o="";const a=e.length%3;for(let s=0;s<e.length;){if((i=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=i<<16|n<<8|r,o+=SB[t>>18&63]+SB[t>>12&63]+SB[t>>6&63]+SB[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},wB="function"==typeof btoa?e=>btoa(e):EB?e=>Buffer.from(e,"binary").toString("base64"):DB,AB=EB?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;i<n;i+=4096)t.push(kB.apply(null,e.subarray(i,i+4096)));return wB(t.join(""))},RB=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?kB(192|t>>>6)+kB(128|63&t):kB(224|t>>>12&15)+kB(128|t>>>6&63)+kB(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return kB(240|t>>>18&7)+kB(128|t>>>12&63)+kB(128|t>>>6&63)+kB(128|63&t)},xB=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,OB=e=>e.replace(xB,RB),LB=EB?e=>Buffer.from(e,"utf8").toString("base64"):TB?e=>AB(TB.encode(e)):e=>wB(OB(e)),NB=(e,t=!1)=>t?IB(LB(e)):LB(e),MB=e=>{if(e=e.replace(/\s+/g,""),!CB.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i,n,r="";for(let o=0;o<e.length;)t=bB[e.charAt(o++)]<<18|bB[e.charAt(o++)]<<12|(i=bB[e.charAt(o++)])<<6|(n=bB[e.charAt(o++)]),r+=64===i?kB(t>>16&255):64===n?kB(t>>16&255,t>>8&255):kB(t>>16&255,t>>8&255,255&t);return r},UB=NB;var BB={};!function(e){e._getPrivFilters=function(){var e,t=/</g,i=/"/g,n=/'/g,r=/&/g,o=/\x00/g,a=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,s=/[&<>"'`]/g,l=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,c=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,u={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},h=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,d=/[\x00-\x1F\x7F\[\]{}\\"]/g,f=/[\x00-\x1F\x7F\[\]{}\\']/g,p=/url[\(\u207D\u208D]+/g,g=/['\(\)]/g,y=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,v={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},m=/(?::|&#[xX]0*3[aA];?|&#0*58;?|&colon;)/,_=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,E={Tab:"\t",NewLine:"\n"},T=function(e,t,i){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,i)},S=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function b(e){var t=e.split(m,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function C(t,i,n,r){return i=i||u,n=n||c,void 0===t?"undefined":null===t?"null":t.toString().replace(o,"�").replace(n,(function(t,n,o,a){return n?(n=Number(n[0]<="9"?n:"0"+n),r?S(n):128===n?"€":130===n?"‚":131===n?"ƒ":132===n?"„":133===n?"…":134===n?"†":135===n?"‡":136===n?"ˆ":137===n?"‰":138===n?"Š":139===n?"‹":140===n?"Œ":142===n?"Ž":145===n?"‘":146===n?"’":147===n?"“":148===n?"”":149===n?"•":150===n?"–":151===n?"—":152===n?"˜":153===n?"™":154===n?"š":155===n?"›":156===n?"œ":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":e.frCoPt(n)):i[o||a]||t}))}function k(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function I(e){return e.replace(p,(function(e){return"-x-"+e}))}function P(t){var i=b(t=e.yufull(C(t)));return i&&v[i.toLowerCase()]?"##"+t:t}return e={frCoPt:function(e){return null==e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":S(e)},d:C,yup:function(e){return(e=b(e.replace(o,"")))?C(e,E,null,!0).replace(_,"").toLowerCase():null},y:function(e){return T(e,s,(function(e){return"&"===e?"&amp;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"&#96;"}))},ya:function(e){return T(e,r,"&amp;")},yd:function(e){return T(e,t,"&lt;")},yc:function(e){return T(e,l,(function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"}))},yavd:function(e){return T(e,i,"&quot;")},yavs:function(e){return T(e,n,"&#39;")},yavu:function(e){return T(e,a,(function(e){return"\t"===e?"&#9;":"\n"===e?"&#10;":"\v"===e?"&#11;":"\f"===e?"&#12;":"\r"===e?"&#13;":" "===e?"&#32;":"="===e?"&#61;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"`"===e?"&#96;":"�"}))},yu:encodeURI,yuc:encodeURIComponent,yubl:function(t){return v[e.yup(t)]?"x-"+t:t},yufull:function(t){return e.yu(t).replace(y,(function(e,t){return"//["+t+"]"}))},yublf:function(t){return e.yubl(e.yufull(t))},yceu:function(e){return e=C(e),h.test(e)?e:";-x:'"+I(e.replace(f,k))+"';-v:"},yced:function(e){return I(C(e).replace(d,k))},yces:function(e){return I(C(e).replace(f,k))},yceuu:function(e){return P(e).replace(g,(function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"}))},yceud:function(e){return P(e)},yceus:function(e){return P(e).replace(n,"\\27 ")}}};var t=e._privFilters=e._getPrivFilters();function i(e,i,n){return t.yubl(i((n||t.yufull)(e)))}e.inHTMLData=t.yd,e.inHTMLComment=t.yc,e.inSingleQuotedAttr=t.yavs,e.inDoubleQuotedAttr=t.yavd,e.inUnQuotedAttr=t.yavu,e.uriInSingleQuotedAttr=function(e){return i(e,t.yavs)},e.uriInDoubleQuotedAttr=function(e){return i(e,t.yavd)},e.uriInUnQuotedAttr=function(e){return i(e,t.yavu)},e.uriInHTMLData=t.yufull,e.uriInHTMLComment=function(e){return t.yc(t.yufull(e))},e.uriPathInSingleQuotedAttr=function(e){return i(e,t.yavs,t.yu)},e.uriPathInDoubleQuotedAttr=function(e){return i(e,t.yavd,t.yu)},e.uriPathInUnQuotedAttr=function(e){return i(e,t.yavu,t.yu)},e.uriPathInHTMLData=t.yu,e.uriPathInHTMLComment=function(e){return t.yc(t.yu(e))},e.uriQueryInSingleQuotedAttr=e.uriPathInSingleQuotedAttr,e.uriQueryInDoubleQuotedAttr=e.uriPathInDoubleQuotedAttr,e.uriQueryInUnQuotedAttr=e.uriPathInUnQuotedAttr,e.uriQueryInHTMLData=e.uriPathInHTMLData,e.uriQueryInHTMLComment=e.uriPathInHTMLComment,e.uriComponentInSingleQuotedAttr=function(e){return t.yavs(t.yuc(e))},e.uriComponentInDoubleQuotedAttr=function(e){return t.yavd(t.yuc(e))},e.uriComponentInUnQuotedAttr=function(e){return t.yavu(t.yuc(e))},e.uriComponentInHTMLData=t.yuc,e.uriComponentInHTMLComment=function(e){return t.yc(t.yuc(e))},e.uriFragmentInSingleQuotedAttr=function(e){return t.yubl(t.yavs(t.yuc(e)))},e.uriFragmentInDoubleQuotedAttr=function(e){return t.yubl(t.yavd(t.yuc(e)))},e.uriFragmentInUnQuotedAttr=function(e){return t.yubl(t.yavu(t.yuc(e)))},e.uriFragmentInHTMLData=e.uriComponentInHTMLData,e.uriFragmentInHTMLComment=e.uriComponentInHTMLComment}(BB);const FB="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",HB={SLOW:.5,MODERATE:1,FAST:2},jB={SLOW:5,MODERATE:3.5,FAST:2},VB={style:{node:FB,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function KB(e,t){const i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((e=>{i.setAttribute(e,t[e])})),i}class GB{constructor(e){this.root=e.root,this.config=e,this.wrap=document.createElement("div"),this.img=document.createElement("img"),this.imgSrc="",this.root&&this.root.appendChild(this.wrap),this.moveTimer=null,this.blinkTimer=null,this.pauseAnimation=!1,this.observer=[]}_getWatermarkDom(){const{content:e="",fontFamily:t}=this.config,i=e,n="string"==typeof this.config.fontSize?`${this.config.fontSize}`:`${this.config.fontSize}px`,r=document.createElement("text");r.style.fontSize=n,r.style.whiteSpace="nowrap",t&&(r.style.fontFamily=t),r.innerHTML=BB.inHTMLData(i),document.body.appendChild(r);const o=KB("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.offsetWidth+2,height:r.offsetHeight}),a=KB("text",c({x:r.offsetWidth/2,y:r.offsetHeight/2,style:`\n fill:${this.config.fontColor};\n text-anchor: middle;\n alignment-baseline:middle;\n opacity: ${this.config.opacity};\n font-size: ${n};\n `},t?{"font-family":t}:{}));return a.innerHTML=BB.inHTMLData(i),document.body.removeChild(r),o.appendChild(a),"data:image/svg+xml;base64, "+UB((new XMLSerializer).serializeToString(o))}_startRender(){switch(this.pauseAnimation=!1,this.config.displayType){case 0:this._fixedRender();break;case 1:this._startMove();break;case 2:this._startBlink()}this.observer[0]=this._attrObserver(this.img,["src","class"],"img"),this.observer[1]=this._attrObserver(this.wrap,["class","style","id"],"node"),this.observer[2]=this._attrObserver(this.root,["class","style"],"wrap"),this.observer[3]=this._domObserver(this.wrap),this.observer[4]=this._domObserver(this.root),this.observer[5]=this._domObserver(this.root.parentElement,!0)}_startMove(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;const{offsetX:t,offsetY:i}=this._getOffset(),n=HB[this.config.tickerSpeed]||HB.MODERATE;let r=t,o=n,a=i,s=n;clearInterval(this.moveTimer),this.moveTimer=setInterval((()=>{if(this.pauseAnimation)return;const e=this._getOffsetThreshold();r+=o,a+=s,this.wrap.offsetWidth>this.img.offsetWidth&&r>this.wrap.offsetWidth&&(r=this.wrap.offsetWidth-this.img.offsetWidth),this.wrap.offsetHeight>this.img.offsetHeight&&a>this.wrap.offsetHeight&&(a=this.wrap.offsetHeight-this.img.offsetHeight),this.img.setAttribute("style",`position: relative;left:${r}px; top:${a}px`),r>=e.hRight&&(o=-n),r<=e.hLeft&&(o=n),a>=e.vBottom&&(s=-n),a<=e.vTop&&(s=n)}),30)}_startBlink(){const e=jB[this.config.tickerSpeed]||jB.MODERATE;clearInterval(this.blinkTimer),this._blinkRender(e,!0),this.blinkTimer=setInterval((()=>{this.pauseAnimation||this._blinkRender(e)}),1e3*e)}_randomBetween(e,t){const i=t-e+1;return Math.floor(Math.random()*i)+e}_fixedRender(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;this.img.setAttribute("style","");const{offsetX:t,offsetY:i}=this._getOffset(),n=jB[this.config.tickerSpeed];return n?this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${n}s linear infinite;`):this.img.setAttribute("style",`opacity: 1;transform: translate(${t}px, ${i}px);`)}_getOffset(){const{left:e,top:t,right:i,bottom:n}=this.config,{clientWidth:r,clientHeight:o}=this.wrap,{clientWidth:a,clientHeight:s}=this.img;let l=0,c=0;return void 0!==i&&r&&(l=r-a-i),void 0!==e&&r&&(l=e),void 0!==n&&o&&(c=o-s-n),void 0!==t&&o&&(c=t),{offsetX:l,offsetY:c}}_getOffsetThreshold(){const{clientWidth:e,clientHeight:t}=this.wrap,{clientWidth:i,clientHeight:n}=this.img;return{hLeft:e-i>=0?0:e-i,hRight:e-i>=0?e-i:0,vTop:t-n>=0?0:t-n,vBottom:t-n>=0?t-n:0}}_blinkRender(e,t){var i;if(!this.img||!(null==(i=this.wrap)?void 0:i.clientWidth))return;if(this.img.setAttribute("style","opacity: 0.1;"),t){const{offsetX:t,offsetY:i}=this._getOffset();return this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${e}s linear 1;`)}const n=this._getOffsetThreshold(),{clientWidth:r,clientHeight:o}=this.wrap,a=r?this._randomBetween(n.hLeft,n.hRight):0,s=o?this._randomBetween(n.vTop,n.vBottom):0;setTimeout((()=>{this.img.setAttribute("style",`opacity: 0.1;transform: translate(${a}px, ${s}px);animation: _xg_animation_blink ${e}s linear 1;`)}),10)}_attrObserver(e,t,i){if(!e||!this.wrap||!window.MutationObserver)return;const n=new window.MutationObserver((t=>{e&&this.wrap&&t.forEach((t=>{if("class"===t.attributeName&&e.getAttribute("class")!=VB.class[i]&&e.setAttribute("class",VB.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=VB.style[i]&&e.setAttribute("style",VB.style[i]),"img"===i&&"src"===t.attributeName){if(((null==e?void 0:e.getAttribute("src"))||"")!==this.imgSrc){const t=this._getWatermarkDom();this.wrap&&t&&(this.imgSrc=t,e.setAttribute("src",t))}}}))}));return n.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:t}),n}_domObserver(e,t){if(!e||!this.wrap)return;const i=new window.MutationObserver((i=>{e&&this.wrap&&i.forEach((i=>{i.removedNodes.forEach((i=>{if(!t)return e.appendChild(i);!e.getElementsByClassName(this.config.rootClassName).length&&e.appendChild(i)}))}))}));return i.observe(e,{childList:!0}),i}update(){const e=this._getWatermarkDom();this.wrap&&this.img&&e&&(this.imgSrc=e,this.img.setAttribute("src",e))}start(){if(!(this.root&&this.wrap&&this.img))return;clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.wrap.innerHTML="",this.wrap.setAttribute("style",FB);const e=this._getWatermarkDom();e&&(this.img.src=e,this.img.style.opacity="0",this.img.alt="",this.imgSrc=e,this.wrap.appendChild(this.img),setTimeout((()=>this._startRender())))}pause(){this.pauseAnimation=!0}resume(){this.pauseAnimation=!1}resize(){}destroy(){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.img=null,this.wrap.innerHTML="",this.wrap=null}}const WB="xg-dynamic-watermark";class YB extends ba{constructor(e){super(e),this.wm=null}static get pluginName(){return"DynamicWatermark"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT,displayType:1,tickerSpeed:void 0,fontSize:12,fontColor:"#ffffff",opacity:.3,enable:!1,top:void 0,left:void 0,right:void 0,bottom:void 0,content:""}}afterCreate(){this.config.enable&&(this._initWatermark(),this.once(to,(()=>{this.start()})),this.on(Ro,(()=>{this.resize()})))}start(){var e,t;null==(t=null==(e=this.wm)?void 0:e.start)||t.call(e)}pause(){var e,t;null==(t=null==(e=this.wm)?void 0:e.pause)||t.call(e)}resume(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resume)||t.call(e)}resize(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resize)||t.call(e)}_initWatermark(){this.wm=new GB(u(c({},this.config),{root:this.root,rootClassName:WB}))}destroy(){var e,t;null==(t=null==(e=this.wm)?void 0:e.destroy)||t.call(e),this.offAll()}render(){return`\n <xg-dynamic-watermark class=${WB} />\n `}}class zB extends ba{constructor(e){super(e),this.waitings=[],this.longWaitingEmitTime=0,this.waitingStartTime=0,this.playerData=null,this.playerData=this.playerConfig.playerData}static get pluginName(){return"DefinitionDemotePlugin"}static get defaultConfig(){return{isNeedAutoDemote:!0,toastShowTime:3e3,demotePriority:[],isNeedShowTips:!0,oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3}}registerLanguageTexts(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}afterCreate(){this.bindCtx(),this.bindEvents()}bindCtx(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this),this.demote=this.demote.bind(this)}bindEvents(){this.on(io,this._waiting),this.on(Zr,this._clearTime),this.on($r,this._clearTime),this.on(wo,this._clearTime),this.on(MA.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(MA.LONG_WAITING,this.demote)}_waiting(){this._count(),this._time()}_count(){const e=Date.now();this.waitings.push(e);const{oftenWaitingCount:t,oftenWaitingTime:i}=this.config;if(this.waitings.length>=t){const n=this.waitings.shift();n&&e-n<=i&&(ss.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(MA.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void ss.log("The stuttering was triggered continuously, and the interval since the last stuttering was ",Date.now()-this.waitingStartTime+"ms");this.waitingStartTime=Date.now();const e=this.player.currentTime;this.timer=setTimeout((()=>{this.player&&this.player.currentTime<=e+.1&&(ss.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(MA.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&ss.log("stuttering last for ",Date.now()-this.waitingStartTime+"ms"),this.clearState()}clearState(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}demote(){if(!this.player.checkBuffer(this.player.currentTime,{endDiff:.5,startDiff:.5})&&!this.player.isSeeking&&this.player.state===Na.RUNNING&&this.player.currentTime>1){if(!this.playerData)return;const e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(!t||!t.url)return;const i=t.definition;if(!i)return;const{current:{definition:n}}=this.playerData;if(this.player.emit(MA.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){const e=t.url;ss.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==n&&this.showToast(t)}else ss.log("stuttering but not need demote definition")}changeUrl(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,{seamless:!this.player.config.isLive}).then((()=>{ss.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(MA.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}showToast(e){var t;const i=null==(t=this.player)?void 0:t.getPlugin("sdkToastPlugin");if(!i)return;if(this.toastId&&(i.remove(this.toastId),this.toastId=null),!this.config.isNeedShowTips)return;const n=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,r=Ur.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=Ur.createDom("span",n,void 0,"toast-txt-bt");r.appendChild(o),this.toastId=i.add(r,this.config.toastShowTime,!0),o.addEventListener("click",(()=>{this.playerData&&(this.playerData.current.definition=e.definition,i.remove(this.toastId),this.toastId=null,ss.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}}function $B(){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 XB(){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}const{POSITIONS:qB}=ba,ZB="getMirror",QB="exitMirror";class JB extends ba{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:qB.CONTROLS_RIGHT,index:VA,disable:!1,defaultEnable:!1}}afterCreate(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}registerIcons(){return{[ZB]:{icon:$B,class:"xg-get-mirror"},[QB]:{icon:XB,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[ZB]),t.appendChild(e[QB])}registerLanguageTexts(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}btnClick(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}action(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(MA.MIRROR_CHANGE,this.isEnableMirror)}updateMirrorState(e){const t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}animate(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}switchTips(e){this.changeLangTextKey(this.find(".xg-tips"),e?QB:ZB)}destroy(){this.unbind(["click","touchend"],this.btnClick)}render(){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">${this.langText[ZB]}</div>\n </xg-icon>`}}class eF extends ba{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=Ur.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=Ur.checkIsFunction(this.config.getTime)?this.config.getTime:this.getTimeByStorage,this.startTime=0,this.memoryId=this.config.memoryId,this.showToast=this.showToast.bind(this),this.saveTime=this.saveTime.bind(this),this.visibilitychangeCallback=this.visibilitychangeCallback.bind(this)}static get pluginName(){return"memoryPlay"}static get defaultConfig(){return{getTime:null,saveTime:null,memoryId:"",minStartTime:1,minEndTime:1}}registerLanguageTexts(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}children(){return{toast:cO}}afterCreate(){this.once(eo,this.showToast),this.on(to,(()=>{this.curTime=this.player.currentTime}))}beforePlayerInit(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}getTime(){return new Promise((e=>{const t=(i=this.getTimeFun(this.memoryId))&&i.then?i:new Promise((e=>{e(i)}));var i;t.then((t=>{var i,n,r,o,a,s;const l=function(e,t=0){const i=parseFloat(e);return Number.isNaN(i)?t:i}(t);!isNaN(l)&&l>0?(this.startTime=l,this.shouldShowToast=!0,this.playerConfig.startTime=this.startTime,(null==(r=null==(n=null==(i=this.player.plugins)?void 0:i.hls)?void 0:n.hls)?void 0:r.config)&&(this.player.plugins.hls.hls.config.startTime=this.startTime),(null==(s=null==(a=null==(o=this.player.plugins)?void 0:o.encrypthlsplugin)?void 0:a.hls)?void 0:s.config)&&(this.player.plugins.encrypthlsplugin.hls.config.startTime=this.startTime)):ss.warn("the time got is invalid",t),e()})).catch((t=>{ss.error("getTime function occur error",t),e()}))}))}saveTime(){var e;if(!this.player)return;const{minStartTime:t=1,minEndTime:i=1}=this.config,{currentTime:n,duration:r}=this.player,o=null!=(e=null!=n?n:this.curTime)?e:0;r&&(o<t||Math.abs(r-o)<i?this.saveTimeFun(this.memoryId,0):this.saveTimeFun(this.memoryId,o))}visibilitychangeCallback(){"hidden"===document.visibilityState&&this.saveTime()}setSave(){this.on(qr,this.saveTime.bind(this)),this.on(Qr,this.saveTime.bind(this)),document.addEventListener("visibilitychange",this.visibilitychangeCallback.bind(this)),document.addEventListener("pagehide",this.saveTime.bind(this)),window.addEventListener("beforeunload",this.saveTime.bind(this))}showToast(){var e;if(this.shouldShowToast){this.shouldShowToast=!1;const t=null==(e=this.player)?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;if(this.startTime>0){const e=Ur.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){Ds(e,eF.pluginName,t+"")}getTimeByStorage(e){return ws(e,eF.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function tF(){return(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}class iF{constructor(e){this.config=e.config,this.parent=e.root,this.root=Ur.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===Kr.device?"touchend":"click";this.modal=Ur.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),e.root.appendChild(this.modal),this._delegates=ba.delegate.call(this,this.modal,".xg-play-list-modal",t,this.modalClick.bind(this));const{maxHeight:i}=this.config;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(ba.delegate.call(this,this.root,"li",t,this.onItemClick))}renderItemList(e){const{config:t,root:i}=this;e?t.data=e:e=t.data,t.style&&Object.keys(t.style).map((e=>{i.style[e]=t[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map(((e,t)=>{const i=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=t;const n=e.duration?Ur.format(e.duration):"",r=`\n <div style="${e.poster?`background-image: url('${e.poster}')`:""}" class="xg-play-list-poster ${e.selected?"is-active":""} ${e.poster?"":"no-poster"}" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">${n}</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">${e.title}</div>\n </div>\n `,o=Ur.createDom("li",r,e,i),a=Ur.findDom(o,".bg"),s=null==tF?void 0:tF();!e.poster&&s&&a.appendChild(s),this.root.appendChild(o)}));const n=e.findIndex((e=>e.selected));if(n>=0){const t=Ur.findDom(this.root,".xg-play-list-item.selected");if(!t)return;const{height:i}=t.getBoundingClientRect(),{height:r}=this.root.getBoundingClientRect(),o=(e.length-n)*i,a=i*e.length;this.root.scrollTop=o<r?a-r:n*i}}onItemClick(e){e.delegateTarget||(e.delegateTarget=e.target);const t=e.delegateTarget;if(t&&Ur.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Ur.addClass(t,"selected"),n&&Ur.removeClass(n,"selected"),i&&i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}getAttrObj(e,t){if(!e||!t)return{};const i={};t.map((t=>{i[t]=e.getAttribute(t)}));const n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}show(){Ur.removeClass(this.modal,"hide"),Ur.addClass(this.modal,"active"),Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}hide(){Ur.removeClass(this.modal,"active"),Ur.addClass(this.modal,"hide"),Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide")}modalClick(e){e.stopPropagation(),this.hide();const t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}setStyle(e){Object.keys(e).forEach((t=>{this.root.style[t]=e[t]}))}destroy(){this._delegates&&(this._delegates.map((e=>{e.destroy&&e.destroy()})),this._delegates=null),this.root.parentNode.removeChild(this.root),this.root.innerHTML=null,this.root=null}}function nF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path 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 rF(){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}const oF="playListNext",aF="playListToggle",sF="mobile"===Kr.device;function lF(e=[]){if(!Array.isArray(e))return[];return e.filter((e=>e.url||e.playAuthToken)).map(((e,t)=>{const i=c({},e||{});return i.vid||(i.vid=""+t),i}))}function cF(e=[],t=0){const i=Number(t),n=Number.isNaN(i)?0:i;let r=0;return r=n<=0?0:n<e.length?n:0,r<0?0:r}kA.prototype.setVodPlayListConfig=function(e){if(!(e.plugins||[]).find((e=>e.pluginName===uF.pluginName)))return;const t=$s(e,"playListPlugin");if(t&&function(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}(t)){const{list:i=[],defaultIndex:n=0}=t,r=lF(i),o=cF(r,n),a=null==r?void 0:r[o];if(a){const{url:t,poster:i,playAuthToken:n}=a;n?e.getVideoByToken=u(c({},e.getVideoByToken||{}),{playAuthToken:n}):t&&(e.url=t),i&&(e.poster=i)}}};class uF extends ba{constructor(){super(...arguments),this.timer=null,this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.switchActiveState(e)},this.switchActiveState=e=>{e.stopPropagation();const{toggleMode:t}=this.config;"click"===t?this.toggle(!this.isActive):this.toggle(!0)},this.handleNext=e=>{e.stopPropagation(),this.next()},this._onTimeUpdate=()=>{const{player:e}=this;!this.halfPass&&e.currentTime>e.duration/2&&this.confirmOrder()},this._onEnded=()=>{if("order"===this.mode&&this.curIndex+1>=this.list.length)return this.player.pause(),void(this.player.currentTime=0);this.next()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.isActive&&this.toggle(!1)}}static get pluginName(){return"playListPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.CONTROLS_LEFT,index:GA,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}beforeCreate(e){Object.values(ba.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=ba.POSITIONS.CONTROLS_LEFT,e.position=ba.POSITIONS.CONTROLS_LEFT)}afterCreate(){const{config:e}=this,{list:t=[],mode:i,defaultIndex:n}=e||{};this.initIcons(),this.halfPass=!1,this.list=lF(t),this.timer=setTimeout((()=>{this.emit(MA.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=cF(this.list,n),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(to,this._onTimeUpdate),this.on(qr,this._onEnded),this.on([Ro,Io],(()=>{this._resizeList()})),this.once(no,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),sF&&this.on(ho,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),sF?(e.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===e.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===e.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))}registerLanguageTexts(){return{playNext:{jp:"次に遊ぶ",en:"play next",zh:"播放下一个","zh-hk":"播放下一個"},playList:{jp:"プレイリスト",en:"playList",zh:"播放列表","zh-hk":"播放清單"}}}registerIcons(){return{[oF]:{icon:nF,class:"xg-play-next-btn"},[aF]:{icon:rF,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[oF]),this.appendChild(".xg-play-list-btn",e[aF])}show(){!this.list||this.list.length<1||Ur.addClass(this.root,"show")}hide(){Ur.removeClass(this.root,"show")}prev(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}next(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}changeList(e){this.player.currentTime=0,this.list=lF(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(MA.PLAY_LIST_CHANGE,this.list)}setIndex(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())}change(){if(this.disable)return;const{player:e,list:t,curIndex:i}=this;this.halfPass=!1;const{url:n,playAuthToken:r,title:o="",vid:a="",poster:s=""}=t[i];this.curInfo={url:n,playAuthToken:r,title:o,vid:a,poster:s};const l=e.sdk||e;r?l.playNext({vid:a,poster:s,autoplay:!0,getVideoByToken:{playAuthToken:r}}):l.playNext({vid:a,poster:s,autoplay:!0,url:n}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}confirmOrder(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}_nextCompute(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}_prevCompute(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}_emitChange(){this.emit(MA.PLAY_LIST_ITEM_CHANGE,this.curInfo)}toggle(e){if(e===this.isActive)return;const{controls:t}=this.player;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}onItemClick(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}renderItemList(e){const{list:t,config:i,optionsList:n,player:r}=this;"number"==typeof e&&(this.curIndex=e,this.curInfo=t[e]);const o=t.map(((t,i)=>{const n=u(c({},t),{selected:!1});return i===this.curIndex&&(n.selected=!0,e=i),n}));if(n)return void n.renderItemList(o);const a={config:{data:o,className:"xg-side-play-list",onItemClick:(e,t)=>{this.onItemClick(e,t)},onModalClick:()=>{this.toggle(!1)}},root:r.innerContainer||r.root},{height:s}=this.player.root.getBoundingClientRect(),l=s;l&&i.heightLimit&&(a.config.maxHeight=`${l}px`),this.optionsList=new iF(a),this.show(),this._resizeList()}_resizeList(){if(!this.config.heightLimit)return;const{height:e}=this.player.root.getBoundingClientRect(),t=e;this.optionsList&&this.optionsList.setStyle({maxHeight:`${t}px`})}destroy(){const{config:e}=this;"click"===e.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)}set disable(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}get disable(){return this._disable}render(){if(!this.disable)return`<xg-icon class="xg-options-icon xg-play-list-btn-container ${this.config.className||""}">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">${this.langText.playNext}</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">${this.langText.playList}</div>\n </div>\n </xg-icon>`}}const hF=Object.assign(mB,{Events:FA,Event:BA,DefinitionDemotePlugin:zB,MirrorPlugin:JB,MemoryPlay:eF,Subtitle:lO,DynamicWatermarkPlugin:YB,PlayListPlugin:uF,getI18N:_B,BasePlugin:ua,Plugin:ba,Sniffer:Kr,Util:Ur,STATE_CLASS:Pa,I18N:La,STATES:Na});exports.BasePlugin=ua,exports.CodecType=tr,exports.ContentType=ir,exports.DefinitionDemotePlugin=zB,exports.DynamicWatermarkPlugin=YB,exports.EAudioFormat=rr,exports.EDRMTYPE=or,exports.EVideoFormat=nr,exports.Event=BA,exports.Events=FA,exports.I18N=La,exports.MemoryPlay=eF,exports.MirrorPlugin=JB,exports.POSITIONS=ar,exports.PlayListPlugin=uF,exports.Plugin=ba,exports.STATES=Na,exports.STATE_CLASS=Pa,exports.Sniffer=Kr,exports.Subtitle=lO,exports.UmdKeys=Hw,exports.Util=Ur,exports.default=hF,exports.getI18N=_B;
1
+ // @byteplus/veplayer@1.19.0-rc.1 Built @9/3/2026, 9:33:56 PM
2
+ "use strict";var e,t=Object.defineProperty,i=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,a=Math.pow,l=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,u=(e,t)=>{for(var i in t||(t={}))o.call(t,i)&&l(e,i,t[i]);if(r)for(var i of r(t))s.call(t,i)&&l(e,i,t[i]);return e},c=(e,t)=>i(e,n(t)),h=(e,t)=>{var i={};for(var n in e)o.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&r)for(var n of r(e))t.indexOf(n)<0&&s.call(e,n)&&(i[n]=e[n]);return i},d=(e,t,i)=>new Promise(((n,r)=>{var o=e=>{try{a(i.next(e))}catch(pa){r(pa)}},s=e=>{try{a(i.throw(e))}catch(pa){r(pa)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,s);a((i=i.apply(e,t)).next())}));function p(e,t){return e===t||e!=e&&t!=t}function f(e,t){for(var i=e.length;i--;)if(p(e[i][0],t))return i;return-1}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var g=Array.prototype.splice;function y(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])}}y.prototype.clear=function(){this.__data__=[],this.size=0},y.prototype.delete=function(e){var t=this.__data__,i=f(t,e);return!(i<0)&&(i==t.length-1?t.pop():g.call(t,i,1),--this.size,!0)},y.prototype.get=function(e){var t=this.__data__,i=f(t,e);return i<0?void 0:t[i][1]},y.prototype.has=function(e){return f(this.__data__,e)>-1},y.prototype.set=function(e,t){var i=this.__data__,n=f(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};const v="object"==typeof global&&global&&global.Object===Object&&global;var m="object"==typeof self&&self&&self.Object===Object&&self;const _=v||m||Function("return this")();const E=_.Symbol;var T=Object.prototype,S=T.hasOwnProperty,b=T.toString,k=E?E.toStringTag:void 0;var C=Object.prototype.toString;var I="[object Null]",A="[object Undefined]",P=E?E.toStringTag:void 0;function w(e){return null==e?void 0===e?A:I:P&&P in Object(e)?function(e){var t=S.call(e,k),i=e[k];try{e[k]=void 0;var n=!0}catch(pa){}var r=b.call(e);return n&&(t?e[k]=i:delete e[k]),r}(e):function(e){return C.call(e)}(e)}function D(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var L="[object AsyncFunction]",R="[object Function]",x="[object GeneratorFunction]",O="[object Proxy]";function N(e){if(!D(e))return!1;var t=w(e);return t==R||t==x||t==L||t==O}const M=_["__core-js_shared__"];var U,B=(U=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var H=Function.prototype.toString;function F(e){if(null!=e){try{return H.call(e)}catch(pa){}try{return e+""}catch(pa){}}return""}var j=/^\[object .+?Constructor\]$/,V=Function.prototype,K=Object.prototype,G=V.toString,W=K.hasOwnProperty,Y=RegExp("^"+G.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!D(e)||(t=e,B&&B in t))&&(N(e)?Y:j).test(F(e));var t}function $(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return z(i)?i:void 0}const X=$(_,"Map");const q=$(Object,"create");var Q=Object.prototype.hasOwnProperty;var Z=Object.prototype.hasOwnProperty;function J(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 ee(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function te(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])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},J.prototype.get=function(e){var t=this.__data__;if(q){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Q.call(t,e)?t[e]:void 0},J.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:Z.call(t,e)},J.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(X||y),string:new J}},te.prototype.delete=function(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ee(this,e).get(e)},te.prototype.has=function(e){return ee(this,e).has(e)},te.prototype.set=function(e,t){var i=ee(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ie(e){var t=this.__data__=new y(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new y,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var i=this.__data__;if(i instanceof y){var n=i.__data__;if(!X||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new te(n)}return i.set(e,t),this.size=i.size,this};var ne=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(pa){}}();const re=ne;function oe(e,t,i){"__proto__"==t&&re?re(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var se=Object.prototype.hasOwnProperty;function ae(e,t,i){var n=e[t];se.call(e,t)&&p(n,i)&&(void 0!==i||t in e)||oe(e,t,i)}function le(e,t,i,n){var r=!i;i||(i={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=n?n(i[a],e[a],a,i,e):void 0;void 0===l&&(l=e[a]),r?oe(i,a,l):ae(i,a,l)}return i}function ue(e){return null!=e&&"object"==typeof e}function ce(e){return ue(e)&&"[object Arguments]"==w(e)}var he=Object.prototype,de=he.hasOwnProperty,pe=he.propertyIsEnumerable;const fe=ce(function(){return arguments}())?ce:function(e){return ue(e)&&de.call(e,"callee")&&!pe.call(e,"callee")};const ge=Array.isArray;var ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,ve=ye&&"object"==typeof module&&module&&!module.nodeType&&module,me=ve&&ve.exports===ye?_.Buffer:void 0;const _e=(me?me.isBuffer:void 0)||function(){return!1};var Ee=9007199254740991,Te=/^(?:0|[1-9]\d*)$/;function Se(e,t){var i=typeof e;return!!(t=null==t?Ee:t)&&("number"==i||"symbol"!=i&&Te.test(e))&&e>-1&&e%1==0&&e<t}var be=9007199254740991;function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=be}var Ce={};function Ie(e){return function(t){return e(t)}}Ce["[object Float32Array]"]=Ce["[object Float64Array]"]=Ce["[object Int8Array]"]=Ce["[object Int16Array]"]=Ce["[object Int32Array]"]=Ce["[object Uint8Array]"]=Ce["[object Uint8ClampedArray]"]=Ce["[object Uint16Array]"]=Ce["[object Uint32Array]"]=!0,Ce["[object Arguments]"]=Ce["[object Array]"]=Ce["[object ArrayBuffer]"]=Ce["[object Boolean]"]=Ce["[object DataView]"]=Ce["[object Date]"]=Ce["[object Error]"]=Ce["[object Function]"]=Ce["[object Map]"]=Ce["[object Number]"]=Ce["[object Object]"]=Ce["[object RegExp]"]=Ce["[object Set]"]=Ce["[object String]"]=Ce["[object WeakMap]"]=!1;var Ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pe=Ae&&"object"==typeof module&&module&&!module.nodeType&&module,we=Pe&&Pe.exports===Ae&&v.process;const De=function(){try{var e=Pe&&Pe.require&&Pe.require("util").types;return e||we&&we.binding&&we.binding("util")}catch(pa){}}();var Le=De&&De.isTypedArray;const Re=Le?Ie(Le):function(e){return ue(e)&&ke(e.length)&&!!Ce[w(e)]};var xe=Object.prototype.hasOwnProperty;function Oe(e,t){var i=ge(e),n=!i&&fe(e),r=!i&&!n&&_e(e),o=!i&&!n&&!r&&Re(e),s=i||n||r||o,a=s?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=a.length;for(var u in e)!t&&!xe.call(e,u)||s&&("length"==u||r&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Se(u,l))||a.push(u);return a}var Ne=Object.prototype;function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function Ue(e,t){return function(i){return e(t(i))}}const Be=Ue(Object.keys,Object);var He=Object.prototype.hasOwnProperty;function Fe(e){return null!=e&&ke(e.length)&&!N(e)}function je(e){return Fe(e)?Oe(e):function(e){if(!Me(e))return Be(e);var t=[];for(var i in Object(e))He.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ve=Object.prototype.hasOwnProperty;function Ke(e){if(!D(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Me(e),i=[];for(var n in e)("constructor"!=n||!t&&Ve.call(e,n))&&i.push(n);return i}function Ge(e){return Fe(e)?Oe(e,!0):Ke(e)}var We="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=We&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Ye&&Ye.exports===We?_.Buffer:void 0,$e=ze?ze.allocUnsafe:void 0;function Xe(e,t){if(t)return e.slice();var i=e.length,n=$e?$e(i):new e.constructor(i);return e.copy(n),n}function qe(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function Qe(){return[]}var Ze=Object.prototype.propertyIsEnumerable,Je=Object.getOwnPropertySymbols;const et=Je?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 s=e[i];t(s,i,e)&&(o[r++]=s)}return o}(Je(e),(function(t){return Ze.call(e,t)})))}:Qe;function tt(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}const it=Ue(Object.getPrototypeOf,Object);const nt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)tt(t,et(e)),e=it(e);return t}:Qe;function rt(e,t,i){var n=t(e);return ge(e)?n:tt(n,i(e))}function ot(e){return rt(e,je,et)}function st(e){return rt(e,Ge,nt)}const at=$(_,"DataView");const lt=$(_,"Promise");const ut=$(_,"Set");const ct=$(_,"WeakMap");var ht="[object Map]",dt="[object Promise]",pt="[object Set]",ft="[object WeakMap]",gt="[object DataView]",yt=F(at),vt=F(X),mt=F(lt),_t=F(ut),Et=F(ct),Tt=w;(at&&Tt(new at(new ArrayBuffer(1)))!=gt||X&&Tt(new X)!=ht||lt&&Tt(lt.resolve())!=dt||ut&&Tt(new ut)!=pt||ct&&Tt(new ct)!=ft)&&(Tt=function(e){var t=w(e),i="[object Object]"==t?e.constructor:void 0,n=i?F(i):"";if(n)switch(n){case yt:return gt;case vt:return ht;case mt:return dt;case _t:return pt;case Et:return ft}return t});const St=Tt;var bt=Object.prototype.hasOwnProperty;const kt=_.Uint8Array;function Ct(e){var t=new e.constructor(e.byteLength);return new kt(t).set(new kt(e)),t}var It=/\w*$/;var At=E?E.prototype:void 0,Pt=At?At.valueOf:void 0;function wt(e,t){var i=t?Ct(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var Dt="[object Boolean]",Lt="[object Date]",Rt="[object Map]",xt="[object Number]",Ot="[object RegExp]",Nt="[object Set]",Mt="[object String]",Ut="[object Symbol]",Bt="[object ArrayBuffer]",Ht="[object DataView]",Ft="[object Float32Array]",jt="[object Float64Array]",Vt="[object Int8Array]",Kt="[object Int16Array]",Gt="[object Int32Array]",Wt="[object Uint8Array]",Yt="[object Uint8ClampedArray]",zt="[object Uint16Array]",$t="[object Uint32Array]";function Xt(e,t,i){var n,r=e.constructor;switch(t){case Bt:return Ct(e);case Dt:case Lt:return new r(+e);case Ht:return function(e,t){var i=t?Ct(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case Ft:case jt:case Vt:case Kt:case Gt:case Wt:case Yt:case zt:case $t:return wt(e,i);case Rt:return new r;case xt:case Mt:return new r(e);case Ot:return function(e){var t=new e.constructor(e.source,It.exec(e));return t.lastIndex=e.lastIndex,t}(e);case Nt:return new r;case Ut:return n=e,Pt?Object(Pt.call(n)):{}}}var qt=Object.create,Qt=function(){function e(){}return function(t){if(!D(t))return{};if(qt)return qt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();const Zt=Qt;function Jt(e){return"function"!=typeof e.constructor||Me(e)?{}:Zt(it(e))}var ei=De&&De.isMap;const ti=ei?Ie(ei):function(e){return ue(e)&&"[object Map]"==St(e)};var ii=De&&De.isSet;const ni=ii?Ie(ii):function(e){return ue(e)&&"[object Set]"==St(e)};var ri=1,oi=2,si=4,ai="[object Arguments]",li="[object Function]",ui="[object GeneratorFunction]",ci="[object Object]",hi={};function di(e,t,i,n,r,o){var s,a=t&ri,l=t&oi,u=t&si;if(i&&(s=r?i(e,n,r,o):i(e)),void 0!==s)return s;if(!D(e))return e;var c=ge(e);if(c){if(s=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&bt.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!a)return qe(e,s)}else{var h=St(e),d=h==li||h==ui;if(_e(e))return Xe(e,a);if(h==ci||h==ai||d&&!r){if(s=l||d?{}:Jt(e),!a)return l?function(e,t){return le(e,nt(e),t)}(e,function(e,t){return e&&le(t,Ge(t),e)}(s,e)):function(e,t){return le(e,et(e),t)}(e,function(e,t){return e&&le(t,je(t),e)}(s,e))}else{if(!hi[h])return r?e:{};s=Xt(e,h,a)}}o||(o=new ie);var p=o.get(e);if(p)return p;o.set(e,s),ni(e)?e.forEach((function(n){s.add(di(n,t,i,n,e,o))})):ti(e)&&e.forEach((function(n,r){s.set(r,di(n,t,i,r,e,o))}));var f=c?void 0:(u?l?st:ot:l?Ge:je)(e);return function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););}(f||e,(function(n,r){f&&(n=e[r=n]),ae(s,r,di(n,t,i,r,e,o))})),s}hi[ai]=hi["[object Array]"]=hi["[object ArrayBuffer]"]=hi["[object DataView]"]=hi["[object Boolean]"]=hi["[object Date]"]=hi["[object Float32Array]"]=hi["[object Float64Array]"]=hi["[object Int8Array]"]=hi["[object Int16Array]"]=hi["[object Int32Array]"]=hi["[object Map]"]=hi["[object Number]"]=hi[ci]=hi["[object RegExp]"]=hi["[object Set]"]=hi["[object String]"]=hi["[object Symbol]"]=hi["[object Uint8Array]"]=hi["[object Uint8ClampedArray]"]=hi["[object Uint16Array]"]=hi["[object Uint32Array]"]=!0,hi["[object Error]"]=hi[li]=hi["[object WeakMap]"]=!1;function pi(e){return di(e,5)}function fi(e,t,i){(void 0!==i&&!p(e[t],i)||void 0===i&&!(t in e))&&oe(e,t,i)}var gi,yi=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),s=o.length;s--;){var a=o[gi?s:++n];if(!1===t(r[a],a,r))break}return e};const vi=yi;var mi="[object Object]",_i=Function.prototype,Ei=Object.prototype,Ti=_i.toString,Si=Ei.hasOwnProperty,bi=Ti.call(Object);function ki(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Ci(e,t,i,n,r,o,s){var a=ki(e,i),l=ki(t,i),u=s.get(l);if(u)fi(e,i,u);else{var c,h=o?o(a,l,i+"",e,t,s):void 0,d=void 0===h;if(d){var p=ge(l),f=!p&&_e(l),g=!p&&!f&&Re(l);h=l,p||f||g?ge(a)?h=a:ue(c=a)&&Fe(c)?h=qe(a):f?(d=!1,h=Xe(l,!0)):g?(d=!1,h=wt(l,!0)):h=[]:function(e){if(!ue(e)||w(e)!=mi)return!1;var t=it(e);if(null===t)return!0;var i=Si.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Ti.call(i)==bi}(l)||fe(l)?(h=a,fe(a)?h=function(e){return le(e,Ge(e))}(a):D(a)&&!N(a)||(h=Jt(l))):d=!1}d&&(s.set(l,h),r(h,l,n,o,s),s.delete(l)),fi(e,i,h)}}function Ii(e,t,i,n,r){e!==t&&vi(t,(function(o,s){if(r||(r=new ie),D(o))Ci(e,t,s,i,Ii,n,r);else{var a=n?n(ki(e,s),o,s+"",e,t,r):void 0;void 0===a&&(a=o),fi(e,s,a)}}),Ge)}function Ai(e){return e}var Pi=Math.max;var wi=re?function(e,t){return re(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ai;const Di=wi;var Li,Ri,xi,Oi=Date.now;const Ni=(Li=Di,Ri=0,xi=0,function(){var e=Oi(),t=16-(e-xi);if(xi=e,t>0){if(++Ri>=800)return arguments[0]}else Ri=0;return Li.apply(void 0,arguments)});function Mi(e,t){return Ni(function(e,t,i){return t=Pi(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=Pi(n.length-t,0),s=Array(o);++r<o;)s[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i(s),function(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)}(e,this,a)}}(e,t,Ai),e+"")}function Ui(e){return Mi((function(t,i){var n=-1,r=i.length,o=r>1?i[r-1]:void 0,s=r>2?i[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,s&&function(e,t,i){if(!D(i))return!1;var n=typeof t;return!!("number"==n?Fe(i)&&Se(t,i.length):"string"==n&&t in i)&&p(i[t],e)}(i[0],i[1],s)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var a=i[n];a&&e(t,a,n,o)}return t}))}const Bi=Ui((function(e,t,i,n){Ii(e,t,i,n)}));function Hi(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new te;++t<i;)this.add(e[t])}function Fi(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 ji(e,t){return e.has(t)}Hi.prototype.add=Hi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Hi.prototype.has=function(e){return this.__data__.has(e)};var Vi=1,Ki=2;function Gi(e,t,i,n,r,o){var s=i&Vi,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var h=-1,d=!0,p=i&Ki?new Hi:void 0;for(o.set(e,t),o.set(t,e);++h<a;){var f=e[h],g=t[h];if(n)var y=s?n(g,f,h,t,e,o):n(f,g,h,e,t,o);if(void 0!==y){if(y)continue;d=!1;break}if(p){if(!Fi(t,(function(e,t){if(!ji(p,t)&&(f===e||r(f,e,i,n,o)))return p.push(t)}))){d=!1;break}}else if(f!==g&&!r(f,g,i,n,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Wi(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Yi(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var zi=1,$i=2,Xi="[object Boolean]",qi="[object Date]",Qi="[object Error]",Zi="[object Map]",Ji="[object Number]",en="[object RegExp]",tn="[object Set]",nn="[object String]",rn="[object Symbol]",on="[object ArrayBuffer]",sn="[object DataView]",an=E?E.prototype:void 0,ln=an?an.valueOf:void 0;var un=1,cn=Object.prototype.hasOwnProperty;var hn=1,dn="[object Arguments]",pn="[object Array]",fn="[object Object]",gn=Object.prototype.hasOwnProperty;function yn(e,t,i,n,r,o){var s=ge(e),a=ge(t),l=s?pn:St(e),u=a?pn:St(t),c=(l=l==dn?fn:l)==fn,h=(u=u==dn?fn:u)==fn,d=l==u;if(d&&_e(e)){if(!_e(t))return!1;s=!0,c=!1}if(d&&!c)return o||(o=new ie),s||Re(e)?Gi(e,t,i,n,r,o):function(e,t,i,n,r,o,s){switch(i){case sn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case on:return!(e.byteLength!=t.byteLength||!o(new kt(e),new kt(t)));case Xi:case qi:case Ji:return p(+e,+t);case Qi:return e.name==t.name&&e.message==t.message;case en:case nn:return e==t+"";case Zi:var a=Wi;case tn:var l=n&zi;if(a||(a=Yi),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;n|=$i,s.set(e,t);var c=Gi(a(e),a(t),n,r,o,s);return s.delete(e),c;case rn:if(ln)return ln.call(e)==ln.call(t)}return!1}(e,t,l,i,n,r,o);if(!(i&hn)){var f=c&&gn.call(e,"__wrapped__"),g=h&&gn.call(t,"__wrapped__");if(f||g){var y=f?e.value():e,v=g?t.value():t;return o||(o=new ie),r(y,v,i,n,o)}}return!!d&&(o||(o=new ie),function(e,t,i,n,r,o){var s=i&un,a=ot(e),l=a.length;if(l!=ot(t).length&&!s)return!1;for(var u=l;u--;){var c=a[u];if(!(s?c in t:cn.call(t,c)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var p=!0;o.set(e,t),o.set(t,e);for(var f=s;++u<l;){var g=e[c=a[u]],y=t[c];if(n)var v=s?n(y,g,c,t,e,o):n(g,y,c,e,t,o);if(!(void 0===v?g===y||r(g,y,i,n,o):v)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,i,n,r,o))}function vn(e,t,i,n,r){return e===t||(null==e||null==t||!ue(e)&&!ue(t)?e!=e&&t!=t:yn(e,t,i,n,vn,r))}var mn=1,_n=2;function En(e){return e==e&&!D(e)}function Tn(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Sn(e){var t=function(e){for(var t=je(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,En(r)]}return t}(e);return 1==t.length&&t[0][2]?Tn(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,o=r,s=!n;if(null==e)return!o;for(e=Object(e);r--;){var a=i[r];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<o;){var l=(a=i[r])[0],u=e[l],c=a[1];if(s&&a[2]){if(void 0===u&&!(l in e))return!1}else{var h=new ie;if(n)var d=n(u,c,l,e,t,h);if(!(void 0===d?vn(c,u,mn|_n,n,h):d))return!1}}return!0}(i,e,t)}}var bn="[object Symbol]";function kn(e){return"symbol"==typeof e||ue(e)&&w(e)==bn}var Cn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;function An(e,t){if(ge(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!kn(e))||(In.test(e)||!Cn.test(e)||null!=t&&e in Object(t))}var Pn="Expected a function";function wn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Pn);var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var s=e.apply(this,n);return i.cache=o.set(r,s)||o,s};return i.cache=new(wn.Cache||te),i}wn.Cache=te;var Dn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ln=/\\(\\)?/g,Rn=function(e){var t=wn(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Dn,(function(e,i,n,r){t.push(n?r.replace(Ln,"$1"):i||e)})),t}));const xn=Rn;var On=1/0,Nn=E?E.prototype:void 0,Mn=Nn?Nn.toString:void 0;function Un(e){if("string"==typeof e)return e;if(ge(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,Un)+"";if(kn(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-On?"-0":t}function Bn(e,t){return ge(e)?e:An(e,t)?[e]:xn(function(e){return null==e?"":Un(e)}(e))}var Hn=1/0;function Fn(e){if("string"==typeof e||kn(e))return e;var t=e+"";return"0"==t&&1/e==-Hn?"-0":t}function jn(e,t){for(var i=0,n=(t=Bn(t,e)).length;null!=e&&i<n;)e=e[Fn(t[i++])];return i&&i==n?e:void 0}function Vn(e,t,i){var n=null==e?void 0:jn(e,t);return void 0===n?i:n}function Kn(e,t){return null!=e&&t in Object(e)}function Gn(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Bn(t,e)).length,o=!1;++n<r;){var s=Fn(t[n]);if(!(o=null!=e&&i(e,s)))break;e=e[s]}return o||++n!=r?o:!!(r=null==e?0:e.length)&&ke(r)&&Se(s,r)&&(ge(e)||fe(e))}(e,t,Kn)}var Wn=1,Yn=2;function zn(e){return An(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Fn(e)):function(e){return function(t){return jn(t,e)}}(e)}function $n(e){return"function"==typeof e?e:null==e?Ai:"object"==typeof e?ge(e)?(t=e[0],i=e[1],An(t)&&En(i)?Tn(Fn(t),i):function(e){var n=Vn(e,t);return void 0===n&&n===i?Gn(e,t):vn(i,n,Wn|Yn)}):Sn(e):zn(e);var t,i}function Xn(e){return e!=e}function qn(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,Xn,i)}(e,t,0)>-1}function Qn(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}const Zn=ut&&1/Yi(new ut([,-0]))[1]==1/0?function(e){return new ut(e)}:function(){};var Jn=200;function er(e,t){return e&&e.length?function(e,t,i){var n=-1,r=qn,o=e.length,s=!0,a=[],l=a;if(i)s=!1,r=Qn;else if(o>=Jn){var u=t?null:Zn(e);if(u)return Yi(u);s=!1,r=ji,l=new Hi}else l=t?[]:a;e:for(;++n<o;){var c=e[n],h=t?t(c):c;if(c=i||0!==c?c:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(c)}else r(l,h,i)||(l!==a&&l.push(h),a.push(c))}return a}(e,$n(t)):[]}const tr={H264:"h264",H265:"h265",H266:"h266",AAC:"aac",MP3:"mp3",OPUS:"opus",UNKNOWN:"unknown"},ir={[tr.H265]:'video/mp4; codecs="hev1.1.6.L120.90"',[tr.H264]:'video/mp4; codecs="avc1.42c01e"'};var nr=(e=>(e.MP4="mp4",e.DASH="dash",e.HLS="hls",e))(nr||{}),rr=(e=>(e.M4A="m4a",e.MP4="mp4",e.MP3="mp3",e.DASH="dash",e.HLS="hls",e.OGG="ogg",e))(rr||{}),or=(e=>(e.DRM_ENCRYPT="drm_encrypt",e.PRIVATE_ENCRYPT="private_encrypt",e.PRIVATE_ENCRYPT_UPGRADE="private_encrypt_upgrade",e.STANDARD_ENCRYPT="standard_encrypt",e))(or||{});class sr extends Error{constructor(e,t){super(t),this.name="HlsControlError",this.code=e,Object.setPrototypeOf(this,sr.prototype)}}var ar=(e=>(e.ROOT="root",e.ROOT_LEFT="rootLeft",e.ROOT_RIGHT="rootRight",e.ROOT_TOP="rootTop",e.CONTROLS_LEFT="controlsLeft",e.CONTROLS_RIGTH="controlsRight",e.CONTROLS_RIGHT="controlsRight",e.CONTROLS_CENTER="controlsCenter",e.CONTROLS="controls",e))(ar||{}),lr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cr=function(){let e,t=null;function i(e){return!!e&&("object"==typeof e||"function"==typeof e)}function n(e){if(null!==e&&!i(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}const r=Object,o=Boolean(r.create)||!({__proto__:null}instanceof r),s=r.create||(o?function(e){return n(e),{__proto__:e}}:function(e){if(n(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}),a=function(){return null},l=r.getPrototypeOf||([].__proto__===Array.prototype?function(e){const t=e.__proto__;return i(t)?t:null}:a);return e=function(u,c){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!i(u)||!i(c))throw new TypeError("Cannot create proxy with a non-object as target or handler");let h=function(){};t=function(){u=null,h=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}},setTimeout((function(){t=null}),0);const d=c;c={get:null,set:null,apply:null,construct:null};for(let e in d){if(!(e in c))throw new TypeError(`Proxy polyfill does not support trap '${e}'`);c[e]=d[e]}"function"==typeof d&&(c.apply=d.apply.bind(d));const p=l(u);let f,g=!1,y=!1;"function"==typeof u?(f=function(){const e=this&&this.constructor===f,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&c.construct)return c.construct.call(this,u,t);if(!e&&c.apply)return c.apply(u,this,t);if(e){t.unshift(u);return new(u.bind.apply(u,t))}return u.apply(this,t)},g=!0):u instanceof Array?(f=[],y=!0):f=o||null!==p?s(p):{};const v=c.get?function(e){return h("get"),c.get(this,e,f)}:function(e){return h("get"),this[e]},m=c.set?function(e,t){h("set"),c.set(this,e,t,f)}:function(e,t){h("set"),this[e]=t},_=r.getOwnPropertyNames(u),E={};_.forEach((function(e){if((g||y)&&e in f)return;const t=r.getOwnPropertyDescriptor(u,e),i={enumerable:Boolean(t.enumerable),get:v.bind(u,e),set:m.bind(u,e)};r.defineProperty(f,e,i),E[e]=!0}));let T=!0;if(g||y){const e=r.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return n(t),e.__proto__=t,e}:a);p&&e(f,p)||(T=!1)}if(c.get||!T)for(let e in u)E[e]||r.defineProperty(f,e,{get:v.bind(u,e)});return r.seal(u),r.seal(f),f},e.revocable=function(i,n){return{proxy:new e(i,n),revoke:t}},e};const hr=ur(cr)();const dr=new class{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new hr(e,{set:(e,i,n)=>{const r=Reflect.get(e,i);Reflect.set(e,i,n);const o=this.watcherMap.get(t);return o&&(this.flushCallback(o),this.flushPropertyCallback(o,i,r,n)),!0}});return this.watcherMap.set(t,{pending:!1,queue:[],property:{}}),t}subscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;this.subscribeId++;return i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}unsubscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;const n=i.queue,r=n.findIndex((e=>e.id===t));void 0!==r&&r>-1&&n.splice(r,1)}subscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){this.subscribeId++,n.property[t]||(n.property[t]={pending:!1,timer:0,pre:null,queue:[]});return n.property[t].queue.push({id:this.subscribeId,callback:i}),this.subscribeId}}unsubscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){const e=n.property[t];if(e){const t=e.queue,n=t.findIndex((e=>e.id===i));void 0!==n&&n>-1&&t.splice(n,1)}}}flushCallback(e){e.pending||(e.pending=!0,setTimeout((()=>{e.queue.forEach((e=>e.callback())),e.pending=!1}),0))}flushPropertyCallback(e,t,i,n){const r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=i),r.timer=setTimeout((()=>{r.queue.forEach((e=>e.callback(r.pre,n))),r.pending=!1}),0))}};function pr(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 fr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(i),!0).forEach((function(t){_r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):pr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function gr(e){return(gr="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 yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(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,wr(n.key),n)}}function mr(e,t,i){return t&&vr(e.prototype,t),i&&vr(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _r(e,t,i){return(t=wr(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Er(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&&Sr(e,t)}function Tr(e){return(Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sr(e,t){return(Sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function br(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kr(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 br(e)}function Cr(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(pa){return!1}}();return function(){var i,n=Tr(e);if(t){var r=Tr(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return kr(this,i)}}function Ir(){return Ir="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Tr(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},Ir.apply(this,arguments)}function Ar(e){return function(e){if(Array.isArray(e))return Pr(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 Pr(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 Pr(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 Pr(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 wr(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 Dr={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,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,o||e,s),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.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},a.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,s=new Array(o);r<o;r++)s[r]=n[r].fn;return s},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,o,s){var a=i?i+e:e;if(!this._events[a])return!1;var l,u,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,o),!0;case 6:return c.fn.call(c.context,t,n,r,o,s),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},a.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||s(this,o);else{for(var l=0,u=[],c=a.length;l<c;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&u.push(a[l]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}(Dr);var Lr=Dr.exports;const Rr=ur(Lr);var xr="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Or={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Nr="%c[xgplayer]",Mr={config:{debug:xr?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,[Nr,Or.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,[Nr,Or.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,[Nr,Or.error,e].concat(r))}}};var Ur=function(){function e(t){yr(this,e),this.bufferedList=t}return mr(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}(),Br={};function Hr(e){var t=gr(e);return null!==e&&("object"===t||"function"===t)}function Fr(e,t,i){var n,r,o,s,a,l,u=0,c=!1,h=!1,d=!0,p=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var i=n,o=r;return n=r=void 0,u=t,s=e.apply(o,i)}function g(e,t){return p?(window.cancelAnimationFrame(a),window.requestAnimationFrame(e)):setTimeout(e,t)}function y(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-u>=o}function v(){var e=Date.now();if(y(e))return m(e);a=g(v,function(e){var i=e-u,n=t-(e-l);return h?Math.min(n,o-i):n}(e))}function m(e){return a=void 0,d&&n?f(e):(n=r=void 0,s)}function _(){for(var e=Date.now(),i=y(e),o=arguments.length,d=new Array(o),p=0;p<o;p++)d[p]=arguments[p];if(n=d,r=this,l=e,i){if(void 0===a)return function(e){return u=e,a=g(v,t),c?f(e):s}(l);if(h)return a=g(v,t),f(l)}return void 0===a&&(a=g(v,t)),s}return t=+t||0,Hr(i)&&(c=!!i.leading,o=(h="maxWait"in i)?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==a&&function(e){if(p)return window.cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,n=l=r=a=void 0},_.flush=function(){return void 0===a?s:m(Date.now())},_.pending=function(){return void 0!==a},_}Br.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},Br.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&&Br.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return Mr.logError("util.createDomFromHtml",o),null}},Br.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(pa){var i=e.className&&"object"===gr(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Br.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(pa){Br.hasClass(e,t)||(e.className&&"object"===gr(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Br.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(pa){Br.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===gr(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},Br.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Br.hasClass(e,t)?Br.removeClass(e,t):Br.addClass(e,t)}))},Br.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===Br.typeOf(e[i])?t.push(e[i]):"Object"===Br.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(" ")},Br.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(pa){Mr.logError("util.findDom",pa),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},Br.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Br.padStart=function(e,t,i){for(var n=String(i),r=t>>0,o=Math.ceil(r/n.length),s=[],a=String(e);o--;)s.push(n);return s.join("").substring(0,r-a.length)+a},Br.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Br.padStart(Math.floor(e/3600),2,0),i=Br.padStart(Math.floor((e-3600*t)/60),2,0),n=Br.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},Br.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},Br.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Br.deepCopy=function(e,t){if("Object"===Br.typeOf(t)&&"Object"===Br.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==Br.typeOf(t[i])||t[i]instanceof Node?"Array"===Br.typeOf(t[i])?e[i]="Array"===Br.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]:Br.deepCopy(e[i],t[i])})),e},Br.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===Br.typeOf(t[i])&&"Array"===Br.typeOf(e[i])?"Array"===Br.typeOf(e[i])&&(n=e[i]).push.apply(n,Ar(t[i])):Br.typeOf(e[i])!==Br.typeOf(t[i])||null===e[i]||"Object"!==Br.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):Br.deepMerge(e[i],t[i])})),e},Br.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},Br.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""},Br.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},Br.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Br.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),Br.clearTimeout(e,n)}),i);return e._timers.push(n),n},Br.clearTimeout=function(e,t){var i=e._timers;if("Array"===Br.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},Br.clearAllTimers=function(e){var t=e._timers;"Array"===Br.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Br.createImgBtn=function(e,t,i,n){var r,o,s,a=Br.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(a.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()),s=e,!1)})),a.style.width="".concat(r).concat(s),a.style.height="".concat(o).concat(s),a.style.backgroundSize="".concat(r).concat(s," ").concat(o).concat(s),a.style.margin="start"===e?"-".concat(o/2).concat(s," auto auto -").concat(r/2).concat(s):"auto 5px auto 5px");return a},Br.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)"},Br.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Br.checkIsFunction=function(e){return e&&"function"==typeof e},Br.checkIsObject=function(e){return null!==e&&"object"===gr(e)},Br.hide=function(e){e.style.display="none"},Br.show=function(e,t){e.style.display=t||"block"},Br.isUndefined=function(e){if(null==e)return!0},Br.isNotNull=function(e){return!(null==e)},Br.setStyleFromCsstext=function(e,t){t&&("String"===Br.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]})))},Br.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&&(!function(e,t){for(var i=0,n=t.length;i<n;i++)if(e.indexOf(t[i])>-1)return!0;return!1}(i[0],t)?o[i[0]]=i[1]:r[i[0]]=i[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Br.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},Br.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}},Br.stopPropagation=function(e){e&&e.stopPropagation()},Br.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Br.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Br.checkTouchSupport=function(){return"ontouchstart"in window},Br.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 s=r.length;if(s){var a=r[s-1].end;i[o].start-a<t?i[o].end>a&&(r[s-1].end=i[o].end):r.push(i[o])}else r.push(i[o])}else r=i;return new Ur(r)},Br.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}},Br.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Br.getHostFromUrl=function(e){if("String"!==Br.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},Br.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Br.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Br.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Br.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(pa){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(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)}))},Br.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Br.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},Br.createPositionBar=function(e,t){var i=Br.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},Br.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")};return Object.keys(i).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},Br.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Br.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},Br.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:Br.getIndexByTime(e,t))<0)return-1;var r=t.length,o=t[n],s=o.start,a=o.end,l=o.cTime,u=o.offset;return e<s?l:e>=s&&e<=a?e-u:e>a&&n>=r-1?a:-1},Br.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 jr=/(Android)\s([\d.]+)/,Vr=/(Version)\/([\d.]+)/,Kr=["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","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Gr={get device(){return Gr.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=/(?:Tizen)/gi.test(e),r=/(?:Web0S)/gi.test(e),o=/(?:Android)/.test(e),s=/(?:Firefox)/.test(e),a=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=a||o&&!/(?:Mobile)/.test(e)||s&&/(?:Tablet)/.test(e),u=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:u,isIpad:a,isIos:u||a,isAndroid:o,isPc:!(u||o||i||l),isSymbian:i,isWindowsPhone:t,isFireFox:s,isTizen:n,isWebOS:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?Vr:jr)?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&&Kr.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(pa){return Promise.resolve(t)}}},Wr="3.0.23-rc.3",Yr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},zr={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},$r=mr((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};yr(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,s=t.currentTime,a=t.ended,l=t.src,u=t.currentSrc,c=t.media,h=c.readyState,d=c.networkState,p=i.errorCode||r.code;zr[p]&&(p=zr[p]);var f={playerVersion:Wr,currentTime:s,duration:o,ended:a,readyState:h,networkState:d,src:l||u,errorType:i.errorType,errorCode:p,message:i.errorMessage||r.message,mediaError:r,originError:i.originError?i.originError.stack:"",host:Br.getHostFromUrl(l||u)};return i.ext&&Object.keys(i.ext).map((function(e){f[e]=i.ext[e]})),f}if(arguments.length>1){for(var g={playerVersion:Wr,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)g[y[v]]=arguments[v];return g.ex=n?(n[arguments[0]]||{}).msg:"",g}})),Xr="play",qr="playing",Qr="ended",Zr="pause",Jr="error",eo="seeking",to="seeked",io="timeupdate",no="waiting",ro="canplay",oo="durationchange",so="volumechange",ao="loadeddata",lo="ratechange",uo="progress",co="loadstart",ho="emptied",po="focus",fo="blur",go="ready",yo="urlNull",vo="autoplay_started",mo="autoplay_was_prevented",_o="complete",Eo="replay",To="destroy",So="urlchange",bo="download_speed_change",ko="leaveplayer",Co="enterplayer",Io="loading",Ao="fullscreen_change",Po="cssFullscreen_change",wo="mini_state_change",Do="definition_change",Lo="after_definition_change",Ro="video_resize",xo="pip_change",Oo="rotate",No="screenShot",Mo="playnext",Uo="shortcut",Bo="xglog",Ho="user_action",Fo="reset",jo="source_error",Vo="source_success",Ko=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],Go={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Wo="fps_stuck";const Yo=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:Lo,AUTOPLAY_PREVENTED:mo,AUTOPLAY_STARTED:vo,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:ro,CANPLAY_THROUGH:"canplaythrough",COMPLETE:_o,CSS_FULLSCREEN_CHANGE:Po,DEFINITION_CHANGE:Do,DESTROY:To,DOWNLOAD_SPEED_CHANGE:bo,DURATION_CHANGE:oo,EMPTIED:ho,ENDED:Qr,ENTER_PLAYER:Co,ERROR:Jr,FPS_STUCK:Wo,FULLSCREEN_CHANGE:Ao,LEAVE_PLAYER:ko,LOADED_DATA:ao,LOADED_METADATA:"loadedmetadata",LOADING:Io,LOAD_START:co,MINI_STATE_CHANGE:wo,PAUSE:Zr,PIP_CHANGE:xo,PLAY:Xr,PLAYER_BLUR:fo,PLAYER_FOCUS:po,PLAYING:qr,PLAYNEXT:Mo,PROGRESS:uo,RATE_CHANGE:lo,READY:go,REPLAY:Eo,RESET:Fo,RETRY:"retry",ROTATE:Oo,SCREEN_SHOT:No,SEEKED:to,SEEKING:eo,SEI_PARSED:"SEI_PARSED",SHORTCUT:Uo,SOURCE_ERROR:jo,SOURCE_SUCCESS:Vo,STALLED:"stalled",STATS_EVENTS:Go,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:io,URL_CHANGE:So,URL_NULL:yo,USER_ACTION:Ho,VIDEO_EVENTS:Ko,VIDEO_RESIZE:Ro,VOLUME_CHANGE:so,WAITING:no,XGLOG:Bo},Symbol.toStringTag,{value:"Module"}));function zo(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var $o=function(e){Er(i,Rr);var t=Cr(i);function i(e){var n;yr(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 Gr.isWeixin&&Gr.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=e.mediaEl instanceof HTMLMediaElement?e.mediaEl:"function"==typeof e.mediaEl?e.mediaEl(n.mediaConfig):Br.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===Br.typeOf(e.volume)&&(n.volume=e.volume),e.autoplayMuted&&(n.media.muted=!0,n._lastMuted=!0),e.autoplay&&(n.media.autoplay=!0),e.playsinline&&(n.media.playsinline=!0),n._interval={},n.mediaEventMiddleware={},n.attachVideoEvents(),n}return mr(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=Ko.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]),_r({},t,function(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:Br.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 s=zo.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,s)}catch(a){throw zo.call(t,e,r),a}}else zo.call(t,e,r)}}(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(Br.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(Vo,{src:e.target.currentSrc,host:Br.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=Yr[4];i.emit(jo,new $r(i,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var s=0;s<n.length;s++)n[s].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?Yr[i.code]:"other";i.message;this.media.currentSrc||this.media.srcObject||(i={code:6,message:"empty_src"}),this.emit(e,new $r(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?Br.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(So,e),this.emit(no),this._currentTime=0,this._duration=0,Br.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===Br.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:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{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),s=2;s<r;s++)o[s-2]=arguments[s];(n=Ir(Tr(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),s=2;s<r;s++)o[s-2]=arguments[s];(n=Ir(Tr(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),s=2;s<r;s++)o[s-2]=arguments[s];(n=Ir(Tr(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),s=2;s<r;s++)o[s-2]=arguments[s];(n=Ir(Tr(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){Ir(Tr(i.prototype),"removeAllListeners",this).call(this)}}]),i}(),Xo=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"}};yr(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return mr(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}(),qo=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Qo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Zo=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Jo="data-xgplayerid";function es(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 s=t.call.apply(t,[e].concat(r));i&&"function"==typeof i&&(s&&s.then?s.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 ts(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(pa){throw pa.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(pa.message),pa}if(this.__hooks&&this.__hooks[e])try{var s=us.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then((function(e){!1!==e&&es.apply(void 0,[r,t,i.next].concat(Ar(n)))})).catch((function(e){throw e})):es.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&es.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(pa){throw pa.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(pa.message),pa}else es.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function is(e,t){var i=this.__hooks;if(!i||!Array.isArray(i[e]))return-1;for(var n=i[e],r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function ns(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===is.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function rs(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var n=i[e],r=is.call(this,e,t);-1!==r&&n.splice(r,1)}else i[e]&&(i[e]=null)}function os(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 ss(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 as(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 ls(e){e.__hooks=null}function us(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&&Array.isArray(e.__hooks[t])){var s=e.__hooks[t],a=-1;return function e(t,i,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];if(a++,0===s.length||a===s.length)return n.call.apply(n,[t,t].concat(o));var u=s[a],c=u.call.apply(u,[t,t].concat(o));return c&&c.then?c.then((function(r){return!1===r?null:e.apply(void 0,[t,i,n].concat(o))})).catch((function(e){console.warn("[runHooks]".concat(i," reject"),e.message)})):!1!==c?e.apply(void 0,[t,i,n].concat(o)):void 0}.apply(void 0,[e,t,i].concat(r))}return i.call.apply(i,[e,e].concat(r))}function cs(e,t){Mr.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var hs=function(){function e(t){yr(this,e),Br.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),as(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return mr(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=Br.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)})):cs(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)})):cs(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)})):cs(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=fr(fr({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return ts.call.apply(ts,[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 ns.call.apply(ns,[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 rs.call.apply(rs,[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(),Br.clearAllTimers(this),Br.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),ls(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:"defineMethod",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var ds=Element.prototype;ds.matches=ds.matchesSelector||ds.mozMatchesSelector||ds.msMatchesSelector||ds.oMatchesSelector||ds.webkitMatchesSelector}var ps=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function fs(e,t,i,n,r){var o=gs.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function gs(e,t,i,n){return function(i){i.delegateTarget=ps(i.target,t),i.delegateTarget&&n.call(e,i)}}var ys=function(e,t,i,n,r){return"function"==typeof e.addEventListener?fs.apply(null,arguments):"function"==typeof i?fs.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return fs(e,t,i,n,r)})))};const vs=ur(ys);var ms={CONTROLS:"controls",ROOT:"root"},_s={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"},Es="xg-icon-disable";function Ts(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Ss(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 Br.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(Ts(e)||Ts(e.url))return n.src=Ts(e)?e:e.url||"",o=Br.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Br.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Mr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(pa){return Mr.logError("Plugin named [".concat(r,"]:createIcon"),pa),null}return"string"==typeof e?Br.createDomFromHtml(e,n,i):(Mr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function bs(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:"",s=r&&r.attr?r.attr:{},a=null;i&&i[n]&&(o=function(e,t){return"object"===gr(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),s=function(e,t){return"object"===gr(e)&&e.attr&&"object"===gr(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],s),a=Ss(i[n],n,o,s,t.pluginName)),!a&&r&&(a=Ss(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[n]=a}))}var ks=function(e){Er(i,hs);var t=Cr(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yr(this,i),(e=t.call(this,n)).__delegates=[],e}return mr(i,[{key:"__init",value:function(e){if(Ir(Tr(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],bs(this.registerIcons()||{},this),this.langText={};var r,o,s=this.registerLanguageTexts()||{};r=s,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 a="";try{a=this.render()}catch(pa){throw Mr.logError("Plugin:".concat(this.pluginName,":render"),pa),new Error("Plugin:".concat(this.pluginName,":render:").concat(pa.message))}if(a)(n=i.insert(a,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=Br.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||{},u=this.config.style||{};this.setAttr(l),this.setStyle(u),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"===gr(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var n,r,o=i,s=t[o],a={root:e.root};"function"==typeof s?(n=e.config[o]||{},r=s):"object"===gr(s)&&"function"==typeof s.plugin&&(n=s.options?Br.deepCopy(e.config[o]||{},s.options):e.config[o]||{},r=s.plugin),a.config=n,void 0!==n.index&&(a.index=n.index),n.root&&(a.root=n.root),e.registerPlugin(r,a,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:"disable",value:function(){this.config.disable=!0,Br.addClass(this.find(".xgplayer-icon"),Es)}},{key:"enable",value:function(){this.config.disable=!1,Br.removeClass(this.find(".xgplayer-icon"),Es)}},{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=Ir(Tr(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"===Br.typeOf(e)?this.root.style[e]=t:void("Object"===Br.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"===Br.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Br.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 Mr.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)),Ir(Tr(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null})),this.extraEls=[]}}],[{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 s=0,a=null,l="";s<n;s++){a=t.children[s];var u=Number(a.getAttribute("data-index"));if(u>=r){l="beforebegin";break}u<r&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,a):a.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[s]}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 s=vs(e,t,i,n,r);s.key="".concat(t,"_").concat(i),o.push(s)}));else{var s=vs(e,t,i,n,r);s.key="".concat(t,"_").concat(i),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return ms}},{key:"POSITIONS",get:function(){return _s}}]),i}(),Cs=function(){function e(){var t=this;if(yr(this,e),_r(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 Hr(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Fr(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(pa){console.error(pa)}}return mr(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(Jo),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{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(pa){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.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}(),Is=null;var As={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()},Is||(Is=new Cs),Is.addObserver(t,i)),this.pluginGroup[n]={_originalOptions:e.config||{},_plugins:{}}},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"===Br.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=e;var s=i.pluginName||t.pluginName;if(!s)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 a=Object.keys(o),l=0;l<a.length;l++)if(s.toLowerCase()===a[l].toLowerCase()){var u=o[a[l]];"Object"===Br.typeOf(u)?i.config=Object.assign({},i.config,o[a[l]]):"Boolean"===Br.typeOf(u)&&(i.config.disable=!u);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[s.toLowerCase()]&&(this.unRegister(n,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var c=new t(i);return r[s.toLowerCase()]=c,r[s.toLowerCase()].func=t,c&&"function"==typeof c.afterCreate&&c.afterCreate(),c}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(s,"]"))}}},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(pa){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),pa)}},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,s=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();s.push(i(t))}catch(pa){throw s.push(i(null)),pa}})),Promise.all([].concat(s)).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()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n,r;i=e.root,null===(r=Is)||void 0===r||r.unObserver(i,n);for(var o=this.pluginGroup[t]._plugins,s=0,a=Object.keys(o);s<a.length;s++){var l=a[s];this.unRegister(t,l)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Ps={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 ws(){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 Ds=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=br(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),_r(br(e),"onMouseLeave",(function(t){br(e).player.focus()})),e}return mr(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Gr.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(Ps.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(wo,(function(t){t?Br.addClass(e.root,"mini-controls"):Br.removeClass(e.root,"mini-controls")}));var s=this.playerConfig.isMobileSimulateMode;"mobile"!==Gr.device&&"mobile"!==s&&(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&&Br.addClass(this.root,Ps.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){Br.removeClass(this.root,Ps.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){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){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case _s.CONTROLS_LEFT:t.root=this.left;break;case _s.CONTROLS_RIGHT:t.root=this.right;break;case _s.CONTROLS_CENTER:t.root=this.center;break;case _s.CONTROLS:t.root=this.root;break;default:t.root=this.left}return Ir(Tr(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Gr.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,n=e.initShow;if(!e.disable){var r=Br.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},_r({},Ps.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}(),Ls={lang:{},langKeys:[],textKeys:[]};function Rs(e,t){return Object.keys(t).forEach((function(i){var n,r=Br.typeOf(t[i]),o=Br.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,Ar(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Rs(e[i],t[i])):e[i]=t[i]})),e}function xs(){Object.keys(Ls.lang.en).map((function(e){Ls.textKeys[e]=e}))}function Os(e,t){var i=e.LANG;if(t||(t=Ls),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Rs(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),xs()}}Os({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 Ns={get textKeys(){return Ls.textKeys},get langKeys(){return Ls.langKeys},get lang(){var e={};return Ls.langKeys.map((function(t){e[t]=Ls.lang[t]})),Ls.lang["zh-cn"]&&(e.zh=Ls.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=Ls),t.lang){i="Array"!==Br.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]?Rs(n[e.LANG]||{},e.TEXT||{}):Os(e,t)})),xs()}},use:Os,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Rs(i.lang,Ls.lang),(t=i.langKeys).push.apply(t,Ar(Ls.langKeys)),Rs(i.textKeys,Ls.textKeys),i}},Ms={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Us=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Bs={},Hs=null,Fs=function(e){Er(i,Lr.EventEmitter);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(i,[{key:"add",value:function(e){e&&(Bs[e.playerId]=e,1===Object.keys(Bs).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Bs[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Bs)if(Object.prototype.hasOwnProperty.call(Bs,i)){var n=Bs[i];if(t){if(e(n))break}else e(n)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var n=e(i);return n&&(t=i),n}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Bs[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Bs[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Bs),t=0;t<e.length;t++){var i=Bs[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Bs[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Bs[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Hs||(Hs=new i),Hs}}]),i}();var js=["play","pause","replay","retry"],Vs=0,Ks=0,Gs=null,Ws=function(e){Er(i,$o);var t=Cr(i);function i(e){var n;yr(this,i);var r,o=Br.deepMerge(ws(),e);_r(br(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Mr.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(ro,n.canPlayFunc),n.removeClass(Ps.ENTER)}})),_r(br(n),"onFullscreenChange",(function(e,t){var i=function(){Br.setTimeout(br(n),(function(){n.resize()}),100)},r=Br.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Ho,{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,Jo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Ps.FULLSCREEN),n.emit(Ao,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var s=br(n),a=s._fullScreenOffset;if(s.config.needFullscreenScroll?(window.scrollTo(a.left,a.top),Br.setTimeout(br(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(Ps.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Ps.FULLSCREEN)}n._fullscreenEl=null,n.emit(Ao,!1)}})),_r(br(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),_r(br(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),as(br(n),js),n.config=o,n._pluginInfoId=Br.generateSessionId(),(r=br(n)).logInfo=Mr.logInfo.bind(r),r.logWarn=Mr.logWarn.bind(r),r.logError=Mr.logError.bind(r);var s=n.constructor.defaultPreset;if(n.config.presets.length){var a=n.config.presets.indexOf("default");a>=0&&s&&(n.config.presets[a]=s)}else s&&n.config.presets.push(s);if(n.userTimer=null,n.waitTimer=null,n.handleSource=!0,n._state=Ms.INITIAL,n.isAd=!1,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=Ns.init(n._pluginInfoId),Gr.os.isAndroid&&Gr.osVersion>0&&Gr.osVersion<6&&(n.config.autoplay=!1),n.database=new Xo,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=Gs,!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"))),kr(n);var l=n.config,u=l.definition,c=void 0===u?{}:u;if(!l.url&&c.list&&c.list.length>0){var h=c.list.find((function(e){return e.definition&&e.definition===c.defaultDefinition}));h||(c.defaultDefinition=c.list[0].definition,h=c.list[0]),n.config.url=h.url,n.curDefinition=h}return n._bindEvents(),n._registerPresets(),n._registerPlugins(),As.onPluginsReady(br(n)),n.getInitDefinition(),n.setState(Ms.READY),Br.setTimeout(br(n),(function(){n.emit(go)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<Ms.ATTACHED)&&n.start(),n}return mr(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.nodeType)return this.emit(Jr,new $r("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=i}var n=function(e){for(var t=Object.keys(Bs),i=0;i<t.length;i++){var n=Bs[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(Mr.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Jo,this.playerId),this.media.setAttribute(Jo,this.playerId),null===(e=Gs)||void 0===e||e.add(this),As.init(this),this._initBaseDoms(),this.config.controls){var r=this.config.controls.root||null,o=As.register(this,Ds,{root:r});this.controls=o}var s="mobile"===this.config.isMobileSimulateMode?"mobile":Gr.device;if(this.addClass("".concat(Ps.DEFAULT," ").concat(Ps.INACTIVE," xgplayer-").concat(s," ").concat(this.config.controls?"":Ps.NO_CONTROLS)),this.config.autoplay?this.addClass(Ps.ENTER):this.addClass(Ps.NO_START),this.config.fluid){var a=this.config,l=a.width,u=a.height;"number"==typeof l&&"number"==typeof u||(l=600,u=337.5);var c={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*u/l,"%")};Object.keys(c).forEach((function(e){t.root.style[e]=c[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var h=this.root.getBoundingClientRect(),d=h.width,p=h.height,f=h.left,g=h.top;return this.sizeInfo.width=d,this.sizeInfo.height=p,this.sizeInfo.left=f,this.sizeInfo.top=g,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=Br.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)])})),qo.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Gr.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(ao,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(Xr,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),qo.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(Xr,this.playFunc),this.off(ro,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(Br.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.media&&(e&&""!==e&&("Array"!==Br.typeOf(e)||0!==e.length)||(e="",this.emit(yo),Mr.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){Br.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===Br.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"===Br.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var r=this.media.readyState;Mr.logInfo("_startInit readyState",r),this.config.autoplay&&(!Br.isMSE(this.media)&&this.load(),(Gr.os.isIpad||Gr.os.isPhone)&&this.mediaPlay());var o=this.config.startTime;this.__startTime=o>0?o:-1,this.config.startTime=0,r>=2&&this.duration>0?this.canPlayFunc():this.on(ro,this.canPlayFunc),(!this.hasStart||this.state<Ms.ATTACHED)&&As.afterInit(this),this.hasStart=!0,this.setState(Ms.ATTACHED),Br.setTimeout(this,(function(){t.emit(_o)}),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&&Ns.extend(r,this.__i18n);var o=i.join("||").toLowerCase().split("||"),s=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&&s[n.toLowerCase()])return;if(i.lazy&&i.loader){var r=As.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Mr.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(a){Mr.logError("_registerPlugins:",a)}}))}},{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,s=void 0===o?[]:o,a=r.ignores,l=void 0===a?[]:a,u=r.icons,c=void 0===u?{}:u,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,Ar(s)),(n=e.config.ignores).push.apply(n,Ar(l)),Object.keys(c).map((function(t){e.config.icons[t]||(e.config.icons[t]=c[t])}));var p=e.config.i18n||[];d.push.apply(d,Ar(p)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case _s.ROOT_RIGHT:this.rightBar||(this.rightBar=Br.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case _s.ROOT_LEFT:this.leftBar||(this.leftBar=Br.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case _s.ROOT_TOP:this.topBar||(this.topBar=Br.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&Br.addClass(this.topBar,Ps.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=As.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!As.checkPluginIfExits(n.pluginName,o)&&o.push(n);var s=As.getRootByConfig(n.pluginName,this.config);s.root&&(r.root=s.root),s.position&&(r.position=s.position);var a,l=r.position?r.position:r.config&&r.config.position||n.defaultConfig&&n.defaultConfig.position;return!r.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(a=this.controls)||void 0===a?void 0:a.registerPlugin(n,r,n.pluginName):(r.root||(r.root=this._getRootByPosition(l)),As.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?As.unRegister(this,e):e instanceof hs&&As.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 hs&&(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 As.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=As.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Br.hasClass(this.root,e)||Br.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Br.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Br.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>Ms.ATTACHING)){var i=this._playSessionId;return Br.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(Ms.ATTACHING),this._registerPlugins(!1),As.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url,{playSessionId:i})}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Mr.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===Br.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",s),i.off("canplay",s),t(e)},s=function(){i._seekToStartTime(),o&&i.pause(),i.off("error",r),e(!0)};i.once("error",r),n?(Gr.os.isAndroid?i.once("timeupdate",s):i.once("canplay",s),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<Ms.ATTACHED)return this.removeClass(Ps.NO_START),this.addClass(Ps.ENTER),this.start(),void(this._useAutoplay=!0);this.state<Ms.RUNNING&&(this.removeClass(Ps.NO_START),!this.isCanplay&&this.addClass(Ps.ENTER));var t=Ir(Tr(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Ps.NOT_ALLOW_AUTOPLAY),e.addClass(Ps.PLAYING),e.state<Ms.RUNNING&&(Mr.logInfo(">>>>playPromise.then"),e.setState(Ms.RUNNING),e.emit(vo))})).catch((function(t){if(Mr.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Ps.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Br.setTimeout(e,(function(){e._errorTimer=null,e.emit(mo),e.addClass(Ps.NOT_ALLOW_AUTOPLAY),e.removeClass(Ps.ENTER),e.pause(),e.setState(Ms.NOTALLOW)}),0))})):(Mr.logWarn("video.play not return promise"),this.state<Ms.RUNNING&&(this.setState(Ms.RUNNING),this.removeClass(Ps.NOT_ALLOW_AUTOPLAY),this.removeClass(Ps.NO_START),this.removeClass(Ps.ENTER),this.addClass(Ps.PLAYING),this.emit(vo))),t}},{key:"mediaPause",value:function(){Ir(Tr(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){Ir(Tr(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Ps.PAUSED),us(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;us(this,"pause",(function(){Ir(Tr(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,s=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(to,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Ps.ENTER),i.isSeeking=!1,s){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(to,this._onceSeekCanplay),this.state<Ms.RUNNING?(this.removeClass(Ps.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(Do,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,fr({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(Lo,{from:t,to:e})})):this.emit(Lo,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ao,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Ps.NOT_ALLOW_AUTOPLAY,Ps.PLAYING,Ps.NO_START,Ps.PAUSED,Ps.REPLAY,Ps.ENTER,Ps.ENDED,Ps.ERROR,Ps.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(Ps.NO_START),this.emit(Fo)}},{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;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var n=ws();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e,t=this,n=this.innerContainer,r=this.root,o=this.media;if(r&&o){if(this.hasStart=!1,this._useAutoplay=!1,r.removeAttribute(Jo),o.removeAttribute(Jo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),Br.clearAllTimers(this),this.emit(To),null===(e=Gs)||void 0===e||e.remove(this),As.destroy(this),ls(this),Ir(Tr(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var s=n.children,a=0;a<s.length;a++)n.removeChild(s[a]);!n&&o instanceof window.Node&&r.contains(o)&&!this.config.remainMediaAfterDestroy&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var l=r.className.split(" ");l.length>0?r.className=l.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(Ps.ENDED),this.currentTime=0,this.isSeeking=!1,us(this,"replay",(function(){e.once(to,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(Eo),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Ps.ERROR),this.addClass(Ps.LOADING),us(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=Br.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(ro,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Ps.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Br.filterStyleFromText(e)),Br.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Br.filterStyleFromText(t),Br.addClass(t,n),t.setAttribute(Jo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Ps.PARENT_FULLSCREEN),this._orgCss&&(Br.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Br.removeClass(e,i),t&&t!==e&&this._orgPCss&&(Br.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Br.removeClass(t,n),t.removeAttribute(Jo))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:Br.scrollTop(),left:Br.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",Br.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<Qo.length;n++){var r=Qo[n];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o: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||Br.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<Zo.length;i++){var n=Zo[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(Ps.INNER_FULLSCREEN," ").concat(Ps.CSS_FULLSCREEN):Ps.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i;(!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(this.fullscreen=!0,this.emit(Ao,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Po,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Ps.INNER_FULLSCREEN," ").concat(Ps.CSS_FULLSCREEN):Ps.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(Ao,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Po,!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(Ps.INNER_FULLSCREEN," ").concat(Ps.ROTATE_FULLSCREEN):Ps.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Ps.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style");var i=90===Math.abs(window.orientation)||90===Math.abs(screen.orientation.angle);this.root.style.width="".concat(i?window.innerWidth:window.innerHeight,"px"),this.emit(Ao,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Ps.INNER_FULLSCREEN," ").concat(Ps.ROTATE_FULLSCREEN):Ps.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Ps.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(Ao,!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(po,fr({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._clearUserTimer(),this.emit(fo,fr({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(Ps.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Br.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||i||!this.paused&&!this.ended)&&this.addClass(Ps.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Ps.ENTER),this.removeClass(Ps.ERROR),this.removeClass(Ps.LOADING),this.isCanplay=!0,this.waitTimer&&Br.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(oo,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Ps.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===Ms.ENDED&&this.setState(Ms.RUNNING),this.removeClass(Ps.PAUSED),this.ended&&this.removeClass(Ps.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Ps.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Ps.ENDED),this.setState(Ms.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Ps.NOT_ALLOW_AUTOPLAY),this.removeClass(Ps.NO_START),this.removeClass(Ps.ENTER),this.removeClass(Ps.LOADING),this.addClass(Ps.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Ps.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Br.clearTimeout(this,this.waitTimer),this.removeClass(Ps.LOADING),this.removeClass(Ps.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Br.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Br.setTimeout(this,(function(){e.addClass(Ps.LOADING),e.emit(Io),Br.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Ps.NO_START,Ps.PAUSED,Ps.ENDED,Ps.ERROR,Ps.REPLAY,Ps.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(Ps.LOADING))&&this.media.readyState>2&&(this.removeClass(Ps.LOADING),Br.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===Ms.NOTALLOW&&this.duration&&(this.setState(Ms.RUNNING),this.emit(vo)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Br.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"===Br.typeOf(e)?e:e.type||"";i.props&&"Array"!==Br.typeOf(i.props)&&(i.props=[i.props]),this.emit(Ho,fr({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=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,n=void 0===i?0:i,r=t.endDiff,o=void 0===r?0:r,s=this.media.buffered;if(!s||0===s.length||!this.duration)return!0;for(var a=e||this.media.currentTime||.2,l=s.length,u=0;u<l;u++)if(s.start(u)+n<=a&&s.end(u)-o>a)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,t=this.videoPos,i=t.vy,n=t.vx,r=t.h,o=t.w,s=this.videoPos.rotate;if(!(s<0&&r<0&&o<0)){var a=this.videoPos._pi;if(!a&&this.media.videoHeight&&(a=this.media.videoWidth/this.media.videoHeight*100),a){this.videoPos.pi=a;var l={rotate:s=s<0?0:s},u=0,c=0,h=1,d=Math.abs(s/90),p=this.root,f=this.innerContainer,g=p.offsetWidth,y=f?f.offsetHeight:p.offsetHeight,v={},m=y,_=g;if(d%2==0)h=r>0?100/r:o>0?100/o:1,l.scale=h,u=i>0?(100-r)/2-i:0,l.y=2===d?0-u:u,c=n>0?(100-o)/2-n:0,l.x=2===d?0-c:c,v.width="".concat(_,"px"),v.height="".concat(m,"px"),v.maxWidth="",v.maxHeight="";else if(d%2==1){m=g;var E=y-g;c=-E/2/(_=y)*100,l.x=3===d?c+i/2:c-i/2,u=E/2/m*100,l.y=3===d?u+n/2:u-n/2,l.scale=h,v.width="".concat(_,"px"),v.maxWidth="".concat(_,"px"),v.height="".concat(m,"px"),v.maxHeight="".concat(m,"px")}var T=Br.getTransformStyle(l,this.media.style.transform||this.media.style.webkitTransform);v.transform=T,v.webkitTransform=T,Object.keys(v).map((function(t){e.media.style[t]=v[t]}))}}}},{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"===Br.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,us(this,"playnext",(function(){t.start(),t.emit(Mo,e)}))}},{key:"resize",value:function(){var e=this;if(this.media&&this.root){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,s=o.fitVideoSize,a=o.videoFillMode;if("fill"!==a&&"cover"!==a&&"contain"!==a||this.setAttribute("data-xgfill",a),r&&n){this._videoHeight=r,this._videoWidth=n;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,c=t.height-l,h=parseInt(n/r*1e3,10),d=parseInt(u/c*1e3,10),p=u,f=c,g={};"auto"===s&&d>h||"fixWidth"===s?(f=u/h*1e3,this.config.fluid?g.paddingTop="".concat(100*f/p,"%"):g.height="".concat(f+l,"px")):("auto"===s&&d<h||"fixHeight"===s)&&(p=h*c/1e3,g.width="".concat(p,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===a&&d<h||"fillWidth"===a&&d>h)&&this.setAttribute("data-xgfill","cover");var y={videoScale:h,vWidth:p,vHeight:f,cWidth:p,cHeight:f+l};this.resizePosition(),this.emit(Ro,y)}}}},{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){Mr.logInfo("setState","state from:".concat(Us[this.state]," to:").concat(Us[e])),this._state=e}},{key:"preProcessUrl",value:function(e,t){var i=this.config,n=i.preProcessUrl,r=i.preProcessUrlOptions,o=Object.assign({},r,t);return Br.isBlob(e)||"function"!=typeof n?{url:e}:n(e,o)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{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(Ms.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===Ms.RUNNING||this._state===Ms.ENDED},set:function(e){e?this.setState(Ms.RUNNING):this._state>=Ms.RUNNING&&this.setState(Ms.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){var t=Ns.langKeys.filter((function(t){return t===e}));0!==t.length||"zh"===e?(this.config.lang=e,As.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(Ns.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 Wr}},{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 Ir(Tr(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=Ir(Tr(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return Ir(Tr(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=Br.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Ks},set:function(e){Ks=e}},{key:"realTimeSpeed",get:function(){return Vs},set:function(e){Vs=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 ts.call.apply(ts,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return ns.call.apply(ns,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return rs.call.apply(rs,[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 os.call.apply(os,[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 ss.call.apply(ss,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),Br.typeOf(t)===Boolean&&(this.muted=t)),null===(i=Gs)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Mr.config.debug},set:function(e){Mr.config.debug=e}},{key:"instManager",get:function(){return Gs},set:function(e){Gs=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=Gs)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=Gs)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return Gr.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Gr.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}();_r(Ws,"defaultPreset",null),_r(Ws,"XgVideoProxy",null),Ws.instManager=Fs.getInstance();const Ys=Object.assign(Ws,{BasePlugin:hs,Errors:$r,Events:Yo,InstManager:Fs,Sniffer:Gr,Util:Br}),zs={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"}},$s=["zh","en","jp","zh-hk"],Xs={NORMAL:0,INNER:1,FULLSCREEN:2};var qs=(e=>(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))(qs||{});const Qs=5e9,Zs={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var Js=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(Js||{}),ea={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:"生放送"}},ta={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:"直播"}};const ia="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,na="color: #fff; background-color: #5f5f5f;",ra="color: #fff; background-color: #f53f3f;",oa="color: #fff; background-color: #ff7d00;",sa="color: #fff; background: #4281ff",aa="%c VePlayer %c 1.19.0-rc.1 ",la={config:{debug:ia?3:1},log:function(e,...t){this.config.debug>=3&&console.log(aa,na,sa,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(aa,oa,sa,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](aa,ra,sa,e,...t)}};localStorage.getItem("velog")&&(la.config.debug=3);var ua={exports:{}};ua.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",o="minute",s="hour",a="day",l="week",u="month",c="quarter",h="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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])+"]"}},v=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},m={s:v,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(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,s=t.clone().add(n+(o?-1:1),u);return+(-(n+(i-r)/(o?r-s:s-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:h,w:l,d:a,D:d,h:s,m:o,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",E={};E[_]=y;var T=function(e){return e instanceof C},S=function e(t,i,n){var r;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();E[o]&&(r=o),i&&(E[o]=i,r=o);var s=t.split("-");if(!r&&s.length>1)return e(s[0])}else{var a=t.name;E[a]=t,r=a}return!n&&r&&(_=r),r||!n&&_},b=function(e,t){if(T(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new C(i)},k=m;k.l=S,k.i=T,k.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function y(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=y.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(k.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(f);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()},v.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()},v.$utils=function(){return k},v.isValid=function(){return!(this.$d.toString()===p)},v.isSame=function(e,t){var i=b(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return b(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<b(e)},v.$g=function(e,t,i){return k.u(e)?this[t]:this.set(i,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var i=this,n=!!k.u(t)||t,c=k.p(e),p=function(e,t){var r=k.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(a)},f=function(e,t){return k.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(c){case h:return n?p(1,0):p(31,11);case u:return n?p(1,y):p(0,y+1);case l:var _=this.$locale().weekStart||0,E=(g<_?g+7:g)-_;return p(n?v-E:v+(6-E),y);case a:case d:return f(m+"Hours",0);case s:return f(m+"Minutes",1);case o:return f(m+"Seconds",2);case r:return f(m+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var i,l=k.p(e),c="set"+(this.$u?"UTC":""),p=(i={},i[a]=c+"Date",i[d]=c+"Date",i[u]=c+"Month",i[h]=c+"FullYear",i[s]=c+"Hours",i[o]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[l],f=l===a?this.$D+(t-this.$W):t;if(l===u||l===h){var g=this.clone().set(d,1);g.$d[p](f),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[k.p(e)]()},v.add=function(n,c){var d,p=this;n=Number(n);var f=k.p(c),g=function(e){var t=b(p);return k.w(t.date(t.date()+Math.round(e*n)),p)};if(f===u)return this.set(u,this.$M+n);if(f===h)return this.set(h,this.$y+n);if(f===a)return g(1);if(f===l)return g(7);var y=(d={},d[o]=t,d[s]=i,d[r]=e,d)[f]||1,v=this.$d.getTime()+n*y;return k.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.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=k.z(this),o=this.$H,s=this.$m,a=this.$M,l=i.weekdays,u=i.months,c=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].slice(0,o)},h=function(e){return k.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:a+1,MM:k.s(a+1,2,"0"),MMM:c(i.monthsShort,a,u,3),MMMM:c(u,a),D:this.$D,DD:k.s(this.$D,2,"0"),d:String(this.$W),dd:c(i.weekdaysMin,this.$W,l,2),ddd:c(i.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:k.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,s,!0),A:d(o,s,!1),m:String(s),mm:k.s(s,2,"0"),s:String(this.$s),ss:k.s(this.$s,2,"0"),SSS:k.s(this.$ms,3,"0"),Z:r};return n.replace(g,(function(e,t){return t||f[e]||r.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,d,p){var f,g=k.p(d),y=b(n),v=(y.utcOffset()-this.utcOffset())*t,m=this-y,_=k.m(this,y);return _=(f={},f[h]=_/12,f[u]=_,f[c]=_/3,f[l]=(m-v)/6048e5,f[a]=(m-v)/864e5,f[s]=m/i,f[o]=m/t,f[r]=m/e,f)[g]||m,p?_:k.a(_)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return E[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=S(e,t,!0);return n&&(i.$L=n),i},v.clone=function(){return k.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},y}(),I=C.prototype;return b.prototype=I,[["$ms",n],["$s",r],["$m",o],["$H",s],["$W",a],["$M",u],["$y",h],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),b.extend=function(e,t){return e.$i||(e(t,C,b),e.$i=!0),b},b.locale=S,b.isDayjs=T,b.unix=function(e){return b(1e3*e)},b.en=E[_],b.Ls=E,b.p={},b}();const ca=ur(ua.exports);var ha,da,pa,fa={exports:{}};const ga=ur(fa.exports=(ha="minute",da=/[+-]\d\d(?::?\d\d)?/g,pa=/([+-]|\d\d)/g,function(e,t,i){var n=t.prototype;i.utc=function(e){return new t({date:e,utc:!0,args:arguments})},n.utc=function(e){var t=i(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),ha):t},n.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var r=n.parse;n.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),r.call(this,e)};var o=n.init;n.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 o.call(this)};var s=n.utcOffset;n.utcOffset=function(e,t){var i=this.$utils().u;if(i(e))return this.$u?0:i(this.$offset)?s.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(da);if(!t)return null;var i=(""+t[0]).match(pa)||["-",0,0],n=i[0],r=60*+i[1]+ +i[2];return 0===r?0:"+"===n?r:-r}(e)))return this;var n=Math.abs(e)<=16?60*e:e,r=this;if(t)return r.$offset=n,r.$u=0===e,r;if(0!==e){var o=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(r=this.local().add(n+o,ha)).$offset=n,r.$x.$localOffset=o}else r=this.utc();return r};var a=n.format;n.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return a.call(this,t)},n.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var l=n.toDate;n.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var u=n.diff;n.diff=function(e,t,n){if(e&&this.$u===e.$u)return u.call(this,e,t,n);var r=this.local(),o=i(e).local();return u.call(r,o,t,n)}}));var ya=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"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},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,s="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=s&&o[e]||(s?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 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.exports=function(e){return"object"===(void 0===e?"undefined":n(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),s=Object.defineProperty;t.f=i(7)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return s(e,t,i)}catch(a){}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,s;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"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},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),s=i(13)("src"),a=i(29),l=(""+a).split("toString");i(2).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,i,a){var u="function"==typeof i;u&&(o(i,"name")||r(i,"name",t)),e[t]!==i&&(u&&(o(i,s)||r(i,s,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=i:a?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[s]||a.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,s=i(5),a=i(38),l=i(39),u=i(16),c=i(0),h=c.process,d=c.setImmediate,p=c.clearImmediate,f=c.MessageChannel,g=c.Dispatch,y=0,v={},m=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},_=function(e){m.call(e.data)};d&&p||(d=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return v[++y]=function(){a("function"==typeof e?e:Function(e),t)},n(y),y},p=function(e){delete v[e]},"process"==i(8)(h)?n=function(e){h.nextTick(s(m,e,1))}:g&&g.now?n=function(e){g.now(s(m,e,1))}:f?(o=(r=new f).port2,r.port1.onmessage=_,n=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):n="onreadystatechange"in u("script")?function(e){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),m.call(e)}}:function(e){setTimeout(s(m,e,1),0)}),e.exports={set:d,clear:p}},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,s,a=i(10),l=i(0),u=i(5),c=i(11),h=i(25),d=i(4),p=i(6),f=i(30),g=i(31),y=i(37),v=i(20).set,m=i(40)(),_=i(21),E=i(41),T=i(42),S=i(43),b=l.TypeError,k=l.process,C=k&&k.versions,I=C&&C.v8||"",A=l.Promise,P="process"==c(k),w=function(){},D=r=_.f,L=!!function(){try{var e=A.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(w,w)};return(P||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t&&0!==I.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(n){}}(),R=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},x=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,s=function(t){var i,o,s,a=r?t.ok:t.fail,l=t.resolve,u=t.reject,c=t.domain;try{a?(r||(2==e._h&&M(e),e._h=1),!0===a?i=n:(c&&c.enter(),i=a(n),c&&(c.exit(),s=!0)),i===t.promise?u(b("Promise-chain cycle")):(o=R(i))?o.call(i,l,u):l(i)):u(n)}catch(h){c&&!s&&c.exit(),u(h)}};i.length>o;)s(i[o++]);e._c=[],e._n=!1,t&&!e._h&&O(e)}))}},O=function(e){v.call(l,(function(){var t,i,n,r=e._v,o=N(e);if(o&&(t=E((function(){P?k.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||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){v.call(l,(function(){var t;P?k.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=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()),x(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 b("Promise can't be resolved itself");(i=R(t))?m((function(){var r={_w:n,_d:!1};try{i.call(t,u(e,r,1),u(U,r,1))}catch(o){U.call(r,o)}})):(n._v=t,n._s=1,x(n,!1))}catch(r){U.call({_w:n,_d:!1},r)}}};L||(A=function(e){f(this,A,"Promise","_h"),p(e),n.call(this);try{e(u(B,this,1),u(U,this,1))}catch(t){U.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)(A.prototype,{then:function(e,t){var i=D(y(this,A));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=P?k.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&x(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=u(B,e,1),this.reject=u(U,e,1)},_.f=D=function(e){return e===A||e===s?new o(e):r(e)}),h(h.G+h.W+h.F*!L,{Promise:A}),i(45)(A,"Promise"),i(46)("Promise"),s=i(2).Promise,h(h.S+h.F*!L,"Promise",{reject:function(e){var t=D(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(a||!L),"Promise",{resolve:function(e){return S(a&&this===s?A:this,e)}}),h(h.S+h.F*!(L&&i(47)((function(e){A.all(e).catch(w)}))),"Promise",{all:function(e){var t=this,i=D(t),n=i.resolve,r=i.reject,o=E((function(){var i=[],o=0,s=1;g(e,!1,(function(e){var a=o++,l=!1;i.push(void 0),s++,t.resolve(e).then((function(e){l||(l=!0,i[a]=e,--s||n(i))}),r)})),--s||n(i)}));return o.e&&r(o.v),i.promise},race:function(e){var t=this,i=D(t),n=i.reject,r=E((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),s=i(17),a=i(5),l=function e(t,i,l){var u,c,h,d,p=t&e.F,f=t&e.G,g=t&e.P,y=t&e.B,v=f?n:t&e.S?n[i]||(n[i]={}):(n[i]||{}).prototype,m=f?r:r[i]||(r[i]={}),_=m.prototype||(m.prototype={});for(u in f&&(l=i),l)h=((c=!p&&v&&void 0!==v[u])?v:l)[u],d=y&&c?a(h,n):g&&"function"==typeof h?a(Function.call,h):h,v&&s(v,u,h,t&e.U),m[u]!=h&&o(m,u,d),g&&_[u]!=h&&(_[u]=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),s=i(3),a=i(34),l=i(36),u={},c={},h=e.exports=function(e,t,i,h,d){var p,f,g,y,v=d?function(){return e}:l(e),m=n(i,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(p=a(e.length);p>_;_++)if((y=t?m(s(f=e[_])[0],f[1]):m(e[_]))===u||y===c)return y}else for(g=v.call(e);!(f=g.next()).done;)if((y=r(g,m,f.value,t))===u||y===c)return y};h.BREAK=u,h.RETURN=c},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(s){var o=e.return;throw void 0!==o&&n(o.call(e)),s}}},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,s=n(e).constructor;return void 0===s||null==(i=n(s)[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,s=n.process,a=n.Promise,l="process"==i(8)(s);e.exports=function(){var e,t,i,u=function(){var n,r;for(l&&(n=s.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(){s.nextTick(u)};else if(!o||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var c=a.resolve(void 0);i=function(){c.then(u)}}else i=function(){r.call(n,u)};else{var h=!0,d=document.createTextNode("");new o(u).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),s=i(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[s]&&r.f(t,s,{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(s){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o=[7],s=o[n]();s.next=function(){return{done:i=!0}},o[n]=function(){return s},e(o)}catch(a){}return i}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var 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};t.default=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var a=void 0;try{a=(0,o.getUri)(e,t,i,r)}catch(l){return Promise.reject(l.message)}return new s.default({type:"json",method:"GET",url:a}).then((function(e){var t=void 0;if(e&&e.response)switch(n(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}))};var r,o=i(49),s=(r=i(51))&&r.__esModule?r:{default:r};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]:{},o=arguments[3];try{e=JSON.parse((0,n.decode)(e))}catch(a){throw new Error("base64 decode error: "+a.message)}!1===o.jointSsl||r(i,"ssl")||r(i,"Ssl")||(i.Ssl=1);var s=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+function(e){var t=[];for(var i in e)r(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}(i);return s};var n=i(50),r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},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,s=void 0,a=[-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,s="";o<l;){do{t=a[255&e.charCodeAt(o++)]}while(o<l&&-1===t);if(-1===t)break;do{i=a[255&e.charCodeAt(o++)]}while(o<l&&-1===i);if(-1===i)break;s+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(n=255&e.charCodeAt(o++)))return s;n=a[n]}while(o<l&&-1===n);if(-1===n)break;s+=String.fromCharCode((15&i)<<4|(60&n)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return s;r=a[r]}while(o<l&&-1===r);if(-1===r)break;s+=String.fromCharCode((3&n)<<6|r)}return s}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.data,s=void 0===o?{}:o,a=t.headers,l=void 0===a?{}:a;return new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),a=[];if("GET"!==o)throw new Error("xhr "+o+" is not supported");for(var u in s)a.push(u+"="+s[u]);for(var c in n.open(o,""+i,!0),n.responseType="",l)Object.prototype.hasOwnProperty.call(l,c)&&n.setRequestHeader(c,""+l[c]);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}]);const va=ur(ya);ca.extend(ga);var ma=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(ma||{});function _a(e){try{return JSON.parse(e)}catch(pa){return la.warn(`[utils/json] decode fail: ${e}`,pa),null}}function Ea(e,t="GetPlayInfoToken"){if(!e)return;const i={},n=_a(window.atob(e));if(n&&"string"==typeof n[t]){n[t].split("&").map((e=>{const t=e.split("=");t[0]&&t[1]&&(i[t[0]]=t[1])}))}return i}function Ta(e){const t={};return decodeURIComponent(e).split("&").map((e=>{const i=e.split("=");i[0]&&i[1]&&(t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))})),t}const Sa=e=>{var t,i,n;if(!(null==e?void 0:e.playAuthToken))return;const r=Ea(null==e?void 0:e.playAuthToken),o=null!=(i=null==(t=null==r?void 0:r.FileType)?void 0:t.toLowerCase())?i:"video",s=null==(n=null==r?void 0:r.Format)?void 0:n.toLowerCase();return s||(Object.values(ma).includes(o)?nr.MP4:rr.M4A)},ba=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;const t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;const i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),n=ca.utc(i,"YYYYMMDD hhmmss");if(!n.isValid())return!1;return n.add(t,"seconds").isBefore(ca())};function ka(e,t){const i=["240p","360p","480p","540p","720p","1080p","2k","4k","od","oe"],n=e.Definition,r=t.Definition;if(i.includes(n)&&i.includes(r)){const e=i.findIndex((e=>e.toLocaleLowerCase()===n.toLocaleLowerCase()));return i.findIndex((e=>e.toLocaleLowerCase()===r.toLocaleLowerCase()))-e}return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}function Ca(e){const{playAuthToken:t,playDomain:i,reqParams:n={},definitionMap:r,needThumbs:o=!1,needBarrageMask:s=!1,autoDemoteDefinition:a,autoDemoteDefinitionTextKey:l,urlQueryParams:h}=e;if(t){const e=c(u({},n),{NeedThumbs:o?1:0,NeedBarrageMask:s?1:0});return new Promise(((n,o)=>{va.url(t,i,e).then((e=>{var t;const{Status:i,PlayInfoList:o=[],PosterUrl:s,Vid:d,Duration:p,BarrageMaskUrl:f,ThumbInfoList:g=[],EnableAdaptive:y,AdaptiveBitrateStreamingInfo:v}=e.Data||e;if(i===qs.VALID&&o.length){const i=o.map((e=>{var t;const i=h?$a(e.MainPlayUrl,h):e.MainPlayUrl,n=h?$a(e.BackupPlayUrl,h):e.BackupPlayUrl;return u(u({vid:d,url:i,_mainURL:i,_backupURL:n,streamType:e.Format,backupUrl:n,backUrlList:[n],fileType:e.FileType,format:e.Format,bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,playAuthId:e.PlayAuthId,playAuth:e.PlayAuth,secretKey:e.PlayAuth,vwidth:e.Width,vheight:e.Height,vtype:null==(t=e.Format)?void 0:t.toLocaleUpperCase(),codec:e.Codec,urlExpireTimestamp:al(e.MainUrlExpire,10,Qs),drmType:e.DrmType},e),ja(e,{definitionMap:r,autoDemoteDefinition:a,autoDemoteDefinitionTextKey:l}))})).sort(ka);n({playList:i,type:null==(t=i[0])?void 0:t.Format,poster:s,vid:d,duration:p,dashOpts:e.Data?e:{Data:c(u({},e),{VideoID:d})},thumbs:g,barrageMaskUrl:f,enableAdaptive:y,adaptiveBitrateStreamingInfo:v})}else n({playList:[],poster:s,vid:d,duration:p,dashOpts:e.Data?e:{Data:e},thumbs:g,barrageMaskUrl:f,enableAdaptive:y,adaptiveBitrateStreamingInfo:v}),la.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{la.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function Ia(e,t,i,n){return d(this,null,(function*(){try{return yield e()}catch(r){if(--t&&i(r))return Ia(e,t,i,n);if(n&&"function"==typeof n)return yield n(r);throw r}}))}function Aa(e,t,i,n){return i+"/?"+n+"&"+ol({ThirdPartyDrmType:e,Kid:t})}const Pa="__veplayer_";function wa(e,t="",i){if(!e)return;const n=Pa+t+"_"+e;localStorage.setItem(n,i+"")}function Da(e,t=""){if(!e)return;const i=Pa+t+"_"+e;return localStorage.getItem(i)}function La(){var e,t;try{const i=null==(t=null==(e=globalThis.crypto)?void 0:e.randomUUID)?void 0:t.call(e);if("string"==typeof i&&i.length>0)return i}catch(pa){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function Ra(e){if(!e)return La();const t=`line_user_${encodeURIComponent(e)}`;try{const e=Da(t,"ttdrama");if(e)return e;const i=La();return wa(t,"ttdrama",i),i}catch(pa){return La()}}function xa(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var Oa=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(Oa||{});function Na(e,t){return new Promise(((i,n)=>{try{e||n(new Error("url is undefined"));let r=xa();const o=r,s=new window.XMLHttpRequest,a={status:0,statusText:"",connectTime:0,raw:s};s.open("get",e),s.onreadystatechange=()=>{2===s.readyState&&(a.headers=function(e){const t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){const i=e.split(": "),n=i.shift();t[n]=i.join(": ")}))}catch(i){return t}return t}(s),a.connectTime=xa()-o,a.status=s.status,a.statusText=s.statusText,r=xa())},s.onload=()=>{a.response=s.response,i(a)},s.onprogress=e=>{const t=xa()-r;let i=0;i=parseInt(""+e.loaded/1e3/(t/1e3),10),a.speed=0|i,a.costTime=t},s.onerror=()=>{a.status||(a.status=-1,a.costTime=xa()-r),n(a)},s.ontimeout=()=>{a.status||(a.status=-2,a.costTime=xa()-r),i(a)},s.onabort=()=>{i(a)},(null==t?void 0:t.type)&&(s.responseType=t.type),s.timeout=(null==t?void 0:t.timeout)||1e4,s.setRequestHeader("Range",`bytes=${(null==t?void 0:t.range)||"0-1048576"}`),s.send()}catch(pa){n(pa)}}))}function Ma(e){var t,i,n;if(e.url)return(null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i.hls)||(null==(n=null==e?void 0:e.plugins)?void 0:n.mp4encryptplayer)?1:+Br.isMSE(e.media)}function Ua(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class Ba{constructor(){this.timings=[],this.timingMap={},this.now=function(){const e=globalThis.performance;return(null==e?void 0:e.now)&&"function"==typeof e.now?()=>e.now():()=>Date.now()}(),this.startAt=this.now()}markDuration(e,t){const i=Ua(t);this.timings.push({name:e,duration:i}),this.timingMap[e]=i}measure(e,t){const i=this.now();try{return t()}finally{this.markDuration(e,this.now()-i)}}measureAsync(e,t){return d(this,null,(function*(){const i=this.now();try{return yield t()}finally{this.markDuration(e,this.now()-i)}}))}finish(){return{totalDuration:Ua(this.now()-this.startAt),timings:[...this.timings],timingMap:u({},this.timingMap)}}}let Ha;const Fa=()=>Ha,ja=function(e,t){var i;const{definitionMap:n,autoDemoteDefinition:r,autoDemoteDefinitionTextKey:o}=t||{};if(!e)return{definition:"240P"};const s=e,a=s.Definition||s.Quality||s.definition||s.quality;if(!a)return{definition:"240P"};if(n){let e={definition:a};const t=n[a];return e=t?"string"==typeof t?{definition:t}:u({definition:a},t||{}):{definition:a},r&&r.toLocaleLowerCase()===(null==(i=null==e?void 0:e.definition)?void 0:i.toLocaleLowerCase())&&(e={definition:"auto",definitionTextKey:o,mapDefinition:e.definition}),e}return{definition:a}};const Va=class{constructor(){this.timeID=null,this.func=null}repeat(e,t){this.timeID=1,this.repeatInterval(e,t)}repeatInterval(e,t){this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((()=>{e(),this.repeatInterval(e,t)}),t)))}clear(){clearTimeout(this.timeID),this.timeID=null}},Ka='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',Ga=['video/mp4;codecs="hev1.1.6.L120.90"','video/mp4;codecs="hev1.2.4.L120.90"','video/mp4;codecs="hev1.3.E.L120.90"','video/mp4;codecs="hev1.4.10.L120.90"'],Wa={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]};function Ya(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(Wa)){const[i,n]=t;if(n.includes(i)){e=i;break}}if(e)return e}i=null==(t=e[0])?void 0:t.src}else i="string"==typeof e?e:"";return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(i)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(i)?"flv":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(i)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(i)?"dash":"mp4"}function za(e){return e&&e.then?e:Promise.resolve(e)}const $a=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+ol(t):e,Xa=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((n=>{n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function qa(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function Qa(e,t=200,i=""){let n=setTimeout((()=>{i&&la.warn(i),n=null}),t);return e.then?e.then((()=>clearTimeout(n))):(clearTimeout(n),n=null),e}function Za(e,t=1,i=0){return new Promise(((n,r)=>{e().then(n).catch((o=>{setTimeout((()=>{1!==t?Za(e,t-1,i).then(n,r):r(o)}),i)}))}))}function Ja(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return la.error("mse error",t),!1}}function el(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(Ka):"h265"===e?Ga.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const tl="undefined"!=typeof window,il=tl&&navigator.userAgent.toLocaleLowerCase(),nl=tl&&/^((?!chrome|android).)*safari/.test(il);function rl(e,t){const i={sg:{__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"byteplus",__LOG_CHANNEL_DOMAIN__:"https://mcs-nontt.byteintlapi.com",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.19.0-rc.1/plugin"}},n=t||"sg";return e&&i[e]||i[n]}function ol(e){return Object.entries(e).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}function sl(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function al(e,t=10,i=0){const n=parseInt(e,t);return Number.isNaN(n)?i:n}function ll(e){var t,i,n,r,o,s,a;const l=e.getPlugin("drm"),u=e.getPlugin("EncryptHlsPlugin"),c=e.getPlugin("Mp4EncryptPlayer"),h=e.getPlugin("DASHPlugin"),d=(null==(t=null==u?void 0:u.config)?void 0:t.drmKeyToken)||(null==(i=null==c?void 0:c.config)?void 0:i.drmKeyToken)||(null==(n=null==h?void 0:h.config)?void 0:n.drmKeyToken),p=((null==(r=null==u?void 0:u.config)?void 0:r.drmType)||(null==(o=null==c?void 0:c.config)?void 0:o.drmType)||(null==(s=null==h?void 0:h.config)?void 0:s.drmType))===or.PRIVATE_ENCRYPT_UPGRADE,f=null==(a=null==u?void 0:u.config)?void 0:a.keyToken;return l?or.DRM_ENCRYPT:d?or.PRIVATE_ENCRYPT:f?or.STANDARD_ENCRYPT:p?or.PRIVATE_ENCRYPT_UPGRADE:void 0}function ul(e){var t,i,n,r;const o=null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i._playOriginalUrl,s=null==(n=null==e?void 0:e.curDefinition)?void 0:n.main_url;return o||s||(null==(r=e.curDefinition)?void 0:r.url)||e.config.url}const cl=/["'&<>]/;function hl(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 dl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hl(Object(i),!0).forEach((function(t){vl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):hl(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function pl(e){return(pl="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 fl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gl(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,_l(n.key),n)}}function yl(e,t,i){return t&&gl(e.prototype,t),i&&gl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function vl(e,t,i){return(t=_l(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ml(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 _l(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 El=function(e){return e&&e.Math==Math&&e},Tl=El("object"==typeof globalThis&&globalThis)||El("object"==typeof window&&window)||El("object"==typeof self&&self)||El("object"==typeof lr&&lr)||function(){return this}()||Function("return this")(),Sl={},bl=function(e){try{return!!e()}catch(t){return!0}},kl=!bl((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Cl=!bl((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Il=Cl,Al=Function.prototype.call,Pl=Il?Al.bind(Al):function(){return Al.apply(Al,arguments)},wl={},Dl={}.propertyIsEnumerable,Ll=Object.getOwnPropertyDescriptor,Rl=Ll&&!Dl.call({1:2},1);wl.f=Rl?function(e){var t=Ll(this,e);return!!t&&t.enumerable}:Dl;var xl,Ol,Nl=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ml=Cl,Ul=Function.prototype,Bl=Ul.call,Hl=Ml&&Ul.bind.bind(Bl,Bl),Fl=Ml?Hl:function(e){return function(){return Bl.apply(e,arguments)}},jl=Fl,Vl=jl({}.toString),Kl=jl("".slice),Gl=function(e){return Kl(Vl(e),8,-1)},Wl=bl,Yl=Gl,zl=Object,$l=Fl("".split),Xl=Wl((function(){return!zl("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yl(e)?$l(e,""):zl(e)}:zl,ql=function(e){return null==e},Ql=ql,Zl=TypeError,Jl=function(e){if(Ql(e))throw Zl("Can't call method on "+e);return e},eu=Xl,tu=Jl,iu=function(e){return eu(tu(e))},nu="object"==typeof document&&document.all,ru={all:nu,IS_HTMLDDA:void 0===nu&&void 0!==nu},ou=ru.all,su=ru.IS_HTMLDDA?function(e){return"function"==typeof e||e===ou}:function(e){return"function"==typeof e},au=su,lu=ru.all,uu=ru.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:au(e)||e===lu}:function(e){return"object"==typeof e?null!==e:au(e)},cu=Tl,hu=su,du=function(e,t){return arguments.length<2?(i=cu[e],hu(i)?i:void 0):cu[e]&&cu[e][t];var i},pu=Fl({}.isPrototypeOf),fu=du("navigator","userAgent")||"",gu=Tl,yu=fu,vu=gu.process,mu=gu.Deno,_u=vu&&vu.versions||mu&&mu.version,Eu=_u&&_u.v8;Eu&&(Ol=(xl=Eu.split("."))[0]>0&&xl[0]<4?1:+(xl[0]+xl[1])),!Ol&&yu&&(!(xl=yu.match(/Edge\/(\d+)/))||xl[1]>=74)&&(xl=yu.match(/Chrome\/(\d+)/))&&(Ol=+xl[1]);var Tu=Ol,Su=Tu,bu=bl,ku=!!Object.getOwnPropertySymbols&&!bu((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Su&&Su<41})),Cu=ku&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Iu=du,Au=su,Pu=pu,wu=Object,Du=Cu?function(e){return"symbol"==typeof e}:function(e){var t=Iu("Symbol");return Au(t)&&Pu(t.prototype,wu(e))},Lu=String,Ru=function(e){try{return Lu(e)}catch(t){return"Object"}},xu=su,Ou=Ru,Nu=TypeError,Mu=function(e){if(xu(e))return e;throw Nu(Ou(e)+" is not a function")},Uu=Mu,Bu=ql,Hu=function(e,t){var i=e[t];return Bu(i)?void 0:Uu(i)},Fu=Pl,ju=su,Vu=uu,Ku=TypeError,Gu={exports:{}},Wu=Tl,Yu=Object.defineProperty,zu=function(e,t){try{Yu(Wu,e,{value:t,configurable:!0,writable:!0})}catch(i){Wu[e]=t}return t},$u=zu,Xu="__core-js_shared__",qu=Tl[Xu]||$u(Xu,{}),Qu=qu;(Gu.exports=function(e,t){return Qu[e]||(Qu[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Zu=Gu.exports,Ju=Jl,ec=Object,tc=function(e){return ec(Ju(e))},ic=tc,nc=Fl({}.hasOwnProperty),rc=Object.hasOwn||function(e,t){return nc(ic(e),t)},oc=Fl,sc=0,ac=Math.random(),lc=oc(1..toString),uc=function(e){return"Symbol("+(void 0===e?"":e)+")_"+lc(++sc+ac,36)},cc=Tl,hc=rc,dc=uc,pc=ku,fc=Cu,gc=Zu("wks"),yc=cc.Symbol,vc=yc&&yc.for,mc=fc?yc:yc&&yc.withoutSetter||dc,_c=function(e){if(!hc(gc,e)||!pc&&"string"!=typeof gc[e]){var t="Symbol."+e;pc&&hc(yc,e)?gc[e]=yc[e]:gc[e]=fc&&vc?vc(t):mc(t)}return gc[e]},Ec=Pl,Tc=uu,Sc=Du,bc=Hu,kc=function(e,t){var i,n;if("string"===t&&ju(i=e.toString)&&!Vu(n=Fu(i,e)))return n;if(ju(i=e.valueOf)&&!Vu(n=Fu(i,e)))return n;if("string"!==t&&ju(i=e.toString)&&!Vu(n=Fu(i,e)))return n;throw Ku("Can't convert object to primitive value")},Cc=TypeError,Ic=_c("toPrimitive"),Ac=function(e,t){if(!Tc(e)||Sc(e))return e;var i,n=bc(e,Ic);if(n){if(void 0===t&&(t="default"),i=Ec(n,e,t),!Tc(i)||Sc(i))return i;throw Cc("Can't convert object to primitive value")}return void 0===t&&(t="number"),kc(e,t)},Pc=Ac,wc=Du,Dc=function(e){var t=Pc(e,"string");return wc(t)?t:t+""},Lc=uu,Rc=Tl.document,xc=Lc(Rc)&&Lc(Rc.createElement),Oc=function(e){return xc?Rc.createElement(e):{}},Nc=Oc,Mc=!kl&&!bl((function(){return 7!=Object.defineProperty(Nc("div"),"a",{get:function(){return 7}}).a})),Uc=kl,Bc=Pl,Hc=wl,Fc=Nl,jc=iu,Vc=Dc,Kc=rc,Gc=Mc,Wc=Object.getOwnPropertyDescriptor;Sl.f=Uc?Wc:function(e,t){if(e=jc(e),t=Vc(t),Gc)try{return Wc(e,t)}catch(i){}if(Kc(e,t))return Fc(!Bc(Hc.f,e,t),e[t])};var Yc={},zc=kl&&bl((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$c=uu,Xc=String,qc=TypeError,Qc=function(e){if($c(e))return e;throw qc(Xc(e)+" is not an object")},Zc=kl,Jc=Mc,eh=zc,th=Qc,ih=Dc,nh=TypeError,rh=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,sh="enumerable",ah="configurable",lh="writable";Yc.f=Zc?eh?function(e,t,i){if(th(e),t=ih(t),th(i),"function"==typeof e&&"prototype"===t&&"value"in i&&lh in i&&!i[lh]){var n=oh(e,t);n&&n[lh]&&(e[t]=i.value,i={configurable:ah in i?i[ah]:n[ah],enumerable:sh in i?i[sh]:n[sh],writable:!1})}return rh(e,t,i)}:rh:function(e,t,i){if(th(e),t=ih(t),th(i),Jc)try{return rh(e,t,i)}catch(n){}if("get"in i||"set"in i)throw nh("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var uh=Yc,ch=Nl,hh=kl?function(e,t,i){return uh.f(e,t,ch(1,i))}:function(e,t,i){return e[t]=i,e},dh={exports:{}},ph=kl,fh=rc,gh=Function.prototype,yh=ph&&Object.getOwnPropertyDescriptor,vh=fh(gh,"name"),mh={EXISTS:vh,PROPER:vh&&"something"===function(){}.name,CONFIGURABLE:vh&&(!ph||ph&&yh(gh,"name").configurable)},_h=su,Eh=qu,Th=Fl(Function.toString);_h(Eh.inspectSource)||(Eh.inspectSource=function(e){return Th(e)});var Sh,bh,kh,Ch=Eh.inspectSource,Ih=su,Ah=Tl.WeakMap,Ph=Ih(Ah)&&/native code/.test(String(Ah)),wh=uc,Dh=Zu("keys"),Lh=function(e){return Dh[e]||(Dh[e]=wh(e))},Rh={},xh=Ph,Oh=Tl,Nh=uu,Mh=hh,Uh=rc,Bh=qu,Hh=Lh,Fh=Rh,jh="Object already initialized",Vh=Oh.TypeError,Kh=Oh.WeakMap;if(xh||Bh.state){var Gh=Bh.state||(Bh.state=new Kh);Gh.get=Gh.get,Gh.has=Gh.has,Gh.set=Gh.set,Sh=function(e,t){if(Gh.has(e))throw Vh(jh);return t.facade=e,Gh.set(e,t),t},bh=function(e){return Gh.get(e)||{}},kh=function(e){return Gh.has(e)}}else{var Wh=Hh("state");Fh[Wh]=!0,Sh=function(e,t){if(Uh(e,Wh))throw Vh(jh);return t.facade=e,Mh(e,Wh,t),t},bh=function(e){return Uh(e,Wh)?e[Wh]:{}},kh=function(e){return Uh(e,Wh)}}var Yh={set:Sh,get:bh,has:kh,enforce:function(e){return kh(e)?bh(e):Sh(e,{})},getterFor:function(e){return function(t){var i;if(!Nh(t)||(i=bh(t)).type!==e)throw Vh("Incompatible receiver, "+e+" required");return i}}},zh=bl,$h=su,Xh=rc,qh=kl,Qh=mh.CONFIGURABLE,Zh=Ch,Jh=Yh.enforce,ed=Yh.get,td=Object.defineProperty,id=qh&&!zh((function(){return 8!==td((function(){}),"length",{value:8}).length})),nd=String(String).split("String"),rd=dh.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!Xh(e,"name")||Qh&&e.name!==t)&&(qh?td(e,"name",{value:t,configurable:!0}):e.name=t),id&&i&&Xh(i,"arity")&&e.length!==i.arity&&td(e,"length",{value:i.arity});try{i&&Xh(i,"constructor")&&i.constructor?qh&&td(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=Jh(e);return Xh(n,"source")||(n.source=nd.join("string"==typeof t?t:"")),e};Function.prototype.toString=rd((function(){return $h(this)&&ed(this).source||Zh(this)}),"toString");var od=dh.exports,sd=su,ad=Yc,ld=od,ud=zu,cd=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(sd(i)&&ld(i,o,n),n.global)r?e[t]=i:ud(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(s){}r?e[t]=i:ad.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},hd={},dd=Math.ceil,pd=Math.floor,fd=Math.trunc||function(e){var t=+e;return(t>0?pd:dd)(t)},gd=function(e){var t=+e;return t!=t||0===t?0:fd(t)},yd=gd,vd=Math.max,md=Math.min,_d=function(e,t){var i=yd(e);return i<0?vd(i+t,0):md(i,t)},Ed=gd,Td=Math.min,Sd=function(e){return e>0?Td(Ed(e),9007199254740991):0},bd=Sd,kd=function(e){return bd(e.length)},Cd=iu,Id=_d,Ad=kd,Pd=function(e){return function(t,i,n){var r,o=Cd(t),s=Ad(o),a=Id(n,s);if(e&&i!=i){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===i)return e||a||0;return!e&&-1}},wd={includes:Pd(!0),indexOf:Pd(!1)},Dd=rc,Ld=iu,Rd=wd.indexOf,xd=Rh,Od=Fl([].push),Nd=function(e,t){var i,n=Ld(e),r=0,o=[];for(i in n)!Dd(xd,i)&&Dd(n,i)&&Od(o,i);for(;t.length>r;)Dd(n,i=t[r++])&&(~Rd(o,i)||Od(o,i));return o},Md=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ud=Nd,Bd=Md.concat("length","prototype");hd.f=Object.getOwnPropertyNames||function(e){return Ud(e,Bd)};var Hd={};Hd.f=Object.getOwnPropertySymbols;var Fd=du,jd=hd,Vd=Hd,Kd=Qc,Gd=Fl([].concat),Wd=Fd("Reflect","ownKeys")||function(e){var t=jd.f(Kd(e)),i=Vd.f;return i?Gd(t,i(e)):t},Yd=rc,zd=Wd,$d=Sl,Xd=Yc,qd=function(e,t,i){for(var n=zd(t),r=Xd.f,o=$d.f,s=0;s<n.length;s++){var a=n[s];Yd(e,a)||i&&Yd(i,a)||r(e,a,o(t,a))}},Qd=bl,Zd=su,Jd=/#|\.prototype\./,ep=function(e,t){var i=ip[tp(e)];return i==rp||i!=np&&(Zd(t)?Qd(t):!!t)},tp=ep.normalize=function(e){return String(e).replace(Jd,".").toLowerCase()},ip=ep.data={},np=ep.NATIVE="N",rp=ep.POLYFILL="P",op=ep,sp=Tl,ap=Sl.f,lp=hh,up=cd,cp=zu,hp=qd,dp=op,pp=function(e,t){var i,n,r,o,s,a=e.target,l=e.global,u=e.stat;if(i=l?sp:u?sp[a]||cp(a,{}):(sp[a]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(s=ap(i,n))&&s.value:i[n],!dp(l?n:a+(u?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;hp(o,r)}(e.sham||r&&r.sham)&&lp(o,"sham",!0),up(i,n,o,e)}},fp=Gl,gp=Array.isArray||function(e){return"Array"==fp(e)},yp=TypeError,vp=function(e){if(e>9007199254740991)throw yp("Maximum allowed index exceeded");return e},mp=Dc,_p=Yc,Ep=Nl,Tp=function(e,t,i){var n=mp(t);n in e?_p.f(e,n,Ep(0,i)):e[n]=i},Sp={};Sp[_c("toStringTag")]="z";var bp="[object z]"===String(Sp),kp=bp,Cp=su,Ip=Gl,Ap=_c("toStringTag"),Pp=Object,wp="Arguments"==Ip(function(){return arguments}()),Dp=kp?Ip: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=Pp(e),Ap))?i:wp?Ip(t):"Object"==(n=Ip(t))&&Cp(t.callee)?"Arguments":n},Lp=Fl,Rp=bl,xp=su,Op=Dp,Np=Ch,Mp=function(){},Up=[],Bp=du("Reflect","construct"),Hp=/^\s*(?:class|function)\b/,Fp=Lp(Hp.exec),jp=!Hp.exec(Mp),Vp=function(e){if(!xp(e))return!1;try{return Bp(Mp,Up,e),!0}catch(t){return!1}},Kp=function(e){if(!xp(e))return!1;switch(Op(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jp||!!Fp(Hp,Np(e))}catch(t){return!0}};Kp.sham=!0;var Gp=!Bp||Rp((function(){var e;return Vp(Vp.call)||!Vp(Object)||!Vp((function(){e=!0}))||e}))?Kp:Vp,Wp=gp,Yp=Gp,zp=uu,$p=_c("species"),Xp=Array,qp=function(e){var t;return Wp(e)&&(t=e.constructor,(Yp(t)&&(t===Xp||Wp(t.prototype))||zp(t)&&null===(t=t[$p]))&&(t=void 0)),void 0===t?Xp:t},Qp=function(e,t){return new(qp(e))(0===t?0:t)},Zp=bl,Jp=Tu,ef=_c("species"),tf=function(e){return Jp>=51||!Zp((function(){var t=[];return(t.constructor={})[ef]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},nf=pp,rf=bl,of=gp,sf=uu,af=tc,lf=kd,uf=vp,cf=Tp,hf=Qp,df=tf,pf=Tu,ff=_c("isConcatSpreadable"),gf=pf>=51||!rf((function(){var e=[];return e[ff]=!1,e.concat()[0]!==e})),yf=df("concat"),vf=function(e){if(!sf(e))return!1;var t=e[ff];return void 0!==t?!!t:of(e)};nf({target:"Array",proto:!0,arity:1,forced:!gf||!yf},{concat:function(e){var t,i,n,r,o,s=af(this),a=hf(s,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(vf(o=-1===t?s:arguments[t]))for(r=lf(o),uf(l+r),i=0;i<r;i++,l++)i in o&&cf(a,l,o[i]);else uf(l+1),cf(a,l++,o);return a.length=l,a}});var mf=Gl,_f=Fl,Ef=function(e){if("Function"===mf(e))return _f(e)},Tf=Mu,Sf=Cl,bf=Ef(Ef.bind),kf=function(e,t){return Tf(e),void 0===t?e:Sf?bf(e,t):function(){return e.apply(t,arguments)}},Cf=kf,If=Xl,Af=tc,Pf=kd,wf=Qp,Df=Fl([].push),Lf=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(l,u,c,h){for(var d,p,f=Af(l),g=If(f),y=Cf(u,c),v=Pf(g),m=0,_=h||wf,E=t?_(l,v):i||s?_(l,0):void 0;v>m;m++)if((a||m in g)&&(p=y(d=g[m],m,f),e))if(t)E[m]=p;else if(p)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:Df(E,d)}else switch(e){case 4:return!1;case 7:Df(E,d)}return o?-1:n||r?r:E}},Rf={forEach:Lf(0),map:Lf(1),filter:Lf(2),some:Lf(3),every:Lf(4),find:Lf(5),findIndex:Lf(6),filterReject:Lf(7)},xf=Rf.map;pp({target:"Array",proto:!0,forced:!tf("map")},{map:function(e){return xf(this,e,arguments.length>1?arguments[1]:void 0)}});var Of=Nd,Nf=Md,Mf=Object.keys||function(e){return Of(e,Nf)},Uf=tc,Bf=Mf;pp({target:"Object",stat:!0,forced:bl((function(){Bf(1)}))},{keys:function(e){return Bf(Uf(e))}});var Hf=Dp,Ff=String,jf=function(e){if("Symbol"===Hf(e))throw TypeError("Cannot convert a Symbol value to a string");return Ff(e)},Vf=Fl,Kf=gd,Gf=jf,Wf=Jl,Yf=Vf("".charAt),zf=Vf("".charCodeAt),$f=Vf("".slice),Xf=function(e){return function(t,i){var n,r,o=Gf(Wf(t)),s=Kf(i),a=o.length;return s<0||s>=a?e?"":void 0:(n=zf(o,s))<55296||n>56319||s+1===a||(r=zf(o,s+1))<56320||r>57343?e?Yf(o,s):n:e?$f(o,s,s+2):r-56320+(n-55296<<10)+65536}},qf={codeAt:Xf(!1),charAt:Xf(!0)},Qf=qf.charAt,Zf=Jl,Jf=gd,eg=jf;pp({target:"String",proto:!0,forced:!0},{at:function(e){var t=eg(Zf(this)),i=t.length,n=Jf(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:Qf(t,r)}});var tg=Dp,ig=bp?{}.toString:function(){return"[object "+tg(this)+"]"};bp||cd(Object.prototype,"toString",ig,{unsafe:!0});var ng=Qc,rg=function(){var e=ng(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},og=Pl,sg=rc,ag=pu,lg=rg,ug=RegExp.prototype,cg=function(e){var t=e.flags;return void 0!==t||"flags"in ug||sg(e,"flags")||!ag(ug,e)?t:og(lg,e)},hg=mh.PROPER,dg=cd,pg=Qc,fg=jf,gg=bl,yg=cg,vg="toString",mg=RegExp.prototype[vg],_g=gg((function(){return"/a/b"!=mg.call({source:"a",flags:"b"})})),Eg=hg&&mg.name!=vg;(_g||Eg)&&dg(RegExp.prototype,vg,(function(){var e=pg(this);return"/"+fg(e.source)+"/"+fg(yg(e))}),{unsafe:!0});var Tg=Oc("span").classList,Sg=Tg&&Tg.constructor&&Tg.constructor.prototype,bg=Sg===Object.prototype?void 0:Sg,kg=bl,Cg=function(e,t){var i=[][e];return!!i&&kg((function(){i.call(null,t||function(){return 1},1)}))},Ig=Rf.forEach,Ag=Tl,Pg={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},wg=bg,Dg=Cg("forEach")?[].forEach:function(e){return Ig(this,e,arguments.length>1?arguments[1]:void 0)},Lg=hh,Rg=function(e){if(e&&e.forEach!==Dg)try{Lg(e,"forEach",Dg)}catch(t){e.forEach=Dg}};for(var xg in Pg)Pg[xg]&&Rg(Ag[xg]&&Ag[xg].prototype);Rg(wg);var Og=su,Ng=String,Mg=TypeError,Ug=Fl,Bg=Qc,Hg=function(e){if("object"==typeof e||Og(e))return e;throw Mg("Can't set "+Ng(e)+" as a prototype")},Fg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Ug(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return Bg(i),Hg(n),t?e(i,n):i.__proto__=n,i}}():void 0),jg=su,Vg=uu,Kg=Fg,Gg=function(e,t,i){var n,r;return Kg&&jg(n=t.constructor)&&n!==i&&Vg(r=n.prototype)&&r!==i.prototype&&Kg(e,r),e},Wg=Fl(1..valueOf),Yg="\t\n\v\f\r                 \u2028\u2029\ufeff",zg=Jl,$g=jf,Xg=Yg,qg=Fl("".replace),Qg="["+Xg+"]",Zg=RegExp("^"+Qg+Qg+"*"),Jg=RegExp(Qg+Qg+"*$"),ey=function(e){return function(t){var i=$g(zg(t));return 1&e&&(i=qg(i,Zg,"")),2&e&&(i=qg(i,Jg,"")),i}},ty={start:ey(1),end:ey(2),trim:ey(3)},iy=kl,ny=Tl,ry=Fl,oy=op,sy=cd,ay=rc,ly=Gg,uy=pu,cy=Du,hy=Ac,dy=bl,py=hd.f,fy=Sl.f,gy=Yc.f,yy=Wg,vy=ty.trim,my="Number",_y=ny[my],Ey=_y.prototype,Ty=ny.TypeError,Sy=ry("".slice),by=ry("".charCodeAt),ky=function(e){var t,i,n,r,o,s,a,l,u=hy(e,"number");if(cy(u))throw Ty("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=vy(u),43===(t=by(u,0))||45===t){if(88===(i=by(u,2))||120===i)return NaN}else if(48===t){switch(by(u,1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+u}for(s=(o=Sy(u,2)).length,a=0;a<s;a++)if((l=by(o,a))<48||l>r)return NaN;return parseInt(o,n)}return+u};if(oy(my,!_y(" 0o1")||!_y("0b1")||_y("+0x1"))){for(var Cy,Iy=function(e){var t=arguments.length<1?0:_y(function(e){var t=hy(e,"number");return"bigint"==typeof t?t:ky(t)}(e)),i=this;return uy(Ey,i)&&dy((function(){yy(i)}))?ly(Object(t),i,Iy):t},Ay=iy?py(_y):"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(","),Py=0;Ay.length>Py;Py++)ay(_y,Cy=Ay[Py])&&!ay(Iy,Cy)&&gy(Iy,Cy,fy(_y,Cy));Iy.prototype=Ey,Ey.constructor=Iy,sy(ny,my,Iy,{constructor:!0})}var wy=kl,Dy=mh.EXISTS,Ly=Fl,Ry=Yc.f,xy=Function.prototype,Oy=Ly(xy.toString),Ny=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,My=Ly(Ny.exec);wy&&!Dy&&Ry(xy,"name",{configurable:!0,get:function(){try{return My(Ny,Oy(this))[1]}catch(e){return""}}});var Uy=pp,By=Xl,Hy=iu,Fy=Cg,jy=Fl([].join),Vy=By!=Object,Ky=Fy("join",",");Uy({target:"Array",proto:!0,forced:Vy||!Ky},{join:function(e){return jy(Hy(this),void 0===e?",":e)}});var Gy,Wy,Yy,zy,$y="process"==Gl(Tl.process),Xy=Yc.f,qy=rc,Qy=_c("toStringTag"),Zy=function(e,t,i){e&&!i&&(e=e.prototype),e&&!qy(e,Qy)&&Xy(e,Qy,{configurable:!0,value:t})},Jy=du,ev=Yc,tv=kl,iv=_c("species"),nv=function(e){var t=Jy(e),i=ev.f;tv&&t&&!t[iv]&&i(t,iv,{configurable:!0,get:function(){return this}})},rv=pu,ov=TypeError,sv=Gp,av=Ru,lv=TypeError,uv=Qc,cv=function(e){if(sv(e))return e;throw lv(av(e)+" is not a constructor")},hv=ql,dv=_c("species"),pv=function(e,t){var i,n=uv(e).constructor;return void 0===n||hv(i=uv(n)[dv])?t:cv(i)},fv=Cl,gv=Function.prototype,yv=gv.apply,vv=gv.call,mv="object"==typeof Reflect&&Reflect.apply||(fv?vv.bind(yv):function(){return vv.apply(yv,arguments)}),_v=du("document","documentElement"),Ev=Fl([].slice),Tv=TypeError,Sv=/(?:ipad|iphone|ipod).*applewebkit/i.test(fu),bv=Tl,kv=mv,Cv=kf,Iv=su,Av=rc,Pv=bl,wv=_v,Dv=Ev,Lv=Oc,Rv=function(e,t){if(e<t)throw Tv("Not enough arguments");return e},xv=Sv,Ov=$y,Nv=bv.setImmediate,Mv=bv.clearImmediate,Uv=bv.process,Bv=bv.Dispatch,Hv=bv.Function,Fv=bv.MessageChannel,jv=bv.String,Vv=0,Kv={},Gv="onreadystatechange";try{Gy=bv.location}catch(fF){}var Wv=function(e){if(Av(Kv,e)){var t=Kv[e];delete Kv[e],t()}},Yv=function(e){return function(){Wv(e)}},zv=function(e){Wv(e.data)},$v=function(e){bv.postMessage(jv(e),Gy.protocol+"//"+Gy.host)};Nv&&Mv||(Nv=function(e){Rv(arguments.length,1);var t=Iv(e)?e:Hv(e),i=Dv(arguments,1);return Kv[++Vv]=function(){kv(t,void 0,i)},Wy(Vv),Vv},Mv=function(e){delete Kv[e]},Ov?Wy=function(e){Uv.nextTick(Yv(e))}:Bv&&Bv.now?Wy=function(e){Bv.now(Yv(e))}:Fv&&!xv?(zy=(Yy=new Fv).port2,Yy.port1.onmessage=zv,Wy=Cv(zy.postMessage,zy)):bv.addEventListener&&Iv(bv.postMessage)&&!bv.importScripts&&Gy&&"file:"!==Gy.protocol&&!Pv($v)?(Wy=$v,bv.addEventListener("message",zv,!1)):Wy=Gv in Lv("script")?function(e){wv.appendChild(Lv("script"))[Gv]=function(){wv.removeChild(this),Wv(e)}}:function(e){setTimeout(Yv(e),0)});var Xv,qv,Qv,Zv,Jv,em,tm,im,nm={set:Nv,clear:Mv},rm=Tl,om=/ipad|iphone|ipod/i.test(fu)&&void 0!==rm.Pebble,sm=/web0s(?!.*chrome)/i.test(fu),am=Tl,lm=kf,um=Sl.f,cm=nm.set,hm=Sv,dm=om,pm=sm,fm=$y,gm=am.MutationObserver||am.WebKitMutationObserver,ym=am.document,vm=am.process,mm=am.Promise,_m=um(am,"queueMicrotask"),Em=_m&&_m.value;Em||(Xv=function(){var e,t;for(fm&&(e=vm.domain)&&e.exit();qv;){t=qv.fn,qv=qv.next;try{t()}catch(fF){throw qv?Zv():Qv=void 0,fF}}Qv=void 0,e&&e.enter()},hm||fm||pm||!gm||!ym?!dm&&mm&&mm.resolve?((tm=mm.resolve(void 0)).constructor=mm,im=lm(tm.then,tm),Zv=function(){im(Xv)}):fm?Zv=function(){vm.nextTick(Xv)}:(cm=lm(cm,am),Zv=function(){cm(Xv)}):(Jv=!0,em=ym.createTextNode(""),new gm(Xv).observe(em,{characterData:!0}),Zv=function(){em.data=Jv=!Jv}));var Tm=Em||function(e){var t={fn:e,next:void 0};Qv&&(Qv.next=t),qv||(qv=t,Zv()),Qv=t},Sm=Tl,bm=function(e){try{return{error:!1,value:e()}}catch(fF){return{error:!0,value:fF}}},km=function(){this.head=null,this.tail=null};km.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Cm=km,Im=Tl.Promise,Am="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Pm=!Am&&!$y&&"object"==typeof window&&"object"==typeof document,wm=Tl,Dm=Im,Lm=su,Rm=op,xm=Ch,Om=_c,Nm=Pm,Mm=Am,Um=Tu;Dm&&Dm.prototype;var Bm=Om("species"),Hm=!1,Fm=Lm(wm.PromiseRejectionEvent),jm={CONSTRUCTOR:Rm("Promise",(function(){var e=xm(Dm),t=e!==String(Dm);if(!t&&66===Um)return!0;if(!Um||Um<51||!/native code/.test(e)){var i=new Dm((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[Bm]=n,!(Hm=i.then((function(){}))instanceof n))return!0}return!t&&(Nm||Mm)&&!Fm})),REJECTION_EVENT:Fm,SUBCLASSING:Hm},Vm={},Km=Mu,Gm=TypeError,Wm=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw Gm("Bad Promise constructor");t=e,i=n})),this.resolve=Km(t),this.reject=Km(i)};Vm.f=function(e){return new Wm(e)};var Ym,zm,$m,Xm=pp,qm=$y,Qm=Tl,Zm=Pl,Jm=cd,e_=Fg,t_=Zy,i_=nv,n_=Mu,r_=su,o_=uu,s_=function(e,t){if(rv(t,e))return e;throw ov("Incorrect invocation")},a_=pv,l_=nm.set,u_=Tm,c_=function(e,t){var i=Sm.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},h_=bm,d_=Cm,p_=Yh,f_=Im,g_=Vm,y_="Promise",v_=jm.CONSTRUCTOR,m_=jm.REJECTION_EVENT,__=jm.SUBCLASSING,E_=p_.getterFor(y_),T_=p_.set,S_=f_&&f_.prototype,b_=f_,k_=S_,C_=Qm.TypeError,I_=Qm.document,A_=Qm.process,P_=g_.f,w_=P_,D_=!!(I_&&I_.createEvent&&Qm.dispatchEvent),L_="unhandledrejection",R_=function(e){var t;return!(!o_(e)||!r_(t=e.then))&&t},x_=function(e,t){var i,n,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{a?(s||(2===t.rejection&&B_(t),t.rejection=1),!0===a?i=o:(c&&c.enter(),i=a(o),c&&(c.exit(),r=!0)),i===e.promise?u(C_("Promise-chain cycle")):(n=R_(i))?Zm(n,i,l,u):l(i)):u(o)}catch(fF){c&&!r&&c.exit(),u(fF)}},O_=function(e,t){e.notified||(e.notified=!0,u_((function(){for(var i,n=e.reactions;i=n.get();)x_(i,e);e.notified=!1,t&&!e.rejection&&M_(e)})))},N_=function(e,t,i){var n,r;D_?((n=I_.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),Qm.dispatchEvent(n)):n={promise:t,reason:i},!m_&&(r=Qm["on"+e])?r(n):e===L_&&c_("Unhandled promise rejection",i)},M_=function(e){Zm(l_,Qm,(function(){var t,i=e.facade,n=e.value;if(U_(e)&&(t=h_((function(){qm?A_.emit("unhandledRejection",n,i):N_(L_,i,n)})),e.rejection=qm||U_(e)?2:1,t.error))throw t.value}))},U_=function(e){return 1!==e.rejection&&!e.parent},B_=function(e){Zm(l_,Qm,(function(){var t=e.facade;qm?A_.emit("rejectionHandled",t):N_("rejectionhandled",t,e.value)}))},H_=function(e,t,i){return function(n){e(t,n,i)}},F_=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,O_(e,!0))},j_=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw C_("Promise can't be resolved itself");var n=R_(t);n?u_((function(){var i={done:!1};try{Zm(n,t,H_(j_,i,e),H_(F_,i,e))}catch(fF){F_(i,fF,e)}})):(e.value=t,e.state=1,O_(e,!1))}catch(fF){F_({done:!1},fF,e)}}};if(v_&&(k_=(b_=function(e){s_(this,k_),n_(e),Zm(Ym,this);var t=E_(this);try{e(H_(j_,t),H_(F_,t))}catch(fF){F_(t,fF)}}).prototype,(Ym=function(e){T_(this,{type:y_,done:!1,notified:!1,parent:!1,reactions:new d_,rejection:!1,state:0,value:void 0})}).prototype=Jm(k_,"then",(function(e,t){var i=E_(this),n=P_(a_(this,b_));return i.parent=!0,n.ok=!r_(e)||e,n.fail=r_(t)&&t,n.domain=qm?A_.domain:void 0,0==i.state?i.reactions.add(n):u_((function(){x_(n,i)})),n.promise})),zm=function(){var e=new Ym,t=E_(e);this.promise=e,this.resolve=H_(j_,t),this.reject=H_(F_,t)},g_.f=P_=function(e){return e===b_||undefined===e?new zm(e):w_(e)},r_(f_)&&S_!==Object.prototype)){$m=S_.then,__||Jm(S_,"then",(function(e,t){var i=this;return new b_((function(e,t){Zm($m,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete S_.constructor}catch(fF){}e_&&e_(S_,k_)}Xm({global:!0,constructor:!0,wrap:!0,forced:v_},{Promise:b_}),t_(b_,y_,!1),i_(y_);var V_={},K_=V_,G_=_c("iterator"),W_=Array.prototype,Y_=Dp,z_=Hu,$_=ql,X_=V_,q_=_c("iterator"),Q_=function(e){if(!$_(e))return z_(e,q_)||z_(e,"@@iterator")||X_[Y_(e)]},Z_=Pl,J_=Mu,eE=Qc,tE=Ru,iE=Q_,nE=TypeError,rE=Pl,oE=Qc,sE=Hu,aE=kf,lE=Pl,uE=Qc,cE=Ru,hE=function(e){return void 0!==e&&(K_.Array===e||W_[G_]===e)},dE=kd,pE=pu,fE=function(e,t){var i=arguments.length<2?iE(e):t;if(J_(i))return eE(Z_(i,e));throw nE(tE(e)+" is not iterable")},gE=Q_,yE=function(e,t,i){var n,r;oE(e);try{if(!(n=sE(e,"return"))){if("throw"===t)throw i;return i}n=rE(n,e)}catch(fF){r=!0,n=fF}if("throw"===t)throw i;if(r)throw n;return oE(n),i},vE=TypeError,mE=function(e,t){this.stopped=e,this.result=t},_E=mE.prototype,EE=function(e,t,i){var n,r,o,s,a,l,u,c=i&&i.that,h=!(!i||!i.AS_ENTRIES),d=!(!i||!i.IS_RECORD),p=!(!i||!i.IS_ITERATOR),f=!(!i||!i.INTERRUPTED),g=aE(t,c),y=function(e){return n&&yE(n,"normal",e),new mE(!0,e)},v=function(e){return h?(uE(e),f?g(e[0],e[1],y):g(e[0],e[1])):f?g(e,y):g(e)};if(d)n=e.iterator;else if(p)n=e;else{if(!(r=gE(e)))throw vE(cE(e)+" is not iterable");if(hE(r)){for(o=0,s=dE(e);s>o;o++)if((a=v(e[o]))&&pE(_E,a))return a;return new mE(!1)}n=fE(e,r)}for(l=d?e.next:n.next;!(u=lE(l,n)).done;){try{a=v(u.value)}catch(fF){yE(n,"throw",fF)}if("object"==typeof a&&a&&pE(_E,a))return a}return new mE(!1)},TE=_c("iterator"),SE=!1;try{var bE=0,kE={next:function(){return{done:!!bE++}},return:function(){SE=!0}};kE[TE]=function(){return this},Array.from(kE,(function(){throw 2}))}catch(fF){}var CE=Im,IE=jm.CONSTRUCTOR||!function(e,t){if(!t&&!SE)return!1;var i=!1;try{var n={};n[TE]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(fF){}return i}((function(e){CE.all(e).then(void 0,(function(){}))})),AE=Pl,PE=Mu,wE=Vm,DE=bm,LE=EE;pp({target:"Promise",stat:!0,forced:IE},{all:function(e){var t=this,i=wE.f(t),n=i.resolve,r=i.reject,o=DE((function(){var i=PE(t.resolve),o=[],s=0,a=1;LE(e,(function(e){var l=s++,u=!1;a++,AE(i,t,e).then((function(e){u||(u=!0,o[l]=e,--a||n(o))}),r)})),--a||n(o)}));return o.error&&r(o.value),i.promise}});var RE=pp,xE=jm.CONSTRUCTOR,OE=Im,NE=du,ME=su,UE=cd,BE=OE&&OE.prototype;if(RE({target:"Promise",proto:!0,forced:xE,real:!0},{catch:function(e){return this.then(void 0,e)}}),ME(OE)){var HE=NE("Promise").prototype.catch;BE.catch!==HE&&UE(BE,"catch",HE,{unsafe:!0})}var FE=Pl,jE=Mu,VE=Vm,KE=bm,GE=EE;pp({target:"Promise",stat:!0,forced:IE},{race:function(e){var t=this,i=VE.f(t),n=i.reject,r=KE((function(){var r=jE(t.resolve);GE(e,(function(e){FE(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var WE=Pl,YE=Vm;pp({target:"Promise",stat:!0,forced:jm.CONSTRUCTOR},{reject:function(e){var t=YE.f(this);return WE(t.reject,void 0,e),t.promise}});var zE=Qc,$E=uu,XE=Vm,qE=function(e,t){if(zE(e),$E(t)&&t.constructor===e)return t;var i=XE.f(e);return(0,i.resolve)(t),i.promise},QE=pp,ZE=jm.CONSTRUCTOR,JE=qE;du("Promise"),QE({target:"Promise",stat:!0,forced:ZE},{resolve:function(e){return JE(this,e)}});var eT=pp,tT=Im,iT=bl,nT=du,rT=su,oT=pv,sT=qE,aT=cd,lT=tT&&tT.prototype;if(eT({target:"Promise",proto:!0,real:!0,forced:!!tT&&iT((function(){lT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=oT(this,nT("Promise")),i=rT(e);return this.then(i?function(i){return sT(t,e()).then((function(){return i}))}:e,i?function(i){return sT(t,e()).then((function(){throw i}))}:e)}}),rT(tT)){var uT=nT("Promise").prototype.finally;lT.finally!==uT&&aT(lT,"finally",uT,{unsafe:!0})}var cT=kl,hT=gp,dT=TypeError,pT=Object.getOwnPropertyDescriptor,fT=cT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(fF){return fF instanceof TypeError}}(),gT=Ru,yT=TypeError,vT=pp,mT=tc,_T=_d,ET=gd,TT=kd,ST=fT?function(e,t){if(hT(e)&&!pT(e,"length").writable)throw dT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},bT=vp,kT=Qp,CT=Tp,IT=function(e,t){if(!delete e[t])throw yT("Cannot delete property "+gT(t)+" of "+gT(e))},AT=tf("splice"),PT=Math.max,wT=Math.min;vT({target:"Array",proto:!0,forced:!AT},{splice:function(e,t){var i,n,r,o,s,a,l=mT(this),u=TT(l),c=_T(e,u),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=u-c):(i=h-2,n=wT(PT(ET(t),0),u-c)),bT(u+i-n),r=kT(l,n),o=0;o<n;o++)(s=c+o)in l&&CT(r,o,l[s]);if(r.length=n,i<n){for(o=c;o<u-n;o++)a=o+i,(s=o+n)in l?l[a]=l[s]:IT(l,a);for(o=u;o>u-n+i;o--)IT(l,o-1)}else if(i>n)for(o=u-n;o>c;o--)a=o+i-1,(s=o+n-1)in l?l[a]=l[s]:IT(l,a);for(o=0;o<i;o++)l[o+c]=arguments[o+2];return ST(l,u-n+i),r}});var DT=gd,LT=jf,RT=Jl,xT=RangeError,OT=pp,NT=Fl,MT=gd,UT=Wg,BT=function(e){var t=LT(RT(this)),i="",n=DT(e);if(n<0||n==1/0)throw xT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},HT=bl,FT=RangeError,jT=String,VT=Math.floor,KT=NT(BT),GT=NT("".slice),WT=NT(1..toFixed),YT=function(e,t,i){return 0===t?i:t%2==1?YT(e,t-1,i*e):YT(e*e,t/2,i)},zT=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=VT(r/1e7)},$T=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=VT(n/t),n=n%t*1e7},XT=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=jT(e[t]);i=""===i?n:i+KT("0",7-n.length)+n}return i};OT({target:"Number",proto:!0,forced:HT((function(){return"0.000"!==WT(8e-5,3)||"1"!==WT(.9,0)||"1.25"!==WT(1.255,2)||"1000000000000000128"!==WT(0xde0b6b3a7640080,0)}))||!HT((function(){WT({})}))},{toFixed:function(e){var t,i,n,r,o=UT(this),s=MT(e),a=[0,0,0,0,0,0],l="",u="0";if(s<0||s>20)throw FT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return jT(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*YT(2,69,1))-69)<0?o*YT(2,-t,1):o/YT(2,t,1),i*=4503599627370496,(t=52-t)>0){for(zT(a,0,i),n=s;n>=7;)zT(a,1e7,0),n-=7;for(zT(a,YT(10,n,1),0),n=t-1;n>=23;)$T(a,1<<23),n-=23;$T(a,1<<n),zT(a,1,1),$T(a,2),u=XT(a)}else zT(a,0,i),zT(a,1<<-t,0),u=XT(a)+KT("0",s);return u=s>0?l+((r=u.length)<=s?"0."+KT("0",s-r)+u:GT(u,0,r-s)+"."+GT(u,r-s)):l+u}}),pp({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var qT=bl,QT=Tl.RegExp,ZT=qT((function(){var e=QT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),JT=ZT||qT((function(){return!QT("a","y").sticky})),eS={BROKEN_CARET:ZT||qT((function(){var e=QT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:JT,UNSUPPORTED_Y:ZT},tS={},iS=kl,nS=zc,rS=Yc,oS=Qc,sS=iu,aS=Mf;tS.f=iS&&!nS?Object.defineProperties:function(e,t){oS(e);for(var i,n=sS(t),r=aS(t),o=r.length,s=0;o>s;)rS.f(e,i=r[s++],n[i]);return e};var lS,uS=Qc,cS=tS,hS=Md,dS=Rh,pS=_v,fS=Oc,gS="prototype",yS="script",vS=Lh("IE_PROTO"),mS=function(){},_S=function(e){return"<"+yS+">"+e+"</"+yS+">"},ES=function(e){e.write(_S("")),e.close();var t=e.parentWindow.Object;return e=null,t},TS=function(){try{lS=new ActiveXObject("htmlfile")}catch(fF){}var e,t,i;TS="undefined"!=typeof document?document.domain&&lS?ES(lS):(t=fS("iframe"),i="java"+yS+":",t.style.display="none",pS.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(_S("document.F=Object")),e.close(),e.F):ES(lS);for(var n=hS.length;n--;)delete TS[gS][hS[n]];return TS()};dS[vS]=!0;var SS,bS,kS=Object.create||function(e,t){var i;return null!==e?(mS[gS]=uS(e),i=new mS,mS[gS]=null,i[vS]=e):i=TS(),void 0===t?i:cS.f(i,t)},CS=bl,IS=Tl.RegExp,AS=CS((function(){var e=IS(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),PS=bl,wS=Tl.RegExp,DS=PS((function(){var e=wS("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),LS=Pl,RS=Fl,xS=jf,OS=rg,NS=eS,MS=kS,US=Yh.get,BS=AS,HS=DS,FS=Zu("native-string-replace",String.prototype.replace),jS=RegExp.prototype.exec,VS=jS,KS=RS("".charAt),GS=RS("".indexOf),WS=RS("".replace),YS=RS("".slice),zS=(bS=/b*/g,LS(jS,SS=/a/,"a"),LS(jS,bS,"a"),0!==SS.lastIndex||0!==bS.lastIndex),$S=NS.BROKEN_CARET,XS=void 0!==/()??/.exec("")[1];(zS||XS||$S||BS||HS)&&(VS=function(e){var t,i,n,r,o,s,a,l=this,u=US(l),c=xS(e),h=u.raw;if(h)return h.lastIndex=l.lastIndex,t=LS(VS,h,c),l.lastIndex=h.lastIndex,t;var d=u.groups,p=$S&&l.sticky,f=LS(OS,l),g=l.source,y=0,v=c;if(p&&(f=WS(f,"y",""),-1===GS(f,"g")&&(f+="g"),v=YS(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==KS(c,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),i=new RegExp("^(?:"+g+")",f)),XS&&(i=new RegExp("^"+g+"$(?!\\s)",f)),zS&&(n=l.lastIndex),r=LS(jS,p?i:l,v),p?r?(r.input=YS(r.input,y),r[0]=YS(r[0],y),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:zS&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),XS&&r&&r.length>1&&LS(FS,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=s=MS(null),o=0;o<d.length;o++)s[(a=d[o])[0]]=r[a[1]];return r});var qS=VS;pp({target:"RegExp",proto:!0,forced:/./.exec!==qS},{exec:qS});var QS=Ef,ZS=cd,JS=qS,eb=bl,tb=_c,ib=hh,nb=tb("species"),rb=RegExp.prototype,ob=function(e,t,i,n){var r=tb(e),o=!eb((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!eb((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[nb]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!s||i){var a=QS(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var s=QS(e),l=t.exec;return l===JS||l===rb.exec?o&&!r?{done:!0,value:a(t,i,n)}:{done:!0,value:s(i,t,n)}:{done:!1}}));ZS(String.prototype,e,l[0]),ZS(rb,r,l[1])}n&&ib(rb[r],"sham",!0)},sb=qf.charAt,ab=function(e,t,i){return t+(i?sb(e,t).length:1)},lb=Fl,ub=tc,cb=Math.floor,hb=lb("".charAt),db=lb("".replace),pb=lb("".slice),fb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,gb=/\$([$&'`]|\d{1,2})/g,yb=Pl,vb=Qc,mb=su,_b=Gl,Eb=qS,Tb=TypeError,Sb=function(e,t){var i=e.exec;if(mb(i)){var n=yb(i,e,t);return null!==n&&vb(n),n}if("RegExp"===_b(e))return yb(Eb,e,t);throw Tb("RegExp#exec called on incompatible receiver")},bb=mv,kb=Pl,Cb=Fl,Ib=ob,Ab=bl,Pb=Qc,wb=su,Db=ql,Lb=gd,Rb=Sd,xb=jf,Ob=Jl,Nb=ab,Mb=Hu,Ub=function(e,t,i,n,r,o){var s=i+e.length,a=n.length,l=gb;return void 0!==r&&(r=ub(r),l=fb),db(o,l,(function(o,l){var u;switch(hb(l,0)){case"$":return"$";case"&":return e;case"`":return pb(t,0,i);case"'":return pb(t,s);case"<":u=r[pb(l,1,-1)];break;default:var c=+l;if(0===c)return o;if(c>a){var h=cb(c/10);return 0===h?o:h<=a?void 0===n[h-1]?hb(l,1):n[h-1]+hb(l,1):o}u=n[c-1]}return void 0===u?"":u}))},Bb=Sb,Hb=_c("replace"),Fb=Math.max,jb=Math.min,Vb=Cb([].concat),Kb=Cb([].push),Gb=Cb("".indexOf),Wb=Cb("".slice),Yb="$0"==="a".replace(/./,"$0"),zb=!!/./[Hb]&&""===/./[Hb]("a","$0");Ib("replace",(function(e,t,i){var n=zb?"$":"$0";return[function(e,i){var n=Ob(this),r=Db(e)?void 0:Mb(e,Hb);return r?kb(r,e,n,i):kb(t,xb(n),e,i)},function(e,r){var o=Pb(this),s=xb(e);if("string"==typeof r&&-1===Gb(r,n)&&-1===Gb(r,"$<")){var a=i(t,o,s,r);if(a.done)return a.value}var l=wb(r);l||(r=xb(r));var u=o.global;if(u){var c=o.unicode;o.lastIndex=0}for(var h=[];;){var d=Bb(o,s);if(null===d)break;if(Kb(h,d),!u)break;""===xb(d[0])&&(o.lastIndex=Nb(s,Rb(o.lastIndex),c))}for(var p,f="",g=0,y=0;y<h.length;y++){for(var v=xb((d=h[y])[0]),m=Fb(jb(Lb(d.index),s.length),0),_=[],E=1;E<d.length;E++)Kb(_,void 0===(p=d[E])?p:String(p));var T=d.groups;if(l){var S=Vb([v],_,m,s);void 0!==T&&Kb(S,T);var b=xb(bb(r,void 0,S))}else b=Ub(v,s,m,_,T,r);m>=g&&(f+=Wb(s,g,m)+b,g=m+v.length)}return f+Wb(s,g)}]}),!!Ab((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Yb||zb);var $b=uu,Xb=Gl,qb=_c("match"),Qb=function(e){var t;return $b(e)&&(void 0!==(t=e[qb])?!!t:"RegExp"==Xb(e))},Zb=_d,Jb=kd,ek=Tp,tk=Array,ik=Math.max,nk=function(e,t,i){for(var n=Jb(e),r=Zb(t,n),o=Zb(void 0===i?n:i,n),s=tk(ik(o-r,0)),a=0;r<o;r++,a++)ek(s,a,e[r]);return s.length=a,s},rk=mv,ok=Pl,sk=Fl,ak=ob,lk=Qc,uk=ql,ck=Qb,hk=Jl,dk=pv,pk=ab,fk=Sd,gk=jf,yk=Hu,vk=nk,mk=Sb,_k=qS,Ek=bl,Tk=eS.UNSUPPORTED_Y,Sk=4294967295,bk=Math.min,kk=[].push,Ck=sk(/./.exec),Ik=sk(kk),Ak=sk("".slice);ak("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=gk(hk(this)),r=void 0===i?Sk:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!ck(e))return ok(t,n,e,r);for(var o,s,a,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,h=new RegExp(e.source,u+"g");(o=ok(_k,h,n))&&!((s=h.lastIndex)>c&&(Ik(l,Ak(n,c,o.index)),o.length>1&&o.index<n.length&&rk(kk,l,vk(o,1)),a=o[0].length,c=s,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return c===n.length?!a&&Ck(h,"")||Ik(l,""):Ik(l,Ak(n,c)),l.length>r?vk(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:ok(t,this,e,i)}:t,[function(t,i){var r=hk(this),o=uk(t)?void 0:yk(t,e);return o?ok(o,t,r,i):ok(n,gk(r),t,i)},function(e,r){var o=lk(this),s=gk(e),a=i(n,o,s,r,n!==t);if(a.done)return a.value;var l=dk(o,RegExp),u=o.unicode,c=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Tk?"g":"y"),h=new l(Tk?"^(?:"+o.source+")":o,c),d=void 0===r?Sk:r>>>0;if(0===d)return[];if(0===s.length)return null===mk(h,s)?[s]:[];for(var p=0,f=0,g=[];f<s.length;){h.lastIndex=Tk?0:f;var y,v=mk(h,Tk?Ak(s,f):s);if(null===v||(y=bk(fk(h.lastIndex+(Tk?f:0)),s.length))===p)f=pk(s,f,u);else{if(Ik(g,Ak(s,p,f)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(Ik(g,v[m]),g.length===d)return g;f=p=y}}return Ik(g,Ak(s,p)),g}]}),!!Ek((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]})),Tk);var Pk=mh.PROPER,wk=bl,Dk=Yg,Lk=ty.trim;pp({target:"String",proto:!0,forced:function(e){return wk((function(){return!!Dk[e]()||"​…᠎"!=="​…᠎"[e]()||Pk&&Dk[e].name!==e}))}("trim")},{trim:function(){return Lk(this)}});var Rk=Rf.filter;pp({target:"Array",proto:!0,forced:!tf("filter")},{filter:function(e){return Rk(this,e,arguments.length>1?arguments[1]:void 0)}});var xk=Pl,Ok=Qc,Nk=ql,Mk=Sd,Uk=jf,Bk=Jl,Hk=Hu,Fk=ab,jk=Sb;ob("match",(function(e,t,i){return[function(t){var i=Bk(this),n=Nk(t)?void 0:Hk(t,e);return n?xk(n,t,i):new RegExp(t)[e](Uk(i))},function(e){var n=Ok(this),r=Uk(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return jk(n,r);var s=n.unicode;n.lastIndex=0;for(var a,l=[],u=0;null!==(a=jk(n,r));){var c=Uk(a[0]);l[u]=c,""===c&&(n.lastIndex=Fk(r,Mk(n.lastIndex),s)),u++}return 0===u?null:l}]}));var Vk=Yc.f,Kk=kl,Gk=Tl,Wk=Fl,Yk=op,zk=Gg,$k=hh,Xk=hd.f,qk=pu,Qk=Qb,Zk=jf,Jk=cg,eC=eS,tC=function(e,t,i){i in e||Vk(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},iC=cd,nC=bl,rC=rc,oC=Yh.enforce,sC=nv,aC=AS,lC=DS,uC=_c("match"),cC=Gk.RegExp,hC=cC.prototype,dC=Gk.SyntaxError,pC=Wk(hC.exec),fC=Wk("".charAt),gC=Wk("".replace),yC=Wk("".indexOf),vC=Wk("".slice),mC=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_C=/a/g,EC=/a/g,TC=new cC(_C)!==_C,SC=eC.MISSED_STICKY,bC=eC.UNSUPPORTED_Y,kC=Kk&&(!TC||SC||aC||lC||nC((function(){return EC[uC]=!1,cC(_C)!=_C||cC(EC)==EC||"/a/i"!=cC(_C,"i")})));if(Yk("RegExp",kC)){for(var CC=function(e,t){var i,n,r,o,s,a,l=qk(hC,this),u=Qk(e),c=void 0===t,h=[],d=e;if(!l&&u&&c&&e.constructor===CC)return e;if((u||qk(hC,e))&&(e=e.source,c&&(t=Jk(d))),e=void 0===e?"":Zk(e),t=void 0===t?"":Zk(t),d=e,aC&&"dotAll"in _C&&(n=!!t&&yC(t,"s")>-1)&&(t=gC(t,/s/g,"")),i=t,SC&&"sticky"in _C&&(r=!!t&&yC(t,"y")>-1)&&bC&&(t=gC(t,/y/g,"")),lC&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],s={},a=!1,l=!1,u=0,c="";n<=i;n++){if("\\"===(t=fC(e,n)))t+=fC(e,++n);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:pC(mC,vC(e,n+1))&&(n+=2,l=!0),r+=t,u++;continue;case">"===t&&l:if(""===c||rC(s,c))throw new dC("Invalid capture group name");s[c]=!0,o[o.length]=[c,u],l=!1,c="";continue}l?c+=t:r+=t}return[r,o]}(e),e=o[0],h=o[1]),s=zk(cC(e,t),l?this:hC,CC),(n||r||h.length)&&(a=oC(s),n&&(a.dotAll=!0,a.raw=CC(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=fC(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+fC(e,++n);return r}(e),i)),r&&(a.sticky=!0),h.length&&(a.groups=h)),e!==d)try{$k(s,"source",""===d?"(?:)":d)}catch(fF){}return s},IC=Xk(cC),AC=0;IC.length>AC;)tC(CC,cC,IC[AC++]);hC.constructor=CC,CC.prototype=hC,iC(Gk,"RegExp",CC,{constructor:!0})}sC("RegExp");var PC="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function wC(){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 DC(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 LC(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(fF){return t}return t}function RC(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];PC&&(t=console).log.apply(t,["[logger]",e].concat(n))}function xC(){try{return Math.round(window.performance.now())}catch(fF){return(new Date).getTime()}}function OC(){return(new Date).getTime()}function NC(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=xC(),o=r,s={},a=new window.XMLHttpRequest;a.open("get",e),a.onreadystatechange=function(){2===a.readyState&&(s.headers=LC(a),s.connectTime=xC()-o,s.status=a.status,s.statusText=a.statusText,r=xC())},a.onload=function(){i(s)},a.onprogress=function(e){var t,i=xC()-r;t=parseInt(e.loaded/1e3/(i/1e3),10),s.speed=0|t,s.costTime=i},a.onerror=function(){s.status||(s.status=-1,s.costTime=xC()-r),n(s)},a.ontimeout=function(){s.status||(s.status=-2,s.costTime=xC()-r),i(s)},a.onabort=function(){i(s)},a.responseType="arraybuffer",a.timeout=t.timeout||1e4,a.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),a.send()}catch(pa){n(pa)}}))}function MC(e){return!e||window.location.href.indexOf(e)>-1}function UC(e){return!!e&&/^blob:/.test(e)}var BC={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function HC(e){if(!e)return{};var t={};return Object.keys(BC).map((function(i){if(e[i]||"string"!=typeof BC[i]){if(!e[i]&&BC[i]instanceof Array){var n=BC[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[BC[i]]||""})),t}function FC(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function jC(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(pa){var i=e.className&&"object"===pl(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function VC(e){return"String"===FC(e)?e.replace("P","p"):e?"Number"===FC(e)?"".concat(e):void 0:""}function KC(e){try{return JSON.stringify(e)}catch(pa){return""}}var GC=0,WC=1,YC=2;function zC(e,t){return Math.round(t/e*1e3*100)}var $C=[];"undefined"!=typeof window&&function(){try{var e=new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");$C.length>30&&$C.splice(0,$C.length-30);for(var i=0;i<t.length;i++)$C.push(t[i])}));e.observe({entryTypes:["resource"]})}catch(pa){console.warn("PerformanceObserver not support",pa)}}();var XC="videoplayer_oneplay",qC="videoplayer_oneopera",QC="videoplayer_oneerror",ZC="videoplayer_oneevent",JC="videoplayer_onetemp",eI={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},tI={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},iI=0,nI=1,rI=2,oI=3,sI=4,aI=0,lI=1,uI=2,cI=3,hI=1,dI=2,pI=3,fI=4,gI=5,yI=6,vI=7,mI="error_retry",_I="oneerror",EI="oneevent",TI="onetemp",SI=0,bI=1,kI=864e5,CI=36e5,II=["tag","subtag","device_type"],AI={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var PI=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(pa){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(pa){return!0}}()?window.localStorage:{},wI="__xgplayerlogkey",DI={set:function(e){try{var t=this.get();t.push(e),PI.setItem(wI,JSON.stringify(t))}catch(fF){}},get:function(){try{var e=PI.getItem(wI);return e=e?JSON.parse(e):[]}catch(fF){return[]}},remove:function(){try{PI.removeItem(wI)}catch(fF){}},clear:function(){try{PI.clear()}catch(fF){}}},LI={},RI=Gl,xI=iu,OI=hd.f,NI=nk,MI="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];LI.f=function(e){return MI&&"Window"==RI(e)?function(e){try{return OI(e)}catch(fF){return NI(MI)}}(e):OI(xI(e))};var UI={},BI=_c;UI.f=BI;var HI=Tl,FI=rc,jI=UI,VI=Yc.f,KI=Pl,GI=du,WI=_c,YI=cd,zI=pp,$I=Tl,XI=Pl,qI=Fl,QI=kl,ZI=ku,JI=bl,eA=rc,tA=pu,iA=Qc,nA=iu,rA=Dc,oA=jf,sA=Nl,aA=kS,lA=Mf,uA=hd,cA=LI,hA=Hd,dA=Sl,pA=Yc,fA=tS,gA=wl,yA=cd,vA=Zu,mA=Rh,_A=uc,EA=_c,TA=UI,SA=function(e){var t=HI.Symbol||(HI.Symbol={});FI(t,e)||VI(t,e,{value:jI.f(e)})},bA=function(){var e=GI("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=WI("toPrimitive");t&&!t[n]&&YI(t,n,(function(e){return KI(i,this)}),{arity:1})},kA=Zy,CA=Yh,IA=Rf.forEach,AA=Lh("hidden"),PA="Symbol",wA="prototype",DA=CA.set,LA=CA.getterFor(PA),RA=Object[wA],xA=$I.Symbol,OA=xA&&xA[wA],NA=$I.TypeError,MA=$I.QObject,UA=dA.f,BA=pA.f,HA=cA.f,FA=gA.f,jA=qI([].push),VA=vA("symbols"),KA=vA("op-symbols"),GA=vA("wks"),WA=!MA||!MA[wA]||!MA[wA].findChild,YA=QI&&JI((function(){return 7!=aA(BA({},"a",{get:function(){return BA(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=UA(RA,t);n&&delete RA[t],BA(e,t,i),n&&e!==RA&&BA(RA,t,n)}:BA,zA=function(e,t){var i=VA[e]=aA(OA);return DA(i,{type:PA,tag:e,description:t}),QI||(i.description=t),i},$A=function(e,t,i){e===RA&&$A(KA,t,i),iA(e);var n=rA(t);return iA(i),eA(VA,n)?(i.enumerable?(eA(e,AA)&&e[AA][n]&&(e[AA][n]=!1),i=aA(i,{enumerable:sA(0,!1)})):(eA(e,AA)||BA(e,AA,sA(1,{})),e[AA][n]=!0),YA(e,n,i)):BA(e,n,i)},XA=function(e,t){iA(e);var i=nA(t),n=lA(i).concat(JA(i));return IA(n,(function(t){QI&&!XI(qA,i,t)||$A(e,t,i[t])})),e},qA=function(e){var t=rA(e),i=XI(FA,this,t);return!(this===RA&&eA(VA,t)&&!eA(KA,t))&&(!(i||!eA(this,t)||!eA(VA,t)||eA(this,AA)&&this[AA][t])||i)},QA=function(e,t){var i=nA(e),n=rA(t);if(i!==RA||!eA(VA,n)||eA(KA,n)){var r=UA(i,n);return!r||!eA(VA,n)||eA(i,AA)&&i[AA][n]||(r.enumerable=!0),r}},ZA=function(e){var t=HA(nA(e)),i=[];return IA(t,(function(e){eA(VA,e)||eA(mA,e)||jA(i,e)})),i},JA=function(e){var t=e===RA,i=HA(t?KA:nA(e)),n=[];return IA(i,(function(e){!eA(VA,e)||t&&!eA(RA,e)||jA(n,VA[e])})),n};ZI||(yA(OA=(xA=function(){if(tA(OA,this))throw NA("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?oA(arguments[0]):void 0,t=_A(e),i=function(e){this===RA&&XI(i,KA,e),eA(this,AA)&&eA(this[AA],t)&&(this[AA][t]=!1),YA(this,t,sA(1,e))};return QI&&WA&&YA(RA,t,{configurable:!0,set:i}),zA(t,e)})[wA],"toString",(function(){return LA(this).tag})),yA(xA,"withoutSetter",(function(e){return zA(_A(e),e)})),gA.f=qA,pA.f=$A,fA.f=XA,dA.f=QA,uA.f=cA.f=ZA,hA.f=JA,TA.f=function(e){return zA(EA(e),e)},QI&&(BA(OA,"description",{configurable:!0,get:function(){return LA(this).description}}),yA(RA,"propertyIsEnumerable",qA,{unsafe:!0}))),zI({global:!0,constructor:!0,wrap:!0,forced:!ZI,sham:!ZI},{Symbol:xA}),IA(lA(GA),(function(e){SA(e)})),zI({target:PA,stat:!0,forced:!ZI},{useSetter:function(){WA=!0},useSimple:function(){WA=!1}}),zI({target:"Object",stat:!0,forced:!ZI,sham:!QI},{create:function(e,t){return void 0===t?aA(e):XA(aA(e),t)},defineProperty:$A,defineProperties:XA,getOwnPropertyDescriptor:QA}),zI({target:"Object",stat:!0,forced:!ZI},{getOwnPropertyNames:ZA}),bA(),kA(xA,PA),mA[AA]=!0;var eP=ku&&!!Symbol.for&&!!Symbol.keyFor,tP=pp,iP=du,nP=rc,rP=jf,oP=Zu,sP=eP,aP=oP("string-to-symbol-registry"),lP=oP("symbol-to-string-registry");tP({target:"Symbol",stat:!0,forced:!sP},{for:function(e){var t=rP(e);if(nP(aP,t))return aP[t];var i=iP("Symbol")(t);return aP[t]=i,lP[i]=t,i}});var uP=pp,cP=rc,hP=Du,dP=Ru,pP=eP,fP=Zu("symbol-to-string-registry");uP({target:"Symbol",stat:!0,forced:!pP},{keyFor:function(e){if(!hP(e))throw TypeError(dP(e)+" is not a symbol");if(cP(fP,e))return fP[e]}});var gP=pp,yP=du,vP=mv,mP=Pl,_P=Fl,EP=bl,TP=gp,SP=su,bP=uu,kP=Du,CP=Ev,IP=ku,AP=yP("JSON","stringify"),PP=_P(/./.exec),wP=_P("".charAt),DP=_P("".charCodeAt),LP=_P("".replace),RP=_P(1..toString),xP=/[\uD800-\uDFFF]/g,OP=/^[\uD800-\uDBFF]$/,NP=/^[\uDC00-\uDFFF]$/,MP=!IP||EP((function(){var e=yP("Symbol")();return"[null]"!=AP([e])||"{}"!=AP({a:e})||"{}"!=AP(Object(e))})),UP=EP((function(){return'"\\udf06\\ud834"'!==AP("\udf06\ud834")||'"\\udead"'!==AP("\udead")})),BP=function(e,t){var i=CP(arguments),n=t;if((bP(t)||void 0!==e)&&!kP(e))return TP(t)||(t=function(e,t){if(SP(n)&&(t=mP(n,this,e,t)),!kP(t))return t}),i[1]=t,vP(AP,null,i)},HP=function(e,t,i){var n=wP(i,t-1),r=wP(i,t+1);return PP(OP,e)&&!PP(NP,r)||PP(NP,e)&&!PP(OP,n)?"\\u"+RP(DP(e,0),16):e};AP&&gP({target:"JSON",stat:!0,arity:3,forced:MP||UP},{stringify:function(e,t,i){var n=CP(arguments),r=vP(MP?BP:AP,null,n);return UP&&"string"==typeof r?LP(r,xP,HP):r}});var FP=Hd,jP=tc;pp({target:"Object",stat:!0,forced:!ku||bl((function(){FP.f(1)}))},{getOwnPropertySymbols:function(e){var t=FP.f;return t?t(jP(e)):[]}});var VP=pp,KP=kl,GP=Tl,WP=Fl,YP=rc,zP=su,$P=pu,XP=jf,qP=Yc.f,QP=qd,ZP=GP.Symbol,JP=ZP&&ZP.prototype;if(KP&&zP(ZP)&&(!("description"in JP)||void 0!==ZP().description)){var ew={},tw=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:XP(arguments[0]),t=$P(JP,this)?new ZP(e):void 0===e?ZP():ZP(e);return""===e&&(ew[t]=!0),t};QP(tw,ZP),tw.prototype=JP,JP.constructor=tw;var iw="Symbol(test)"==String(ZP("test")),nw=WP(JP.valueOf),rw=WP(JP.toString),ow=/^Symbol\((.*)\)[^)]+$/,sw=WP("".replace),aw=WP("".slice);qP(JP,"description",{configurable:!0,get:function(){var e=nw(this);if(YP(ew,e))return"";var t=rw(e),i=iw?aw(t,7,-1):sw(t,ow,"$1");return""===i?void 0:i}}),VP({global:!0,constructor:!0,forced:!0},{Symbol:tw})}var lw=[{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)/}],uw=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}],cw=["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"];var hw=["Baiduspider","YandexBot"],dw=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];var pw="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)},s=function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(cw.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}();o.isSupportMP4=s.isSupport,o.mime=s.mime;var a="",l=0,u=[],c=lw;/trident/.test(e)&&(c=uw);for(var h=0;h<c.length;h++)if(u=c[h].reg.exec(e)){a=c[h].key,l=u.length>2?u[2]:"";break}if(a)o["is".concat(a)]=!0,o.name=a,o.appVersion=l;else{var d=function(){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}}();d&&(o.name="360EE")}return o.name&&"Trident"!==o.name&&/(trident)/.exec(e)&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident"),o.isSpider=function(e,t){var i=!1;hw.map((function(t){t===e&&(i=!0)}));for(var n=0;n<dw.length;n++){var r=dw[n];if(-1!==t.indexOf(r)){i=!0;break}}return i}(o.name,e),o}(navigator.userAgent);function fw(){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"'))}var gw=[1,1,1,1,1];function yw(){return parseInt(gw.join(""),10)}gw[0]=pw.isSupportMP4?gw[1]+1:gw[1],gw[1]=fw()?gw[1]+1:gw[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(pa){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?gw[2]=gw[2]+1:gw[2]=1})).catch((function(){gw[2]=gw[2]-1}));var vw={range:"0-1048576",timer:6e4,timeout:15e3},mw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fl(this,e),Object.keys(vw).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=vw[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 yl(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=HC(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)?RC("task>>cant`t trigger url",this.ishangUp,this.intervalId):(RC("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),NC(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){RC("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){RC("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}(),_w="ProgressInfo";var Ew=function(){function e(){fl(this,e),this._init()}return yl(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=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,s=o.vBitrate,a=o.aBitrate;r&&(r.end<0||r.end-r.start<1)?(r.end<0?r.start=e:r.end=e,r.vBitrate=s,r.aBitrate=a):i.push({start:e,end:-1,vBitrate:s,aBitrate:a})}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,RC(_w,"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(),RC(_w,"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){RC(_w,"updateDefInfo",t,this.curBitrate.vBitrate,e);var i=e.mediaType,n=e.start,r=e.bitrate,o=e.definition,s=e.fileid,a={cdnSize:0,pcdnSize:0};"audio"===i?a.aBitrate=r:(a.vBitrate=r,a.definition=o,a.fileid=s,this.updateLastDefInfo()),a.start=n,this.nextBitrate=a,this.checkNextBitrate(t)}},{key:"upDateDownload",value:function(e){var t=e.cdn_size,i=e.pcdn_size,n=e.mediaType,r=this.curBitrate,o=this.nextBitrate,s=0,a=0;i?(s=1,a=i):t&&(a=t),this.cachedSize+=a,"video"===n&&(this.cachedVideoSize+=a,s>0&&(this.pcdnVideoCached+=a)),s>0&&(this.pcdnCached+=a);var l=o.start>=0?o:r;l.cdnSize+=a,s>0&&(l.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 Tw="0.12.10";var Sw=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];RC("xgVodLogger version is ".concat(Tw));var bw,kw=(bw="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(bw,"]")}),Cw=1300,Iw="__tea_cache_tokens_".concat(Cw),Aw="",Pw=null,ww=function(){function e(t,i){var n=this;if(fl(this,e),vl(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===FC(e)?e:"";"String"!==FC(t)&&(t=""),n.urlLog={initial_url:t,initial_host:DC(t),initial_ip:""}})),vl(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())})),vl(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),vl(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),vl(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),vl(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),vl(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=xC(),n._endType="switch"})),vl(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),vl(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),RC("onDefinitionChange from:".concat(t,", to:").concat(i))})),vl(this,"onDefiChangeSuccess",(function(){RC("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),vl(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;RC("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:xC(),operaType:"abr_switch",abrInfo:r})}})),vl(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=OC(),RC("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=VC(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 s=t.played.length;s<1?t.played.push({begin:i.currentTime,end:-1}):t.played[s-1].end=i.currentTime,n.lastVideoTime=i.currentTime||0})),vl(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),vl(this,"onCanplay",(function(){RC("onCanplay","this.startStep:".concat(n.startStep," ").concat(OC())),n.setVt()})),vl(this,"onLoadeddata",(function(){RC("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(OC())),n.setVt(),n.updateVideoSize()})),vl(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=MC(n.player.currentSrc);n.triggerTask("start"),RC("onLoadStart","this.startStep:".concat(n.startStep," ").concat(OC()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),vl(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=OC())}})),vl(this,"onPlayerInited",(function(){RC("player init"),n._playerCreatedTime=OC(),n.playlogs.rt=OC()})),vl(this,"onNotAutoPlay",(function(){RC("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),vl(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(RC("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(pw.isSupportMP4," isPC:").concat(pw.isPC)),RC("onPlayerError",e),n.load_state=cI,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),pw.isPC&&!pw.isSupportMP4||pw.isSpider)return t.errc=tI[5],t.errt=eI.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&&eI[e.errorType]?eI[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&tI[e.errorCode]?tI[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&tI[e.code]?tI[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(hI),n.onOnePlay(hI),n.onOneTemp(hI),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:vI,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),vl(this,"onPlayInterfaceInfo",(function(e){RC("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=xC()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),vl(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=function(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=$C||[],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&&"break"!==n(r);r--);return t}catch(pa){return t}}(e.cdnUrl),s=e.xhr||{},a=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=LC(s));var u=dl(dl({},l=HC(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:s&&s instanceof window.XMLHttpRequest&&(t.status=s.status||0),u.status=t.status;var c=e.cdnUrl||e.url;"error"===e.type&&n.merror.cdn.push(dl(dl({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:c,cdn_host:DC(c)},u),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:a,cur_play_pos:e.pos,cdn_url:c,cdn_host:DC(c)},u,"error"===e.type?0:2)}})),vl(this,"onNext",(function(){if(RC("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(dI))return;n.sendSwitchOpera(dI),n.onOnePlay(dI),n.onOneTemp(dI),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),vl(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=VC(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),vl(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){RC("onXgLogWaiting",e);var o=e.endType,s=e.costTime,a=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:s,end_type:"waitstart"},l,2),void n.appendStallInfo("start",a);if("waitingEnd"===e.eventType){var u=xC();RC("onXgLogWaiting>>".concat(o,"|costTime:").concat(s," vt:").concat(t.vt)),n.appendStallInfo("end",u,o),t.bc++,n.checkInBuffer(n.player.currentTime)?(t.de_bu_acu_t+=s,t.dbc++):(t.nbc++,t.n_bu_acu_t+=s),i.bc++,t.bu_acu_t+=s,i.bu_acu_t+=s,r.end=n.cur_play_pos,r.cost=s,r.acc+=r.cost,1===r.sc&&(r.endf=n.cur_play_pos),n.onOneEvent({costTime:s,end_type:"waitend"},l,2)}}})),vl(this,"onSeeking",(function(){if(!MC(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;RC("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=xC(),r.seekBefore=n.lastVideoTime.toString(),r.buf_include=n.checkInBuffer(n.player.currentTime)?1:0,r.intervalId=setTimeout((function(){n.isSeeking&&n.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),vl(this,"onSeeked",(function(){MC(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),vl(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=lI;var e=xC();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),vl(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(RC("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;n.merror.playCatch.push(dl({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.suspendSeekStatus("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:yI,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),vl(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;RC("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(dl({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},HC(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),vl(this,"onLog",(function(e){RC("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case mI:break;case TI: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){var r,o;e[n]="append"===i?(r=e[n],o=t[n],!r||"string"!=typeof o&&"number"!=typeof o?o:"".concat(r," ").concat(o)):t[n]})),e}(n._templog,e.data,e.action),n._templog.preload_hit&&(n._cacheFile=bI);break;case _I: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 EI: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)}})),vl(this,"onPlay",(function(){RC("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),vl(this,"onPause",(function(){RC("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=xC()})),vl(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(RC("onWaiting>","isSeeking:".concat(n.isSeeking," startStep:").concat(n.startStep," intervalId:").concat(n.stallIntervalId)),n.wait_buf_include=n.checkInBuffer(n.player.currentTime,-1e3)?1:0,n.isSeeking||0===n.playlogs.vt||n.inWaitingStart>0||(n.stallIntervalId&&(window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null),n.inWaitingStart=xC(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;RC("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(xC()-n.inWaitingStart)),n._endType="wait",n.load_state=uI,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,xC()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),vl(this,"onEnded",(function(){if(n.initial_url){RC("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:xC(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(pI),n.onOnePlay(pI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(pI),n.sendEventsQueue(),n.playlogs.lc++}})),vl(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(fI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(fI)||(n.sendSwitchOpera(fI),n.onOnePlay(fI,!0)))})),vl(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),vl(this,"onDestroy",(function(){RC("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(gI),n.startStep>0&&n.initial_url&&(n.onOneTemp(gI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:xC(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(pI),n.sendEventsQueue(),pw.isPC?window.removeEventListener("beforeunload",n.onUnload):(pw.isMobile||pw.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()})),vl(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(RC("onOnePlay _isOnePlayReport:".concat(n._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!n._isOnePlayReport){var i=n.errorLog,r=n.playlogs,o=n.abrInfo,s=n.resLogs,a=n.player,l=n.apiLog,u=n.pauseLog,c=n.stall,h=n.netLog,d=n.watchDur;n._isOnePlayReport=!0;var p=OC();n.getBufferTime(a);var f=n.getFrameInfo(),g=n.getPerformance(),y=i.errc,v=n._progressInfo,m=v.playedSize,_=v.cachedSize,E=v.pcdnCached,T=v.cachedVideoSize,S=v.pcdnVideoCached,b=n._progressInfo.getFileSize(a.duration),k=n.seekLog,C=k.sc,I=k.sat,A={bc:zC(d,n.bc),bu_acu_t:zC(d,n.bu_acu_t),sc:zC(d,C),sat:zC(d,I)};n.setExt();var P=n._getCompatibilityInfo();n.setNovv(null,e);var w=dl(dl(dl(dl({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:s.initial_resolution,final_resolution:s.final_resolution,pt:n.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||OC(),vt:n.vt,lt:n.lt,lpt:n.lpt,fvt:n.fvt,nvt:n.nvt,bft:n.bft,sc:C,sat:I,bc:n.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:n.videoNetworkState,status:n.curStatus,first_buf_startt:c.startf,first_buf_endt:c.endf,lc:r.lc,bu_acu_t: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:u.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,switch_resolution_c:n.switchResolutionCount,is_start_play_automatically:n.isAutoplay,start_time:n.start_time,finish:n.finish,errt:i.errt,errc:y,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:b.video,audio_length:b.audio,df:n.resolution,lf:s.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:s.ldst,ldet:s.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:KC(n.merror),ex:KC(n.exInfo),perf:KC(g),bufs:KC(n.buffers.allBuffer),vds:_,pvds:E,vps:m,vvds:T,pvvds:S,pcdn:KC(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},f),{},{fullScreen:n._getFullScreenType(),encryptedInfo:KC(n.encryptedInfo),per100_info:KC(A)},P);0!==n.vt&&(w.et=p);var D=n._logstrcache||n._getLogCache();0===w.fvt&&D&&(w.log=D,n._logstrcache=null),null!=a&&a.softDecoder&&(w.soft_decoder=a.softDecoder),a&&a.dashState&&(w.dash_state=a.dashState),null!=a&&a.softDecoder&&(w.soft_decoder=a.softDecoder),o.abr_init_opts=a.config.autoBitrateOpts||{},w.abr_info=KC(n.abrInfo);var L=P.is_support_mp4&&P.is_support_mse_mp4;if(P.is_spider||pw.isPC&&!L&&0===n.fvt)RC("is_spider",P.is_spider,"is_support_mp4",P.is_support_mp4);else if(t){var R=!n._options.disableLocalCache;n.reportLog(XC,w,R?1:0)}else n.reportLog(XC,w)}})),vl(this,"onOneEvent",(function(e){var t=e.costTime,i=e.vid,r=e.end_type,o=e.cur_play_pos,s=e.cdn_url,a=e.cdn_host,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2?arguments[2]:void 0;RC("onOneEvent",r);var c=n.buffers,h=c.curBuffer,d=c.allBuffer,p=n.getFrameInfo(),f=dl(dl({local_time:(new Date).getTime(),v:i||n.vid,cost_time:t,end_type:r||n.end_type,cdn_url:s||n.url,cdn_host:a||"",initial_type:n.initial_type,resolution:n.resolution,play_speed:n.playbackRate,first_frame_interval:xC()-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:KC(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),p);r.indexOf("waitend")>=0&&t>3e3&&(f.log=n._getLogCache());var g=n.player,y=g.currentTime,v=g.duration-y;if(r.indexOf("waitstart")>=0&&v<=1){var m=f.local_time,_=f.v,E=f.cost_time,T=f.cdn_url,S=f.first_frame_interval,b=f.cur_play_pos,k=f.video_ready_s,C=f.video_seeking,I=f.video_paused,A=f.bufs,P=f.bc,w=f.preload_hit;n.reportLog(ZC,dl({end_type:"longwait",local_time:m,v:_,cost_time:E,cdn_url:T,first_frame_interval:S,cur_play_pos:b,video_ready_s:k,video_seeking:C,video_paused:I,bufs:A,bc:P,preload_hit:w},h),u)}if("waitstart"===r&&"function"==typeof n._options.getPageFPS){var D=n._options.getPageFPS();f.cur_fps=D.curFPS||0,f.avg_fps=D.avgFPS||0}r.indexOf("wait")>-1&&(f.buf_include=n.wait_buf_include),r.indexOf("timeout")>-1&&f.cost_time>CI&&(f.cost_time=CI);var L=n.player;L&&L.dashState&&(f.dash_state=n.player.dashState),Object.keys(l).forEach((function(e){f[e]=l[e]})),f.ex=KC(n.getPlayerExt()),n.addIfExist("drm_type",n._options,f),n.reportLog(ZC,f,u)})),vl(this,"onOneTemp",(function(){if(RC("onOneTemp>>",!n._templog),n._templog){var e=n.player,t=n.playlogs,i=n.pauseLog,r=n.errorLog,o=n.resLogs,s=n.watchDur,a=dl(dl(dl({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>kI?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:s>kI?0:s,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:KC(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(a.et=OC()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,a)})),n.reportLog(JC,a,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 mw),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 Ew,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),RC("logger constructor:".concat(this.player.video))}catch(pa){console.error(pa)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return yl(e,[{key:"resetLoggerParams",value:function(){RC("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:OC(),vt:0,rt:this.isEnded?OC():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._novv={log_pt:OC()},this.initializeLogDatas(),this.initializeUrlLog()}},{key:"setNovv",value:function(e,t){!this._novv||this.fvt>0||(e&&(this._novv.errc=e.code,this._novv.errt=e.errorType,this._novv.errorMessage=e.message),this._novv.end_state=t,this._novv.novv_pt||(this._novv.novv_pt=OC(),this._novv.novv_lpt=OC()-this._novv.log_pt),this.player&&(this._novv.vtype=this.player.vtype,this.player.novv=this._novv))}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=-1,this.lastEventTime=-1,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:xC(),seekBefore:0,sat:0,sc:0,buf_include:0},this.resLogs={lastSwitchStartTime:-1,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:pw.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=aI,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=SI}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(Iw).web_id||"0"}catch(fF){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(pa){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),RC("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 Pw("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?Cw:1300===Cw?323254:Cw,channel:i,log:!1,disable_sdk_monitor:!0,disable_heartbeat:!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:Tw,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:pw.isPad?"pad":pw.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:yw(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var s=t.trackerConfig||{};RC("commonParams ",this.commonParams,s);var a=dl({evtParams:this.commonParams,disable_auto_pv:!0},s);!pw.name||pw.isChrome||pw.isSafari||(a.browser=pw.name,pw.appVersion&&(a.browser_version=pw.appVersion)),this.line_user_id&&(a.user_unique_id=this.line_user_id,!t.enableTeaWebId&&(a.web_id=this.line_user_id)),t.referrer&&(a.referrer=t.referrer,a.referrer_host=DC(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),RC("trackConfig",a),this.tracker.config(a),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=DI.get();DI.remove(),t.map((function(t){Object.keys(t).map((function(i){if(RC("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._options.enableBeacon&&e===XC?this.tracker.beaconEvent(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:"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:"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:"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;RC(">>>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;return(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache)}},{key:"addIfExist",value:function(e,t,i){if(kw(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},s=null;if("changedetail"===e){if(!i)return;s=i,o.stateBefore=i.definition,o.stateAfter=r.definition}else s=n,o.stateBefore=n.definition,o.stateAfter="";var a={vds:s.cdnSize,pvds:s.pcdnSize,fileid:s.fileid};this.onOneOperator(o,a)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,n=e.startTime,r=e.operaType,o=e.abrInfo,s=e.endType,a=void 0===s?"":s,l=this.resLogs;t=VC(t),i=VC(i),l.ldet=xC(),l.df=i,l.lf=t,l.final_resolution=i,l.switch_count++;var u=l.ldet-n,c={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:wC(l.played)};o&&(c.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:u,operaType:r,endType:a,stateBefore:t,stateAfter:i},c,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=xC(),o=-1===n?-1: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(){pw.isPC?window.addEventListener("beforeunload",this.onUnload):(pw.isMobile||pw.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]:{};RC("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},dl({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>kI?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?AI.FULLSCREEN_TYPE:this.player.isCssfullScreen?AI.CSS:AI.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,s=0;s<r;s++)o+=n.end(s)-n.start(s);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,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=this.getLastInterval("lastOperaTime"),u={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:KC(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount};"seek"===i&&(u.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var c=this.player;c&&c.dashState&&(u.dash_state=this.player.dashState),Object.keys(s).forEach((function(e){u[e]=s[e]})),this.addIfExist("drm_type",this._options,u),this.reportLog(qC,u,a)}},{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];RC("onOneError",t);var r=this.errorLog,o=this.apiLog,s=this.resLogs,a=this.player,l=this.playlogs,u=HC(t.headers||{}),c=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=this._getCompatibilityInfo();this.setNovv(t,t.endState||hI);var p=dl(dl(dl({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:KC(this.buffers.allBuffer),resolution:s.final_resolution,last_errors:r.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:u.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},u),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:l.degrade,end_state:t.endState||hI,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:KC(this.exInfo),pref:KC(c),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0},d);a&&a.dashState&&(p.dash_state=a.dashState);var f=this.player.currentSrc,g=UC(f)?UC(t.url)?this.initial_url:t.url:f,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:UC(f)?1:0};if(n&&"String"===FC(g)){var v={};NC(g,{range:"0-8",timeout:2e3}).then((function(e){RC("getXhr>>check result ",e);var t=HC(e.headers||{});p.server_ip=t.x_response_sinfo,v=dl(dl({},y),{},{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=dl(dl({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=function(e){if(!e||"String"!==FC(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)?WC:YC:GC}catch(pa){return GC}}(g);v.isexpired=t,p.net=KC(v),e.reportLog(QC,p,i)}))}else p.net=KC(y),this.reportLog(QC,p,i)}},{key:"_getCompatibilityInfo",value:function(){var e=function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return{support:!1,message:"MediaSource API not support"};for(var e=!1,t="",i=0;i<cw.length;i++){var n='video/mp4; codecs="'.concat(cw[i],'"'),r=MediaSource.isTypeSupported(n);t+="".concat(n," is ").concat(r," "),r&&(e=!0)}return{support:e,message:t}}();return{is_spider:pw.isSpider?1:0,is_support_mp4:pw.isSupportMP4?1:0,is_support_hevc:fw()?1:0,is_support_mse_mp4:e.support?1:0,support_mse_mp4:e.message}}},{key:"reportLog",value:function(t,i,n){var r=this,o=this._options,s=this.player.ABTestTag,a=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===FC(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=s&&(i.abtest_tag=s);var u=this._options;i.codec_type=this.codecType,kw(u)&&(II.forEach((function(e){r.addIfExist(e,u,i)})),Object.keys(a).forEach((function(e){r.addIfExist(e,a,i)})),i.vtype=this.vtype),i.env_info=KC(this._envInfo||{}),i.support=yw(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0;var c=function(){if(1===n){var e={};return e[t]=i,void DI.set(e)}2!==n?(r.player&&r.player.emit("abLog",t,i),r._track(t,i)):r.addEventsQueue(t,i)};if("function"==typeof o.onReportLog){var h=o.onReportLog(t,i);null!=h&&h.then?h.finally((function(){return c()})):c()}else c()}},{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;RC("triggerTask>>",e),!MC(t=t||this.player.src)&&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)}RC("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=xC(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(RC("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-o>200){var s=t-this.inWaitingStart;if(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=s,i.dbc++):(i.nbc++,i.n_bu_acu_t+=s),n.bc++,i.bu_acu_t+=s,n.bu_acu_t+=s,r.end=this.cur_play_pos,r.cost=s,r.acc+=r.cost,1===r.sc&&(r.endf=this.cur_play_pos),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var a=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:(new Date).getTime(),stall_duration:parseFloat((s/1e3).toFixed(2)),buffer_length:a.bufferLength,internet_speed:a.downloadSpeed,now_bitrate:a.nowBitrate,play_speed:this.player.playbackRate,is_abr:a.isCurrentInAbr?1:0})}this.onOneEvent({costTime:s,end_type:"waitend_".concat(e)||"waitend"},{},2)}this._endType="",this.load_state=lI,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=xC()-i.lastSeekStartTime;RC("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 s=this._endType="seek",a=i.seekBefore,l=(r.currentTime||0).toString();i.sc++,i.sat+=o>CI?0:o,n.sc++,n.sat+=o>CI?0:o,o>CI&&(o=CI),this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:o,operaType:s,stateBefore:a,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=OC(),RC("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=OC(),RC("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(){var e=this.playlogs.bu_acu_t;return e>kI?0:e}},{key:"pt",get:function(){return this.playlogs.pt||OC()}},{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:n,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(pa){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:MC(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:DC(MC(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?HC(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 jC(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return jC(this.player.root,"xgplayer-ended")||jC(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return jC(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return jC(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&&(RC("lt init",this.playlogs.lt),e=OC()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?oI:this.isStop?iI:this.isPause?rI:this.isLoading?sI:nI}},{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:wC(t.played);return i>=0?i>kI?kI: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=xC()-this.inWaitingStart;return e>CI?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,s=-1,a=parseInt(1e3*n,10),l=i.length-1;l>-1;l--){var u=parseInt(1e3*i.start(l),10),c=parseInt(1e3*i.end(l),10);if(a>=u&&a<=c){r.buf_include=1,r.buf_s_pos=u,r.buf_e_pos=c,r.buf_diff=c-a;break}a<u&&(o<0||u-a<o)?(o=u-a,s=l):a>c&&(o<0||a-c<o)&&(o=a-c,s=l)}1!==r.buf_include&&(s<0&&(s=i.length-1),r.buf_s_pos=parseInt(1e3*i.start(s),10),r.buf_e_pos=parseInt(1e3*i.end(s),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),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 dl({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},ml(e,Sw))}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,s=o[o.selectedIdx];RC("updateVideoSize》》videoItem",s),r=s?s.bitrate||s.bandwidth:0,n=s?s.size:0}else{var a=this.player.curDefinition;a?(r=a.bitrate||t.config.bitrate||0,n=parseInt(a.bitrate*t.duration/8,10)):(n=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}RC("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(wC(t.played)/1e3,10),r=i.buffered,o=0,s=0;s<r.length;s++)o+=parseInt(r.end(s)-r.start(s),10);RC("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 RC("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return Cw},set:function(e){Iw="__tea_cache_tokens_".concat(Cw=e)}},{key:"AB_SDK_VERSION",get:function(){return Aw},set:function(e){Aw="Array"===FC(e)?e.join(","):e}},{key:"Collector",set:function(e){Pw=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:{},enableTeaWebId:!1,enableBeacon:!1}}}]),e}();const Dw=null==(e=rl())?void 0:e.__LOG_TEA_ID__;function Lw(e){let t={};const i=(i,n)=>{const r=(e=>Object.assign({},t,null!=e?e:{}))(n);la.log("veplayer sendLog",i,r),e(i,r)};function n(e,t){i(e,t)}return n.init=e=>{},n.config=e=>{const i=null==e?void 0:e.evtParams;i&&"object"==typeof i&&(t=u({},i))},n.start=()=>{},n.event=(e,t)=>{i(e,t)},n.beaconEvent=(e,t)=>{i(e,t)},n}function Rw(){var e;const t=null==(e=EH.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}ww.TEA_ID=Dw,ww.Collector=function(e){const t=Rw();if(t)return Lw(t);const i=Fa();return i?new i(e):void 0};const xw="beforePlayerCreate.authtoken.getVideoInfo.getVideos",Ow=`${xw}.getDramaInfoViaJSB.perfInfo`,Nw={prepareCost:`${Ow}.prepareCost`,requestCost:`${Ow}.requestCost`,parseCost:`${Ow}.parseCost`,totalCost:`${Ow}.totalCost`};function Mw(e,t){var i;const n=null==(i=null==e?void 0:e.timingMap)?void 0:i[t];return Number.isFinite(n)?n:0}const Uw=function(e){if(e&&e.player){const t=(t,i)=>d(this,null,(function*(){var n,r,o;const s=e.player;i.player_sum_num=function(e){var t,i;let n=0;return null==(i=null==(t=null==e?void 0:e.instManager)?void 0:t.forEach)||i.call(t,(()=>(n++,!0))),n}(s),i.is_mse=Ma(s),i.drm_encrypt_type=ll(s)||"",i.initial_url=Br.isBlob(i.initial_url)&&s.config.url||i.initial_url,i.album_id=s.config.albumId||"",i.episode_id=s.config.episodeId||"",i.client_key=(null==(n=EH.ttDramaEnv)?void 0:n.clientKey)||"";const a=function(e){var t,i;return null==(i=null==(t=null==e?void 0:e.sdk)?void 0:t.getCreatePlayerPerfReport)?void 0:i.call(t)}(s),l=Mw(a,xw);const u=function(e){const t=null==e?void 0:e.totalDuration;return Number.isFinite(t)?t:0}(a);if(i.server_fetch_duration=l,Object.assign(i,function(e){return{server_fetch_prepare_cost:Mw(e,Nw.prepareCost),server_fetch_request_cost:Mw(e,Nw.requestCost),server_fetch_parse_cost:Mw(e,Nw.parseCost),server_fetch_total_cost:Mw(e,Nw.totalCost)}}(a)),i.create_player_total_duration=u,i.prepare_play=u-l,i.is_preload_enabled=2===EH.preloaderStatus,t===XC||t===QC){const e=null==s?void 0:s.veError;0!==i.errc&&e?(i.ve_error_code=(null==e?void 0:e.veErrorCode)||0,i.ve_error_type=(null==e?void 0:e.veErrorType)||"",i.ve_error_message=(null==e?void 0:e.veErrorMessage)||"",i.ve_error_ext=JSON.stringify((null==e?void 0:e.ext)||"")):(i.ve_error_code=0,i.ve_error_type="",i.ve_error_message="",i.ve_error_ext=""),i.licenseStatus=(null==(r=null==s?void 0:s.licenseLogInfo)?void 0:r.licenseStatus)||"",i.licenseType=(null==(o=null==s?void 0:s.licenseLogInfo)?void 0:o.licenseType)||""}})),i=Object.assign({onReportLog:t},e.player.config.vodLogOpts||{});e.player.vodLogger=new ww(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new ww(this,this.config.vodLogOpts||{})};Uw.pluginName="__xgVodLogger",Uw.playerConfig={},Uw.Collector=ww.Collector,Uw.setABSdkVersion=e=>{ww.AB_SDK_VERSION=e};const Bw=Ui((function(e,t,i){Ii(e,t,i)}));class Hw{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const Fw={"@byted/streamprobe":"1.0.2","@byted/volcengine-vestrategy":"1.1.0-rc.71","@byted/volcengine-vestrategy-adapt-range":"1.1.0-rc.0","@byted/volcengine-vestrategy-h265":"1.1.0-rc.0","@byted/volcengine-vestrategy-preload":"1.1.0-rc.3","@byted/xgplayer-encrypt":"3.5.29-rc.1","@byted/xgplayer-encrypt-hls":"4.2.0","@byted/xgplayer-encrypt-mp4":"3.0.31-alpha.1","@byted/xgplayer-vod-abralgo":"1.0.5","@byted/xgplayer-vod-preload":"1.0.9-rc.3","@byted/xgplayer-xgvideo":"0.2.5-rc.3","xgplayer-flv":"3.0.23-rc.6","xgplayer-hls":"3.0.24-rc.18"};var jw=(e=>(e.HLS="hls",e.HLSJS="hlsjs",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.VeStrategyPreload="vestrategy_preload",e.VeStrategyAdaptRange="vestrategy_adapt_range",e.DashAbralgo="DashAbralgo",e.Preloader="preloader",e.HLSjsPro="hlsjsPro",e))(jw||{});const Vw={[jw.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${Fw["xgplayer-hls"]}/dist/index.min.js`},[jw.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${Fw["xgplayer-flv"]}/dist/index.min.js`},[jw.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${Fw["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[jw.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Fw["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[jw.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${Fw["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[jw.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${Fw["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[jw.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${Fw["@byted/streamprobe"]}/dist/index.min.js`},[jw.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${Fw["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[jw.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${Fw["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[jw.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${Fw["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[jw.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${Fw["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[jw.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${Fw["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[jw.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${Fw["@byted/xgplayer-vod-preload"]}/dist/index.min.js`},[jw.HLSjsPro]:{name:"EncryptHlsjsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Fw["@byted/xgplayer-encrypt-hls"]}/dist/hlsjs.min.js`}},Kw={h265:jw.VeStrategyH265,preload:jw.VeStrategyPreload,adaptRange:jw.VeStrategyAdaptRange},Gw={setImportedPlugins(e,t){e.importedPlugins=t},prepareStrategyLoad(e){"undefined"!=typeof window&&window.VeStrategy&&(window.__VESTRATEGY_BASE__||(window.__VESTRATEGY_BASE__=window.VeStrategy),window.__VESTRATEGY_STRATEGY_PRELOAD__||e.clearPluginCache(jw.VeStrategyPreload))},loadVeStrategy(e){return d(this,null,(function*(){return e.loadPlugins(jw.VeStrategy)}))},loadStrategy(e,t){return d(this,null,(function*(){return e.loadPlugins(Kw[t])}))},loadPreloader(e){return d(this,null,(function*(){return e.loadPlugins(jw.Preloader)}))},loadMp4Encrypt(e){return d(this,null,(function*(){return e.loadPlugins(jw.MP4Encrypt)}))},loadHlsjsPro(e){return d(this,null,(function*(){return e.loadPlugins(jw.HLSjsPro)}))}};let Ww=!1;class Yw extends Hw{constructor(e){super(e)}applyAbrPluginConfig(e,t){e.Mp4EncryptPlayer=c(u({},e.Mp4EncryptPlayer),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:c(u({},n),{module:yield t.loadPlugins(jw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){Ww=!0;const{playList:t=[]}=e||{};return[...t||[]]}useNativeAbr(){return!1}canOpenAbr(e){var t;if(this.playerData.isVidPlay()&&e){const{playList:t=[]}=e;if(!(t.length>1))return Ww&&la.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether there are more than 1 video."),Ww=!1,!1}return!((null==(t=Gr.os)?void 0:t.isIos)&&!el())}canAdaptRangeEnable(){var e;return!((null==(e=Gr.os)?void 0:e.isIos)&&!el())}adaptRangeDefaultOptions(){return{maxTargetCacheDur:30,minTargetCacheDur:12,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){e.Mp4EncryptPlayer=c(u({},e.Mp4EncryptPlayer),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.Mp4EncryptPlayer=c(u({},e.Mp4EncryptPlayer),{adaptRange:u(u(u({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.Mp4EncryptPlayer)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t;const{configs:i,openSoftDecoding:n,isVidEncrypt:r,drmType:o}=this.playerData,s=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(o);if(i.enableMp4MSE||r||(null==(t=null==i?void 0:i.autoBitrateOpts)?void 0:t.enable)||n||s){return[yield Gw.loadMp4Encrypt(e)]}return[]}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:s,sessionId:a,useUnionInfoDRM:l}=t,c=!!r.kid,{autoBitrateOpts:h,Mp4EncryptPlayer:d,enableMp4MSE:p}=this.playerData.configs,f=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(c||(null==h?void 0:h.enable)||d||p){const{kid:e,secretKey:t}=r,h=null==(i=this.playerData.configs)?void 0:i.Mp4EncryptPlayer,d="object"==typeof h?h:{};if(c){if(f)this.playerData.options.Mp4EncryptPlayer=u({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,preferMMS:!0,secretKey:t},d);else if(s&&a){const t=Ta(s),i=parseInt(""+t["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.Mp4EncryptPlayer=u({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,retryCount:3,drmKeyToken:s,useUnionInfoDRM:l,keyTokenExpiredDuration:r,preferMMS:!0,sessionId:a,playDomain:o.playDomain||this.playerData.playDomain},d)}}else this.playerData.options.Mp4EncryptPlayer=u({vid:n,retryCount:3,preferMMS:!0},d)}}}let zw=!1;class $w extends Hw{applyAbrPluginConfig(e,t){e.DASHPlugin=c(u({},e.DASHPlugin),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:c(u({},n),{module:yield t.loadPlugins(jw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}useNativeAbr(){return!1}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>2&&t&&i))return zw&&la.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),zw=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=Gr.os)?void 0:e.isIos)}generatePlaylistFromServer(e){zw=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===ma.VIDEO))}adaptRangeDefaultOptions(){return{maxTargetCacheDur:60,minTargetCacheDur:50,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){var i;e.DASHPlugin=c(u({},null!=(i=e.DASHPlugin)?i:{}),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.DASHPlugin=c(u({},e.DASHPlugin),{adaptRange:u(u(u({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.DASHPlugin)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t,i;const n=yield e.loadPlugins(jw.DASH);return(null==(i=null==(t=null==n?void 0:n.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[n]:(la.warn("current browser is not supported DASHPlugin"),[])}))}setPluginConfigInVid(e,t){var i;const{vid:n,playList:r=[],dashOpts:o,defaultDefinitionData:s}=e||{},{config:a,privateDrmAuthToken:l,sessionId:c,useUnionInfoDRM:h}=t,d=u({},(null==(i=this.playerData.configs)?void 0:i.DASHPlugin)||{}),{kid:p,secretKey:f}=s,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE,y=o.Data.PlayInfoList.reduce(((e,t)=>{const i=t.Definition||t.Quality;let n="";const o=r.find((e=>e.Definition===i||e.Quality===i));return o&&(n=o.definition),e[i]=n,e}),{});if(this.playerData.dashOpts=o,g)this.playerData.options.DASHPlugin=u({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:n,definitionText:y,defaultDefinition:s.definition,kid:p,dashOpts:o,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:f,sessionId:this.playerData.encryptSessionId,playDomain:a.playDomain||this.playerData.playDomain},d);else if(l&&c&&this.playerData.drmType!==or.DRM_ENCRYPT){const e=Ta(l),t=parseInt(""+e["X-Expires"]),i=isNaN(t)?30:t;this.playerData.options.DASHPlugin=u({playInfoType:"TOP",vid:n,dashOpts:o,defaultFormat:"dash",definitionText:y,defaultDefinition:s.definition,useUnionInfoDRM:h,kid:p,keyTokenExpiredDuration:i,sessionId:c,drmKeyToken:l,playDomain:a.playDomain||this.playerData.playDomain,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}else this.playerData.options.DASHPlugin=u({vid:n,dashOpts:o,playInfoType:"TOP",defaultFormat:"dash",definitionText:y,defaultDefinition:s.definition,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}}var Xw=/\s/;var qw=/^\s+/;function Qw(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Xw.test(e.charAt(t)););return t}(e)+1).replace(qw,""):e}var Zw=NaN,Jw=/^[-+]0x[0-9a-f]+$/i,eD=/^0b[01]+$/i,tD=/^0o[0-7]+$/i,iD=parseInt;function nD(e){if("number"==typeof e)return e;if(kn(e))return Zw;if(D(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=D(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Qw(e);var i=eD.test(e);return i||tD.test(e)?iD(e.slice(2),i?2:8):Jw.test(e)?Zw:+e}const rD=function(){return _.Date.now()};var oD="Expected a function",sD=Math.max,aD=Math.min;function lD(e,t,i){var n,r,o,s,a,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError(oD);function p(t){var i=n,o=r;return n=r=void 0,u=t,s=e.apply(o,i)}function f(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-u>=o}function g(){var e=rD();if(f(e))return y(e);a=setTimeout(g,function(e){var i=t-(e-l);return h?aD(i,o-(e-u)):i}(e))}function y(e){return a=void 0,d&&n?p(e):(n=r=void 0,s)}function v(){var e=rD(),i=f(e);if(n=arguments,r=this,l=e,i){if(void 0===a)return function(e){return u=e,a=setTimeout(g,t),c?p(e):s}(l);if(h)return clearTimeout(a),a=setTimeout(g,t),p(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=nD(t)||0,D(i)&&(c=!!i.leading,o=(h="maxWait"in i)?sD(nD(i.maxWait)||0,t):o,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==a&&clearTimeout(a),u=0,n=l=r=a=void 0},v.flush=function(){return void 0===a?s:y(rD())},v}const uD=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(jw).includes(t))throw new Error(`Unknown UMD key: ${t}`);if(void 0===i)throw new Error(`Registered UMD module ${t} must not be undefined`)}Object.assign(uD.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete uD.jsLoadMap[t],delete uD.jsLoadPromiseMap[t]}constructor(){this.umdMap=Vw,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=rl(this.userRegion,this.region))?void 0:e.__UMD_PRE_PATH__)}updateBackupMap(e){this.backupUmdUrlMap=e}loadExtraCdn(e,t=!0){return new Promise(((i,n)=>{const r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),r.onerror=()=>{n(`url: ${e}`)},r.onload=r.onreadystatechange=function(){(null==this?void 0:this.readyState)&&"loaded"!==(null==this?void 0:this.readyState)&&"complete"!==(null==this?void 0:this.readyState)||(r.onload=r.onreadystatechange=null,i())},document.body.appendChild(r)}))}loadPlugins(e,t){return new Promise((i=>{var n;const r=`${this.pluginPublicPath}_${e}_load`;if(Object.prototype.hasOwnProperty.call(uD.registeredModules,e))return this.triggerSuccessCallback(t),i(uD.registeredModules[e]);if(Reflect.get(uD.jsLoadMap,r))return i(uD.jsLoadMap[r]);const o=this.umdMap[e];if((null==(n=this.importedPlugins)?void 0:n.length)>0&&o.pluginName){const e=this.importedPlugins.find((e=>e.pluginName===o.pluginName));if(e)return i(e)}if(!o)return la.error(`${e} umd info not exit`),this.handleLoadError(e,void 0,i);const{name:s,devPath:a}=o,l=s?Vn(window,s):null;if(l)return uD.jsLoadMap[r]=l,this.triggerSuccessCallback(t),i(l);const u=`${this.pluginPublicPath}/${e+".js"}`;let c=uD.jsLoadPromiseMap[r];la.log(`umdLoader cache hit ${r}=${!!c}`),c||(c=Za((()=>this.loadExtraCdn(u,!0)),2),uD.jsLoadPromiseMap[r]=c),c.then((()=>this.handleLoadSuccess(r,s,t,i))).catch((n=>this.handleLoadCatch(n,e,r,s,t,i)))}))}handleLoadSuccess(e,t,i,n){const r=t?Vn(window,t):null;uD.jsLoadMap[e]=null==r||r,this.triggerSuccessCallback(i),null==n||n(r)}handleLoadError(e,t,i){this.failCallback&&"function"==typeof this.failCallback&&this.failCallback(e,t),i(null)}handleLoadCatch(e,t,i,n,r,o){const s=this.backupUmdUrlMap[t];s?this.loadBackupUrl(s,t,i,n,r,o):(la.error(`load ${t} error, ${e}`),this.handleLoadError(t,e,o))}loadBackupUrl(e,t,i,n,r,o){if(!((s=e)&&s.indexOf&&/^(?:http|data:|\/)/.test(s)))return la.error(`umdMap.${t} isn't a valid url`),this.handleLoadError(t,void 0,o);var s;this.loadExtraCdn(e).then((()=>this.handleLoadSuccess(i,n,r,o))).catch((e=>{la.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let cD=uD;cD.jsLoadMap={},cD.jsLoadPromiseMap={},cD.registeredModules={};const hD=new cD;var dD=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(dD||{});function pD(e){if(!e||"boolean"==typeof e)return{config:{}};const t=e,{Strategy:i,disabled:n,config:r}=t,o=h(t,["Strategy","disabled","config"]);return c(u({},e),{config:u(u({},o),null!=r?r:{})})}var fD=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(fD||{});class gD{constructor(e){this.strategyKey=dD.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new cD}init(e){return d(this,null,(function*(){var t,i,n,r,o,s,a,l,h;const p=null==(t=null==e?void 0:e.strategies)?void 0:t[dD.PRELOAD],f="boolean"==typeof p;if(!p||!f&&(null==p?void 0:p.disabled))return this.preloaderStatus=0,!1;const g=null==(i=pD(p))?void 0:i.config,y=null==(s=null==(o=null==(r=null==(n=this._strategyManager.config)?void 0:n.strategies)?void 0:r[dD.PRELOAD])?void 0:o.Strategy)?void 0:s.preloader;if(!(null==y?void 0:y.register))return this.preloaderStatus=3,!1;y.init((()=>d(this,null,(function*(){la.log("preloader init");const[e,t]=yield Promise.all([Gw.loadPreloader(this.sdkUmdLoader),f||"hls"!==(null==p?void 0:p.format)?Gw.loadMp4Encrypt(this.sdkUmdLoader):Gw.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void la.error("preloader init error");const i=(null==t?void 0:t.Mp4Preloader)||(null==t?void 0:t.HlsPreloader);return c(u({},g),{PreloaderModule:e.PreloaderManager,loaders:[i].filter((e=>!!e)),playPlugins:[t]})}))));const v=yield y.prepare();if(!v)return this.preloaderStatus=3,void la.warn("preloader prepare fail",v);this.preloaderStatus=2,null==(h=null==(l=null==(a=y.inst)?void 0:a.call(y))?void 0:l.on)||h.call(l,"prf_data_size",(e=>{var t,i;null==(i=null==(t=this._strategyManager.tea)?void 0:t.event)||i.call(t,"veplayer_preload_prf_data_size",u({},e))})),this.preloader=y,this.initPreloaderConfig()}))}addPreloadList(e){if(1===this.preloaderStatus)return this.preloadCacheList=this.preloadCacheList.concat(null!=e?e:[]),void la.log("preloader add preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(1===this.preloaderStatus)return this.preloadCacheList=null!=e?e:[],void la.log("preloader set preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.setPreloadList(null!=e?e:[])}))}setPreloadScene(e,t){if([1,0].includes(e))return 1===this.preloaderStatus?(this.preloadCacheScene!==e&&(this.preloadCacheList=[],la.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=u(u({},this.preloadCacheConfig),null!=t?t:{}),void la.log("preloader set preload cache config",this.preloadCacheScene,this.preloadCacheConfig)):void(2!==this.preloaderStatus||this.preloader.setPreloadScene(e,t))}initPreloaderConfig(){var e,t,i,n;"undefined"!==this.preloadCacheScene&&this.preloader.setPreloadScene(this.preloadCacheScene,null!=(e=this.preloadCacheConfig)?e:{}),(null==(t=this.preloadCacheList)?void 0:t.length)&&(this.preloader.setPreloadList(this.preloadCacheList),null==(n=(i=this.preloader).checkPreloadData)||n.call(i),this.preloadCacheList=[])}}class yD{constructor(e){this.strategyKey=dD.H265,this._strategyManager=e}init(){return d(this,null,(function*(){return!0}))}isHevcRecommended(){var e,t;return!!(null==(t=null==(e=this._strategyManager.getStrategyRecommendations().result)?void 0:e[dD.H265])?void 0:t.enableH265Hardware)}}const vD=new class{constructor(){var e,t;this.teaId=null==(e=rl())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=rl())?void 0:t.__LOG_CHANNEL__,this.status=0,this.initUmdLoader()}get preloader(){var e;return null==(e=this.preloadWrapper)?void 0:e.preloader}get preloaderStatus(){var e,t;return null!=(t=null==(e=this.preloadWrapper)?void 0:e.preloaderStatus)?t:fD.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new cD}fetchWebId(){return d(this,null,(function*(){var e,t;return(null==(e=this.config)?void 0:e.deviceId)?Promise.resolve(null==(t=this.config)?void 0:t.deviceId):new Promise((e=>{var t;return(null==(t=this.tea)?void 0:t.getToken)?this.tea.getToken((t=>e(null==t?void 0:t.web_id))):e("default_web_id")})).then((e=>(this.config=c(u({},this.config),{deviceId:e}),this.webId)))}))}initTea(e){var t,i;const n=this.collector;n&&(e&&(this.teaId=null==(t=rl(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=rl(e))?void 0:i.__LOG_CHANNEL__),this.tea=new n(`${this.teaId}_vestrategy_tracker`),this.tea.init({app_id:this.teaId,channel:this.teaChannel}),this.tea.start())}fetchVeStrategy(){return d(this,null,(function*(){if(this.config.Module)return;const e=yield Gw.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=c(u({},this.config),{Module:e}))}))}fetchStrategies(){return d(this,null,(function*(){const e={};return Gw.prepareStrategyLoad(this.sdkUmdLoader),yield Promise.all(Object.keys(this.config.strategies).map((t=>d(this,null,(function*(){if(!this.config.strategies[t])return;!0===this.config.strategies[t]&&(this.config.strategies[t]={});const{Strategy:i}=this.config.strategies[t];if(i)e[t]=this.config.strategies[t];else{const i=t;if(!["h265","preload","adaptRange"].includes(i))return;const n=yield Gw.loadStrategy(this.sdkUmdLoader,i);n&&(e[t]=c(u({},this.config.strategies[t]),{Strategy:n}))}e[t]=pD(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return d(this,null,(function*(){if(!e||!e.appId)return;this.collector=Fa(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(pa){}const{appId:t,deviceId:i,Module:n}=this.config;if(t&&i&&n){this.Module=n;const e=this.collector;yield n.bootstrap(c(u(c(u({},this.config),{strategies:this.config.strategies}),e?{tracker:{Collector:e,enableABVersion:!1}}:{}),{log:{logger:la}})),this.status=2,this.preloadWrapper=new gD(this),this.h265Wrapper=new yD(this)}else this.status=3;return this.isReady()}))}init(e){return d(this,null,(function*(){var t,i;const n=e;return this.initPromise?(null==(i=this.config)?void 0:i.serviceConfigMode)&&(null==n?void 0:n.serviceConfigMode)&&this.config.serviceConfigMode!==n.serviceConfigMode&&la.warn("[VeStrategy] Ignoring conflicting serviceConfigMode after initialization has started."):((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&Gw.setImportedPlugins(this.sdkUmdLoader,e.plugins),this.initPromise=this.initOnce(n).then((t=>d(this,null,(function*(){var i,n;return t&&(yield Promise.all([null==(i=this.preloadWrapper)?void 0:i.init(e),null==(n=this.h265Wrapper)?void 0:n.init()])),t}))))),this.initPromise}))}addPreloadList(e){this.preloadWrapper&&this.preloadWrapper.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(this.preloadWrapper)return this.preloadWrapper.setPreloadList(e)}))}setPreloadScene(e,t){this.preloadWrapper&&this.preloadWrapper.setPreloadScene(e,t)}prepare(){return this.initPromise||Promise.resolve(this.isReady())}getDeviceId(){var e;return null==(e=this.config)?void 0:e.deviceId}isReady(){return 2===this.status}getStrategyRecommendations(e=void 0,t=void 0){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=this.config.Module.rec(e,t)||{};return la.log("strategy recommendations:",i),i}getStrategyRecommendationsAsync(e=void 0,t=void 0){return d(this,null,(function*(){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=yield this.config.Module.recAsync(e,t);return la.log("strategy recommendations:",i),i}))}isHevcRecommended(){var e,t;return this.h265Wrapper?this.h265Wrapper.isHevcRecommended():!!(null==(t=null==(e=this.getStrategyRecommendations().result)?void 0:e[dD.H265])?void 0:t.enableH265Hardware)}};let mD=!1;class _D extends Hw{constructor(e){super(e)}applyAbrPluginConfig(e,t){var i;e.EncryptHlsPlugin=c(u({},e.EncryptHlsPlugin),{autoBitrateOpts:t,maxBufferLength:(null==(i=e.EncryptHlsPlugin)?void 0:i.maxBufferLength)||40})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;!e.isOpenVePlayerABR()||(null==n?void 0:n.module)||this.useNativeAbr()||e.updateConfigs({autoBitrateOpts:c(u({},n),{module:yield t.loadPlugins(jw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,n,r;mD=!0;const{vid:o,playList:s=[],enableAdaptive:a,adaptiveBitrateStreamingInfo:l}=e||{};if(t&&(null==l?void 0:l.MainPlayUrl))return[{vid:o,url:null==l?void 0:l.MainPlayUrl,_mainURL:l.MainPlayUrl,_backupURL:l.BackupPlayUrl,streamType:l.AbrFormat,backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],isMasterM3u8:!0}];const u=[...s||[]];if(this.useNativeAbr()&&(null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.autoBitrateOpts)?void 0:r.enable)&&a&&l&&u.length){const e={url:l.MainPlayUrl,definition:"auto",streamType:"hls",format:"hls",backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],vid:o};u.push(e)}return u}useNativeAbr(){return Gr.os.isIos||"safari"===Gr.browser&&this.playerData.drmType===or.DRM_ENCRYPT}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>1&&t&&i))return mD&&la.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),mD=!1,!1}return!0}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(e){return d(this,null,(function*(){var t,i,n;if(null==(i=null==(t=vD.config)?void 0:t.strategies)?void 0:i[dD.PRELOAD]){return[yield e.loadPlugins(jw.HLSjsPro)]}const{configs:r,options:o,useHlsPluginForSafari:s,enableHlsJs:a,isVidEncrypt:l,isLive:u,openSoftDecoding:c,isMobile:h,drmType:d}=this.playerData,p=d===or.DRM_ENCRYPT,f=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(d),g=Xa(r,"EncryptHlsPlugin");if(!!(null==g?void 0:g.keyToken)||l&&!p||f||this.playerData.isOpenVePlayerABR()&&!(null==(n=null==this?void 0:this.useNativeAbr)?void 0:n.call(this))){return[yield e.loadPlugins(jw.HLSEncrypt)]}{const t=Xa(o,"Subtitle"),i=u&&t,n=(Ja()||window.WebAssembly)&&c,l=r.enableHlsMSE,d=Gr.os.isIos?el():Ja()||el(),f=r.enableMobileHlsPlugin&&d,g=p&&Gr.os.isAndroid,y=p&&nl,v=h&&!document.createElement("video").canPlayType("application/vnd.apple.mpegurl");if(h&&(n||i||l||f||g||v)||!(h||nl&&!s||y)){return[yield e.loadPlugins(a?jw.HLSjsPro:jw.HLS)]}}}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:s,sessionId:a,useUnionInfoDRM:l}=t,{playDomain:c,keyToken:h,getKeyType:d}=o,p=!!r.kid,f=this.playerData.drmType===or.DRM_ENCRYPT,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(p&&!f){const e=null==(i=this.playerData.configs)?void 0:i.EncryptHlsPlugin,t="object"==typeof e?e:{},{kid:o,secretKey:p}=r;if(h)this.playerData.options.EncryptHlsPlugin=u({keyToken:h,playDomain:c||this.playerData.playDomain,getKeyType:d||"TOP",preferMMS:!0,preferMMSStreaming:!0},t);else if(g)this.playerData.options.EncryptHlsPlugin=u({vid:n,kid:o,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:p,preferMMS:!0,preferMMSStreaming:!0},t);else if(s&&a){const e=Ta(s),i=parseInt(""+e["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.EncryptHlsPlugin=u({vid:n,kid:o,keyTokenExpiredDuration:r,drmKeyToken:s,useUnionInfoDRM:l,sessionId:a,playDomain:c||this.playerData.playDomain,preferMMS:!0,preferMMSStreaming:!0},t)}}}}class ED extends Hw{applyAbrPluginConfig(e,t){}needAbrAutoDefinition(){return!1}prepareAbrModule(e,t){}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e,...t){const{playList:i=[]}=e||{};return[...i||[]]}useNativeAbr(){return!1}canOpenAbr(){return!1}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(){return Promise.resolve([])}setPluginConfigInVid(){}}var TD=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(TD||{}),SD=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(SD||{}),bD=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(bD||{}),kD=(e=>(e[e.LICENSE_STATUS_INVALID=0]="LICENSE_STATUS_INVALID",e[e.LICENSE_STATUS_OK=1]="LICENSE_STATUS_OK",e[e.LICENSE_STATUS_EXPIRED=2]="LICENSE_STATUS_EXPIRED",e[e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH=401]="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e))(kD||{});const CD={setLicenseConfig:e=>d(exports,null,(function*(){})),checkLicense:()=>d(exports,null,(function*(){return"premium_edition"})),checkModuleList:()=>d(exports,null,(function*(){return Object.values(bD)})),checkLicenseStatus:()=>d(exports,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>d(exports,null,(function*(){return!0})),renderLogo:e=>{}},ID={levelList:!1,manualLevelSwitch:!1,restoreAuto:!1,levelCap:!1,bitrateCap:!1,definitionCap:!1},AD=(e=ID)=>u({},e),PD=e=>"string"==typeof e?e.trim().toLowerCase():"";function wD(e,t){const i=PD(t);if(void 0!==(null==e?void 0:e.engine)&&""!==i&&"hls"!==i)throw new TypeError("autoBitrateOpts.engine only applies to HLS.")}function DD(e){var t;return!0!==(null==e?void 0:e.enable)?null:null!=(t=e.engine)?t:"veplayer"}class LD{constructor(e,t){var i,n;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:tr.UNKNOWN,kid:"",secretKey:"",drmType:void 0},this.strategiesPlugins=[],this.strategiesPluginConfigs={},this.urlCheckData={enableUrlExpireCheck:!1,urlExpireTimestamp:Qs,urlExpireDiff:60,urlCheckExpireInterval:400},this.isAutoBitrateEnable=!1,this.isVidEncrypt=!1,this.drmType=void 0;const r=e,{options:o,type:s,isLive:a,id:l,root:u,plugins:c=[],defaultConfig:d,languages:p,codec:f,isMobile:g=!1,enableH265Degrade:y=!1,onMediaExpired:v,onTokenExpired:m,unionId:_,isMusic:E=!1,sdkPlugins:T=[],useHlsPluginForSafari:S=!0,enableHlsJs:b=!0,enableMenu:k=!1,region:C={}.__DEFAULT_REGION__,userRegion:I,debug:A=!1,licensSupportModuleList:P=Object.values(bD),encryptSessionId:w}=r,D=h(r,["options","type","isLive","id","root","plugins","defaultConfig","languages","codec","isMobile","enableH265Degrade","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableHlsJs","enableMenu","region","userRegion","debug","licensSupportModuleList","encryptSessionId"]);this.configs=e,this.sdk=t,A&&(la.config.debug=3),this.options=Object.assign({},o,D),this.options.poster="string"==typeof this.options.poster?function(e){const t=""+e,i=cl.exec(t);if(!i)return t;let n,r,o="",s=0;for(r=i.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&#x27;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}s!==r&&(o+=t.substring(s,r)),s=r+1,o+=n}return s!==r?o+t.substring(s,r):o}(this.options.poster):this.options.poster,this.options.icons=(e=>{const t={};return e&&Object.entries(e).forEach((([e,i])=>{i&&"string"!=typeof i&&(t[e]=i)})),t})(this.options.icons),this.id=l,this.root=u,this.type=s,this.isLive=!!(null!=a?a:"live"===s),this.defaultConfig=d,this.languageData=this.initI18nData(p),this.isMobile=g||"mobile"===Gr.device,this.openSoftDecoding=null==(i=this.configs)?void 0:i.useSoftDecoding,this.enableH265Degrade=y,this.codec=f||tr.UNKNOWN,this.onMediaExpired=v,this.onTokenExpired=m,null==(n=this.setVodPlayListConfig)||n.call(this,this.configs),this.current=dr.observe(this.current),this.plugins=[...c],this.isMusic=E,this.unionId=_,this.sdkPlugins=T,this.useHlsPluginForSafari=S,this.enableHlsJs=b,this.enableMenu=k,k&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=C,this.userRegion=I,this.setVodTeaId(),this.playDomainDegrade=!1,this.dashOpts=null,this.encryptSessionId=w,this.initPlayData(this.configs),dr.subscribeProperty(this.current,"definition",this.updateCheckExpireData.bind(this))}initPlayData(e){const t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}initPlaylistAndGetCurrent(e){var t,i;const{url:n,playList:r=[],streamType:o="",definitionText:s,definitionTextKey:a,urlExpireTimestamp:l,playAuth:h,playAuthId:d}=e,p=e.defaultDefinition||this.configs.defaultDefinition,f=e.codec||tr.UNKNOWN;(null==e?void 0:e.autoBitrateOpts)&&this.updateConfigs({autoBitrateOpts:u(u({},null!=(t=this.configs.autoBitrateOpts)?t:{}),e.autoBitrateOpts)});let g=null;const y=pi([...r].filter((e=>e.url)).map(((e,t)=>c(u({},e),{bitrate:e.bitrate||e.Bitrate||1e3*(t+1),secretKey:e.playAuth,kid:e.playAuthId}))));if(n)if(0===y.length){const e=u(c(u({},this.current),{url:n,streamType:o,definitionTextKey:a,codec:f,secretKey:h,kid:d,urlExpireTimestamp:l}),a||s?{definition:s}:{definition:"HD"});this.playList=[e],this.defaultDefinition=e.definition}else{this.playList=y;const e=this.getUrlList({url:n});e.length>0?g=e[0]:la.warn("default url is not match Playlist")}else this.playList=y;e.drmType&&this.setDrmType(e.drmType);let v=this.getCurrentByDefaultConfig();v?this.defaultDefinition=v.definition:(v=g||(p&&(null==(i=this.getUrlList({definition:p}))?void 0:i[0])||this.playList[0]),this.defaultDefinition=null==v?void 0:v.definition);const m=this.getTargetStreamType(v);if(wD(this.configs.autoBitrateOpts,m),this.adapter=function(e,t){const i=c(u({},t),{streamType:e});switch(null==e?void 0:e.toLowerCase()){case"mp4":case"m4a":return new Yw(i);case"dash":return new $w(i);case"hls":return new _D(i);default:return la.log(`no adapter match ${e}, use others adapter by default`),new ED(i)}}(m,{configs:this.configs,playerData:this}),this.isAutoBitrateEnable=this.checkAutoBitratePlayList(),this.isOpenABR()){const e=this.getABRStreamInfo(m,v);v=e.defaultStream,this.playList=e.playList,this.defaultDefinition=e.defaultDefinition}return this.playList.forEach((e=>{(null==e?void 0:e.streamType)&&(e.vtype=e.streamType.toUpperCase()),(null==e?void 0:e.codec)&&(e.codecType=e.codec)})),v}checkAutoBitratePlayList(){var e,t;return!(Gr.os.isIos&&this.adapter.needAbrAutoDefinition()&&!(null==(t=null==(e=this.playList)?void 0:e.find((e=>this.isAutoDefinition(null==e?void 0:e.definition))))?void 0:t.url))}getABRStreamInfo(e,t){var i,n,r,o,s;let a=this.defaultDefinition;const l=(null==(n=null==(i=this.playList)?void 0:i.concat)?void 0:n.call(i))||[];let u=t;const c=l.findIndex((e=>this.isAutoDefinition(null==e?void 0:e.definition))),h=-1!==c?l.splice(c,1)[0]:void 0,d={definition:null!=(r=null==h?void 0:h.definition)?r:"auto",bitrate:void 0,definitionTextKey:(null==h?void 0:h.definitionTextKey)||(null==(s=null==(o=this.configs)?void 0:o.autoBitrateOpts)?void 0:s.definitionTextKey)||"DEFINITION_AUTO",url:(null==h?void 0:h.url)||"__auto__",name:"auto",streamType:e||this.configs.streamType};return this.isAutoDefinition(this.configs.defaultDefinition)||(d.bitrate=null==u?void 0:u.bitrate,a=null==u?void 0:u.definition),this.isPlayAutoDefinition()&&(u=d,this.adapter.setAbrDefaultDefiWithAuto()&&(a=d.definition)),l.push(d),{defaultDefinition:a,defaultStream:u,playList:l}}isCurrentH265(){if(this.codec){return this.codec.replace(".","").toLowerCase()===tr.H265}return!1}setDrmType(e){this.drmType=e}getCurrentByDefaultConfig(){if(!this.defaultConfig)return;const{type:e,isLive:t,lineId:i="",definition:n=""}=this.defaultConfig;if((null!=t?t:"live"===e)!==this.isLive)return;if(!i&&!n)return la.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const r=this.getUrlList({lineId:i,definition:n});return r.length>0?(this.isHitDefault=!0,r[0]):(la.warn("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}initCurrent(e){var t,i,n;Object.keys(this.current).forEach((t=>{this.current[t]=null==e?void 0:e[t]}));const r=null==e?void 0:e.codec;this.codec=r&&Object.values(tr).includes(r)?r:tr.UNKNOWN,(null==(t=this.current)?void 0:t.drmType)&&this.setDrmType(null==(i=this.current)?void 0:i.drmType),this.isVidEncrypt=!!(null==(n=this.current)?void 0:n.kid),this.initCheckExpireData()}initCheckExpireData(){const{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}=this.configs;Bw(this.urlCheckData,{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}),this.updateCheckExpireData()}updateCheckExpireData(){var e;const t=null==(e=this.getCurrentStreams())?void 0:e[0];if(t){const{url:e,urlExpireTimestamp:i}=t;if(!e)return;const n=al(""+(i||this.configs.urlExpireTimestamp));n?this.urlCheckData.urlExpireTimestamp=n:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=Qs,la.warn("not provide urlExpireTimestamp, url expire check will not work")),la.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[ea,ta],i=e&&Object.entries(e).reduce(((e,[i,n])=>($s.includes(i)?e.push({LANG:"zh"===i?"zh-cn":i,TEXT:n}):t.push({LANG:i,TEXT:n}),e)),[]);return{extraLangList:t,extendLangList:i}}getCurrentUrl(){var e;return null==(e=this.getCurrentStreams()[0])?void 0:e.url}getTargetStreamType(e){var t;return e?e.streamType||this.configs.streamType||Ya(e.url):this.configs.streamType||Sa(null==(t=this.configs)?void 0:t.getVideoByToken)}getCurrentStreamType(){const e=this.getCurrentStreams();if(e.length){const{url:t,streamType:i}=e[0];return i||this.configs.streamType||Ya(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||Sa(null==(e=this.configs)?void 0:e.getVideoByToken)}getConfiguredHlsAbrEngine(){var e;return DD(null==(e=this.configs)?void 0:e.autoBitrateOpts)}isOpenVePlayerABR(){var e,t,i;if("veplayer"!==this.getConfiguredHlsAbrEngine()||!this.isAutoBitrateEnable||!(null==(e=this.configs)?void 0:e.isLive)&&!(null==(i=null==(t=this.configs)?void 0:t.licensSupportModuleList)?void 0:i.includes(bD.ABR)))return!1;const n=this.sdk.getSdkPlugin("AuthToken");return this.adapter.canOpenAbr(null==n?void 0:n.playInfo)}isOpenABR(){return this.isOpenVePlayerABR()}showRealDefinition(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.showRealDefinition)}isAutoDefinition(e){return["auto","自动"].includes(e)}isPlayAutoDefinition(e=""){var t;return this.isAutoDefinition(e||this.defaultDefinition)||(null==(t=this.configs.autoBitrateOpts)?void 0:t.startWithAuto)}isDefinitionMatch(e,t){return!(!this.isAutoDefinition(e)||!this.isAutoDefinition(t))||e===t}getCurrentStreams(){const e=this.current;return this.getUrlList(e)}getLineList(){return pi(er(this.playList,"lineId"))}getLineListByLineId(e){return this.playList.filter((t=>{var i;return(null==e?void 0:e.toString())===(null==(i=t.lineId)?void 0:i.toString())}))}getDefinitionListByLineId(e){return pi(er(this.getLineListByLineId(e),"definition"))}getUrlList(e){return this.playList.filter((t=>Object.keys(e).every((i=>{var n,r;if("url"===i){const i=null==e?void 0:e.url,n=null==t?void 0:t.url;return"string"==typeof i?i===(null==n?void 0:n.toString()):!(!Array.isArray(i)||!Array.isArray(n))&&i.map((e=>e.src)).join("")===n.map((e=>e.src)).join("")}{const o=(null==(n=e[i])?void 0:n.toString())===(null==(r=t[i])?void 0:r.toString()),s=!e[i];return o||s}}))))}getNextDefinition(e=!0,t){var i,n,r;const o=e?"next":"prev",{definition:s,lineId:a}=this.current;if(!s)return;const l=null==(i=this.getCurrentStreams())?void 0:i[0],u="auto"===s?l.mapDefinition:s,c=(e=>(null==e?void 0:e.length)&&e.reduce(((t,i,n)=>(t[i]={next:n+1>=e.length?null:e[n+1],pre:0===n?null:e[n-1]},t)),{}))(t)||zs;if(!Object.keys(c).includes(u))return;let h=null==(n=c[u])?void 0:n[o];const d=this.getDefinitionListByLineId(a);for(;0===d.filter((e=>e.definition===h)).length&&h;)h=null==(r=c[h])?void 0:r[o];if(h)return"auto"===s&&h&&(l.mapDefinition=h),this.getUrlList({lineId:a,definition:h});la.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=EH.ttDramaEnv)?void 0:e.channel,n={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},r={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let o,s=t;"byteplus"===i&&n?(o=n,s="sg"):"volcengine"===i&&r?(o=r,s=o[t]?t:"cn"):o={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}};const a=o[this.region]||o[s];return{playDomain:a.__PLAY_DOMAIN__,backupPlayDomain:null==a?void 0:a.__BACKUP_PLAY_DOMAIN__}}get playDomain(){var e;return this.playDomainDegrade&&null!=(e=this.apiMap.backupPlayDomain)?e:this.apiMap.playDomain}setVodTeaId(){const e=rl(this.userRegion,this.region);!function(e){ww.TEA_ID=e}(this.configs.logTeaAppId||e.__LOG_TEA_ID__||4951)}getMergedConfigs(e){const t=pi(this.configs);return Bi(t,pi(e),((e,t)=>{if(ge(e))return t})),t}updateConfigs(e){Bi(this.configs,pi(e),((e,t)=>{if(ge(e))return t}))}updatePlayList(){const{url:e,playList:t=[],urlExpireTimestamp:i}=this.configs,n=[...t].filter((e=>e.url));if(e&&!n.length){const t=c(u({},this.current),{url:e,urlExpireTimestamp:i});this.playList=[t]}else this.playList=n}isVidPlay(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}}class RD{}RD.isSupported=()=>!1,RD.isSupportedH264=e=>!1;var xD=function(){function e(t){yr(this,e),this.config=t.config,this.parent=t.root,this.root=Br.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="touch"===this.config.domEventType?"touchend":"click";this._delegates=ks.delegate.call(this,this.root,"li",n,this.onItemClick)}return mr(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(Br.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&&Br.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Br.addClass(t,"selected"),n&&Br.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(){Br.removeClass(this.root,"hide"),Br.addClass(this.root,"active")}},{key:"hide",value:function(){Br.removeClass(this.root,"active"),Br.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}(),OD="side",ND="middle",MD="default",UD="click",BD="hover";var HD="mobile"===Gr.device,FD=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),_r(br(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===UD?n.toggle(!n.isActive):n.toggle(!0)})),_r(br(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==OD&&n.isActive&&n.toggle(!1)})),_r(br(n),"onListEnter",(function(e){n.enterType=2})),_r(br(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 mr(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(),(HD=HD||"touch"===this.domEventType)&&"mobile"===Gr.device&&t.listType===MD&&(t.listType=OD),t.hidePortrait&&Br.addClass(this.root,"portrait"),this.on([Ro,Ao],(function(){e._resizeList()})),this.once(ro,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),HD&&this.on(po,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),HD?(t.toggleMode=UD,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===UD?"click":"mouseenter",t.toggleMode===UD?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",Br.createDom("span","",{},"icon-text")),Br.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Br.addClass(this.root,"show")}},{key:"hide",value:function(){Br.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||Br.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===gr(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&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===OD?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===OD?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||HD||n===OD)&&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 s,a,l={config:{data:e||[],className:(s=n.listType,a=n.position,s===OD?a===_s.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:HD?"touch":"mouse"},root:n.listType===OD?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var u=this.player.root.getBoundingClientRect().height,c=n.listType===ND?u-50:u;c&&n.heightLimit&&(l.config.maxHeight="".concat(c,"px")),this.optionsList=new xD(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===ND?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===UD?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:_s.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:BD,heightLimit:!0}}}]),i}();const jD={READY:"ready",COMPLETE:"complete",URL_CHANGE:"urlchange",PLAYER_FOCUS:"focus",PLAYER_BLUR:"blur",FULLSCREEN_CHANGE:"fullscreen_change",CSS_FULLSCREEN_CHANGE:"cssFullscreen_change",MINI_STATE_CHANGE:"mini_state_change",DESTROY:"destroy",REPLAY:"replay",RETRY:"retry",DEFINITION_CHANGE:"definition_change",Before_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:"after_definition_change",VIDEO_RESIZE:"video_resize",PIP_CHANGE:"pip_change",ROTATE:"rotate",SHORTCUT:"shortcut",SEI_PARSED:"SEI_PARSED",USER_ACTION:"user_action",AUTOPLAY_STARTED:"autoplay_started",AUTOPLAY_PREVENTED:"autoplay_was_prevented",READY_CREATE_PLAYER:"ready_create_player",PLAYER_CREATED_FINISH:"player_create_finish",CREATE_PLAYER_PERF:"create_player_perf",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",PLAYNEXT:"playnext",URL_NULL:"urlNull",LEAVE_PLAYER:"leaveplayer",ENTER_PLAYER:"enterplayer",RESET:"reset",SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success",LICENSE_STATUS_WARNING:"license_status_warning",AUDIO_TRACKS_UPDATED:"audio_tracks_updated",AUDIO_TRACK_CHANGE:"audio_track_change",HLS_LEVELS_UPDATED:"hls_levels_updated",HLS_LEVEL_SWITCHING:"hls_level_switching",HLS_LEVEL_SWITCHED:"hls_level_switched",HLS_ABR_ENGINE_RESOLVED:"hls_abr_engine_resolved",HLS_ABR_STATE_CHANGE:"hls_abr_state_change",HLS_ABR_LIMIT_CHANGE:"hls_abr_limit_change",HLS_SUBTITLE_TRACKS_UPDATED:"hls_subtitle_tracks_updated",HLS_SUBTITLE_TRACK_SWITCHING:"hls_subtitle_track_switching",HLS_SUBTITLE_TRACK_SWITCHED:"hls_subtitle_track_switched"},VD=c(u({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"},{}),{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",PLAY_NEXT_START:"play_next_start",PLAY_NEXT_END:"play_next_end",ABR_AUTO_DESC_CHANGE:"ABR_AUTO_DESC_CHANGE",CORE_EVENT:"core_event",PRELOAD_INFO:"PRELOAD_INFO"}),KD=u(u(u({},{ABORT:"abort",CANPLAY:"canplay",CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPITED:"empited",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_META_DATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"}),jD),VD),GD={SDKEvents:jD,PluginEvents:VD},WD=KD,YD=70,zD=30,$D=50,XD=60,qD=20,QD=e=>"string"==typeof e&&e.trim()?e.trim():void 0,ZD=e=>{if(e>=1e6){return`${Math.round(e/1e6*10)/10} Mbps`}return`${Math.round(e/1e3)} Kbps`},JD=e=>{const t=null==e?void 0:e.trim().toLowerCase();if(t)return/^(avc1|avc|h264)/.test(t)?"H.264":/^(hev1|hvc1|hevc|h265)/.test(t)?"H.265":/^(vvc1|vvi1|vvc|h266)/.test(t)?"H.266":/^(av01|av1)/.test(t)?"AV1":null==e?void 0:e.trim()},eL=e=>{const t=null==e?void 0:e.trim().toLowerCase();if(t)return["pq","hlg","hdr","hdr10","hdr10+"].includes(t)?"HDR":"sdr"===t?"SDR":null==e?void 0:e.trim().toUpperCase()},tL=e=>{var t,i;const n=[e.width,e.height].filter((e=>"number"==typeof e&&e>0));return n.length>0?`${Math.round(Math.min(...n))}p`:(null==(t=e.name)?void 0:t.trim())?e.name.trim():ZD(null!=(i=e.averageBitrate)?i:e.bitrate)};const iL=(e,t,i)=>e.flatMap((e=>{var n,r;const o=QD(e.definition);if(!o)return[];const s=`definition:${encodeURIComponent(o)}`;return[{id:s,label:null!=(r=null!=(n=QD(e.text))?n:QD(e.definitionTextKey))?r:o,source:"definition",definition:o,selected:o===t,pending:i===s}]})),nL=(e,t,i)=>({id:"auto",label:e,source:"abr-auto",selected:t,pending:"auto"===i});function rL(e){var t,i,n;const r=e.abrState,o=e.levelState,s=null!=(t=e.definitions)?t:[],a=(null==(i=e.autoLabel)?void 0:i.trim())||"Auto",l="hls-levels"===(null==r?void 0:r.decisionSource)&&r.playbackSessionId===(null==o?void 0:o.playbackSessionId)&&o.ready;if(l&&o.levels.length<=1)return[];if(l&&o){const t=function(e){const t=e.map(tL),i=new Map;return t.forEach((e=>{var t;return i.set(e,(null!=(t=i.get(e))?t:0)+1)})),e.map(((n,r)=>{var o,s;const a=t[r];if((null!=(o=i.get(a))?o:0)<2)return a;const l=e.filter(((e,i)=>t[i]===a)),u=[a,ZD(null!=(s=n.averageBitrate)?s:n.bitrate)],c=l.map((e=>e.width)).filter(Boolean);new Set(c).size>1&&n.width&&n.height&&u.push(`${Math.round(n.width)}×${Math.round(n.height)}`);const h=l.map((e=>JD(e.videoCodec)));if(new Set(h).size>1){const e=JD(n.videoCodec);e&&u.push(e)}const d=l.map((e=>eL(e.videoRange)));if(new Set(d).size>1){const e=eL(n.videoRange);e&&u.push(e)}const p=l.map((e=>e.frameRate));return new Set(p).size>1&&n.frameRate&&u.push(`${Math.round(n.frameRate)} fps`),u.join(" · ")}))}(o.levels),i=(null==(n=e.pendingId)?void 0:n.startsWith("level:"))?e.pendingId:null,s=o.levels.findIndex((e=>e.index===o.currentLevel)),l=t[s],u=e.showRealDefinition&&"auto"===(null==r?void 0:r.mode)&&l?`${a}(${l})`:a;return[nL(u,"auto"===(null==r?void 0:r.mode)&&!i,e.pendingId),...o.levels.map(((n,s)=>{const a=`level:${n.index}`;return{id:a,label:t[s],source:"hls-level",levelIndex:n.index,selected:i?i===a:"manual"===(null==r?void 0:r.mode)&&o.currentLevel===n.index,pending:e.pendingId===a}}))]}if("definition-list"===(null==r?void 0:r.decisionSource)&&r.available){const t=s.filter((e=>{const t=QD(e.definition);return!!t&&!(e=>["auto","自动"].includes(e.trim().toLowerCase()))(t)}));return[nL(a,"auto"===r.mode,e.pendingId),...iL(t,e.currentDefinition,e.pendingId).map((e=>c(u({},e),{selected:"manual"===r.mode&&e.selected})))]}return iL(s,e.currentDefinition,e.pendingId)}const oL=e=>class extends e{constructor(e){super(e),this._playTimer=null,this._qualityPendingId=null,this._qualitySessionCleared=!1,this._qualityExpiredSessionId=null,this.handleHlsQualityStateUpdate=e=>{var t,i,n,r;this.isCurrentHlsQualitySession(e)&&(this._qualitySessionCleared=!1,this._qualityExpiredSessionId=null,"auto"===this._qualityPendingId&&"auto"===(null==(r=null==(n=null==(i=null==(t=this.player)?void 0:t.sdk)?void 0:i.getHlsAbrState)?void 0:n.call(i))?void 0:r.mode)&&(this._qualityPendingId=null),this.refreshQualityMenu())},this.handleHlsLevelSwitched=e=>{var t;this.isCurrentHlsQualitySession(e)&&(!(null==(t=this._qualityPendingId)?void 0:t.startsWith("level:"))||void 0!==(null==e?void 0:e.to)&&this._qualityPendingId!==`level:${e.to}`||(this._qualityPendingId=null),this.refreshQualityMenu())},this.handleABRDescChange=(...e)=>{this._autoRealDefinition=e[1]||void 0,this.refreshDefinitionList()},this.handleResourceReady=(e=[])=>{var t,i;const{list:n}=this.getCurrentDefinitionInfo(this.player),r=n.filter((t=>{var i;const n=t&&e.find((e=>this.playerData.isDefinitionMatch(e.definition,t.definition)));return n&&"dash"===(null==(i=this.playerData.getStreamType())?void 0:i.toLowerCase())&&(t.url=n.url),n})),o=e.find((e=>null==e?void 0:e.selected))||this.playerData.current,s=r.find((e=>this.playerData.isDefinitionMatch(e.definition,null==o?void 0:o.definition)));this.playerData.playList=r,(null==s?void 0:s.definition)&&(null==(t=this.playerData.current)?void 0:t.definition)!==s.definition&&(this.playerData.current.definition=null==s?void 0:s.definition),null==(i=this.refreshDefinitionList)||i.call(this)},this.getAutoDefRealLevel=()=>{var e;if(this.playerData.isAutoDefinition(null==(e=this.playerData.current)?void 0:e.definition)){const{videoWidth:e,videoHeight:t}=this.player.media;if(e&&t){const{list:i=[]}=this.getCurrentDefinitionInfo(this.player),n=i.find((i=>{const n=i.vwidth||i.width,r=i.vheight||i.height;return n&&r&&n===e&&r===t}));(null==n?void 0:n.definition)&&this._autoRealDefinition!==n.definition&&(this._autoRealDefinition=n.definition,this.refreshDefinitionList(),"mobile"===Gr.device&&(null==this||this.updatePanel()))}}},this.clientType=e.clientType,this.playerData=e.player.config.playerData,this.toastInfo={},this.dataMonitoring()}afterCreate(){var e,t,i,n,r;super.afterCreate(),this._autoRealDefinition=void 0,null==(e=this.refreshDefinitionList)||e.call(this),(this.playerData.isOpenABR()||"dash"===(null==(t=this.playerData.getStreamType())?void 0:t.toLowerCase()))&&this.on("resourceReady",this.handleResourceReady),this.playerData.isOpenABR()&&(this.on("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),((null==(r=null==(n=null==(i=this.playerData)?void 0:i.adapter)?void 0:n.useNativeAbr)?void 0:r.call(n))||this.player.plugins.dashplugin||this.player.plugins.mp4encryptplayer)&&(this.autoDefDetectTimer=new Va,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(jD.HLS_ABR_ENGINE_RESOLVED,this.handleHlsQualityStateUpdate),this.on(jD.HLS_ABR_STATE_CHANGE,this.handleHlsQualityStateUpdate),this.on(jD.HLS_LEVELS_UPDATED,this.handleHlsQualityStateUpdate),this.on(jD.HLS_LEVEL_SWITCHED,this.handleHlsLevelSwitched),this.on(VD.PLAY_NEXT_START,(()=>{this.handleHlsQualityPlayNextStart(),this.definitionSubscribeId&&dr.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&dr.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(VD.PLAY_NEXT_END,(()=>{var e,t;null==(e=this.dataMonitoring)||e.call(this),null==(t=this.refreshDefinitionList)||t.call(this)}))}getQualityMenuItems(){var e,t,i,n,r,o,s;if(this._qualitySessionCleared)return[];const a=null==(e=this.player)?void 0:e.sdk,{list:l}=this.getCurrentDefinitionInfo(this.player);return rL({abrState:null==(t=null==a?void 0:a.getHlsAbrState)?void 0:t.call(a),levelState:null==(i=null==a?void 0:a.getHlsLevelState)?void 0:i.call(a),definitions:l,currentDefinition:null==(n=this.playerData.current)?void 0:n.definition,pendingId:this._qualityPendingId,showRealDefinition:this.playerData.showRealDefinition(),autoLabel:(null==(o=null==(r=this.playerData.configs)?void 0:r.autoBitrateOpts)?void 0:o.autoDefinitionText)||(null==(s=this.i18n)?void 0:s.DEFINITION_AUTO)||"Auto"})}selectQualityMenuItem(e){var t,i,n,r,o;if(!e||e.selected||e.pending)return;const s=null==(t=this.player)?void 0:t.sdk;if(!s)return;const a=function(e){if("abr-auto"===e.source)return{type:"restore-auto"};if("definition"===e.source&&e.definition)return{type:"change-definition",definition:e.definition};if("hls-level"===e.source&&void 0!==e.levelIndex)return{type:"set-hls-level",levelIndex:e.levelIndex};throw new TypeError(`Invalid quality menu item: ${e.id}`)}(e);try{if("restore-auto"===a.type)return this._qualityPendingId=e.id,this.refreshQualityMenu(),void s.setHlsAbrMode("auto");if("set-hls-level"===a.type){const t=s.getHlsLevelState().playbackSessionId,n=null==(i=this.playerData.configs)?void 0:i.hlsLevelSwitchMode;return this._qualityPendingId=e.id,this.refreshQualityMenu(),void s.setHlsLevel(a.levelIndex,c(u({},n?{mode:n}:{}),{playbackSessionId:t}))}s.changeDefinition(a.definition)}catch(fF){this._qualityPendingId=null,this.refreshQualityMenu(),null==(o=null==(r=null==(n=this.player)?void 0:n.logger)?void 0:r.error)||o.call(r,"quality menu action failed",fF)}}refreshQualityMenu(){var e,t;null==(e=this.refreshDefinitionList)||e.call(this),"MOBILE"===this.clientType&&(null==(t=this.updatePanel)||t.call(this))}isCurrentHlsQualitySession(e){var t,i,n,r,o;const s=null==e?void 0:e.playbackSessionId;if(!s||s===this._qualityExpiredSessionId)return!1;const a=null==(t=this.player)?void 0:t.sdk;return[null==(n=null==(i=null==a?void 0:a.getHlsAbrState)?void 0:i.call(a))?void 0:n.playbackSessionId,null==(o=null==(r=null==a?void 0:a.getHlsLevelState)?void 0:r.call(a))?void 0:o.playbackSessionId].includes(s)}handleHlsQualityPlayNextStart(){var e,t,i,n,r;const o=null==(e=this.player)?void 0:e.sdk;this._qualityExpiredSessionId=(null==(i=null==(t=null==o?void 0:o.getHlsAbrState)?void 0:t.call(o))?void 0:i.playbackSessionId)||(null==(r=null==(n=null==o?void 0:o.getHlsLevelState)?void 0:n.call(o))?void 0:r.playbackSessionId)||null,this._qualityPendingId=null,this._qualitySessionCleared=!0,this.refreshQualityMenu()}getShowText(e={},t,i){var n,r;if(t)return this.playerData.isOpenABR()&&this.playerData.isAutoDefinition(t.definition)?(null==(r=null==(n=this.playerData.configs)?void 0:n.autoBitrateOpts)?void 0:r.autoDefinitionText)||e[t.definitionTextKey]||t.definition:e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}getCurrentDefinitionInfo(e){const t={list:[],defaultDefinition:""},i=e.config.playerData,{current:{lineId:n,definition:r}}=i,o=i.getDefinitionListByLineId(n);return Array.isArray(o)&&o.length>0&&(t.list=o.map((t=>(t.text||(t.text=this.getShowText(e.i18n,t,t.definition)),t)))),t.defaultDefinition=r,t}showToast(e,t){var i,n;const r=null==(i=this.player)?void 0:i.getPlugin("sdkToastPlugin");if(!r)return;const o=this.getShowText(this.i18n,e,t);this.toastInfo&&(clearTimeout(this.toastInfo.timer),null==(n=null==r?void 0:r.remove)||n.call(r,this.toastInfo.id),this.player.off(Lo,this.toastInfo.remove),this.player.off(Jr,this.toastInfo.remove)),this.toastInfo={id:r.add(`${this.langText.switching} ${o}...`,0,!0),showTime:Date.now(),delayClose:!1},this.toastInfo.timer=setTimeout((()=>{r.remove(this.toastInfo.id),clearTimeout(this.toastInfo.timer)}),2e3),this.toastInfo.remove=()=>{if(!this.toastInfo.id)return;Date.now()-this.toastInfo.showTime>2e3?r.remove(this.toastInfo.id):this.toastInfo.delayClose=!0},this.player.once(Lo,this.toastInfo.remove),this.player.once(Jr,this.toastInfo.remove)}selectDefinition(e){var t,i,n;const r=null==(n=null==(i=null==(t=this.renderList)?void 0:t.find)?void 0:i.call(t,(t=>this.playerData.isDefinitionMatch(t.definition,e.definition))))?void 0:n.definitionTextKey;this.config.showToastOnManualClick&&this.showToast(c(u({},e),{definitionTextKey:r}),e.definition),this.playerData.current.definition=e.definition,this.playerData.isAutoDefinition(e.definition)||(this._autoRealDefinition=void 0)}showRealDefinition(e){return e.selected&&this.playerData.isAutoDefinition(e.definition)&&this.playerData.showRealDefinition()&&this._autoRealDefinition&&!this.playerData.isAutoDefinition(this._autoRealDefinition)}dataMonitoring(){this.playerData&&(this.definitionSubscribeId=dr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e&&t&&e!==t&&this.player){const{list:i}=this.getCurrentDefinitionInfo(this.player),n=i.find((e=>e.definition===t));n&&n.url&&(this.player.changeDefinition(c(u({kid:n.playAuthId},n),{secretKey:n.secretKey,definition:t,url:n.url})),"MOBILE"===this.clientType&&this.updatePanel(),this.player.emit(VD.INNER_DEFINITION_CHANGE,{from:e,to:t,url:n.url}),this.player.emit(VD.PlAY_URL_CHANGE,{url:n.url,from:VD.INNER_DEFINITION_CHANGE}),"PC"===this.clientType&&this.renderItemList(t),this.player.config.isLive&&(this._playTimer=setTimeout((()=>{this.player.ended?this.player.replay():this.player.paused&&this.player.play()}),1e3)))}})),this.playListSubscribeId=dr.subscribeProperty(this.playerData,"playList",(()=>{this.refreshDefinitionList()})))}onItemClick(...e){super.onItemClick(...e)}destroy(){clearTimeout(this.toastInfo.timer),clearTimeout(this._playTimer),this.autoDefDetectTimer&&(this.autoDefDetectTimer.clear(),this.autoDefDetectTimer=null,this.getAutoDefRealLevel=null),this.off("resourceReady",this.handleResourceReady),this.off("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),this.off(jD.HLS_ABR_ENGINE_RESOLVED,this.handleHlsQualityStateUpdate),this.off(jD.HLS_ABR_STATE_CHANGE,this.handleHlsQualityStateUpdate),this.off(jD.HLS_LEVELS_UPDATED,this.handleHlsQualityStateUpdate),this.off(jD.HLS_LEVEL_SWITCHED,this.handleHlsLevelSwitched)}};class sL extends(oL(FD)){constructor(e){const t=e.config.className;super(c(u({},e),{config:u(u({},e.config),t?{className:`${t} xgplayer-definition-plugin-pc`}:{}),clientType:"PC"})),this.onItemClick=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return D(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),lD(e,t,{leading:n,maxWait:t,trailing:r})}(this.onItemClick.bind(this),1e3,{trailing:!0})}static get pluginName(){return"sdkDefinitionPlugin"}static get defaultConfig(){return{position:ks.POSITIONS.CONTROLS_RIGHT,index:zD,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition xgplayer-definition-plugin-pc",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}registerLanguageTexts(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0);const{defaultDefinition:t,list:i}=this.getCurrentDefinitionInfo(this.player);this.config.defaultDefinition=t,this.config.list=i.map(((e,t)=>c(u({},e),{itemIndex:t})));const n=this.getQualityMenuItems();n.length>1||this.config.alwaysShowDefinition?(this.renderItemList(void 0,n),this.show()):(this.qualityRenderList=[],this.hide())}show(){!this.qualityRenderList||this.qualityRenderList.length<2&&!this.config.alwaysShowDefinition||Br.addClass(this.root,"show")}afterPlayerInit(){}changeCurrentText(){var e,t,i;const n=(null==(e=this.qualityRenderList)?void 0:e.find((e=>e.selected)))||(null==(t=this.qualityRenderList)?void 0:t[this.curIndex])||(null==(i=this.qualityRenderList)?void 0:i[0]);if(!n)return void super.changeCurrentText();if(this.isIcons)return;const r=this.find(".icon-text");r&&(r.textContent=n.showText)}renderItemList(e,t=this.getQualityMenuItems()){if(Array.isArray(e))return;const{list:i,defaultDefinition:n}=this.config,r=i.map((t=>{var i;const r={url:t.url,definition:t.definition||"",definitionTextKey:t.definitionTextKey,showText:this.getShowText(this.i18n,t,t.definition),isCurrent:!1,selected:!1,isDefinitionAuto:!1},o="string"==typeof e?t.definition===e:void 0===e&&t.definition===n;if(!Br.isUndefined(t.definition)&&o&&(r.isCurrent=!0,r.selected=!0),this.showRealDefinition(r)){const e=null==(i=this.renderList)?void 0:i.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);r.showText=t?`${r.showText}(${t})`:r.showText}return r.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition),r}));this.renderList=r;let o=0;const s=t.some((e=>"definition"===e.source)),a=t.map(((e,t)=>{e.selected&&(o=t);const i="definition"===e.source?r.find((t=>this.playerData.isDefinitionMatch(t.definition,e.definition))):void 0;let n=e.label;if(s&&"abr-auto"===e.source&&this.showRealDefinition(c(u({},e),{definition:"auto"}))){const e=r.find((e=>this.playerData.isDefinitionMatch(e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);t&&(n=`${n}(${t})`)}return u(c(u({},e),{qualityItem:e,showText:n,isCurrent:e.selected,isDefinitionAuto:"abr-auto"===e.source}),(null==i?void 0:i.url)?{url:i.url}:{})}));this.qualityRenderList=a,super.renderItemList(a,o)}onItemClick(e,t){var i,n;const r=null==(n=null==(i=this.qualityRenderList)?void 0:i.find((e=>{var i;return e.id===(null==(i=null==t?void 0:t.to)?void 0:i.id)})))?void 0:n.qualityItem;r&&!r.selected&&(this.emitUserAction(e,"change_definition",{source:r.source,id:r.id,label:r.label}),this.selectQualityMenuItem(r))}selectDef(e){this.selectDefinition(e),"ontouchstart"in window&&this.optionsList.hide()}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}destroy(){super.destroy()}}function aL(e){const t={};for(const i of["lang","name"]){const n=e[i];void 0!==n&&(t[i]=n)}return t}function lL(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function uL(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(aL(t));else{const{id:i,lang:n,name:r}=t,o=e.audioTracks.find((e=>e.id===i&&((void 0===n||e.lang===n)&&(void 0===r||e.name===r))));if(!o||e.audioTrack===o.id)return;e.audioTrack=o.id}}const cL={zh:"中文","zh-cn":"普通话","zh-hk":"粤語","zh-tw":"繁體中文","zh-sg":"普通话",en:"English",ja:"日本語",ko:"한국어",th:"ภาษาไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",fil:"Filipino",tl:"Filipino",my:"မြန်မာဘာသာ",km:"ភាសាខ្មែរ",lo:"ພາສາລາວ",hi:"हिन्दी",bn:"বাংলা",ta:"தமிழ்",te:"తెలుగు",mr:"मराठी",ur:"اردو",fr:"Français",de:"Deutsch",es:"Español","es-419":"Español (Latinoamérica)",it:"Italiano",pt:"Português","pt-br":"Português (Brasil)","pt-pt":"Português (Portugal)",nl:"Nederlands",sv:"Svenska",da:"Dansk",no:"Norsk",fi:"Suomi",ca:"Català",ru:"Русский",pl:"Polski",uk:"Українська",cs:"Čeština",sk:"Slovenčina",ro:"Română",hu:"Magyar",bg:"Български",hr:"Hrvatski",sr:"Српски",sl:"Slovenščina",el:"Ελληνικά",ar:"العربية",fa:"فارسی",he:"עברית",tr:"Türkçe",az:"Azərbaycan",kk:"Қазақша",mn:"Монгол",sw:"Kiswahili"};function hL(e){var t;return null!=(t=cL[e.toLowerCase()])?t:e.toUpperCase()}function dL(e,t){var i;const n=null!=(i=e.name)?i:"",r=e.lang?hL(e.lang):"";return[r||n||`Track ${e.id+1}`,!1!==(null==t?void 0:t.showNameSuffix)&&r&&n?`(${n})`:""].filter(Boolean).join(" ")}function pL(e,t,i){var n;const r=null!=(n=e.label)?n:"",o=e.language?hL(e.language):"";return[o||r||`Track ${t+1}`,!1!==(null==i?void 0:i.showNameSuffix)&&o&&r?`(${r})`:""].filter(Boolean).join(" ")}class fL extends FD{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._nativeChangeRaf=null}static get pluginName(){return"AudioTrack"}static get defaultConfig(){return c(u({},FD.defaultConfig),{position:ks.POSITIONS.CONTROLS_RIGHT,index:YD,list:[],className:"xgplayer-audio-track",hidePortrait:!1,isShowIcon:!0,showNameSuffix:!0})}registerIcons(){return{}}afterPlayerInit(){var e;super.afterPlayerInit(),this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{this._updateSelection(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t?this.hide():this._initNativeAudioTracks()}onItemClick(e,t){if(super.onItemClick(e,t),this._nativeMode){const e=this._getNativeTrackList();if(!e)return;lL(e,t.to.id)}else{const e=this._getHls();if(!e)return;uL(e,t.to)}}destroy(){var e;null!==this._nativeChangeRaf&&cancelAnimationFrame(this._nativeChangeRaf),this._unbindNativeAudioTracks(),null==(e=super.destroy)||e.call(this)}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{null===this._nativeChangeRaf&&(this._nativeChangeRaf=requestAnimationFrame((()=>{this._nativeChangeRaf=null,this._onNativeTrackEnabled()})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1?this._onNativeTracksChanged():this.hide())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1?this.hide():(this._renderNativeTracks(e),this.show())}_onNativeTrackEnabled(){const e=this._getNativeTrackList();e&&this._renderNativeTracks(e)}_renderNativeTracks(e){const t={showNameSuffix:!1!==this.config.showNameSuffix},i=[];for(let r=0;r<e.length;r++){const n=e[r],o=pL(n,r,t);i.push({id:r,name:o,showText:o,iconText:o,selected:n.enabled,default:n.enabled})}const n=i.findIndex((e=>e.selected));this.config.list=i,super.renderItemList(i,n>-1?n:0)}_onAudioTracksUpdated(e){!e||e.length<=1?this.hide():(this._renderTracks(e),this.show())}_updateSelection(e){const t=this._getHls();t&&this._renderTracks(t.audioTracks,e)}_renderTracks(e,t){var i;const n=this._getHls(),r=null!=(i=null!=t?t:null==n?void 0:n.audioTrack)?i:-1,o={showNameSuffix:!1!==this.config.showNameSuffix},s=e.find((e=>e.default)),a=e.map((e=>c(u({},e),{showText:dL(e,o),iconText:dL(e,o),selected:e.id===r})));if(-1===r&&s){const e=a.findIndex((e=>e.id===s.id));e>-1&&(a[e].selected=!0)}const l=a.findIndex((e=>e.selected));this.config.list=a,super.renderItemList(a,l>-1?l:0)}}function gL(){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}const{isWeixin:yL,os:vL,device:mL}=Gr,_L=vL.isAndroid,EL=vL.isIos,TL="mobile"===mL;let SL=0,bL=!1;class kL extends ks{constructor(e){super(e),this.state={mode:0,showUnmuteBt:!1},this.wxCanPlayFn=()=>{window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(()=>{this.wxTimer=setTimeout((()=>{this.wxTimer&&clearTimeout(this.wxTimer);const e=this.player.play();e&&e.then?e.then((()=>{la.log("wechat autoplay success")})).catch((e=>{la.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):la.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():_L?this.player.once(ro,this.wxCanPlayFn):EL&&this.player.once(_o,this.wxCanPlayFn)},this.userClickPlay=()=>{if(bL)return;const e=this.player.play();e&&e.then?e.then((()=>{la.log("user action autoplay success"),bL=!0})).catch((e=>{la.warn("user action autoplay fail:",e)})):(la.warn("no play promise"),bL=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(la.warn("unmute autoplay fail"),this.player.emit(VD.AUTOPLAY_FAILED,{mode:"unmute"}),_L&&yL?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(la.warn("mute autoplay fail"),this.player.emit(VD.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(VD.AUTOPLAY_FAILED,{mode:"noSupport"}),void la.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(VD.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(VD.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(VD.AUTOPLAY_SUCCESS,{mode:"unmute"})},this.handleVolumechange=()=>{this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())},this.cancelUnmute=e=>{const t=Date.now();t-SL>200&&(SL=t,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emitUserAction(e,"cancel_mute"))}}static get pluginName(){return"AutoplayPlugin"}static get defaultConfig(){return{position:ks.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1,showUnmuteBtn:!0}}afterCreate(){this.initState(),this.initEvents(),this.setWXAutoPlay()}registerLanguageTexts(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"},muted:{jp:"ミュート",en:"muted",zh:"已静音","zh-hk":"已靜音"}}}registerIcons(){return{muted:{icon:gL,class:"xgplayer-muted-svg"}}}updateLang(){this.renderUnmuteBt()}initState(){const{enableDegradeMuteAutoplay:e,enableWxJsBridgeAutoplay:t,enableUserActionAutoplay:i}=this.player.config;e&&(this.config.enableDegradeMuteAutoplay=!0),t&&(this.config.enableWxJsBridgeAutoplay=!0),i&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}initEvents(){this.player.on(mo,this.handleAutoplayPrevented),this.player.on(vo,this.handleAutoplayStart),this.player.on(so,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){yL&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay,!1))}setUserActionAutoPlay(){var e;(null==(e=this.config)?void 0:e.enableUserActionAutoplay)&&this.player.once(VD.AUTOPLAY_FAILED,(()=>{this.hasSetUserAutoplay=!0;(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).addEventListener("click",this.userClickPlay,!1)}))}changeMuteMode(){this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((()=>{this.timer&&clearTimeout(this.timer);const e=this.player.play();e&&e.then?e.then((()=>{la.log("degrade mute autoplay success")})).catch((e=>{la.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):la.warn("no play promise")}))}renderUnmuteBt(){var e,t,i;const n=this.root;if(n&&(n.innerHTML="",this.state.showUnmuteBt&&this.config.showUnmuteBtn)){const r=this.langText.unmute||(null==(i=null==(t=null==(e=this.registerLanguageTexts)?void 0:e.call(this))?void 0:t.unmute)?void 0:i.en),o=Br.createDom("div",r,void 0,"xgplayer-unmute-bt");n.appendChild(o),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute)}}destroy(){if(this.player.off(mo,this.handleAutoplayPrevented),this.player.off(vo,this.handleAutoplayStart),this.player.off(so,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=TL?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}render(){return'<div class="xgplayer-unmute"></div>'}}const CL=void 0;function IL(){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}class AL extends ks{constructor(e){super(e),this.panel=null,this.panelContainer=null}static get pluginName(){return"MoreButtonPlugin"}static get defaultConfig(){return{position:ks.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){this.renderMoreIcon()}updateLang(e){if(!this.panelContainer)return;const t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),i=this.getAndSplitList().extraList;t.forEach((t=>{var n,r;const o=Number(t.getAttribute("plugin-index"));(null==(r=null==(n=i[o])?void 0:n.textTips)?void 0:r[e])&&(t.innerHTML=i[o].textTips[e])}))}registerIcons(){return{more:{icon:IL,class:"xgplayer-more-svg"}}}getAndSplitList(){var e;let t,i;const n=(null!=(e=this.player.config.ignores)?e:[]).map((e=>e.toLowerCase())),r=this.config.iconPlugins.filter((e=>!n.includes(e.pluginName.toLowerCase())));return r.length>this.config.maxShowNum+1?(t=r.slice(0,this.config.maxShowNum),i=r.slice(-(r.length-this.config.maxShowNum))):t=[...r],{list:null!=t?t:[],extraList:null!=i?i:[]}}children(){const e=this.getAndSplitList().list,t={};return e.forEach((e=>{t[e.pluginName]={plugin:e,options:{root:this.root}}})),t}renderMoreIcon(){const e=this.getAndSplitList().extraList;if(0===e.length)return;const t=this.root,i=Br.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const n=Br.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),t.appendChild(n)}renderPanel(e){this.panelContainer||(this.panelContainer=Br.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,n;const r=Br.createDom("div","",{},"panel-icon-bt"),o=Br.createDom("div","",{},"panel-icon-svg");r.appendChild(o),this.registerExtraPlugin(e,o);const s="zh-cn"===this.player.lang?"zh":this.player.lang,a=null!=(n=null==(i=e.textTips)?void 0:i[s])?n:e.pluginName;r.appendChild(Br.createDom("span",a,{"plugin-index":t},"panel-icon-bt-text")),this.panelContainer.appendChild(r)}))),this.player.panel.showPanel(this.panelContainer)}registerExtraPlugin(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}destroy(){}render(){return'<div class="xgplayer-rightTop-iconList"></div>'}}function PL(){return(new DOMParser).parseFromString('<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40ZM34.75 34.05C34.75 35.7897 33.5747 37.2 32.125 37.2C30.6753 37.2 29.5 35.7897 29.5 34.05C29.5 32.3103 30.6753 30.9 32.125 30.9C33.5747 30.9 34.75 32.3103 34.75 34.05ZM40.2276 43.7334C36.2145 43.7334 32.6052 45.4732 30.1709 48.2331C29.5316 48.9579 29.6009 50.0638 30.3258 50.7031C31.0506 51.3424 32.1565 51.2731 32.7958 50.5483C34.5802 48.5252 37.2407 47.2334 40.2276 47.2334C43.2213 47.2334 45.8871 48.531 47.6715 50.562C48.3094 51.288 49.4152 51.3594 50.1412 50.7215C50.8673 50.0836 50.9387 48.9778 50.3008 48.2518C47.8663 45.481 44.2498 43.7334 40.2276 43.7334ZM47.8352 37.2C49.2849 37.2 50.4602 35.7897 50.4602 34.05C50.4602 32.3103 49.2849 30.9 47.8352 30.9C46.3854 30.9 45.2102 32.3103 45.2102 34.05C45.2102 35.7897 46.3854 37.2 47.8352 37.2Z" fill="#ffffff" fill-opacity="0.15"/>\n</svg>\n',"image/svg+xml").firstChild}var wL=(e=>(e.NETWORK="NETWORK",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_FORBIDDEN="NETWORK_FORBIDDEN",e.NETWORK_NOTFOUND="NETWORK_NOTFOUND",e.NETWORK_RANGE_NOT_SATISFIABLE="NETWORK_RANGE_NOT_SATISFIABLE",e.NETWORK_PROTOCOL="NETWORK_PROTOCOL",e.NETWORK_URL_EXPIRE="NETWORK_URL_EXPIRE",e.NETWORK_URL_SIGN="NETWORK_URL_SIGN",e.NETWORK_ENCRYPT_HLS_ERR="NETWORK_ENCRYPT_HLS_ERR",e.MEDIA_ERR="MEDIA_ERR",e.MEDIA_ERR_ABORTED="MEDIA_ERR_ABORTED",e.MEDIA_ERR_NETWORK="MEDIA_ERR_NETWORK",e.MEDIA_ERR_DECODE="MEDIA_ERR_DECODE",e.MEDIA_ERR_SRC_NOT_SUPPORTED="MEDIA_ERR_SRC_NOT_SUPPORTED",e.MEDIA_ERR_NOT_SUPPORTED="MEDIA_ERR_NOT_SUPPORTED",e.MEDIA_ERR_URL_EMPTY="MEDIA_ERR_URL_EMPTY",e.MEDIA_ERR_FILE_NOT_SUPPORTED="MEDIA_ERR_FILE_NOT_SUPPORTED",e.MEDIA_ERR_PLAY_ERR="MEDIA_ERR_PLAY_ERR",e.MEDIA_SOURCE_CANNOT_PLAY_TYPE="MEDIA_SOURCE_CANNOT_PLAY_TYPE",e.BUSINESS_DRM_NOT_SUPPORT="BUSINESS_DRM_NOT_SUPPORT",e.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD="BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",e.BUSINESS_DRM_LACK_MEDIA_KEY="BUSINESS_DRM_LACK_MEDIA_KEY",e.BUSINESS_DRM_LACK_KEY_SESSION="BUSINESS_DRM_LACK_KEY_SESSION",e.BUSINESS_DRM_GENERATE_REQUEST_FAIL="BUSINESS_DRM_GENERATE_REQUEST_FAIL",e.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH="BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",e.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH="BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",e.BUSINESS_DRM_LICENSE_FAIL="BUSINESS_DRM_LICENSE_FAIL",e.BUSINESS_DRM_KEY_ERROR="BUSINESS_DRM_KEY_ERROR",e.BUSINESS_DRM_CERT_FAIL="BUSINESS_DRM_CERT_FAIL",e.PRIVATE_DRM_KEY_GET_FAILED="PRIVATE_DRM_KEY_GET_FAILED",e.PRIVATE_DRM_CRYPTO_NOT_SUPPORT="PRIVATE_DRM_CRYPTO_NOT_SUPPORT",e.PRIVATE_DRM_RSA_FAIL="PRIVATE_DRM_RSA_FAIL",e.OTHER="OTHER",e.VOD_LOG_NOT_CONFIGURED="VOD_LOG_NOT_CONFIGURED",e.PLAY_AUTH_TOKEN_EXPIRED="PLAY_AUTH_TOKEN_EXPIRED",e.HLS_KEY_TOKEN_EXPIRED="HLS_KEY_TOKEN_EXPIRED",e.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED="THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED",e.GET_PLAY_INFO_ERR="GET_PLAY_INFO_ERR",e.GET_HLS_DECRYPTION_KEY_ERR="GET_HLS_DECRYPTION_KEY_ERR",e.LICENSE_VALIDATE_FAIL="LICENSE_VALIDATE_FAIL",e.DEFINITION_AUTO="DEFINITION_AUTO",e.LICENSE_STATUS_INVALID="LICENSE_STATUS_INVALID",e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e.BASE_LICENSE_NOT_SUPPORT_265="BASE_LICENSE_NOT_SUPPORT_265",e.BASE_LICENSE_NOT_SUPPORT_ABR="BASE_LICENSE_NOT_SUPPORT_ABR",e.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.BASE_LICENSE_NOT_SUPPORT_PRELOAD="BASE_LICENSE_NOT_SUPPORT_PRELOAD",e.EXPIRED_LICENSE_NOT_SUPPORT_265="EXPIRED_LICENSE_NOT_SUPPORT_265",e.EXPIRED_LICENSE_NOT_SUPPORT_ABR="EXPIRED_LICENSE_NOT_SUPPORT_ABR",e.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD="EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD",e.DRAMA_INVALID_PARAM="DRAMA_INVALID_PARAM",e.DRAMA_NO_INFO_FOUND="DRAMA_NO_INFO_FOUND",e.DRAMA_NOT_SUBMITTED="DRAMA_NOT_SUBMITTED",e.DRAMA_UNDER_REVIEW="DRAMA_UNDER_REVIEW",e.DRAMA_FAILED_REVIEW="DRAMA_FAILED_REVIEW",e.DRAMA_WITHDRAWN_REVIEW="DRAMA_WITHDRAWN_REVIEW",e.DRAMA_FAILED_TO_QUERY="DRAMA_FAILED_TO_QUERY",e.DRAMA_INVALID_TTOP_TOKEN="DRAMA_INVALID_TTOP_TOKEN",e.DRAMA_NOT_ON_SHELF="DRAMA_NOT_ON_SHELF",e.DRAMA_FAILED_GET_EPISODE_INFO="DRAMA_FAILED_GET_EPISODE_INFO",e))(wL||{});const DL={NETWORK:{code:2100,message:"Network error",textKey:wL.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:wL.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:wL.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:wL.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:wL.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:wL.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:wL.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:wL.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:wL.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:wL.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:wL.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:wL.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:wL.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:wL.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:wL.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:wL.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:wL.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:wL.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:wL.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:wL.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:wL.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:wL.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:wL.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:wL.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:wL.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:wL.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:wL.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:wL.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:wL.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:wL.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:wL.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:wL.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:wL.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:wL.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:wL.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:wL.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:wL.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:wL.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:wL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},LL={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:wL.BASE_LICENSE_NOT_SUPPORT_265},BASE_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12112,message:"The basic license does not support ABR",textKey:wL.BASE_LICENSE_NOT_SUPPORT_ABR},BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12113,message:"The basic license does not support dynamic buffer",textKey:wL.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},BASE_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12114,message:"The basic license does not support preload",textKey:wL.BASE_LICENSE_NOT_SUPPORT_PRELOAD},EXPIRED_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12211,message:"Expired license does not support H265",textKey:wL.EXPIRED_LICENSE_NOT_SUPPORT_265},EXPIRED_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12212,message:"Expired license does not support ABR",textKey:wL.EXPIRED_LICENSE_NOT_SUPPORT_ABR},EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12213,message:"The expired license does not support dynamic buffer",textKey:wL.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12214,message:"Expired license does not support preloading",textKey:wL.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}};var RL=(e=>(e[e.manifest=1]="manifest",e[e.network=2]="network",e[e.demux=3]="demux",e[e.remux=4]="remux",e[e.media=5]="media",e[e.decoder=6]="decoder",e[e.drm=7]="drm",e[e.other=8]="other",e[e.runtime=9]="runtime",e[e.token=10]="token",e[e.serve=11]="serve",e[e.license=12]="license",e[e.ad=13]="ad",e))(RL||{});const xL={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:wL.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:wL.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:wL.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:wL.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:wL.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:wL.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:wL.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:wL.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:wL.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:wL.DRAMA_FAILED_GET_EPISODE_INFO}};const OL={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},NL=1002305;class ML{constructor(){this.actions={}}addMiddleware(e,t){this.actions[e]?this.actions[e].push(t):this.actions[e]=[t]}removeMiddleware(e,t){const i=this.actions[e]||[],n=i.findIndex((e=>e===t));n>-1&&(i.splice(n,1),this.actions[e]=i)}removeAllMiddlewareByKey(e){this.actions[e]=[]}removeAllMiddleware(){this.actions={}}applyMiddleware(e){const t=this;return function(i,n){return d(this,null,(function*(){const{eventName:r}=i,o=t.actions[e]||[],s=[];o.forEach((e=>{try{const t=e(i);s.push(za(t))}catch(t){throw s.push(za(null)),t}})),Promise.all([...s]).then((e=>{e.every((e=>!e))&&n(r,i)})).catch((e=>{la.error(e),n(r,e)}))}))}}}const UL="xgplayer-error-analysing",BL="xgplayer-error-retrying",HL="ve_error",FL={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},jL={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},VL="http:",KL="https:";let GL=null;function WL(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(VL)&&i===KL){if(new URL(e).protocol===VL)return YL.getVeErrorInfo(DL.NETWORK_PROTOCOL)}}class YL{constructor(e,t){this.retryTimestamps=[],this.totalRetryCount=0,this.retrying=!1,this.retryTimer=null,this.userInvokedPlay=!1,this._playIntentHook=()=>{this.userInvokedPlay=!0},this._onError=e=>d(this,null,(function*(){var t;this.player.addClass(UL);const i=yield this.transformToVeError(e);this.player.veError=i,la.error("error: ",i),this.player.removeClass(UL),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?la.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit(HL,i)})),this.player=e,this.config={},t&&Object.keys(YL.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=YL.defaultConfig[e]:this.config[e]=t[e]})),this.init()}static get defaultConfig(){return{oriErrRetryCount:3,oriErrRetryCycle:1e4,oriErrRetryBaseDelay:500,oriErrMaxTotalRetry:0,enableOriErrRetry:!0,needSyncAnalyzeError:!0,analyzeTimeout:3e3,ignoreErrorCodes:[],clientKey:void 0}}createVeError(e={}){var t,i;const{errorType:n,errorCode:r=0,errorMessage:o="",originError:s="",ext:a={},mediaError:l=null}=e,h=(null==(i=null==(t=this.player)?void 0:t.i18n)?void 0:i.ERROR_TYPES)||{},d=this.player.media;if(d){const t=l||d.error||{},{duration:i,currentTime:h,ended:p,src:f,currentSrc:g}=this.player,{readyState:y,networkState:v}=d;let m=r||t.code;FL[m]&&(m=FL[m]);const{code:_,message:E,textKey:T}=e.veError||{},S=o||t.message,b=_||m,k=YL.getErrorType(e),C=E||S,I=T||(e=>{for(const[t,{code:i,textKey:n}]of Object.entries(DL))if(i===e)return n})(b)||function(e){for(const t of Object.values(xL))if(t.code===e)return t.textKey}(b),A=this.player.i18n[I]||C||this.player.i18n[wL.MEDIA_ERR]||"unknown error",P=this.player.config,w=this.config.clientKey?{clientKey:this.config.clientKey}:{},D=this.config.clientKey?{albumId:P.albumId||P.album_id,episodeId:P.episodeId||P.episode_id||P.episodeID}:{};return c(u({playerVersion:"1.19.0-rc.1",currentTime:h,duration:i,ended:p,readyState:y,networkState:v,src:f||g,errorType:n,errorCode:m,httpCode:e.httpCode,message:S,mediaError:t,originError:s?s.stack:"",host:Br.getHostFromUrl(f||g),veErrorCode:b,veErrorType:k,veErrorMessage:C,displayMessage:A},w),{videoInfo:u({isMSE:Ma(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:ll(this.player)||"",vid:P.vid},D),ext:a})}if(arguments.length>1){const e={playerVersion:"1.19.0-rc.1",domain:document.domain,ex:null},t=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"];for(let i=0;i<arguments.length;i++)e[t[i]]=arguments[i];return e.ex=h?(h[arguments[0]]||{}).msg:"",e}}static getErrorType(e){const{veError:t,mediaError:i}=e||{},n=t||(null==i?void 0:i.veError);if(null==n?void 0:n.code){const e=n.code+"";return n.code>=1e4?RL[e.slice(0,2)]:RL[e.slice(0,1)]}if(null==i?void 0:i.code)return jL[i.code]||"other"}static getVeErrorInfo(e,t){const{code:i,message:n,textKey:r}=e;return{code:i,message:t||n,textKey:r}}init(){var e,t;GL||(GL=this.player.errorHandler),function(e,t){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}(this.player,(e=this.player,t=this,{errorHandler(i,n){var r;la.log("errorHandler, err: ",n);const o=e;if(o.media&&(o.media.error||n)){let e=o.media.error||n;const s=e.code?Yr[e.code]:"other";let a=e.message;"xg-video"===(null==(r=null==o?void 0:o.config)?void 0:r.mediaType)||o.media.currentSrc||o.media.srcObject||(a="empty_src",e={code:6,message:a}),o.emit(i,t.createVeError({errorType:s,errorCode:e.code,errorMessage:e.message||"",mediaError:e,veError:n.veError,originError:n}))}}})),this.setErrorEventMiddleWare(),this.player.on(Jr,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(Jr,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(BL))}shouldOriRetryReloadOnly(){var e;if(this.userInvokedPlay)return!1;const t=this.player.config;if(!t||t.autoplay||t.autoplayMuted)return!1;const i=this.player.media;return!!i&&0===(null==(e=i.played)?void 0:e.length)}setErrorEventMiddleWare(){this.eventMiddleware=new ML,this.eventMiddleware.addMiddleware(Jr,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(Jr)})}defaultErrorMiddleWare(e){return d(this,null,(function*(){var t,i;if(!Br.isMSE(this.player.media)){const{error:n}=e||{};if(!n)return la.error("invalid media error: ",e),!1;const{code:r}=n||{};if((2===r||3===r||4===r)&&(null==(i=null==(t=this.player)?void 0:t.config)?void 0:i.url)){const t=Date.now();this.retryTimestamps=this.retryTimestamps.filter((e=>t-e<=this.config.oriErrRetryCycle));const{oriErrRetryCount:i,oriErrMaxTotalRetry:n}=this.config,o=n>0&&this.totalRetryCount>=n,s=this.retryTimestamps.length>=i,a=!1!==this.config.enableOriErrRetry;if(a&&!o&&!s)return this.oriVideoRetry(!this.shouldOriRetryReloadOnly());if(a&&(o?la.warn(`max total retry count ${n} reached, stop retrying`):la.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===r)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=sl(ul(this.player));if(t){const i=WL(t);if(i)return e.error.veError=i,!1;this.config.needSyncAnalyzeError&&(e.error.veError=yield this.analyseNet(t,e.error,this.config.analyzeTimeout))}}}}return!1}))}oriVideoRetry(e=!0){if(this.retrying)return!0;this.retrying=!0;const t=this.config.oriErrRetryBaseDelay*Math.pow(2,this.retryTimestamps.length);return la.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(BL),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(BL),this.retrying=!1}),t),!0}oriVideoReloadWithoutPlay(){const e=this.player;e.removeClass("xgplayer-is-error"),e.addClass("xgplayer-isloading"),e.runHooks("retry",(()=>{const t=e.currentTime,i="string"==typeof e.config.url?e.config.url:"",n=Br.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,e.config.isLive||(e.currentTime=t)}))}analyseNet(e,t,i){return d(this,null,(function*(){const n=t.code||t.errorCode,r=t.message||t.errorMessage||t.msg;try{const t=yield Na(e,{range:"0-8",timeout:i});la.log("xhr result",t);const{status:o,response:s}=t;if(403===o){if("string"==typeof s){if(s.includes("expire"))return YL.getVeErrorInfo(DL.NETWORK_URL_EXPIRE);if(s.includes("sign"))return YL.getVeErrorInfo(DL.NETWORK_URL_SIGN)}return YL.getVeErrorInfo(DL.NETWORK_FORBIDDEN)}if(416===o)return YL.getVeErrorInfo(DL.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return YL.getVeErrorInfo(DL.NETWORK_NOTFOUND);if(o===Oa.TIMEOUT)return YL.getVeErrorInfo(DL.NETWORK_TIMEOUT);if(o===Oa.ERROR)return YL.getVeErrorInfo(DL.NETWORK,r);if(200===o||206===o){if(4===n)return r?YL.getVeErrorInfo(DL.MEDIA_ERR_PLAY_ERR,r):YL.getVeErrorInfo(DL.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===n)return YL.getVeErrorInfo(DL.MEDIA_ERR_DECODE,r);if(2===n)return YL.getVeErrorInfo(DL.MEDIA_ERR_NETWORK,r);if(1===n)return YL.getVeErrorInfo(DL.MEDIA_ERR_ABORTED,r);if(-9996===n){return ll(this.player)===or.PRIVATE_ENCRYPT_UPGRADE?YL.getVeErrorInfo(DL.PRIVATE_DRM_GET_KEY_FAILED):YL.getVeErrorInfo(DL.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(o){return la.warn("Failed to analyze the network. If the domain of the video address has been configured with CORS, it means that the playback error is caused by the failure of the video request. If the domain of the video address is not configured with CORS, the real reason for the playback error cannot be determined because the video request cannot be analyzed."),YL.getVeErrorInfo(DL.NETWORK)}}))}analyseStream(){return d(this,null,(function*(){}))}handle2100Error(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,response:n,finalMessage:r}){const o={errorType:RL.network,errorCode:t,httpCode:i,errorMessage:r,originError:e};if(i){if(404===i)o.veError=YL.getVeErrorInfo(DL.NETWORK_NOTFOUND);else if(416===i)o.veError=YL.getVeErrorInfo(DL.NETWORK_RANGE_NOT_SATISFIABLE);else if(403===i){try{const e=yield function(e){return(t=e)&&"object"==typeof t&&"responseText"in t&&"status"in t&&"statusText"in t?e.responseText:function(e){return!(!e||"object"!=typeof e)&&"json"in e&&"text"in e&&"status"in e}(e)?e.text():e;var t}(n);if("string"==typeof e)return e.includes("expire")?o.veError=YL.getVeErrorInfo(DL.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=YL.getVeErrorInfo(DL.NETWORK_URL_SIGN):o.veError=YL.getVeErrorInfo(DL.NETWORK_FORBIDDEN),this.createVeError(o)}catch(s){la.warn("get response text error")}return o.veError=YL.getVeErrorInfo(DL.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=sl(ul(this.player));if(e){const t=WL(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:n}){return this.createVeError({errorType:RL.serve,errorCode:t||DL.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:YL.getVeErrorInfo(DL.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:n}){try{const r=sl(ul(this.player)),o=yield this.analyseNet(r,e,3e3);return o?this.createVeError({errorType:RL.network,errorCode:t||DL.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:o}):this.createVeError({errorCode:t||DL.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:YL.getVeErrorInfo(DL.NETWORK_ENCRYPT_HLS_ERR)})}catch(r){return la.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||DL.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:YL.getVeErrorInfo(DL.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:n}){const r={errorType:RL.network,errorCode:t,httpCode:i,errorMessage:n,originError:e},{currentTime:o,duration:s,buffered:a}=this.player,l=!a||0===a.length||!s,u=this.player.checkBuffer(o,{startDiff:0,endDiff:.1});if(l||!u)return r.veError=YL.getVeErrorInfo(DL.NETWORK),this.createVeError(r);this.createVeError(r)}transformToVeError(e){return d(this,null,(function*(){if((null==e?void 0:e.veErrorCode)&&!this.player.getPlugin("Mp4EncryptPlayer"))return e;const{httpCode:t,errorMessage:i,message:n,msg:r,response:o}=e||{},s=(null==e?void 0:e.code)||(null==e?void 0:e.errorCode),a=i||n||("string"==typeof r?r:"other error");if(2100===s)return this.handle2100Error({error:e,errorCode:s,httpCode:t,response:o,finalMessage:a});if(-9991===s)this.handle9991Error({error:e,errorCode:s,httpCode:t,finalMessage:a});else{if([2103,5104,5102].includes(s)&&this.player.getPlugin("Mp4EncryptPlayer")||-9996===s&&this.player.getPlugin("EncryptHlsPlugin"))return this.handleNetError({error:e,errorCode:s,httpCode:t,finalMessage:a});if([9002,9003].includes(s))return this.handleStuckError({error:e,errorCode:s,httpCode:t,finalMessage:a})}return this.createVeError(u({errorCode:s||DL.OTHER.code,httpCode:t,errorMessage:a,originError:e},e||{}))}))}}const zL=new Set(Object.values(xL).map((e=>e.code)));let $L=class extends ks{constructor(e){super(e),this._errDetailList=[],this._errorDomMode=null,this.state={showError:!1,retryTimes:0,idx:0},this.handleError=e=>d(this,null,(function*(){this.isVodLogConError=(null==e?void 0:e.errorCode)===DL.VOD_LOG_NOT_CONFIGURED.code,this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)})),this.handleEnd=()=>{},this.handleRefreshClick=()=>{var e,t;null==(e=this.player)||e.emit(VD.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(Ps.PAUSED),this.closeError(),null==(t=this.player)||t.retry()},this.closeError=()=>{this.state.showError&&(this.state.showError=!1,this.renderError())},this.playerData=e.player.config.playerData}static get pluginName(){return"sdkErrorPlugin"}static get defaultConfig(){return{showError:!0,errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedCopyButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:ks.POSITIONS.ROOT}}afterCreate(){var e,t,i;this.initEvents();const n=Object.values(DL).reduce(((e,t)=>{const{code:i,textKey:n}=t;return e[i]=this.i18n[n],e}),{});this.errNoteMap=u({other:null!=(i=null==(t=null==(e=this.i18n.ERROR_TYPES)?void 0:e.other)?void 0:t.msg)?i:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE},n)}registerLanguageTexts(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"},errorCode:{jp:"コード",en:"code",zh:"错误码","zh-hk":"錯誤碼"},did:{jp:"デバイスID",en:"deviceID",zh:"设备 ID","zh-hk":"設備 ID"},playTime:{jp:"遊び時間",en:"playTime",zh:"播放时间","zh-hk":"播放時間"},copyError:{jp:"コピーエラー",en:"Copy error",zh:"复制错误信息","zh-hk":"複製錯誤訊息"},copySuccess:{jp:"コピー成功",en:"Copy success",zh:"复制成功","zh-hk":"複製成功"}}}registerIcons(){return{errorImg:{icon:PL,class:"xgplayer-error-svg"}}}updateLang(){var e,t;if(!this.$errorDom)return;const i=this.$errorDom.querySelector(".xgplayer-error-tips");if(i){const n=null!=(t=null==(e=this.config.errorTipsText)?void 0:e[this.lang])?t:this.langText.errorTips;i.innerHTML=n}const n=this.$errorDom.querySelector(".xgplayer-error-button");n&&(n.innerHTML=this.langText.clickButton)}initEvents(){this.player.on(HL,this.handleError),this.on(ro,this.closeError),this.on(qr,this.closeError)}getRetryList(){var e;const t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url,...null!=(e=null==t?void 0:t.backUrlList)?e:[]]}changeMainOrBackup(){this.player.addClass(Ps.ENTER);const e=this.getRetryList(),t=this.config.retryLoopNum*e.length,i=(e.indexOf(this.player.config.url)+1)%e.length;this.state.idx=i;const n=e[i];if(!n||this.state.retryTimes===t)return this.player.removeClass(Ps.ENTER),this.state.retryTimes===t&&this.player.emit(VD.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),la.log(`retry times: ${this.state.retryTimes}`,n),this.player.emit(VD.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:n,retryTimes:this.state.retryTimes}),this.changeUrl(n),this.state.retryTimes=this.state.retryTimes+1}changeUrl(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(VD.PlAY_URL_CHANGE,{url:e,from:VD.PLAY_BACKUP_CHANGE})}resetTimes(){this.state.retryTimes=0,this.state.idx=0}renderError(e){if(!this.config.showError)return;const t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(VD.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}addErrDetail(e){Array.isArray(e)?this._errDetailList=[...this._errDetailList,...e]:this._errDetailList.push(e)}getErrorInfo(e){var t,i,n,r,o;const s=e.veErrorCode||e.errorCode,a=null==(t=this.player)?void 0:t.vodLogger,l=(null==(o=null==(r=null==(n=null==(i=null==a?void 0:a.tracker)?void 0:i.getConfig)?void 0:n.call(i))?void 0:r.user)?void 0:o.user_unique_id)||(null==a?void 0:a.line_user_id);return{code:s,appId:null==a?void 0:a.line_app_id,did:l||"unknown",playTime:ca().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:n}=this.getErrorInfo(e),r=Br.createDom("div","",void 0,"xgplayer-error-info-wrap"),o=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.errorCode||"code"}</span>\n <span class="xgplayer-error-info-content">${t}</span>\n </p>`;r.appendChild(Br.createDomFromHtml(o));const s=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.did||"deviceID"}</span>\n <span class="xgplayer-error-info-content">${i}</span>\n </p>`;r.appendChild(Br.createDomFromHtml(s));const a=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.playTime||"playTime"}</span>\n <span class="xgplayer-error-info-content">${n}</span>\n </p>`;return r.appendChild(Br.createDomFromHtml(a)),r}handleCopyBtnClick(e){const{did:t,playTime:i,appId:n}=this.getErrorInfo(e);try{const r=JSON.stringify(c(u({},e),{playTime:i,deviceID:t,appId:n}));navigator.clipboard.writeText(r).then((()=>{!function(e,t=1e3){const i=document.createElement("div");i.className="veplayer-toast",i.textContent=e,document.body.appendChild(i),setTimeout((()=>i.classList.add("show")),10),setTimeout((()=>{i.classList.remove("show"),setTimeout((()=>null==i?void 0:i.remove()),300)}),t)}(this.langText.copySuccess||"copySuccess")}))}catch(r){la.error("copy error info err ",r)}}getActionDom(e){const t=e.errorType,i=Br.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),n=!(t&&[RL[10],RL[11],RL[12]].includes(t));if(this.config.isNeedRefreshButton&&n){const e=Br.createDom("div",this.langText.clickButton||"Refresh",void 0,"xgplayer-error-button refresh-button");this.bind(".refresh-button","click",this.handleRefreshClick),i.appendChild(e)}if(this.config.isNeedCopyButton){const t=Br.createDom("div",this.langText.copyError||"CopyError",void 0,"xgplayer-error-button copy-button");this.bind(".copy-button","click",this.handleCopyBtnClick.bind(this,e)),i.appendChild(t)}return i}getErrorDom(e){var t,i,n,r,o,s;const{errorCode:a,message:l,displayMessage:u}=e,c=null!=(t=null==e?void 0:e.veErrorCode)?t:null==e?void 0:e.errorCode,h=!!EH.ttDramaEnv,d="number"==typeof c&&zL.has(c);if("drama"===(h&&d?"drama":"normal")){if(!this.$errorDom){this.$errorDom=Br.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=Br.createDom("div","Video isn't available",void 0,"xgplayer-drama-error-toast");this.$errorDom.appendChild(e),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}if(!this.$errorDom){if(this.$errorDom=Br.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=Br.createDom("div","",void 0,"xgplayer-error-img");e.appendChild(this.icons.errorImg),this.$errorDom.appendChild(e)}if(this.config.errorTips){let t="";t=(null==(n=null==(i=this.config)?void 0:i.errorTipsText)?void 0:n[this.lang])?null==(r=this.config.errorTipsText)?void 0:r[this.lang]:e?u||this.errNoteMap[a]||this.player.errorNote&&this.i18n[this.player.errorNote]||l||this.errNoteMap.other||"error":this.langText.errorTips;const o=Br.createDom("div",t,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(o)}this.$errorDom.appendChild(this.getErrorInfoDom(e)),this.$errorDom.appendChild(this.getActionDom(e)),(null==(o=this._errDetailList)?void 0:o.length)&&(null==(s=this._errDetailList)||s.forEach((e=>{const t="function"==typeof e?e():e;if(t){const e=Br.createDom("div",`${t.label}: ${t.value}`,void 0,"xgplayer-error-detail-info");this.$errorDom.appendChild(e)}}))),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}destroy(){this.player.off(Jr,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};function XL(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 qL(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?XL(Object(i),!0).forEach((function(t){tR(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):XL(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function QL(e){return(QL="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 ZL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JL(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,fR(n.key),n)}}function eR(e,t,i){return t&&JL(e.prototype,t),i&&JL(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function tR(e,t,i){return(t=fR(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function iR(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&&rR(e,t)}function nR(e){return(nR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rR(e,t){return(rR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function oR(){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(pa){return!1}}function sR(e,t,i){return(sR=oR()?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&&rR(r,i.prototype),r}).apply(null,arguments)}function aR(e){var t="function"==typeof Map?new Map:void 0;return aR=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 sR(e,arguments,nR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rR(n,e)},aR(e)}function lR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uR(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 lR(e)}function cR(e){var t=oR();return function(){var i,n=nR(e);if(t){var r=nR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return uR(this,i)}}function hR(){return hR="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=nR(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},hR.apply(this,arguments)}function dR(e){return function(e){if(Array.isArray(e))return pR(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 pR(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 pR(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 pR(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 fR(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 gR=["b","i","u","span","c","ruby","rt","v","lang"],yR=["br"];var vR=/^WEBVTT/i,mR=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,_R=/^STYLE+$/,ER=/^\:\:cue/,TR=/^}+$/,SR=/^\[Script Info\].*/,bR=[/[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,3}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}\s*-->\s*[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}/],kR=/^Format:\s/,CR=/^Style:\s/,IR=/^Dialogue:\s/,AR=/^([0-5]?\d)[.,](\d{1,3})$/;function PR(e){var t=AR.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function wR(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+PR(e[2]):2===t?60*Number(e[0])+PR(e[1]):PR(e[0])}function DR(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function LR(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function RR(e,t){return e>=0&&e<t.length?t[e]:""}function xR(e){return t=function(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}(e),gR.includes(t)||yR.includes(t);var t}var OR=function(){function e(){ZL(this,e)}return eR(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);try{var r;i({format:n,list:(r="ass"===n?e.parseASS(t):e.parseVTT(t)).list,styles:r.styles})}catch(fF){console.error(fF),i({format:n},fF)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},n="";try{var r=t.length-e.length;return n=LR(n=(n=r>0?t.splice(e.length-1,r+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,"")),t[e.length-1]=n,e.map((function(e,n){"end"===e||"start"===e?i[e]=wR(t[n].split(":")):"text"===e?i[e]=[t[n]]:"layer"===e?(i[e]=[t[n]],i.textTag=[t[n]]):i[e]="style"===e?[t[n]]:Number(t[n])?Number(t[n]):t[n]})),i}catch(fF){return console.error(fF),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,s=[],a=[],l=null;r<i.length;){if(kR.test(i[r]))a=(a=i[r].replace(kR,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(CR.test(i[r]))s.push(i[r].replace(CR,"").replace(/\s+/g,""));else if(IR.test(i[r])){var u=e.parseASSItem(i[r].replace(IR,""),a);if(l&&u.start===l.start&&u.end===l.end)try{var c=l,h=c.text,d=c.textTag,p=c.style;h.push(u.text[0]),d.push(u.textTag[0]),p.push(u.style[0])}catch(fF){console.error(fF)}else{l=u;var f=null;o%50==0?((f={start:l.start,end:l.end,list:[]}).list.push(l),n.push(f)):((f=n[n.length-1]).end=l.end,f.list.push(l)),o++}}r++}return{list:n,styles:[]}}},{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(vR,"")).split("\n"),i=[],n=0,r=0,o=null,s=!1,a=!1,l=null,u=null,c=[];n<t.length;){var h=RR(n,t).trim();if(!h||s&&DR(h))s=!h;else if(ER.test(h)&&_R.test(RR(n-1,t).trim())){a=!0;var d=/\((.+?)\)/g.exec(h);u=d?d[1]:"",l=""}else if(a)TR.test(h)?(c.push({key:u||"",style:l||""}),l=null,u=null,a=!1):l+=h;else if(h){s=!1;var p=this.checkIsTime(t[n]);if(p){var f=this.parseVttTime(p);if(!o||f.start!==o.start||f.end!==o.end){(o=f).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 y=o,v=y.text,m=y.textTag,_=this.parseVttText(t[n]);v.push(_.text),m.push(_.tag)}s=!1}n++}return{list:i,styles:c}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<bR.length&&!(i=bR[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){if(xR(n=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:LR(e.replace(/\\n+/g,"<br/>"))};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,s=o.exec(i);s&&s.length>2;)i=i.replace(s[0],"<".concat(s[1],' class="').concat(s[2],'">')),s=o.exec(i);return{tag:n,text:LR(i.replace(/\\n+/g,"<br/>"))}}},{key:"parseVttTime",value:function(e){var t=e.split("--\x3e"),i=0,n=0;if(2===t.length){var r=t[0].split(":"),o=t[1].split(":");i=wR(r),n=wR(o)}return{start:i,end:n,time:e}}},{key:"isVTT",value:function(e){return vR.test(e)}},{key:"isASS",value:function(e){return SR.test(e)}},{key:"checkFormat",value:function(e){return e?vR.test(e)?"vtt":SR.test(e)?"ass":mR.test(e)?"srt":"":""}}]),e}(),NR=[{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"}],MR=function(e){iR(i,aR(Error));var t=cR(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return ZL(this,i),e||(e=NR[r||7].msg),(n=t.call(this,e)).code=r||7,n.message=e,n.type=NR[r||7].msg,n.orgError=o||null,n.data=s||null,n}return eR(i)}();function UR(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={code:NR[e].code,msg:NR[e].msg,message:NR[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var BR=eR((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,s=void 0===o?"arraybuffer":o,a=t.timeout,l=void 0===a?1e4:a,u=t.data,c=void 0===u?{}:u,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ZL(this,e),new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),a=[];if(s&&(n.responseType=s),l&&(n.timeout=l),Object.keys(c).forEach((function(e){a.push("k=".concat(c[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(a.join("&"))}}))})),HR=function(){function e(){var t,i;ZL(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 eR(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function FR(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"===QL(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function jR(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):FR(e,t)||(e.className&&"object"===QL(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function VR(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 KR(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 GR(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function WR(){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 YR(e){return e&&e instanceof window.HTMLMediaElement}function zR(e,t,i){if(i||(i=new HR),"json"===t){var n=OR.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&OR.parse(e,(function(e,t){if(t){var n=UR(2,t);i.reject(n,{format:e.format})}else if(e.format||e.list&&0!==e.list.length)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=UR(3);i.reject(r)}}));return i}function $R(e,t){t||(t=new HR);var i=[];"String"===GR(e.url)?i=[e.url]:"Array"===GR(e.url)&&(i=dR(e.url));return function n(){var r=i.shift();if(r)new BR({url:r,type:"text"}).then((function(i){zR(i.res.response,"string").then((function(i){t.resolve(qL(qL({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)n();else{var s=UR(1,qL({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:r},e));t.reject(s)}}));else{var o=UR(1,qL({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function XR(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"==typeof e)return Number.isFinite(e)?Math.trunc(e):t;if("string"==typeof e){var i=e.trim();if(!i)return t;var n=parseInt(i,10);return Number.isNaN(n)?t:n}return t}function qR(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function QR(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function ZR(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var JR=function(){function e(){var t=this;ZL(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return eR(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(fF){console.error(fF)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),ex=null;var tx="resize",ix="change",nx="off",rx="update",ox="error",sx=/^[A-Za-z0-9_-]+$/,ax=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function lx(e,t){t&&String(t).split(/(?:\\[nN]|\r\n|\r|\n)+/).forEach((function(t,i){i>0&&e.appendChild(document.createElement("br")),t&&e.appendChild(document.createTextNode(t))}))}function ux(e){var t=e.slice(1,-1).trim();if(!t||"!"===t[0]||"?"===t[0])return null;if("/"===t[0]){var i=/^\/\s*([A-Za-z][\w:-]*)/.exec(t),n=i&&i[1].toLowerCase();return n&&gR.includes(n)?{closing:!0,tagName:n}:null}var r=/\/\s*$/.test(t),o=t.replace(/\/\s*$/,""),s=/^([A-Za-z][\w:-]*(?:\.[^\s/>.]+)*)([\s\S]*)$/.exec(o);if(!s)return null;var a=s[1].split("."),l=a.shift().toLowerCase();if(!gR.includes(l)&&!yR.includes(l))return null;var u,c=function(e){var t=e.trim(),i={};if(!t||!/(?:^|\s)[^\s=]+\s*=/.test(t))return{attrs:i,annotation:t};for(var n=/([^\s=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,r=n.exec(t);r;)i[r[1].toLowerCase()]=r[2]||r[3]||r[4]||"",r=n.exec(t);return{attrs:i,annotation:""}}(s[2]),h=c.attrs;return{attrs:h,annotation:c.annotation,closing:!1,className:(u="".concat(a.join(" ")," ").concat(h.class||""),String(u||"").split(/\s+/).filter((function(e){return sx.test(e)})).join(" ")),selfClosing:r,tagName:l}}function cx(e){var t="c"===e.tagName||"v"===e.tagName||"lang"===e.tagName?"span":e.tagName,i=document.createElement(t);e.className&&(i.className=e.className);var n=function(e){var t=String(e||"").trim();return ax.test(t)?t:""}(e.attrs.lang||("lang"===e.tagName?e.annotation:""));return n&&i.setAttribute("lang",n),"v"===e.tagName&&e.annotation&&i.setAttribute("data-voice",e.annotation),i}function hx(e,t){for(var i=function(e){return null==e?"":String(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&amp;/g,"&")}(t),n=[{dom:e,tagName:""}],r=/<[^>]*>/g,o=0,s=r.exec(i);s;){lx(n[n.length-1].dom,i.slice(o,s.index));var a=s[0],l=ux(a);if(l)if(l.closing){var u=n.map((function(e){return e.tagName})).lastIndexOf(l.tagName);u>0?n.length=u:lx(n[n.length-1].dom,a)}else if("br"===l.tagName)n[n.length-1].dom.appendChild(document.createElement("br"));else{var c=cx(l);n[n.length-1].dom.appendChild(c),l.selfClosing||n.push({dom:c,tagName:l.tagName})}else lx(n[n.length-1].dom,a);o=r.lastIndex,s=r.exec(i)}lx(n[n.length-1].dom,i.slice(o))}function dx(e){var t=[];if(e&&"String"===GR(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===GR(e)){if(0===e.length)return t;"String"===GR(e[0])?t.push({url:dR(e),index:0,start:-1,end:-1}):e.forEach((function(e,i){t.push({url:e.url||e.src||"",index:i,start:e.start||-1,end:e.end||-1})}))}return t}var px=!1,fx=function(e){iR(i,Rr);var t=cR(i);function i(e){var n,r,o,s,a,l,u;return ZL(this,i),tR(lR(n=t.call(this)),"_onPause",(function(){n.stopRender()})),tR(lR(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),tR(lR(n),"_onTimeupdate",(function(){if(n._isOpen){if(n.config.domRender){var e=n.player.media?n.player.media:n.player,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)))}})),tR(lR(n),"_onResize",(function(e){var t=lR(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,s=r.videoHeight;if(!o||!s)return;i.videoWidth=o,i.videoHeight=s,i.scale=XR(s/o*100)}n.__startResize(e)}})),tR(lR(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)}})),tR(lR(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=lR(n)._curRenderTask;n._lastTimeStamp=(new Date).getTime();var i=[];t.forEach((function(t,r){var o=t.lastTime,s=t.wordList,a=t.interval,l=t.dom,u=t.ids;if(e<0||n._lastTimeStamp<0||n._lastTimeStamp-o>=a){var c=s.shift();c&&l.appendData(c),t.lastTime=n._lastTimeStamp}s.length<1&&i.push({index:r,ids:u})})),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))}})),tR(lR(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),s=/(?:SymbianOS)/.test(r)||o,a=/(?:Android)/.test(r),l=/(?:Firefox)/.test(r),u=/(?:iPad|PlayBook)/.test(r)||a&&!/(?:Mobile)/.test(r)||l&&/(?:Tablet)/.test(r),px=/(?:iPhone)/.test(r)&&!u||a||s||u,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={},n.seiTime=0,n.lastSeiTime=0,n._curTexts=[],n._curRenderTask=[],n._renderIntervalId=-1,n._lastTimeStamp=-1,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"===GR(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.setSubTitles(e.subTitles,n.config.defaultOpen),n):uR(n)}return eR(i,[{key:"version",get:function(){return"3.0.25-rc.11"}},{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(),!t||t.length<1?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=dx(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",r),r&&(this.currentText||(this.currentText=this.textTrack[0]),this.switch().catch((function(t){e.emitError(t),e._log("[switch]",t)}))),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})).catch((function(t){e.emitError(t),e._log("[_loadTrack] error",t)})),this.emit("reset",{type:"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(qR(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=qR(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=dx(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.head||document.getElementsByTagName("head")[0],r="xg-text-track-style",o=document.getElementById(r);if(o||((o=document.createElement("style")).type="text/css",o.id=r,n.appendChild(o)),o.styleSheet){var s=function(){try{o.styleSheet.cssText=(o.styleSheet.cssText||"")+i}catch(pa){}};o.styleSheet.disabled?setTimeout(s,10):s()}else{var a=document.createTextNode(i);o.appendChild(a)}}(t,".xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e&&e!==this.player){this.player&&this.detachPlayer();var i,n,r=this.config,o=r.fontColor,s=r.mode,a=r.fitVideo,l=r.domRender;if(this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&jR(this.root,"text-track-hide"),!a&&jR(this.root,"text-track-no-fitvideo"),s&&jR(this.root,"text-track-".concat(s)),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&&this.player.root.appendChild(this.root),this.player.root&&(i=e.root,n=this._onResize,ex||(ex=new JR),ex.addObserver(i,n))),YR(this.player))this.player.addEventListener("timeupdate",this._onTimeupdate),this.player.addEventListener("pause",this._onPause),this.player.addEventListener("play",this._onPlay);else{if("function"!=typeof this.player.on)return;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&&(YR(i)?(i.removeEventListener("timeupdate",this._onTimeupdate),i.removeEventListener("pause",this._onPause),i.removeEventListener("play",this._onPlay)):"function"==typeof i.off&&(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,ex&&ex.unObserver(e,t),this.root&&i.root.contains(this.root)&&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)return e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),void i({message:"switch default subtitle success",code:0});var r=new MR("no default subtitle",5);return e.emitError(r),void n(r)}if(e.currentText&&qR(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(UR(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var s=0;s<e.textTrack.length;s++)if(qR(t,e.textTrack[s])){o=e.textTrack[s];break}if(e._log("nextSubtitle",o),o)e._emitPlayerSwitch(e.currentText,o),o.list?(e._loadingTrack={},e._updateCurrent(o),e.switchOn(),i(UR(0))):(e._log("this._loadTrack",o),e._updateCurrent(o),e._loadTrack(o).then((function(r){if(e.addStyles(r),e._loadingTrack.id===o.id||e._loadingTrack.language===r.language)e._loadingTrack={},e._updateCurrent(r),e.switchOn(),i(UR(0));else{var s=new MR("check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(r.id),6,null,t);e.emitError(s),n(s)}})).catch((function(t){e.emitError(t),n(t)})));else{var a=new MR("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]"),4,null,t);e.emitError(a),n(a)}}}))}},{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(qR(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!qR(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(UR(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(UR(0))}))}},{key:"emitError",value:function(e){this.emit(ox,{type:ox,error:e})}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show();var e=this.currentText||{},t=e.id,i=e.language;this.emit(ix,{type:ix,isOpen:!0,id:t,language:i,texts:[]})}},{key:"switchOff",value:function(){if(this._isOpen=!1,this.hide(),this.currentText){var e=this.currentText,t=e.id,i=e.language;this.emit(nx,{type:nx,id:t,language:i,texts:[],isOpen:!1})}}},{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 HR,n="",r="";if(e.json?(n="json",r=e.json):!e.stringContent||e.url&&0!==e.url.length||(n="string",r=e.stringContent),r)return zR(r,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):($R(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>0&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=qL({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&"function"==typeof this.player.emit&&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),s=o.length;this._log("_loadTrackUrls",e.language,r,o.length,s),o.forEach((function(t,r){$R(qL(qL({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.styles,e.list||(e.list=[]),n._pushList(e.list,t.list),s--})).catch((function(e){s--})).finally((function(t){0===s&&(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){if(!t||0===t.length)return e;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=VR(e,this.currentText.list,this._gid);if(n>-1&&(i=KR(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,s=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,i){e.index=i+s,t._curTexts.push(e)})),this.__render(r)}this.emit(rx,this.getUpdateData(this._curTexts,0,this.currentText))}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=VR(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=KR(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),this._cids=[],this._curTexts.length>0&&this.emit(rx,this.getUpdateData([],e,this.currentText)),void(this._curTexts=[]);if(this._cids.join("")!==n.join("")||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 s=[];o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,s.push(n)})),this.currentExtText&&o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,s.push(n)})),this._log("update",s,e),this._curTexts=s,this.emit(rx,this.getUpdateData(s,e,this.currentText)),this.__render(s,e)}}}},{key:"getUpdateData",value:function(e,t,i){var n=i.id,r=i.language;return{type:rx,currentTime:0|t,id:n,language:r,texts:e,isOpen:this._isOpen}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return XR(1e3*(void 0===e?0:e)+1e3*this.seiTime-1e3*this.lastSeiTime)/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}}))};qR(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,s=r.baseSizeY,a=r.minMobileSize,l=r.minSize,u=r.fitVideo,c=r.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=XR(h*e)/100,i=e):(d=t,i=XR(t/h*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var p=0,f=0;f=XR(h>120?(p=s)*d/1080:(p=o)*i/1920);var g=px?a:l,y={fontSize:f=f<g?g:f>p?p:f},v=XR((t-d)/2),m=XR((e-i)/2),_=XR(d*c)/100;this._videoMeta.vBottom=v,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,u&&(y.bottom=v+_,y.left=y.right=m),Object.keys(y).map((function(e){n.root.style[e]="".concat(y[e],"px")})),this.emit(tx,{vLeft:m,vBottom:v,marginBottom:_,vWidth:i,vHeight:d,fontSize:f,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 s={"data-start":t.start,"data-end":t.end,"data-index":t.index},a=WR("xg-text-track-span","",s,i);if(e.innerRoot.appendChild(a),"step"===n){var l=WR("xg-text-track-span","",s,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),hx(l,r),setTimeout((function(){e._renderByWords(a,o,t.start,t.end,r)}),600)}else hx(a,r)}))}))}},{key:"_renderByWords",value:function(e,t,i,n,r){var o=document.createTextNode("");e.appendChild(o);var s,a,l=function(e){for(var t=e.split(""),i=[],n=!1,r=0;r<t.length;r++){var o=t[r];if(QR(o))if(n){var s=i.length-1;i[s]="".concat(i[s]).concat(o)}else i.push(o),n=!0;else if(o.match(/^[ ]*$/)||ZR(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 a=i.length-1;a>=0?i[a]="".concat(i[a]).concat(o):i.push(o)}else n=!1,i.push(o)}return i}((s=r,hx(a=document.createElement("span"),s),a.textContent||"")),u=this._getPlayerCurrentTime(),c=XR(1e3*(n-u));if(!(u>=n)){i>=u&&(u=i),c>300&&(c-=50);var h={dom:o,ids:t,wordList:l,interval:c/l.length,start:u,end:n,duration:c,lastTime:0};this._log(">>>>_renderByWords",c,h);for(var d=this._curRenderTask,p=-1,f=0;f<d.length;f++)if(d[f].ids===t){p=f;break}p>-1&&d.slice(p,1),d.push(h),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)})):FR(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===QL(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(jR(this.root,"text-track-hide"),this.innerRoot&&(this.innerRoot.innerHTML=""))}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(n=hR(nR(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),s=2;s<r;s++)o[s-2]=arguments[s];(n=hR(nR(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),s=2;s<r;s++)o[s-2]=arguments[s];(n=hR(nR(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),s=2;s<r;s++)o[s-2]=arguments[s];(n=hR(nR(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){hR(nR(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.vBottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}();class gx{constructor(e,t={}){var i,n;this.root=document.createElement("div"),this.root.className="veplayer-native-subtitle-dom",this.root.style.position="absolute",this.root.style.left="0",this.root.style.right="0",this.root.style.bottom=`${null!=(i=t.offsetBottom)?i:4}%`,this.root.style.color=null!=(n=t.fontColor)?n:"#fff",this.root.style.textAlign="center",this.root.style.pointerEvents="none",this.root.style.zIndex="12",e.appendChild(this.root)}render(e){this.root.replaceChildren(...e.map((e=>{const t=document.createElement("span");return t.className="veplayer-native-subtitle-cue",t.style.display="block",t.textContent=e.text,t})))}clear(){this.render([])}destroy(){this.clear(),this.root.remove()}}const yx=()=>`native-subtitle-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,vx=e=>u({},e);class mx extends Rr{constructor(e){var t;super(),this.options=e,this.mappings=[],this.ids=new WeakMap,this.selectedId=null,this.hiddenSelectionId=null,this.cueTrack=null,this.nativeFullscreen=!1,this.pictureInPicture=!1,this.remotePlayback=!1,this.destroyed=!1,this.refreshTracks=()=>{var e;if(this.destroyed)return;const t=this.options.media.textTracks,i=[];for(let o=0;o<(null!=(e=null==t?void 0:t.length)?e:0);o++){const e=t[o];if(!e||!["subtitles","captions"].includes(e.kind))continue;let n=this.ids.get(e);n||(n=this.createOpaqueId(),this.ids.set(e,n));const r=this.mappings.find((t=>t.track===e));i.push({track:e,item:c(u({id:n},e.language?{language:e.language}:{}),{text:e.label||e.language||"Subtitle",isDefault:"showing"===e.mode||!0===(null==r?void 0:r.item.isDefault),source:"hls",forced:!1})})}this.mappings=i;let n=this.findById(this.selectedId);if(n||null===this.selectedId||(this.selectedId=null,this.detachCueTrack(),this.options.renderer.clear(),this.emit("off")),!n){const e=this.mappings.find((e=>"showing"===e.track.mode));e&&(this.selectedId=e.item.id,this.hiddenSelectionId=this.selectedId,this.applySelectedTrack(e),n=e)}const r=this.getTracks();this.emit("reset",{list:r,isOpen:!!n}),this.options.emit(jD.HLS_SUBTITLE_TRACKS_UPDATED,{playbackSessionId:this.playbackSessionId,playbackEngine:"native",tracks:r})},this.onCueChange=()=>{this.renderActiveCues()},this.onNativeFullscreenStart=()=>{this.nativeFullscreen=!0,this.applyPresentationMode()},this.onNativeFullscreenEnd=()=>{this.nativeFullscreen=!1,this.applyPresentationMode()},this.onPictureInPictureStart=()=>{this.pictureInPicture=!0,this.applyPresentationMode()},this.onPictureInPictureEnd=()=>{this.pictureInPicture=!1,this.applyPresentationMode()},this.onPresentationModeChanged=()=>{const e=this.options.media.webkitPresentationMode;this.pictureInPicture="picture-in-picture"===e,this.nativeFullscreen="fullscreen"===e,this.applyPresentationMode()},this.onRemoteStart=()=>{this.remotePlayback=!0,this.applyPresentationMode()},this.onRemoteEnd=()=>{this.remotePlayback=!1,this.applyPresentationMode()},this.createOpaqueId=null!=(t=e.createOpaqueId)?t:yx,this.playbackSessionId=e.playbackSessionId,this.bind(),this.refreshTracks()}getTracks(){return this.mappings.map((e=>vx(e.item)))}refresh(){this.refreshTracks()}setPlaybackSessionId(e){this.playbackSessionId=e}switch(e){let t;try{t=this.resolveTarget(e)}catch(fF){return Promise.reject(fF)}const i=this.selectedId,n=t.item.id,r=vx(t.item);return this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHING,{playbackSessionId:this.playbackSessionId,playbackEngine:"native",from:i,to:n,track:r}),this.selectedId=n,this.hiddenSelectionId=n,this.applySelectedTrack(t),this.emit("change",r),this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHED,{playbackSessionId:this.playbackSessionId,playbackEngine:"native",from:i,to:n,track:vx(r)}),Promise.resolve({code:0})}switchOff(){const e=this.selectedId;null!==e&&(this.hiddenSelectionId=e),this.selectedId=null,this.detachCueTrack(),this.mappings.forEach((e=>{e.track.mode="disabled"})),this.options.renderer.clear(),this.emit("off"),this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHED,{playbackSessionId:this.playbackSessionId,playbackEngine:"native",from:e,to:null})}show(){var e,t;const i=null!=(t=null!=(e=this.findById(this.hiddenSelectionId))?e:this.mappings.find((e=>e.item.isDefault)))?t:this.mappings[0];return i?this.switch({id:i.item.id}):Promise.resolve({code:0})}destroy(){this.destroyed||(this.destroyed=!0,this.unbind(),this.detachCueTrack(),this.mappings.forEach((e=>{e.track.mode="disabled"})),this.mappings=[],this.selectedId=null,this.hiddenSelectionId=null,this.options.renderer.destroy(),this.removeAllListeners())}resolveTarget(e){if(void 0!==e.id&&null!==e.id&&""!==e.id){const t=this.findById(e.id);if(t)return t;throw new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The native HLS subtitle track was not found.")}if(void 0!==e.language&&null!==e.language&&""!==e.language){const t=this.mappings.filter((t=>String(t.item.language)===String(e.language)));if(1===t.length)return t[0];if(t.length>1)throw new sr("HLS_SUBTITLE_TRACK_AMBIGUOUS","More than one native HLS subtitle track uses the requested language.")}throw new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The native HLS subtitle track was not found.")}findById(e){if(null!=e&&""!==e)return this.mappings.find((t=>String(t.item.id)===String(e)))}applySelectedTrack(e){if(this.detachCueTrack(),this.mappings.forEach((t=>{t!==e&&(t.track.mode="disabled")})),this.canUseDomMode(e.track)&&(e.track.mode="hidden","hidden"===e.track.mode))return this.cueTrack=e.track,e.track.addEventListener("cuechange",this.onCueChange),void this.renderActiveCues();e.track.mode="showing",this.options.renderer.clear()}canUseDomMode(e){var t,i;const n=this.options.media,r=!!n.playsInline||!0===(null==(t=n.hasAttribute)?void 0:t.call(n,"playsinline")),o=null==(i=n.remote)?void 0:i.state,s=this.nativeFullscreen||!!n.webkitDisplayingFullscreen,a=this.pictureInPicture||document.pictureInPictureElement===n,l=this.remotePlayback||"connecting"===o||"connected"===o;if(!r||s||a||l)return!1;try{return e.activeCues,"function"==typeof e.addEventListener}catch(u){return!1}}renderActiveCues(){var e;if(!this.cueTrack)return void this.options.renderer.clear();let t=[];try{t=Array.from(null!=(e=this.cueTrack.activeCues)?e:[]).flatMap((e=>{const t=e.text;return"string"==typeof t?[{text:t}]:[]}))}catch(i){t=[]}this.options.renderer.render(t)}detachCueTrack(){var e,t;null==(t=null==(e=this.cueTrack)?void 0:e.removeEventListener)||t.call(e,"cuechange",this.onCueChange),this.cueTrack=null}applyPresentationMode(){const e=this.findById(this.selectedId);e&&this.applySelectedTrack(e)}bind(){var e,t,i,n,r,o,s,a,l;const u=this.options.media;null==(t=null==(e=u.textTracks)?void 0:e.addEventListener)||t.call(e,"addtrack",this.refreshTracks),null==(n=null==(i=u.textTracks)?void 0:i.addEventListener)||n.call(i,"removetrack",this.refreshTracks),null==(o=null==(r=u.textTracks)?void 0:r.addEventListener)||o.call(r,"change",this.refreshTracks),u.addEventListener("webkitbeginfullscreen",this.onNativeFullscreenStart),u.addEventListener("webkitendfullscreen",this.onNativeFullscreenEnd),u.addEventListener("enterpictureinpicture",this.onPictureInPictureStart),u.addEventListener("leavepictureinpicture",this.onPictureInPictureEnd),u.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChanged);const c=u.remote;null==(s=null==c?void 0:c.addEventListener)||s.call(c,"connecting",this.onRemoteStart),null==(a=null==c?void 0:c.addEventListener)||a.call(c,"connect",this.onRemoteStart),null==(l=null==c?void 0:c.addEventListener)||l.call(c,"disconnect",this.onRemoteEnd)}unbind(){var e,t,i,n,r,o,s,a,l;const u=this.options.media;null==(t=null==(e=u.textTracks)?void 0:e.removeEventListener)||t.call(e,"addtrack",this.refreshTracks),null==(n=null==(i=u.textTracks)?void 0:i.removeEventListener)||n.call(i,"removetrack",this.refreshTracks),null==(o=null==(r=u.textTracks)?void 0:r.removeEventListener)||o.call(r,"change",this.refreshTracks),u.removeEventListener("webkitbeginfullscreen",this.onNativeFullscreenStart),u.removeEventListener("webkitendfullscreen",this.onNativeFullscreenEnd),u.removeEventListener("enterpictureinpicture",this.onPictureInPictureStart),u.removeEventListener("leavepictureinpicture",this.onPictureInPictureEnd),u.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChanged);const c=u.remote;null==(s=null==c?void 0:c.removeEventListener)||s.call(c,"connecting",this.onRemoteStart),null==(a=null==c?void 0:c.removeEventListener)||a.call(c,"connect",this.onRemoteStart),null==(l=null==c?void 0:c.removeEventListener)||l.call(c,"disconnect",this.onRemoteEnd)}}class _x extends Rr{constructor(e,t={}){var i,n;if(super(),this._onChange=e=>{const t=this._media.textTracks;if(!t||0===t.length)return;const i=[],n=[];let r=-1;for(let o=0;o<t.length;o++){const e=t[o];"subtitles"===e.kind&&(i.push({id:e.id||e.language,language:e.language,text:e.label,isDefault:"showing"===e.mode}),-1===r&&"showing"===e.mode&&(r=o),n.push(e.language))}n.join("|")!==this._languages?(this._languages=n.join("|"),this.emit("reset",{list:i,isOpen:r>-1})):-1===r?this.emit("off"):this.curIndex!==r&&this.emit("change",i[r]),this.curIndex=r},this._media=e,this._list=[],this._languages="",this.curIndex=-1,"dom"===t.nativeRenderMode&&t.container){const r=new gx(t.container,t.style);this._domAdapter=new mx({media:e,playbackSessionId:null!=(i=t.playbackSessionId)?i:"",renderer:r,emit:null!=(n=t.emit)?n:()=>{},createOpaqueId:t.createOpaqueId}),this._domAdapter.on("off",(()=>this.emit("off"))),this._domAdapter.on("change",(e=>this.emit("change",e))),this._domAdapter.on("reset",(e=>this.emit("reset",e)))}this._init()}_init(){if(this._domAdapter)return;const e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):la.warn("current browser not support native subtitle")}switch(e){return this._domAdapter?this._domAdapter.switch(e):new Promise(((t,i)=>{if(!e)return i({code:1,message:"no subtitle data"});const n=this._media.textTracks;for(let r=0;r<n.length;r++){const t=n[r];t.language===e.language?t.mode="showing":"showing"===t.mode&&(t.mode="disabled")}return t({code:0})}))}switchOff(){if(this._domAdapter)return void this._domAdapter.switchOff();const e=this._media.textTracks;for(let t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}destroy(){if(this._domAdapter)return this._domAdapter.destroy(),this._domAdapter=void 0,this._media=null,this._list=[],this._languages="",void(this.curIndex=-1);this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}refresh(){this._domAdapter?this._domAdapter.refresh():this._onChange(null)}setPlaybackSessionId(e){var t;null==(t=this._domAdapter)||t.setPlaybackSessionId(e)}}function Ex(){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 Tx(){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}const{POSITIONS:Sx}=ks,bx="mobile"===Gr.device,kx="text-close",Cx=new WeakSet;class Ix extends xD{renderItemList(e){var t;const i=this;e&&(i.config.data=e);const n=null!=(t=null!=e?e:i.config.data)?t:[];n.length>0&&(i.attrKeys=Object.keys(n[0])),i.root.replaceChildren(),n.forEach(((e,t)=>{var n;const r=e.selected?"option-item selected":"option-item";e["data-index"]=t;const o=Br.createDom("li","",e,r),s=document.createElement("span");s.textContent=String(null!=(n=e.showText)?n:""),o.appendChild(s),i.root.appendChild(o)}))}}function Ax(e=[]){let t=-1;return e.map(((e,i)=>{!e.source&&(e.source="config"),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}class Px extends ks{constructor(e){super(e),this.isOpenState=!0,this.optionList=null,this.currentLang="",this._hideListTimer=null,this._runtimeSubtitleSource="config",this._onOff=()=>{"hls"!==this._runtimeSubtitleSource&&this.noShowSubtitle()},this._onChange=e=>{if("hls"===this._runtimeSubtitleSource)return;const t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)},this._onListReset=e=>{"hls"!==this._runtimeSubtitleSource&&this.updateList(e)},this.handleButtonChange=e=>{e.preventDefault(),e.stopPropagation(),e.delegateTarget||(bx?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.runUiSubtitleAction(this.openSubtitle().then((()=>this.showList()))))},this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.clearPendingListHide(),this.showList()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.scheduleListHide()},this.handlerClickSwitch=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.subTitles&&(t.type===kx?this.switchOffSubtitle():this.runUiSubtitleAction(this.switchSubTitle({language:t.language,id:t.id})))},this.onPlayerFocus=e=>{this.subTitles&&this.config.style.follow&&this.rePosition()},this.onPlayerBlur=e=>{this.subTitles&&this.config.style.follow&&!this.playerConfig.marginControls&&this.subTitles.root&&(this.subTitles.root.style.transform="translate(0, 0)")};const{player:t,config:i}=e;t.config.isLive&&(e.config.updateMode="live",Gr.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:Sx.CONTROLS_RIGHT,index:XD,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",nativeRenderMode:"system",updateMode:"vod"}}afterCreate(){const{list:e=[]}=this.config;this.curIndex=-1,this.curItem=null;const t=Ax(e);super.afterCreate(),"native"===this.config.mode?this._initNativeSubtitle(t):this._initExtSubTitle(t),e.length||this.hide()}_initNativeSubtitle(e){var t,i,n,r,o,s,a,l,u,c,h,d,p;const{player:f}=this;if(!f._subTitles){const e=String(null!=(i=null==(t=f.config)?void 0:t.streamType)?i:"").toLowerCase(),d=null==(n=f.config)?void 0:n.url,p="hls"===e||"string"==typeof d&&d.split(/[?#]/,1)[0].toLowerCase().endsWith(".m3u8"),g=!(!(null==(o=null==(r=f.plugins)?void 0:r.hls)?void 0:o.hls)&&!(null==(a=null==(s=f.plugins)?void 0:s.encrypthlsplugin)?void 0:a.hls)),y="dom"===this.config.nativeRenderMode&&Gr.os.isIos&&p&&!g?"dom":"system";f._subTitles=new _x(f.video,{nativeRenderMode:y,container:f.root,style:this.config.style,playbackSessionId:null!=(h=null==(c=null==(u=null==(l=f.sdk)?void 0:l.getHlsLevelState)?void 0:u.call(l))?void 0:c.playbackSessionId)?h:"",emit:(e,t)=>{var i,n;return null==(n=null==(i=f.sdk)?void 0:i.emit)?void 0:n.call(i,e,t)}})}this.subTitles=f._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),null==(p=(d=this.subTitles).refresh)||p.call(d),this._renderList(e)}_initExtSubTitle(e){const{list:t=[],style:i,isDefaultOpen:n,updateMode:r,renderMode:o}=this.config,s={subTitles:t,defaultOpen:n,debugger:!1,renderMode:o,updateMode:r};this.isOpenState=n,Object.keys(i).map((e=>{s[e]=i[e]}));!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(po,this.onPlayerFocus),this.on(fo,this.onPlayerBlur));const{player:a}=this;if(a._subTitles)a._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,a._subTitles.currentText));else{const e=new fx(s);this.protectExtSubtitleCoreEvents(e),a._subTitles=e,e.attachPlayer(this.player),this.changeTipText()}this.subTitles=a._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),i.follow&&this.subTitles.root&&Br.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}protectExtSubtitleCoreEvents(e){const t=e;if(Cx.has(t)||"function"!=typeof t._onCoreEvents)return;const i=t._onCoreEvents;t._onCoreEvents=e=>{if("core.subtitlesegments"===(null==e?void 0:e.eventName)&&(!Array.isArray(e.list)||0===e.list.length))return;if("core.subtitlesegments"!==(null==e?void 0:e.eventName))return void i.call(t,e);const n=e.list.map((e=>{var i,n;if(!e||e.lang||e.language)return e;const r=Number(e.level),o=null==(n=null==(i=t.textTrack)?void 0:i[r])?void 0:n.language;return o?c(u({},e),{url:e.url,lang:o}):e}));i.call(t,c(u({},e),{list:n}))},Cx.add(t)}_renderList(e){const{list:t=[],isDefaultOpen:i}=this.config;t.length&&(e<0?(t[0].isDefault=!0,this.curIndex=0,this.curItem=t[0]):(this.curIndex=e,this.curItem=t[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?Br.addClass(this.root,"isOpen"):Br.addClass(this.root,"isClose"),!1===this.config.isShowIcon&&this.hide()}updateCurItem(e,t){this.curIndex=e,this.curItem=this.config.list[e],this.renderItemList(),this.emit("subtitle_change",u({off:!1,isListUpdate:!1,list:[]},t))}initEvents(){this.bind(["click"],this.handleButtonChange),this.bind(["mouseenter"],this.onEnter),this.bind(["mouseleave"],this.onLeave),this._delegates=[]}runUiSubtitleAction(e){e.catch((()=>{la.error("subtitle UI action failed")}))}clearPendingListHide(){null!==this._hideListTimer&&void 0!==this._hideListTimer&&(clearTimeout(this._hideListTimer),this._hideListTimer=null)}scheduleListHide(){this.clearPendingListHide(),this._hideListTimer=setTimeout((()=>{var e,t,i,n,r,o,s;this._hideListTimer=null;const a=null!=(i=null==(t=null==(e=this.root)?void 0:e.matches)?void 0:t.call(e,":hover"))&&i,l=null!=(s=null==(o=null==(r=null==(n=this.optionList)?void 0:n.root)?void 0:r.matches)?void 0:o.call(r,":hover"))&&s;a||l||this.hideList()}),150)}bindOptionListHoverEvents(){var e;const t=null==(e=this.optionList)?void 0:e.root;t&&(this._optionListEnterHandler=e=>{e.stopPropagation(),this.clearPendingListHide()},this._optionListLeaveHandler=e=>{e.stopPropagation(),this.scheduleListHide()},t.addEventListener("mouseenter",this._optionListEnterHandler),t.addEventListener("mouseleave",this._optionListLeaveHandler))}unbindOptionListHoverEvents(){var e;const t=null==(e=this.optionList)?void 0:e.root;t&&this._optionListEnterHandler&&t.removeEventListener("mouseenter",this._optionListEnterHandler),t&&this._optionListLeaveHandler&&t.removeEventListener("mouseleave",this._optionListLeaveHandler),this._optionListEnterHandler=void 0,this._optionListLeaveHandler=void 0}showList(){var e;!bx&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!bx&&this.isOpenState&&(null==(e=this.optionList)||e.hide())}openSubtitle(){return this.curIndex<0&&(this.curIndex=0,this.curItem=this.config.list[0]),this.curIndex>-1&&this.curItem?this.switchSubTitle(this.curItem):Promise.resolve(void 0)}getSubTitleIndex(e,t={id:"",language:""}){if(!t||!t.id&&!t.language)return-1;if(void 0!==t.id&&null!==t.id&&""!==t.id)return e.findIndex((e=>String(e.id)===String(t.id)));const i=e.reduce(((e,i,n)=>(String(i.language)===String(t.language)&&e.push(n),e)),[]);return 1===i.length?i[0]:i.length>1?-2:-1}setRuntimeSubtitleSource(e){this._runtimeSubtitleSource=e}setRuntimeSubtitleBridge(e){this._runtimeSubtitleBridge=e}replaceRuntimeSubtitleList(e,t){this.setRuntimeSubtitleSource("hls"),this.updateList({list:e.map((e=>c(u({},e),{source:"hls"}))),isOpen:t})}confirmRuntimeSubtitleSelection(e){if(!e)return void this.noShowSubtitle();const t=this.getSubTitleIndex(this.config.list,{id:e.id});t<0||(this.isOpenState=!0,Br.removeClass(this.root,"isClose"),Br.addClass(this.root,"isOpen"),this.updateCurItem(t,e),this.changeTipText())}syncRuntimeSubtitleRenderer(e){var t,i;try{const n=this.subTitles,r=null==(t=null==n?void 0:n.textTrack)?void 0:t[e];if(!r||"function"!=typeof(null==n?void 0:n._updateCurrent))return;n._loadingTrack={},n._updateCurrent(r),null==(i=n.switchOn)||i.call(n),Array.isArray(r.url)&&r.url.length>0&&"function"==typeof n._loadTrack&&Promise.resolve(n._loadTrack(r)).then((e=>{var t;n.currentText===r&&(null==(t=n.addStyles)||t.call(n,e),n._updateCurrent(e))})).catch((()=>{la.error("load queued HLS subtitle segments failed")}))}catch(pa){la.error("sync HLS subtitle renderer failed")}}clearRuntimeSubtitleView(){var e,t;null==(t=null==(e=this.subTitles)?void 0:e.switchOff)||t.call(e)}registerIcons(){return{vttSubOpen:{icon:Ex,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:Tx,class:"xgplayer-vttsub-close-svg"}}}registerLanguageTexts(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}creatOptionList(){if(bx)return;const e={config:{data:this.getList(),className:"",onItemClick:(e,t)=>{this.handlerClickSwitch(e,null==t?void 0:t.to)}},root:this.root};this.optionList=new Ix(e),this.bindOptionListHoverEvents()}getList(){return this.config.list.map(((e,t)=>(t===this.curIndex&&this.isOpenState?(e.isCurrent=!0,e.selected=!0):(e.isCurrent=!1,e.selected=!1),e.showText=this.getTextByLang(e),e)))}renderOptionList(){this.optionList.renderItemList(this.getList())}switchSubTitle(e={id:"",language:""}){if(!e||!e.id&&!e.language)return Promise.reject(new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The subtitle track was not found."));const t=this.getSubTitleIndex(this.config.list,e);if(-2===t)return Promise.reject(new sr("HLS_SUBTITLE_TRACK_AMBIGUOUS","More than one subtitle track uses the requested language."));if(t<0)return Promise.reject(new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The subtitle track was not found."));if(this.isOpenState&&t===this.curIndex)return Promise.resolve(void 0);const i=this.config.list[t];if("hls"===this._runtimeSubtitleSource){if(!this._runtimeSubtitleBridge)return Promise.reject(new sr("HLS_SUBTITLE_SWITCH_FAILED","The HLS subtitle bridge is unavailable."));const e=i.id?{id:i.id}:{language:i.language};return this._runtimeSubtitleBridge.switchSubtitle(e)}return this.subTitles.switch(i).then((n=>{0===n.code&&(e.off=!1,e.isListUpdate=!1,e.list=[],this.curIndex=t,this.curItem=i,this.isOpenState=!0,Br.removeClass(this.root,"isClose"),Br.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>{throw la.error("switch subtitle failed"),e}))}switchOffSubtitle(){"hls"===this._runtimeSubtitleSource&&this._runtimeSubtitleBridge?this._runtimeSubtitleBridge.hide():(this.subTitles.switchOff(),this.noShowSubtitle())}noShowSubtitle(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,Br.addClass(this.root,"isClose"),Br.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null==(e=this.optionList)||e.hide()}renderItemList(){bx?this.updatePanel():this.renderOptionList()}updateSubtitles(e=[],t=!0){if(!e)return;this.setRuntimeSubtitleSource("config");const i=e.map((e=>c(u({},e),{source:"config"}))),n=this.curIndex>-1||this.config.isDefaultOpen;this.updateList({list:i,isOpen:n}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,n,t)}updateList(e={}){var t,i,n,r,o,s,a;if(!e.list)return;const l=!(bx||!e.isOpen||!(null==(n=null==(i=null==(t=this.optionList)?void 0:t.root)?void 0:i.classList)?void 0:n.contains("active")));e.list.length>0&&!1!==this.config.isShowIcon&&this.show();const u=[];e.list.map((e=>{u.push(e)}));const c=Ax(u);e.isOpen?(this.isOpenState=!0,this.curIndex=c,this.curItem=c>-1?u[c]:null,Br.removeClass(this.root,"isClose"),Br.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,Br.removeClass(this.root,"isOpen"),Br.addClass(this.root,"isClose"),this.changeTipText(),null==(r=this.optionList)||r.hide()),this.config.list=u,u.length>0?bx||l||null==(o=this.optionList)||o.hide():(this.switchOffSubtitle(),bx?this.showMobilePanel():null==(s=this.optionList)||s.show(),bx||null==(a=this.optionList)||a.hide(),this.hide()),this.renderItemList()}changeTipText(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}showMobilePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.showPanel(t,this.langText.sub,!0)}updatePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.updatePanel(t)}renderPanel(){const e=[...this.config.list],t=Br.createDom("div","",{},"ai-panel-content");e.map(((e,i)=>{const n=u({language:e.language||e.srclang,"data-id":e.id,selected:this.isOpenState&&this.curIndex===i,showText:this.getTextByLang(e)},e),r=this.renderPanelItem(n);t.appendChild(r)}));const i={showText:this.langText.subClose,"data-type":kx,selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,n=Br.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item "+(i?"select-in":""));n.textContent=t;const r=bx?"touchend":"click",o=ks.delegate(n,".panel-Item",r,(t=>{e["data-type"]===kx?(t.stopPropagation(),t.preventDefault(),this.switchOffSubtitle()):this.handlerClickSwitch(t,e)}));return this._delegates.push(o),n}getTextByLang(e,t,i){if(void 0===e)return"";const{list:n}=this.config;return!i&&(i=this.player.lang),t=!t||Br.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]),"object"==typeof e[t]?e[t][i]||e[t].zh:e[t]||""}rePosition(){const{fitVideo:e}=this.config.style,t=0-this.player.controls.root.getBoundingClientRect().height;if(!e)return void(this.subTitles.root.style.transform=`translate(0, ${t}px)`);const{video:i,root:n}=this.player,{height:r,width:o}=n.getBoundingClientRect(),{videoHeight:s,videoWidth:a}=i;let l=parseInt(s/a*100,10)*o/100;l>r&&(l=r);const u=(r-l)/2-t;u<0&&(this.subTitles.root.style.transform=`translate(0, ${u}px)`)}destroy(){var e;this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),this.unbind(["click"],this.handleButtonChange),this.unbind(["mouseenter"],this.onEnter),this.unbind(["mouseleave"],this.onLeave),this.clearPendingListHide(),this.unbindOptionListHoverEvents(),null==(e=this.optionList)||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((e=>{Array.isArray(e)&&e.map((e=>{e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),super.destroy()}render(){var e;return`\n <xg-icon class="xgplayer-vttsub"${!1===this.config.isShowIcon||!(null==(e=this.config.list)?void 0:e.length)?' style="display: none;"':""}>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">${this.langText.subOpen}</div>\n </xg-icon>\n `}}const wx=class extends ks{constructor(e){super(e),this.toastNumber=0,this.toastMaps={}}static get pluginName(){return"sdkToastPlugin"}static get defaultConfig(){return{index:5}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){}destroy(){}add(e,t=2e3,i=!1){const n=this.toastNumber+1;this.toastNumber=n;const r=this.renderToast(e,i,n);return this.root.appendChild(r),this.toastMaps[n]=r,t&&setTimeout((()=>{this.remove(n)}),t),n}remove(e){const t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}renderToast(e,t,i){const n=Br.createDom("div","",void 0,"toast-container"),r=Br.checkIsObject(e)?e:Br.createDom("div",e,void 0,"toast-txt");if(n.appendChild(r),t){const e=Br.createDom("span","×",void 0,"toast-close-bt");e.addEventListener("click",(()=>{this.remove(i)})),n.appendChild(e)}return n}render(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}};function Dx(){return(new Date).getTime()}var Lx="loadstart",Rx="loadeddata",xx="firstFrame",Ox="waitingStart",Nx="waitingEnd",Mx="seekStart",Ux="seekEnd",Bx=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Mr.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),_r(br(e),"_onAutoplayStart",(function(){Mr.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),_r(br(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=Dx(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Br.clearTimeout(br(e),e._waitTimer),e._waittTimer&&Br.clearTimeout(br(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),_r(br(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=Dx(),e.emitLog(Mx,{start:Dx()}))})),_r(br(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),_r(br(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=Dx(),e.fixedWaitingStart=Dx(),e._waitType=1,e.emitLog(Ox,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),_r(br(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=Dx(),e._waitTimer=Br.setTimeout(br(e),(function(){e._isWaiting&&(e.waitingStart=Dx(),Br.clearTimeout(br(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(Ox,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),_r(br(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),_r(br(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return mr(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=Dx(),this.loadedCostTime=0,this.startCostTime=0,this.on(co,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=Dx()-e.newPointTime,Mr.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(Lx,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=Dx(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(ao,(function(){e.vt=Dx(),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;Mr.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(Rx,{}),e.suspendWaitingStatus("loadeddata")})),this.on(eo,this._onSeeking),this.on(to,this._onSeeked),this.on(To,(function(){e.endState("destroy")})),this.on(So,(function(){e.endState("urlChange"),Mr.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([qr,ro],this._onPlaying),this.on(no,this._onWaiting),this.on(Jr,this._onError),this.on(Fo,(function(){Mr.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(vo,this._onAutoplayStart),this.off(io,this._onTimeupdate),this.once(vo,this._onAutoplayStart),this.once(io,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=Dx();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Mr.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Mr.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(xx,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Br.clearTimeout(this,this._waittTimer),this._waittTimer=Br.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Br.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=Dx(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(Ux,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Br.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Br.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=Dx(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(Nx,{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(Bo,fr({t:Dx(),host:Br.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}();function Hx(){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 Fx=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(i,[{key:"registerIcons",value:function(){return{replay:Hx}}},{key:"afterCreate",value:function(){var e=this;ks.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(Qr,(function(){if(e.playerConfig.loop||Br.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(Xr,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Br.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){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}();function jx(){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 Vx(){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 Kx={};function Gx(e){e?window.clearTimeout(e):Object.keys(Kx).map((function(e){window.clearTimeout(Kx[e].id),delete Kx[e]}))}var Wx=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),Br.removeClass(n.root,e),n.show()})),_r(br(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";Br.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return mr(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(go,(function(){i&&(i.lang&&"en"===i.lang?Br.addClass(t.root,"lang-is-en"):"jp"===i.lang&&Br.addClass(t.root,"lang-is-jp"))})),this.on(vo,this.onAutoplayStart),this.on(mo,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Br.removeClass(e.root,t),e.show()})),this.on(Xr,(function(){e.toggleTo("play")})),this.on(Zr,(function(){e.toggleTo("pause")})),this.on(Fo,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;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:jx,class:"xg-icon-play"},startPause:{icon:Vx,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(){Br.addClass(this.root,"hide")}},{key:"show",value:function(e){Br.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Br.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Br.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 Kx[e]&&window.clearTimeout(Kx[e].id),Kx[e]={},i.start&&i.start(),Kx[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(Kx[e].id),delete Kx[e]}),t),Kx[e].id}("pauseplay",400,{start:function(){Br.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Br.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){Br.removeClass(this.root,"interact"),Gx(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<Ms.READY)||(this.player.paused||t.state!==Ms.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<Ms.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),Gx(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}(),Yx=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=Br.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}();function zx(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(pa){return'<div class="xg-tips hide"></div>'}}var $x=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(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:_s.CONTROLS_RIGHT,index:10}}}]),i}();function Xx(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var qx=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Qx=qx.length;function Zx(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===gr(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<Qx;t++)e[qx[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<Qx;r++){var o=qx[r],s=t[o],a=parseFloat(s);i[o]=Number.isNaN(a)?0:a}var l=i.paddingLeft+i.paddingRight,u=i.paddingTop+i.paddingBottom,c=i.marginLeft+i.marginRight,h=i.marginTop+i.marginBottom,d=i.borderLeftWidth+i.borderRightWidth,p=i.borderTopWidth+i.borderBottomWidth,f=n,g=Xx(t.width);!1!==g&&(i.width=g+(f?0:l+d));var y=Xx(t.height);return!1!==y&&(i.height=y+(f?0:u+p)),i.innerWidth=i.width-(l+d),i.innerHeight=i.height-(u+p),i.outerWidth=i.width+c,i.outerHeight=i.height+h,i}}function Jx(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var eO="dragStart",tO="dragMove",iO="dragEnded",nO={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},rO=function(e){Er(i,Rr);var t=Cr(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return yr(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):kr(n)}return mr(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)]),nO[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=nO[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=Jx(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Jx(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Jx(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=Zx(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(eO,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(iO)),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),s=o.x,a=o.y;s=this.checkContain("x",s,n),a=this.checkContain("y",a,r),this.position.x=n+s,this.position.y=r+a,this.dragPoint.x=s,this.dragPoint.y=a,this.emit(tO,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=Zx(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(),oO=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;yr(this,i),_r(br(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),_r(br(n),"onCenterClick",(function(e){var t=br(n).player;t.paused?t.play():t.pause()})),_r(br(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(Br.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=br(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 mr(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(Zr,(function(){e.setAttr("data-state","pause")})),this.on(Xr,(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($x,i,$x.pluginName)}var n=Br.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new rO(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:jx,class:"xg-icon-play"},pause:{icon:Vx,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={},Br.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(wo,!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;Br.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(wo,!1),this.isMini=t.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Br.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(zx(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}(),sO={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},aO=["videoClick","videoDbClick"],lO=function(e){Er(i,hs);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=br(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),_r(br(e),"onMouseEnter",(function(t){var i=br(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(Co)})),_r(br(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({ignorePaused:!0})),e.emit(ko)})),_r(br(e),"onVideoClick",(function(t){var i=br(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--,us(br(e),aO[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),_r(br(e),"onVideoDblClick",(function(t){var i=br(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(),us(br(e),aO[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 mr(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,aO.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Gr.device&&!Gr.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(sO).map((function(t){n.addEventListener(t,e[sO[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(sO).map((function(t){n.removeEventListener(t,e[sO[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),uO="press",cO="pressend",hO="doubleclick",dO="click",pO="touchmove",fO="touchstart",gO="touchend",yO={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},vO={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function mO(e){return e&&e.length>0?e[e.length-1]:null}var _O=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};yr(this,e),_r(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=mO(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(fO,e)})),_r(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),_r(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(cO,e),i.trigger(gO,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),_r(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=mO(e.touches),o=r?parseInt(r.pageX,10):e.pageX,s=r?parseInt(r.pageY,10):e.pageX,a=o-t.x,l=s-t.y;Math.abs(l)<n.miniStep&&Math.abs(a)<n.miniStep||(i.__clearPress(),t.press&&i.trigger(cO,e),t.press=!1,t.moving=!0,i.trigger(pO,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?vO:yO,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return mr(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(uO,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(hO,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(dO,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(fF){console.error("trigger>>:".concat(e),fF)}}))}},{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 EO(){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 TO="auto",SO="seeking",bO="playbackrate",kO=["videoClick","videoDbClick"],CO=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"onTouchStart",(function(e){var t=br(n),i=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=n.getTouche(e);if(a&&!r.disableGesture&&n.duration>0&&!i.ended){o.isStart=!0,n.timer&&clearTimeout(n.timer),Br.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),n.find(".xg-dur").innerHTML=Br.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 u=parseInt(a.pageX-o.left,10),c=parseInt(a.pageY-o.top,10);o.x=90===i.rotateDeg?c:u,o.y=90===i.rotateDeg?u:c,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}})),_r(br(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=br(n),r=i.pos,o=i.config,s=i.player;if(t&&!o.disableGesture&&n.duration&&r.isStart){var a=o.miniMoveStep,l=o.hideControlsActive,u=parseInt(t.pageX-r.left,10),c=parseInt(t.pageY-r.top,10),h=90===s.rotateDeg?c:u,d=90===s.rotateDeg?u:c;if(Math.abs(h-r.x)>a||Math.abs(d-r.y)>a){var p=h-r.x,f=d-r.y,g=r.scope;if(-1===g&&(0===(g=n.checkScope(h,d,p,f,r))&&(l?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*n.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;n.executeMove(p,f,g,r.width,r.height),r.x=h,r.y=d}}})),_r(br(n),"onTouchEnd",(function(e){var t=br(n),i=t.player,r=t.pos,o=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var s=n.config,a=s.disableGesture,l=s.gestureX;!a&&l?n.endLastMove(r.scope):r.time=0,r.scope=-1,n.resetPos(),Br.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(TO)}})),_r(br(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),_r(br(n),"onRootTouchEnd",(function(e){n.pos.scope>-1&&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 mr(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:EO,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;kO.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(),Br.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Br.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new _O(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),n.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var o=this.player.controls;o&&o.center&&(o.center.addEventListener("touchmove",this.onRootTouchMove,!0),o.center.addEventListener("touchend",this.onRootTouchEnd,!0),o.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(oo,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([ro,Qr],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var s={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(s).map((function(t){e.touch.on(t,(function(i){e[s[t]](i)}))})),!i.disableActive){var a=n.plugins.progress;a&&(a.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){a.addCallBack(t,(function(){e.changeAction(TO)}))})))}}},{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,n=e.timePreviewStyle,r=e.curTimeColor,o=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),n){var s=this.find(".time-preview");Object.keys(n).forEach((function(e){s.style[e]=n[e]}))}var a=r||t,l=o;a&&(this.find(".xg-cur").style.color=a),l&&(this.find(".xg-dur").style.color=l),this.config.disableTimeProgress&&Br.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,s=-1;if(e<0||e>o)return s;var a=0===n?Math.abs(i):Math.abs(i/n);return Math.abs(i)>0&&a>=1.73&&e>r.scopeM1&&e<r.scopeM2?s=0:(0===Math.abs(i)||a<=.57)&&(s=e<r.scopeL?1:e>r.scopeR?2:3),s}},{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:Gr.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(TO)}},{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<Ms.RUNNING?n.closeVideoClick||(this.sendUseAction(Br.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(Br.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=Ms.RUNNING&&(this.sendUseAction(Br.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;us(this,kO[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;us(this,kO[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(bO))}},{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(TO))}},{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){var t=this.pos,i=this.config,n=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var 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(SO);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Br.format(this.duration),this.find(".xg-cur").innerHTML=Br.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Br.removeClass(this.find(".xg-seek-show"),"xg-back"):Br.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<Ms.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{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),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",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 class="xg-separator">/</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}();function IO(e){e.preventDefault(),e.returnValue=!1}function AO(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var PO=function(e){Er(i,hs);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=br(e),o=r._keyState,s=r.player,a=e.config,l=a.disable,u=a.disableBodyTrigger,c=a.isIgnoreUserActive;l||u||!s.isUserActive&&!c||AO(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!AO(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),_r(br(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),_r(br(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=br(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)}})),_r(br(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return mr(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:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{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,s=t.timeSegments,a=n>-1?n:i,l=o||r,u=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;a+u<=l?a+=u:a=l;var c=Br.getCurrentTimeByOffset(a,s),h={currentTime:{from:i,to:c}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=c}},{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 s={currentTime:{from:i,to:o=Br.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:s}),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=Object.keys(this.keyCodeMap),r=0;r<n.length;r++){var o=this.keyCodeMap[n[r]],s=o.action,a=o.keyCode,l=o.disable,u=o.pressAction,c=o.disablePress;if(a===e){if(!(l||i&&c)){var h=i&&u||s;"function"==typeof h?s(t,this.player,i):"string"==typeof h&&"function"==typeof this[h]&&this[h](t,this.player,i),this.emit(Uo,fr({key:n[r],target:t.target,isPress:i},this.keyCodeMap[n[r]]))}IO(t),t.stopPropagation();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}();function wO(){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 DO=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(i,[{key:"registerIcons",value:function(){return{loadingIcon:wO}}},{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:_s.ROOT}}}]),i}(),LO=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],RO=function(){function e(t){yr(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 mr(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,s=t.millisecond;r!==o&&i.map((function(t,i){i<r?t[e].style.width="100%":i>r&&(t[e].style.width=0)}));var a=n[r],l=0===s?0:(s-a.start)/a.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"!==Br.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"!==Br.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(Br.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++)Br.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Br.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=Br.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=Br.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),LO.forEach((function(t){o.appendChild(Br.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}(),xO={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},OO=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=br(n),r=i.pos,o=i.config,s=i.player,a=t;if(e){Br.event(e);var l=Br.getEventPos(e,s.zoom),u=90===s.rotateDeg?l.clientY:l.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,a=n.computeTime(e,u)}n.triggerCallbacks("dragmove",a,e),n._updateInnerFocus(a)})),_r(br(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),_r(br(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),_r(br(n),"_mouseUpHandler",(function(e,t){br(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),_r(br(n),"_mouseMoveHandler",(function(e,t){var i=br(n),r=i._state,o=i.pos,s=i.config,a=i.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,s.isPauseMoving&&a.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)})),_r(br(n),"onMouseDown",(function(e){var t=br(n),i=t._state,r=t.player,o=t.pos,s=t.config,a=t.playerConfig,l=Br.getEventPos(e,r.zoom),u=90===r.rotateDeg?l.clientY:l.clientX;if(!(r.isMini||s.closeMoveSeek||!a.allowSeekAfterEnded&&r.ended)){if(r.duration||r.isPlaying){e.stopPropagation(),n.focus(),Br.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),Br.checkIsFunction(s.onMoveStart)&&s.onMoveStart(),Br.event(e),o.x=u,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,Br.addClass(n.progressBtn,"active");var c=n.computeTime(e,u);return c.prePlayTime=i.prePlayTime,n._mouseDownHandlerHook(e,c),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp),n.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}r.play()}})),_r(br(n),"onMouseUp",(function(e){var t=br(n),i=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;if(o){e.stopPropagation(),e.preventDefault(),Br.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),Br.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Br.event(e),Br.removeClass(n.progressBtn,"active");var l=n.computeTime(e,o.x);l.prePlayTime=a.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,a.prePlayTime=0,a.time=0;var u=e.type;"touchend"===u||"touchcancel"===u?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),o.isEnter?"mobile"!==s.isMobileSimulateMode&&n.bind("mousemove",n.onMoveOnly):n.onMouseLeave(e)),Br.setTimeout(br(n),(function(){n.resetSeekState()}),1),i.focus()}})),_r(br(n),"onMouseMove",(function(e){var t=br(n),i=t._state,r=t.pos,o=t.player,s=t.config;Br.checkTouchSupport()&&e.preventDefault(),Br.event(e);var a=Br.getEventPos(e,o.zoom),l=90===o.rotateDeg?a.clientY:a.clientX,u=Math.abs(r.x-l);if(!(r.moving&&u<s.miniMoveStep||!r.moving&&u<s.miniStartStep)){r.x=l;var c=n.computeTime(e,l);c.prePlayTime=i.prePlayTime,n._mouseMoveHandlerHook(e,c)}})),_r(br(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),_r(br(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),_r(br(n),"onMouseEnter",(function(e){var t=br(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),Br.event(e);var o=Br.getEventPos(e,i.zoom),s=90===i.rotateDeg?o.clientY:o.clientX,a=n.computeTime(e,s);n.triggerCallbacks("mouseenter",a,e),n.focus()}})),_r(br(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),_r(br(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,"boolean"==typeof n.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),n.config.isDraggingSeek=n.config.isDragingSeek),n}return mr(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(e){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=fr(fr({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new RO(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(){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 e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===Gr.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(oo,(function(){e.onMouseLeave()})),this.on(io,(function(){e.onTimeupdate()})),this.on(to,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(uo,(function(){e.onCacheUpdate()})),this.on(Qr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(ho,(function(){e.onReset()})),this.on(Ro,(function(){e.onVideoResize()}))}},{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"===gr(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(fF){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),fF)}}))}},{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.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),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.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(),Br.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Br.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 s=t=t>=o.duration?o.duration-r.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==n||r.isDraggingSeek&&"audio"!==o.config.mediaType)&&(this._state.now=s,this._state.direc=s>o.currentTime?0:1,o.seek(s))}}},{key:"computeTime",value:function(e,t){var i,n,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,l=o.top,u=o.left,c=t;90===r.rotateDeg?(i=a,n=l):(i=s,n=u);var h=c-n,d=(h=h>i?i:h<0?0:h)/i;d=d<0?0:d>1?1:d,Number.isNaN(d)&&(d=this.player.currentTime/this.offsetDuration);var p=parseInt(d*this.offsetDuration*1e3,10)/1e3;return{percent:d,currentTime:p,seekTime:Br.getCurrentTimeByOffset(p,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=Br.adjustTimeByDuration(o,n,e),this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=Br.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(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:_s.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:xO.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return xO}}]),i}(),NO=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),_r(br(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return mr(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(),MO=function(e){Er(i,NO);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=br(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return mr(i,[{key:"afterCreate",value:function(){Ir(Tr(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([Xr,Zr,Jr,ho],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:jx,class:"xg-icon-play"},pause:{icon:Vx,class:"xg-icon-pause"}}}},{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(){Ir(Tr(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(zx(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:_s.CONTROLS_LEFT,index:0,disable:!1}}}]),i}();function UO(){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 BO=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(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:UO,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Br.addClass(this.root,"show")}},{key:"hide",value:function(){Br.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:_s.ROOT_TOP,index:0}}}]),i}();function HO(){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 FO(){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 jO=function(e){Er(i,NO);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(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 mr(i,[{key:"afterCreate",value:function(){var e=this;Ir(Tr(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=Br.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(Ao,(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:BO,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Gr.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:HO,class:"xg-get-fullscreen"},exitFullscreen:{icon:FO,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){Ir(Tr(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Gr.device?"touchend":"click",this.handleFullscreen),"mobile"===Gr.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 instanceof Event&&(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(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{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:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(zx(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(pa){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(pa){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:_s.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(),VO=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),(n=t.call(this,e)).isActiving=!1,n}return mr(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.player.controls.config.mode;this.mode="flex"===e?"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.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([oo,to,io],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(Qr,(function(){e.onTimeUpdate(!0)})),this.on(ho,(function(){e.onReset()}))}},{key:"show",value:function(e){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=Br.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Br.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=Br.format(n))):(this.timeDom.innerHTML=this.minWidthTime(Br.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=Br.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Br.format(0)),this.centerDurDom.innerHTML=Br.format(0)):(this.timeDom.innerHTML=this.minWidthTime(Br.format(0)),this.durationDom.innerHTML=Br.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Br.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=Br.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),this.extraEls=[this.centerCurDom,this.centerDurDom]}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Br.hide(this.durationDom),Br.hide(this.timeDom),Br.hide(this.find(".time-separator")),Br.show(this.find(".time-live-tag"))):Br.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Br.hide(this.durationDom),Br.hide(this.timeDom),Br.hide(this.find(".time-separator")),Br.show(this.find(".time-live-tag"))):(Br.hide(this.find(".time-live-tag")),Br.show(this.find(".time-separator")),Br.show(this.durationDom),Br.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(Br.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(Br.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(to,i),t.isSeeking&&t.media.seeking?this.once(to,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:_s.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(),KO=function(e){Er(i,hs);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(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=Br.getIndexByTime(i,n),o=Br.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),_r(br(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=Br.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),_r(br(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=Br.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var s=Br.getOffsetCurrentTime(i,n,o);if(e.player.offsetCurrentTime=s,e.curPos){var a=e.curPos,l=a.start,u=a.end;i<l?e.player.currentTime=l:i>u&&o>=r-1&&e.player.pause()}}})),_r(br(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=Br.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),_r(br(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 mr(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(oo,this._onDurationChange),this.on(ao,this._onLoadedData),this.on(io,this._onTimeupdate),this.on(eo,this._onSeeking),this.on(Xr,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 s=i[n-1];r.offset=s.offset+(r.start-s.end),r.cTime=s.duration+s.cTime,r.segDuration=o,r.duration=s.duration+o}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,n){var r=-1,o=n[i],s=o.start,a=o.end;if(e>=s&&e<=a)return r;var l=e-t;if(l<0&&e<s){var u=t>s?t-s:0;return r=i-1>=0?n[i-1].end+l+u: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}();function GO(){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 WO(){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 YO(){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 zO=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=br(e).player,n=e.find(".xgplayer-bar");Br.event(t);var r=n.getBoundingClientRect(),o=Br.getEventPos(t,i.zoom),s=r.height-(o.clientY-r.top);if(o.h=s,o.barH=r.height,e.pos=o,!(s<-2))return e.updateVolumePos(s,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),_r(br(e),"onBarMouseMove",(function(t){var i=br(e)._d;if(i.isStart){var n=br(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),Br.event(t);var s=Br.getEventPos(t,o.zoom);i.isMoving=!0;var a=r.h-s.clientY+r.clientY;a>r.barH||e.updateVolumePos(a,t)}})),_r(br(e),"onBarMouseUp",(function(t){Br.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=br(e)._d;i.isStart=!1,i.isMoving=!1})),_r(br(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),_r(br(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),_r(br(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 mr(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:WO,class:"xg-volume-small"},volumeLarge:{icon:GO,class:"xg-volume"},volumeMuted:{icon:YO,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"!==Gr.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(so,this.onVolumeChange),this.once(ao,this.onVolumeChange),"Number"!==Br.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 s=Math.max(Math.min(o/1e3,1),0),a={volume:{from:i.volume,to:s}};i.muted&&(a.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:a}),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.round(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(Br.clearTimeout(this,this._timerId),this._timerId=null),Br.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&&(Br.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Br.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),Br.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&&(Br.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"===Gr.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:_s.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}();function $O(){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>\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>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var XO=function(e){Er(i,NO);var t=Cr(i);function i(e){var n;return yr(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return mr(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){Ir(Tr(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(Ro,(function(){e.rotateDeg&&e.config.innerRotate&&Br.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(){Ir(Tr(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,s=i.innerContainer,a=i.media,l=o.offsetWidth,u=s&&t?s.offsetHeight:o.offsetHeight,c=n,h=r,d=0,p=0;.75!==e&&.25!==e||(c="".concat(u,"px"),h="".concat(l,"px"),d=-(u-l)/2,p=-(l-u)/2);var f="translate(".concat(d,"px,").concat(p,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:f,webKitTransform:f,height:h,width:c},y=t?a:o,v=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],v&&v.root&&(v.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(Oo,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:$O}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(zx(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:_s.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}();function qO(){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 QO(){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 ZO="picture-in-picture",JO="inline",eN="fullscreen",tN=function(e){Er(i,NO);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(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 mr(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()&&(Ir(Tr(i.prototype),"afterCreate",this).call(this),this.pMode=JO,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(_o,(function(){e.config.showIcon&&(Br.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:qO,class:"xg-get-pip"},pipIconExit:{icon:QO,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;Br.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(xo,!1)},this.enterPIPCallback=function(i){t.emit(xo,!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===eN&&n!==eN&&t.onFullscreenChange(null,!1),e.pMode=n,n===ZO?e.enterPIPCallback(i):n===JO&&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=Ar(document.styleSheets).map((function(t){try{return Ar(t.cssRules).map((function(e){return e.cssText})).join("")}catch(pa){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"===Br.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var s={};if(r.width&&r.height)s.width=r.width,s.height=r.height;else{var a=t.root.getBoundingClientRect();s.width=a.width,s.height=a.height}documentPictureInPicture.requestWindow(s).then((function(i){var n=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var s=n||t.root,a=s.parentElement,l=s.previousSibling,u=s.nextSibling;e.copyStyleIntoPiPWindow(i);var c=document.createElement("style");if(c.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(r)),h&&c.append(h)}else s===t.root&&c.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(c),i.document.body.append(s),i.addEventListener("pagehide",(function(t){a&&(u?a.insertBefore(s,u):l?a.insertBefore(s,l.nextSibling):a.appendChild(s)),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===ZO}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===Br.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===Br.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Br.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){Ir(Tr(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(zx(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:_s.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}();function iN(){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 nN=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"playNext",(function(e){var t=br(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(Mo,n.idx+1)):(n.nextHandler(),t.emit(Mo))})),n.idx=-1,n}return mr(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:iN}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Gr.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(zx(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:_s.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(),rN={exports:{}};rN.exports=function e(t,i,n){var r,o,s=window,a="application/octet-stream",l=n||a,u=t,c=!i&&!n&&u,h=document.createElement("a"),d=function(e){return String(e)},p=s.Blob||s.MozBlob||s.WebKitBlob||d,f=i||"download";if(p=p.call?p.bind(s):Blob,"true"===String(this)&&(l=(u=[u,l])[0],u=u[1]),c&&c.length<2048&&(f=c.split("/").pop().split("?")[0],h.href=c,-1!==h.href.indexOf(c))){var g=new XMLHttpRequest;return g.open("GET",c,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,f,a)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(u),f):E(u);l=(u=_(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var y=0,v=new Uint8Array(u.length),m=v.length;y<m;++y)v[y]=u.charCodeAt(y);u=new p([v],{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,s=new Uint8Array(r);o<r;++o)s[o]=n.charCodeAt(o);return new p([s],{type:i})}function E(e,t){if("download"in h)return h.href=e,h.setAttribute("download",f),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(){s.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\/\-\+]+)/,a)),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\/\-\+]+)/,a)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),333)}if(r=u instanceof p?u:new p([u],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(r,f);if(s.URL)E(s.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return E("data:"+l+";base64,"+s.btoa(r))}catch(T){return E("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){E(this.result)},o.readAsDataURL(r)}return!0};const oN=ur(rN.exports);function sN(){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 aN=function(e){Er(i,NO);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===Br.typeOf(t)?i=t:"Array"===Br.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);oN(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 mr(i,[{key:"afterCreate",value:function(){Ir(Tr(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:sN}}},{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(){Ir(Tr(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(zx(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:_s.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(),lN=function(e){Er(i,NO);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){Ir(Tr(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(Ro,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,n=document.createElement("a");n.href=e,n.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}catch(pa){console.error("MouseEvent unsupported",pa)}i&&n.dispatchEvent(i)}},{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(No,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,s=n.quality||r.quality,a=n.type||r.type;return new Promise((function(n,l){var u,c=null;if(o.media.canvas)c=o.media.canvas;else{i.canvas?(i.canvas.width=e||r.width,i.canvas.height=t||r.height):i.createCanvas(e,t),c=i.canvas,u=i.canvasCtx;var h,d,p,f,g=o.media.videoWidth/o.media.videoHeight,y=c.width/c.height,v=o.media.videoWidth,m=o.media.videoHeight;g>y?(p=c.width,f=c.width/g,h=0,d=Math.round((c.height-f)/2)):g===y?(p=c.width,f=c.height,h=0,d=0):g<y&&(p=c.height*g,f=c.height,h=Math.round((c.width-p)/2),d=0),u.drawImage(o.media,0,0,v,m,h,d,p,f)}var _=c.toDataURL(a,s).replace(a,"image/octet-stream");n(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){Ir(Tr(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Ro,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:_s.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(),uN=function(e){Er(i,FD);var t=Cr(i);function i(e){var n;return yr(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return mr(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;Ir(Tr(i.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(Do,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Br.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,s=t.map((function(t,i){var n=fr(fr({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));Ir(Tr(i.prototype),"renderItemList",this).call(this,s,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;Ir(Tr(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 fr(fr({},FD.defaultConfig),{},{position:_s.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(),cN=function(e){Er(i,FD);var t=Cr(i);function i(e){var n;return yr(this,i),(n=t.call(this,e)).curRate=1,n}return mr(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;Ir(Tr(i.prototype),"afterCreate",this).call(this),this.on(lo,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&Ir(Tr(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){Ir(Tr(i.prototype),"onItemClick",this).call(this,e,t);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}));Ir(Tr(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(){Ir(Tr(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return fr(fr({},FD.defaultConfig),{},{position:_s.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}();function hN(){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 dN(){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 pN=function(e){Er(i,NO);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(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;Ir(Tr(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Po,(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:hN,class:"xg-get-cssfull"},exitCssFullscreen:{icon:dN,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){Ir(Tr(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(zx(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:_s.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(),fN=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(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(Jr,(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}(),gN=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(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.showPrompt.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:"showPrompt",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;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),Br.addClass(this.root,"show"),"arrow"===i.mode&&Br.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),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var o=i.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){Br.removeClass(this.root,"show"),Br.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Ps.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}(),yN={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function vN(e){Object.keys(yN).map((function(t){void 0===e[t]&&(e[t]=yN[t])}))}var mN={_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?Br.addClass(t,"mini"):Br.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&&(vN(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 s=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",a=Br.createDom("xg-spot",s,{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){a.style[e]=r[e]})),i.outer&&i.outer.appendChild(a),this.positionDot(a,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 s=i.find('xg-spot[data-id="'.concat(e,'"]'));s&&s.parentElement.removeChild(s)}}},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=Br.findDom(e,".xgplayer-spot-pop");if(i){var n=this.playerSize,r=e.getBoundingClientRect(),o=i.getBoundingClientRect(),s=r.left-n.left,a=n.width-s-r.width/2;if(s<o.width/2||n.width<o.width){var l=o.width/2-s;i.style.left="".concat(l,"px")}else if(a<o.width/2){var u=a-o.width/2+r.width/2;i.style.left="".concat(u,"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 _N={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},EN=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),_r(br(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(Br.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||Br.hasClass(e.target,"xg-spot-content"))&&(Br.event(e),e.stopPropagation()))})),_r(br(n),"onMousedown",(function(e){n.config.disable||(n._state.f||Br.hasClass(e.target,"xg-spot-content"))&&(Br.event(e),e.stopPropagation())})),_r(br(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))}})),_r(br(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()}})),_r(br(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&Br.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 mr(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(Br.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(mN).map((function(t){e[t]=mN[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return vN(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(oo,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Ro,(function(){e.positionDots()}))}(this),this.on(oo,(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(_N).map((function(i){e[_N[i]]=e[_N[i]].bind(e),t.addCallBack(i,e[_N[i]])})),"mobile"!==Gr.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(n){n.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,n),t&&t.onMouseUp(n)},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&&Br.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Br.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||Br.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,s="flex"===r.controls.mode,a=i.getBoundingClientRect().width;if(a||!this._hasThumnail){var l,u=e-(a=this._hasThumnail&&a<o.width?o.width:a)/2;u<0&&!s?(u=0,l=e-a/2):u>t-a&&!s?(l=u-(t-a),u=t-a):l=0,void 0!==l&&(n.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(u.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,s=this._state;if(r){s.now=i,this.transformTimeHook(i);var a=this.timeStr;n&&n.target&&Br.hasClass(n.target,"xgplayer-spot")?(this.showTips(n.target.getAttribute("data-text"),!1,a),this.focusDot(n.target),s.f=!0,o.isFocusDots&&s.f&&(s.now=parseInt(n.target.getAttribute("data-time"),10))):o.defaultText?(s.f=!1,this.showTips(o.defaultText,!0,a)):(s.f=!1,this.hideTips("")),this.updateTimeText(a),this.updateThumbnails(s.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"!==Gr.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){Br.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&Br.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=Br.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Br.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")),Br.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Br.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Br.addClass(this.root,"no-timepoint"),e&&(Br.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Br.addClass(this.root,"product"),this.tipText.textContent=e):(Br.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){Br.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Br.removeClass(this.find(".xg-spot-content"),"show-text"),Br.removeClass(this.root,"product")}},{key:"hide",value:function(){Br.addClass(this.root,"hide")}},{key:"show",value:function(e){Br.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(_N).map((function(i){t.removeCallBack(i,e[_N[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"===Gr.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}(),TN=function(e){Er(i,ks);var t=Cr(i);function i(e){var n;return yr(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return mr(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([oo],(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,Br.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,s=n.col,a=n.width,l=n.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),c=(u=u>r?r:u)<o*s?0:Math.ceil(u/(o*s))-1,h=u-c*(s*o),d=h>0?Math.ceil(h/s)-1:0,p=h>0?h-d*s-1:0,f=0,g=0;t&&i?t/i<a/l?f=(g=i)*(a/l):g=(f=t)/(a/l):i?t||(f=(g=i||l)*(a/l)):g=(f=t||a)/(a/l);var y=this.getUrlByIndex(c);return{urlIndex:c,rowIndex:d,colIndex:p,url:y,height:g,width:f,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(f*s,"px auto"),backgroundPosition:"-".concat(p*f,"px -").concat(d*g,"px"),width:"".concat(f,"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,s=o.pic_num,a=o.urls;if(!(s<=0)&&a&&0!==a.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=Br.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}();function SN(e){return e?"background:".concat(e,";"):""}var bN=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=br(e).offsetDuration,n=e.currentTime;n=Br.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return mr(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(io,this.onTimeupdate),this.on(ho,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{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(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,n=i.mode,r=i.height,o={cached:SN(t.cachedColor),played:SN(t.playedColor),progress:SN(t.progressColor),height:r>0&&2!==r?"height: ".concat(r,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(o.progress," ").concat(o.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(o.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(o.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(),kN="realtime",CN="firstframe",IN="poster";var AN=null,PN=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(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(io,e.renderOnTimeupdate),e.on(io,e.renderOnTimeupdate))})),_r(br(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),_r(br(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(io,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),_r(br(e),"start",(function(t,i){var n=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(pa){return(new Date).getTime()}}(),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===kN||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Br.setTimeout(br(e),e.start,i):Br.requestAnimationFrame(e.start))})),_r(br(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Br.clearTimeout(br(e),e.frameId):Br.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return mr(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!==kN&&this.interval>=1e3?"timer":"animation",this.once(_o,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==IN&&(r!==CN&&(this.on(ho,(function(){e.stop()})),this.on(Xr,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Zr,(function(){e.stop()}))),this.on(ao,this.onLoadedData),this.on(co,(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(pa){Mr.logError("plugin:DynamicBg",pa)}}},{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"!==Gr.browser||!Br.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"===Br.typeOf(e)?e:"String"===Br.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!==CN&&e!==IN}},{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,s=r.height;if(o!==i.width||s!==i.height||i.pi!==t){var a=parseInt(o/s*100,10);i.pi=t,i.width!==o&&(i.width=this.canvas.width=o),i.height!==s&&(i.height=this.canvas.height=s);var l=s,u=o;a<t?u=parseInt(s*t/100,10):a>t&&(l=parseInt(100*o/t,10)),i.rwidth=u*n.multiple,i.rheight=l*n.multiple,i.x=(o-i.rwidth)/2,i.y=(s-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=n.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(pa){Mr.logError("plugin:DynamicBg",pa)}}},{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 AN?AN:AN=function(){try{return!!document.createElement("canvas").getContext}catch(pa){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Gr.browser||"firefox"===Gr.browser)}}]),i}(),wN="info",DN=Go,LN=function(e){Er(i,hs);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(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[wN].push(fr(fr({type:"userAction"},i),{},{payload:n}))})),_r(br(e),"_onReset",(function(){e.reset()})),_r(br(e),"_recordInfo",(function(t){e.info(t)})),_r(br(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 mr(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Ho,this._recordUserActions),this.on(DN.STATS_INFO,this._recordInfo),this.on(DN.STATS_DOWNLOAD,this._downloadStats),this.on(DN.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[wN].push(fr(fr({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=fr({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=(_r(e={},wN,[]),_r(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[wN].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(fF){console.log("err",fF)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[wN].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),RN=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=br(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,s=r.smallGapLimit||.5,a=r.gapDetectionThreshold||.3,l=n.media.currentTime,u=e._getIndex(o,l,a);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var c=o.start(u)+.1;if(!(c>n.media.duration)){var h=c-l,d=h<=s;h<i.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(n.media.currentTime=e.isSafari?c+.1:c),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",d," currentTime:",n.media.currentTime," jumpSize:",l-n.media.currentTime),.08!==c&&n&&n.emit("log",{type:"oneevent",end_type:"gap",vid:n.config.vid,ext:{video_postion:Math.floor(1e3*c)}}))}}}}})),e}return mr(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(no,this.onGapJump),this.on(Xr,(function(){e.hasPlayed=!0})),this.on(eo,(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}();RN.BROWSER_GAP_TOLERANCE=.001;var xN=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=br(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),_r(br(e),"onJump",(function(){var t=br(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||(e.jumpCnt++,i.currentTime=r)}})),e}return mr(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(no,this.onWaiting),this.on([qr,ro],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(Xr,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(),ON="cdn",NN=["cdn"],MN=function(e){Er(i,ks);var t=Cr(i);function i(){var e;yr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return _r(br(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ON;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)})),_r(br(e),"startTimer",(function(){Br.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),_r(br(e),"initSpeedList",(function(){e.speedListCache={},NN.forEach((function(t){e.speedListCache[t]=[]}))})),_r(br(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||ON)})),_r(br(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,s=i+(i.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var a=(new Date).getTime(),l=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",s);var c={},h=Math.floor(10*Math.random());c.Range="bytes="+h+"-"+(n+h),c&&Object.keys(c).forEach((function(e){u.setRequestHeader(e,c[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,l=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,i=Math.round(1e3*t/(l-a));e.appendList(i),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(pa){console.error(pa)}}}})),_r(br(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ON;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=br(e).player;r&&(i===ON?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),_r(br(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ON,i=e.getSpeed(t),n=br(e).player;if(n)if(t===ON)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(bo,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(bo,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return mr(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&NN.push.apply(NN,Ar(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([ao,Eo],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([ao,Eo],this.startTimer),NN.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}(),UN=function(e){Er(i,ks);var t=Cr(i);function i(){return yr(this,i),t.apply(this,arguments)}return mr(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,n=t.media||t.video;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled)||n.getVideoPlaybackQuality&&(this.on(Xr,(function(){e._startTick()})),this.on(Zr,(function(){e._stopTick()})),this.on(Qr,(function(){e._stopTick()})),this.on(ho,(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:"_checkBuffer",value:function(e,t){for(var i=!1,n=[],r=0;r<t.length;r++){var o=t.start(r),s=t.end(r);if(n.push({start:o,end:s}),o<=e&&e<=s-1){i=!0;break}}return{enoughBuffer:i,buffers:n}}},{key:"_checkStuck",value:function(e,t,i,n){var r=this.player.media||this.player.video,o=document.hidden,s=r.paused,a=r.readyState,l=r.currentTime,u=r.buffered;if(!(o||s||a<4)){var c=this._checkBuffer(l,u),h=c.enoughBuffer,d=c.buffers;h&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:d,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:n}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(Wo,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,n=t.droppedVideoFrames,r=performance.now();if(i&&this._lastCheckPoint){var o=i-this._lastDecodedFrames,s=r-this._lastCheckPoint;this._checkStuck(o,i,n,s)}this._lastDecodedFrames=i,this._lastCheckPoint=r}}},{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}();const BN=class extends ks{static get pluginName(){return"poster"}static get defaultConfig(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}set isEndedShow(e){this.config.isEndedShow=e}get isEndedShow(){return this.config.isEndedShow}hide(){Br.addClass(this.root,"hide")}show(){return Br.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(Qr,(()=>{this.isEndedShow&&Br.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(io,(()=>{this.onTimeUpdate()})),this.on(So,(()=>{Br.removeClass(this.root,"hide"),Br.addClass(this.root,"xg-showplay"),this.once(io,(()=>{this.onTimeUpdate()}))}))):this.on(Xr,(()=>{Br.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?Br.removeClass(this.root,"xg-showplay"):this.once(io,(()=>{this.onTimeUpdate()}))}update(e){e&&(this.config.poster=e,this.root.style.backgroundImage=`url(${e})`)}setConfig(e){"string"==typeof e?this.config.poster=e:"object"==typeof e&&Object.keys(this.config).forEach((t=>{Object.keys(e).includes(t)&&(this.config[t]=e[t])})),this.update(this.config.poster)}getBgSize(e){let t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;case"fixWidth":t="100% auto";break;default:t=""}return t?`background-size: ${t};`:""}render(){const{poster:e,hideCanplay:t,fillMode:i,notHidden:n}=this.config,r=this.getBgSize(i);return`<xg-poster class="xgplayer-poster ${n?"xg-not-hidden":t?"xg-showplay":""} ${e?"active":""}" style="${e?`background-image:url(${e});${r}`:r}">\n </xg-poster>`}};Ns.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:"直播"}});class HN{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:n}=t,r=[...n?[]:[KO,OO,bN,EN,VO],MO,jO,XO,nN,uN,cN,aN,lN,zO,tN],o=[Fx,BN,Wx,DO,Yx,fN,gN,TN,oO];this.plugins=[LN,Bx,...r,...o,RN,xN];const s=i?"mobile":Gr.device;switch(s){case"pc":this.plugins.push(PO,lO,pN,MN,UN);break;case"mobile":this.plugins.push(CO);break;default:this.plugins.push(PO,lO,pN)}(Gr.os.isIpad||"pc"===s)&&this.plugins.push(PN),this.ignores=[],this.i18n=[]}}function FN(e,t){return d(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:n,playerData:r},o){const s=[HN,jN()],{openSoftDecoding:a,isMusic:l}=r,u=[],c=[];if(i?s.push(function({isLive:e,playerData:t}){const i=["error","playbackRate"],n=t.configs,r=Xa(n,"EncryptHlsPlugin");(null==r?void 0:r.playAuthToken)||i.push("definition");const o=[AL];return class{constructor(){this.plugins=o,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})):s.push(function({isLive:e,playerData:t}){const i=["cssfullscreen"],n=[fL],r=t.configs,o=Xa(r,"EncryptHlsPlugin");(null==o?void 0:o.playAuthToken)||(i.push("definition"),n.push(sL));return class{constructor(){this.plugins=n,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})),"flv"===t)c.push((()=>d(this,null,(function*(){if(i){if(Ja()||el()||a){const e=yield o.sdkUmdLoader.loadPlugins(jw.FLV);u.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(jw.FLV);u.push(e)}})))());Xa(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&u.push(Px);const[h,p]=yield Promise.all([n(),VN({playerData:o.playerData},o),...c]);return{presets:s,softDecodingOption:h,plugins:[...u,...p].filter(Boolean)}}))}function jN(e){const t=[$L,wx,kL];return class{constructor(){this.plugins=t,this.ignores=["error"]}}}function VN(e,t){return d(this,arguments,(function*({playerData:e},t){var i,n,r;const o=[];e.options,e.drmType,or.DRM_ENCRYPT;const s=(yield null==(r=null==(n=null==(i=t.playerData)?void 0:i.adapter)?void 0:n.getPlugins)?void 0:r.call(n,t.sdkUmdLoader))||[];return o.push(...s),Boolean(Rw()||Fa())&&o.push(Uw),e.enableMenu&&o.push(CL),o}))}function KN(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function GN(){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 WN(){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 YN(){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 zN(){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 $N(){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}const XN=c(u({startPlay:WN,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:GN,refresh: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="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}},{}),{volumeLarge:YN,volumeMuted:zN,volumeSmall:$N}),qN={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:qa(),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:u({},XN),flv:{retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}},QN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},ZN={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}};const JN=c(u({startPlay:WN,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" viewBox="0 0 20 20" 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>\n',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" 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>\n',"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:GN,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}},{}),{volumeLarge:YN,volumeMuted:zN,volumeSmall:$N}),eM=c(u({width:"100%",height:"100%",lang:qa(),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"}},{}),{cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:u({},JN),flv:{innerDegrade:1,retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{innerDegrade:1,retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}}),tM={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}},iM={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"}};const{POSITIONS:nM}=ks,rM=e=>{const t="mobile"===Gr.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:n=(t?"inner":"normal"),position:r=nM.CONTROLS_LEFT,icon:o=KN,index:s=1,hideAtFullScreen:a=!0,tips:l={jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}}=e;return class extends ks{static get isExtendPlugin(){return!0}static get type(){return n}static get textTips(){return l}static get pluginName(){return i}static get defaultConfig(){return{position:r,index:s}}afterCreate(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),a&&(null==(e=this.player)?void 0:e.fullscreen)&&this.handleFullScreenChange()}registerIcons(){return{[i]:{icon:o,class:"xgplayer-extendicon-svg"}}}updateIcons(e){const t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}registerLanguageTexts(){return{[i]:l}}initEvents(){var e;this.handleCallback=lD(this.handleCallback.bind(this),200);const t="mobile"===Gr.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),a&&(null==(e=this.player)||e.on(Ao,this.handleFullScreenChange.bind(this)))}handleFullScreenChange(){var e;const t=this.player;null==(e=this.player)||e.changePluginsIcon(i,!(null==t?void 0:t.fullscreen))}handleCallback(e){const{player:t}=this;t&&(e.preventDefault(),e.stopPropagation(),t.emit(VD.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),a&&(null==(e=this.player)||e.off(Ao,this.handleFullScreenChange.bind(this)))}render(){return`\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="${i}">${this.langText[i]}</div>\n </xg-icon>\n `}}};class oM{constructor(e){var t,i,n;const{config:r,root:o,player:s}=e;this.config=r,this.parent=o,this.player=s;let a=null!=(t=null==r?void 0:r.mode)?t:Xs.INNER;Object.values(Xs).includes(a)||(a=Xs.INNER),this.mode=a,this.isAutoChange=null!=(i=null==r?void 0:r.isAutoChange)&&i,this.isShow=!1,this.showCancelBtn=null!=(n=null==r?void 0:r.showCancelBtn)&&n,this.initEvents(),this.renderPanel()}initEvents(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.on(Ao,this.handleOrientationChange.bind(this)))}handleOrientationChange(){var e,t,i;const n=[90,-90,"90","-90"].includes(window.orientation);(null==(e=this.player)?void 0:e.fullscreen)&&n?this.changeMode(Xs.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:Xs.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(VD.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["normal","inner","fullscreen"][this.mode]}`;switch(this.root=Br.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case Xs.NORMAL:{const e=Br.createDom("div","",{},"xg-mobile-panel-content "+(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(e),this.showCancelBtn){const e="zh-cn"===this.player.lang?"zh":this.player.lang,t=Br.createDom("div",Zs[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case Xs.INNER:this.container=this.root;break;case Xs.FULLSCREEN:{const e=Br.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(e),this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}}}showPanel(e,t="",i=!1){return d(this,null,(function*(){if(i&&Br.addClass(e,"item-list-panel-content"),this.setTitle(t),this.children)return yield this.hide(),void setTimeout((()=>{this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}));this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}))}updatePanel(e){this.children&&Br.hasClass(this.children,"item-list-panel-content")&&Br.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))}setTitle(e){e&&this.mode!==Xs.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return Br.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,Br.removeClass(this.root,"hide"),Br.addClass(this.root,"active")}hide(){this.isShow=!1,Br.removeClass(this.root,"active"),Br.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}handleHide(e){e.stopPropagation(),e.preventDefault(),this.hide()}bind(e,t,i=!1){this.root&&`on${e}`in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}destroy(){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)||e.off(Ao,this.handleOrientationChange.bind(this))}}function sM(){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}const{POSITIONS:aM}=ks;class lM extends(oL(ks)){constructor(e){super(c(u({},e),{clientType:"MOBILE"})),this.handleButtonChange=()=>{const e=this.renderItemList();this.renderPanel(e)}}static get pluginName(){return"DefinitionMobilePlugin"}static get textTips(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}static get defaultConfig(){return{position:aM.CONTROLS_RIGHT,index:3,showToastOnManualClick:!0,alwaysShowDefinition:!1}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0);const t=this.getQualityMenuItems();t.length>1||this.config.alwaysShowDefinition?(this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents(),this.renderItemList(t),this.show()):(this.qualityRenderList=[],this.hide())}registerIcons(){return{definition:{icon:sM,class:"xgplayer-definition-svg"}}}registerLanguageTexts(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterPlayerInit(){}initEvents(){this.unbind(["click"],this.handleButtonChange),this.bind(["click"],this.handleButtonChange)}renderItemList(e=this.getQualityMenuItems()){const{list:t}=this.getCurrentDefinitionInfo(this.player),i=Br.createDom("div","",{},"definition-panel-content");return this.qualityRenderList=e,this.renderList=t,e.forEach((e=>{const t=this.renderItem(e);i.appendChild(t)})),i}renderItem(e){var t,i;const n=Br.createDom("div","",{},`panel-Item ${e.selected?"select-in":""} ${e.pending?"pending":""}`);let r=e.label;if("abr-auto"===e.source&&(null==(t=this.qualityRenderList)?void 0:t.some((e=>"definition"===e.source)))&&this.showRealDefinition(c(u({},e),{definition:"auto"}))){const e=null==(i=this.renderList)?void 0:i.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);r=t?`${r}(${t})`:r}return n.textContent=r,n.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),e.selected||(this.emitUserAction(t,"change_definition",{source:e.source,id:e.id,label:e.label}),this.selectQualityMenuItem(e))})),n}selectDef(e){this.selectDefinition(e)}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.definitionSelect,!0)}updatePanel(){var e,t,i,n,r,o,s;if((null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&(null==(r=null==(n=null==(i=this.player)?void 0:i.panel)?void 0:n.title)?void 0:r.innerHTML)!==this.langText.definitionSelect)return;const a=this.renderItemList();null==(s=null==(o=this.player)?void 0:o.panel)||s.updatePanel(a)}destroy(){super.destroy(),this.unbind(["click"],this.handleButtonChange)}render(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function uM(){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}const{POSITIONS:cM}=ks;class hM extends ks{constructor(e){super(e),this.playerData=e.player.config.playerData,this.dataMonitoring()}static get pluginName(){return"LineMobilePlugin"}static get textTips(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}static get defaultConfig(){return{position:cM.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&dr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e!==t&&this.player){const e=this.playerData.getCurrentUrl();this.player.changeDefinition({definition:t,url:e}),this.updatePanel(),setTimeout((()=>{this.player.paused&&this.player.play()}),1e3)}}))}registerIcons(){return{line:{icon:uM,class:"xgplayer-line-svg"}}}registerLanguageTexts(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.handleButtonChange.bind(this))}handleButtonChange(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=this.playerData.getLineList(),t=Br.createDom("div","",{},"line-panel-content");return e.forEach((e=>{const i=this.renderItem(e);t.appendChild(i)})),t}renderItem(e){const{current:{lineId:t}}=this.playerData,i=Br.createDom("div","",{},"panel-Item "+(t===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.player.emit(VD.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(jD.PLAYER_REBUILD)})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.lineSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}destroy(){this.unbind(["click"],this.handleButtonChange.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function dM(){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}const{POSITIONS:pM}=ks;class fM extends ks{constructor(e){super(e),this.state={currentRate:1,isSupport:!0},this.playerData=e.player.config.playerData}static get pluginName(){return"PlaybackRateMobilePlugin"}static get textTips(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}static get defaultConfig(){return{position:pM.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:dM,class:"xgplayer-rate-svg"}}}registerLanguageTexts(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.renderList.bind(this)),this.on(lo,(()=>{var e,t;this.state.currentRate!==this.player.playbackRate&&(this.state.currentRate=this.player.playbackRate,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this.updatePanel(),this.changeIconText())}))}renderList(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=Br.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((t=>{const i=this.renderItem(t);e.appendChild(i)})),e}renderItem(e){const t=D(e)?e:{textKey:e+"X",value:e},i=Br.createDom("div","",{},"panel-Item "+(this.state.currentRate===t.value?"select-in":""));return i.innerHTML=this.i18n[t.textKey]||t.textKey,i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const i={playbackRate:{from:this.player.playbackRate,to:t.value}};this.emitUserAction(e,"change_rate",{props:i}),this.state.currentRate=t.value,this.player.playbackRate=t.value,this.updatePanel(),this.changeIconText()})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.rateSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}changeIconText(){let e;const 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}const n=this.find(".icon-text");n.style.transform=`scale(${e})`,n.innerHTML=i}destroy(){this.unbind(["click"],this.renderList.bind(this))}render(){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 '}}function gM(){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.8881 11.8208C16.812 11.6153 16.5213 11.6153 16.4452 11.8208L16.0985 12.7579C15.8115 13.5334 15.2001 14.1448 14.4246 14.4318L13.4875 14.7786C13.2819 14.8546 13.2819 15.1454 13.4875 15.2214L14.4246 15.5682C15.2001 15.8551 15.8115 16.4666 16.0985 17.2421L16.4452 18.1792C16.5213 18.3847 16.812 18.3847 16.8881 18.1792L17.2348 17.2421C17.5218 16.4666 18.1332 15.8551 18.9087 15.5682L19.8458 15.2214C20.0514 15.1454 20.0514 14.8546 19.8458 14.7786L18.9087 14.4318C18.1332 14.1448 17.5218 13.5334 17.2348 12.7579L16.8881 11.8208Z" fill="white"/>\n<rect x="9.5" y="2" width="1.5" height="16" rx="0.75" fill="white"/>\n<rect x="5.75" y="5" width="1.5" height="10" rx="0.75" fill="white"/>\n<rect x="2" y="7" width="1.5" height="6" rx="0.75" fill="white"/>\n<path d="M16.5 7.75C16.5 7.33579 16.8358 7 17.25 7C17.6642 7 18 7.33579 18 7.75V9.18934C18 9.85752 17.1921 10.1921 16.7197 9.71967C16.579 9.57902 16.5 9.38825 16.5 9.18934V7.75Z" fill="white"/>\n<path d="M12.75 5.75C12.75 5.33579 13.0858 5 13.5 5C13.9142 5 14.25 5.33579 14.25 5.75V11.3229C14.25 11.4394 14.2229 11.5542 14.1708 11.6584C13.8169 12.3662 12.75 12.1144 12.75 11.3229V5.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:yM}=ks;class vM extends ks{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._clickHandler=null,this._nativePanelUpdateRaf=null}static get pluginName(){return"AudioTrackMobile"}static get textTips(){return{en:"Audio",zh:"音频","zh-hk":"音頻",jp:"オーディオ"}}static get defaultConfig(){return{position:yM.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:gM,class:"xgplayer-audiotrack-svg"}}}afterPlayerInit(){var e;this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{var t,i;(null==(i=null==(t=this.player)?void 0:t.panel)?void 0:i.isShow)&&this._updateHlsPanel(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t||this._initNativeAudioTracks()}destroy(){this._clickHandler&&this.unbind(["click"],this._clickHandler),null!==this._nativePanelUpdateRaf&&cancelAnimationFrame(this._nativePanelUpdateRaf),this._unbindNativeAudioTracks()}render(){return this.config.isShowIcon?'\n <xg-icon class="xgplayer-mobile-audiotrack">\n <div class="xgplayer-icon"></div>\n </xg-icon>\n ':""}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_onAudioTracksUpdated(e){!e||e.length<=1||this._bindClickOnce()}_renderList(){this._nativeMode?this._renderNativePanel():this._renderHlsPanel()}_getLabelOpts(){return{showNameSuffix:!1!==this.config.showNameSuffix}}_renderHlsPanel(){var e,t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=null!=(e=n.audioTrack)?e:-1,s=r.find((e=>e.default)),a=this._getLabelOpts(),l=Br.createDom("div","",{},"audiotrack-panel-content");r.forEach((e=>{let t=e.id===o;t||-1!==o||(null==s?void 0:s.id)!==e.id||(t=!0);const i=Br.createDom("div","",{},"panel-Item "+(t?"select-in":""));i.innerHTML=dL(e,a),i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this._switchHlsTrack(n,e)})),l.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(l,this._panelTitle(),!0)}_updateHlsPanel(e){var t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=this._getLabelOpts(),s=Br.createDom("div","",{},"audiotrack-panel-content");r.forEach((t=>{const i=Br.createDom("div","",{},"panel-Item "+(t.id===e?"select-in":""));i.innerHTML=dL(t,o),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this._switchHlsTrack(n,t)})),s.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.updatePanel(s)}_switchHlsTrack(e,t){uL(e,t)}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{var e,t;(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&null===this._nativePanelUpdateRaf&&(this._nativePanelUpdateRaf=requestAnimationFrame((()=>{var e,t;this._nativePanelUpdateRaf=null,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this._renderNativePanel(!0)})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1&&this._onNativeTracksChanged())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_bindClickOnce(){this._clickHandler||(this.appendChild(".xgplayer-icon",this.icons.audiotrack),this._clickHandler=this._renderList.bind(this),this.bind(["click"],this._clickHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1||this._bindClickOnce()}_renderNativePanel(e=!1){var t;const i=this._getNativeTrackList();if(!i)return;const n=this._getLabelOpts(),r=Br.createDom("div","",{},"audiotrack-panel-content");for(let s=0;s<i.length;s++){const e=i[s],t=pL(e,s,n),o=Br.createDom("div","",{},"panel-Item "+(e.enabled?"select-in":""));o.innerHTML=t,o.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=this._getNativeTrackList();t&&lL(t,s)})),r.appendChild(o)}const o=null==(t=this.player)?void 0:t.panel;e?null==o||o.updatePanel(r):null==o||o.showPanel(r,this._panelTitle(),!0)}_panelTitle(){var e;return null!=(e=vM.textTips[this.player.lang||"en"])?e:vM.textTips.en}}class mM{constructor(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=e,this.pluginName="",this.__init(e)}static defineGetterOrSetter(e,t){for(const i in t)Object.defineProperty(e,i,t[i])}static get pluginName(){return"pluginName"}beforeCreate(){}afterCreate(){}beforePlayerCreate(){}afterPlayerCreate(){}destroy(){}__init(e){mM.defineGetterOrSetter(this,{sdk:{get:()=>e.sdk,configurable:!0},player:{get:()=>e.sdk.getPlayerInstance(),configurable:!0},playerData:{get:()=>e.sdk.playerData,configurable:!0},pluginName:{get:()=>e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),configurable:!0},_emitter:{get:()=>e.sdk._emitter,configurable:!0}})}__destroy(){const e=this.sdk,t=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((e=>{Object.defineProperty(this,e,{writable:!0})})),Object.keys(this).map((e=>{this[e]=null,delete this[e]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete e._sdkPlugins[t]}}const _M=18e5,EM=1e3,TM="media_info",SM="ttdrama_media_info",bM="[mediaInfoCache]";let kM=u({},{enable:!1,expireTime:_M,cacheType:"memory",maxEntries:100});const CM=new Map,IM=new Map;function AM(e,t={}){la.log(`${bM} ${e}`,t)}function PM(e){var t;return{vid:null==e?void 0:e.vid,playListLength:(null==(t=null==e?void 0:e.playList)?void 0:t.length)||0,hasValidPlayUrl:RM(e)}}function wM(){return u({},kM)}function DM(){const e=CM.size,t=IM.size;CM.clear(),IM.clear();const i=function(){const e=BM();if(!e)return 0;const t=[`${Pa}${TM}_`,`${Pa}${SM}_`],i=[];for(let n=0;n<e.length;n++){const r=e.key(n);r&&t.some((e=>r.startsWith(e)))&&i.push(r)}return i.forEach((t=>e.removeItem(t))),i.length}();AM("clear success",{memoryCacheCount:e,prefetchedCacheCount:t,localStorageCacheCount:i})}function LM(e){return"string"==typeof e?e.trim():""}function RM(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function xM(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function OM(e){const t=NM(e);return t.playAuthTokenHash?xM(JSON.stringify(t)):""}function NM(e){const t=LM(e.playAuthToken);return{playAuthTokenHash:t?xM(t):"",reqParams:MM(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function MM(e){if(!e)return;const t=u({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const UM={getItem:e=>CM.get(e)||null,setItem(e,t){CM.delete(e),CM.set(e,t)},removeItem(e){CM.delete(e)}};function BM(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(pa){return}}function HM(e){return e.startsWith(`${Pa}${TM}_`)||e.startsWith(`${Pa}${SM}_`)}function FM(){if("memory"===kM.cacheType)return Array.from(CM.keys()).filter(HM);const e=BM();return e?function(e){const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);n&&HM(n)&&t.push(n)}return t}(e):[]}function jM(){return"memory"===kM.cacheType?UM:BM()}function VM(e){try{return JSON.parse(e)}catch(pa){return}}function KM(e){const t=LM(e.moduleName),i=LM(e.cacheKey);return t&&i?`${Pa}${t}_${i}`:""}function GM(e){const t=(e.playList||[]).map((e=>function(e){const t=Number(e);if(Number.isFinite(t)&&!(t<=0))return t>a(10,12)?t:1e3*t}(e.urlExpireTimestamp||e.MainUrlExpire||e.mainUrlExpire||e.main_url_expire))).filter((e=>!!e));if(t.length)return Math.min(...t)}function WM(e,t){const i=Date.now()+t,n=GM(e);return n?Math.min(i,n-EM):i}function YM(e){const t=LM(e.moduleName),i=LM(e.cacheKey);return t&&i?`${t}:${i}`:""}function zM(e){const t=YM(e),i=t?IM.get(t):void 0;if(i){if(!(Date.now()>=i.expireAt))return i.lastAccessedAt=Date.now(),i.mediaInfo;IM.delete(t)}}function $M(e,t){const i=YM(e);if(!i||!RM(t))return;const n=WM(t,kM.expireTime);n<=Date.now()||(IM.set(i,{mediaInfo:t,expireAt:n,lastAccessedAt:Date.now()}),function(){const e=IM.size-kM.maxEntries;e<=0||[...IM.entries()].sort((([,e],[,t])=>e.lastAccessedAt-t.lastAccessedAt)).slice(0,e).forEach((([e])=>IM.delete(e)))}())}function XM(e){return{moduleName:LM(e.moduleName),cacheKey:LM(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:kM.cacheType}}function qM(e){const t=jM(),i=KM(e),n=XM(e);if(!t)return void AM("get skip no storage",n);if(!i)return void AM("get skip empty storage key",n);const r=t.getItem(i)||"";if(!r)return void AM("get miss empty cache",n);const o=VM(r);if(!o)return void AM("get miss parse failed",n);const s=null==o?void 0:o.mediaInfo;if(s&&o.expireAt)return Date.now()>=o.expireAt?(t.removeItem(i),void AM("get miss expired and removed",c(u({},n),{expireAt:o.expireAt,now:Date.now()}))):(AM("get hit",u(c(u({},n),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),PM(s))),function(e,t,i,n){try{e.setItem(t,JSON.stringify(c(u({},i),{lastAccessedAt:Date.now()})))}catch(fF){AM("touch failed",c(u({},n),{error:fF}))}}(t,i,o,n),s);AM("get miss invalid cache payload",n)}function QM(e,t,i=_M){const n=jM(),r=KM(e),o=XM(e);if(!n)return void AM("set skip no storage",u(u({},o),PM(t)));if(!r)return void AM("set skip empty storage key",u(u({},o),PM(t)));if(!RM(t))return void AM("set skip invalid media info",u(u({},o),PM(t)));const s=WM(t,i);if(s<=Date.now())return void AM("set skip expired media info",u(c(u({},o),{expireTime:i,expireAt:s}),PM(t)));const a={createdAt:Date.now(),expireAt:s,lastAccessedAt:Date.now(),cacheKeyInfo:e.cacheKeyInfo,mediaInfo:t};try{n.setItem(r,JSON.stringify(a)),function(e){const t=FM(),i=kM.maxEntries;if(t.length<=i)return;const n=t.map((t=>{const i=VM(e.getItem(t)||"");return{key:t,lastAccessedAt:(null==i?void 0:i.lastAccessedAt)||(null==i?void 0:i.createdAt)||0}})).sort(((e,t)=>e.lastAccessedAt-t.lastAccessedAt)),r=t.length-i;n.slice(0,r).forEach((t=>e.removeItem(t.key))),AM("prune success",{removeCount:r,maxEntries:i,cacheType:kM.cacheType})}(n),AM("set success",u(c(u({},o),{cacheKeyInfo:a.cacheKeyInfo,expireTime:i,expireAt:s}),PM(t)))}catch(fF){AM("set failed",u(c(u({},o),{error:fF}),PM(t)))}}function ZM(e){if(kM.enable)return function(e){return qM({moduleName:TM,cacheKey:OM(e),cacheKeyInfo:NM(e)})}(e)}function JM(e){return zM({moduleName:TM,cacheKey:OM(e),cacheKeyInfo:NM(e)})||ZM(e)}function eU(e,t){kM.enable&&function(e,t,i=_M){QM({moduleName:TM,cacheKey:OM(e),cacheKeyInfo:NM(e)},t,i)}(e,t,kM.expireTime)}const tU=[["format","format"],["codec","codec"],["definition","definition"],["fileType","file_type"],["needThumbs","need_thumbs"],["needBarrageMask","need_barrage_mask"],["unionInfo","union_info"],["quality","quality"],["drmKek","drm_kek"],["jsPlayer","js_player"]];function iU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nU(e){if(!e)return;const t={};return tU.forEach((([i,n])=>{const r=e[i];"string"==typeof r&&(t[n]=r)})),t}function rU(e){return xM(JSON.stringify(nU(e)||{}))}function oU(e){return!0===(null==e?void 0:e.canIUseGetDramaInfoTranscodeParam)}function sU(e){switch(e){case OL.NOT_SUBMITTED:return"NOT_SUBMITTED";case OL.UNDER_REVIEW:return"UNDER_REVIEW";case OL.FAILED_REVIEW:return"FAILED_REVIEW";case OL.WITHDRAWN:return"WITHDRAWN_REVIEW";case OL.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}}function aU(e,t){return void 0!==t?sU(t):(null==e?void 0:e.includes("not found"))||(null==e?void 0:e.includes("未查询"))?"NO_INFO_FOUND":(null==e?void 0:e.includes("query"))||(null==e?void 0:e.includes("查询"))?"FAILED_TO_QUERY":"FAILED_GET_EPISODE_INFO"}function lU(e,t){return e&&t?`${e}${-1===e.indexOf("?")?"?":"&"}${i=t,Object.entries(i).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}`:e;var i}function uU(e,t=10,i=0){const n=parseInt(`${e}`,t);return Number.isNaN(n)?i:n}function cU(e){var t;return LM(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function hU(e){var t,i;const n="sg",r={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},o={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let s={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},a=n;return"byteplus"===e&&r?(s=r,a="sg"):"volcengine"===e&&o&&(s=o,a=s[n]?n:"cn"),(null==(t=null==s?void 0:s[n])?void 0:t.__PLAY_DOMAIN__)||(null==(i=null==s?void 0:s[a])?void 0:i.__PLAY_DOMAIN__)||""}function dU(e){return LM(e.albumId||e.album_id)}function pU(e){return LM(e.episodeId||e.episode_id||e.episodeID)}function fU(e,t){const i={episodeId:pU(e)};return!iU(e,"transcodeParam")||t&&!oU(t)||(i.transcodeParam=e.transcodeParam),i}function gU(e){const t=LM(e.episodeId);return t?iU(e,"transcodeParam")?`${t}_${rU(e.transcodeParam||{})}`:t:""}function yU(e){const t={episodeId:LM(e.episodeId)};return iU(e,"transcodeParam")&&(t.transcodeParamHash=rU(e.transcodeParam||{})),t}function vU(e){const t={moduleName:SM,cacheKey:gU(e),cacheKeyInfo:yU(e)};return zM(t)||function(e){if(kM.enable)return qM(e);AM("get skip disabled",c(u({},XM(e)),{config:wM()}))}(t)}function mU(e,t){!function(e,t){kM.enable?QM(e,t,kM.expireTime):AM("set skip disabled",u(c(u({},XM(e)),{config:wM()}),PM(t)))}({moduleName:SM,cacheKey:gU(e),cacheKeyInfo:yU(e)},t)}function _U(e){return JM(EU(e))}function EU(e){const t=e.getVideoByToken||{};return c(u({},t),{defaultDefinition:cU(e),reqParams:u({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function TU(e,t){const i=EU(e);return c(u({},i),{playDomain:i.playDomain||hU(null==t?void 0:t.channel)})}function SU(e,t={}){var i,n,r;const o=(e,t,i)=>{for(const n of t)if(e&&void 0!==e[n])return e[n];return i},s=o(e,["PlayInfoList","playInfoList","play_info_list"],[]),a=o(e,["PosterUrl","posterUrl","poster_url"],""),l=o(e,["Vid","vid"],""),h=o(e,["Duration","duration"],0),d=o(e,["BarrageMaskUrl","barrageMaskUrl","barrage_mask_url"],""),p=o(e,["ThumbInfoList","thumbInfoList","thumb_info_list"],[]),f=o(e,["EnableAdaptive","enableAdaptive","enable_adaptive"],void 0),g=o(e,["AdaptiveBitrateStreamingInfo","adaptiveBitrateStreamingInfo","adaptive_bitrate_streaming_info"],void 0),y=null==t?void 0:t.urlQueryParams,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}=t||{},E=s.map((e=>{const t=(t,i)=>o(e,t,i),i=t(["MainPlayUrl","mainPlayUrl","main_play_url"],""),n=t(["BackupPlayUrl","backupPlayUrl","backup_play_url"],""),r=lU(i,y),s=lU(n,y),a=t(["Format","format"],"");return u(u({vid:l,url:r,_mainURL:r,_backupURL:s,streamType:a,backupUrl:s,backUrlList:[s],fileType:t(["FileType","fileType","file_type"]),format:a,bitrate:t(["Bitrate","bitrate"]),size:t(["Size","size"]),kid:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuthId:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuth:t(["PlayAuth","playAuth","play_auth"]),secretKey:t(["PlayAuth","playAuth","play_auth"]),vwidth:t(["Width","width"]),vheight:t(["Height","height"]),vtype:null==a?void 0:a.toLocaleUpperCase(),codec:t(["Codec","codec"]),urlExpireTimestamp:uU(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,Qs),drmType:t(["DrmType","drmType","drm_type"])},e),ja(e,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}))})).sort(ka);return{playList:E,type:(null==(i=E[0])?void 0:i.Format)||(null==(n=E[0])?void 0:n.format)||(null==(r=E[0])?void 0:r.streamType),poster:a||"",vid:l,duration:h||0,dashOpts:{Data:c(u({},e),{VideoID:l})},thumbs:p||[],barrageMaskUrl:d||"",enableAdaptive:f,adaptiveBitrateStreamingInfo:g}}function bU(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function kU(e,t){var i,n;const r=cU(t),o=function(e,t){const i=e.playList||[];return t&&i.find((e=>{var i;const n=e.mapDefinition||e.definition||e.Definition;return(null==(i=null==n?void 0:n.toLocaleLowerCase)?void 0:i.call(n))===t.toLocaleLowerCase()}))||i[0]}(e,r),s=bU(null==o?void 0:o.url);if(!o||!s)return;const a=o.mapDefinition||o.definition||o.Definition||r,l=o.streamType||o.format||o.Format||e.type||"",u=(o.codec||(null==(n=null==(i=o.Codec)?void 0:i.toLowerCase)?void 0:n.call(i))||tr.H264).toLowerCase();return{vid:e.vid||o.vid||t.vid||"",url:s,definition:a,streamType:l,codec:u,bitrate:uU(o.bitrate||o.Bitrate),duration:uU(o.duration||o.Duration||e.duration),size:uU(o.size||o.Size)}}let CU=!1;const IU=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function AU(e,t){if(!e)return e;const i=e.indexOf("#"),n=-1===i?"":e.slice(i),r=-1===i?e:e.slice(0,i),o=r.indexOf("?"),s=-1===o?r:r.slice(0,o),a=-1===o?"":r.slice(o+1),l=a?a.split("&").filter((e=>{const t=e.split("=")[0];try{return"t"!==decodeURIComponent(t||"")}catch(pa){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${s}?${l.join("&")}${n}`}function PU(e,t){return"string"==typeof e?AU(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?AU(e,t):e&&"object"==typeof e&&"string"==typeof e.src?c(u({},e),{src:AU(e.src,t)}):e)):e}function wU(e,t=Date.now()){if(!CU||!e)return e;const i=u({},e);return IU.forEach((e=>{i[e]&&(i[e]=PU(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>PU(e,t)))),i}function DU(e,t=Date.now()){return CU&&e?c(u({},e),{playList:(e.playList||[]).map((e=>wU(e,t)))}):e}const LU=[{id:1,tag:"cmn-Hans-CN",label:"简体中文"},{id:2,tag:"eng-US",label:"English"},{id:3,tag:"jpn-JP",label:"日本語"},{id:4,tag:"kor-KR",label:"한국어"},{id:5,tag:"cmn-Hans-CN|eng-US",label:"中英双语"},{id:6,tag:"rus-RU",label:"Русский"},{id:7,tag:"fra-FR",label:"Français"},{id:8,tag:"por-PT",label:"Português"},{id:9,tag:"spa-ES",label:"Español"},{id:10,tag:"vie-VN",label:"Tiếng Việt"},{id:11,tag:"afr-ZA",label:"Afrikaans"},{id:12,tag:"ben-BD",label:"বাংলা"},{id:13,tag:"bul-BG",label:"Български"},{id:14,tag:"mya-MM",label:"မြန်မာဘာသာ"},{id:15,tag:"ces-CZ",label:"Čeština"},{id:16,tag:"dan-DK",label:"Dansk"},{id:17,tag:"hrv-HR",label:"Hrvatski"},{id:18,tag:"nld-NL",label:"Nederlands"},{id:19,tag:"fin-FI",label:"Suomi"},{id:20,tag:"deu-DE",label:"Deutsch"},{id:21,tag:"ell-GR",label:"Ελληνικά"},{id:22,tag:"hun-HU",label:"Magyar"},{id:23,tag:"ind-ID",label:"Bahasa Indonesia"},{id:24,tag:"gle-IE",label:"Gaeilge"},{id:25,tag:"isl-IS",label:"Íslenska"},{id:26,tag:"ita-IT",label:"Italiano"},{id:27,tag:"nor-NO",label:"Norsk"},{id:28,tag:"pol-PL",label:"Polski"},{id:29,tag:"swe-SE",label:"Svenska"},{id:30,tag:"tha-TH",label:"ภาษาไทย"},{id:31,tag:"tur-TR",label:"Türkçe"},{id:32,tag:"ukr-UA",label:"Українська"},{id:33,tag:"urd-PK",label:"اردو"},{id:34,tag:"ara-SA",label:"العربية"},{id:35,tag:"fra-CA",label:"Français (Canada)"},{id:36,tag:"cmn-Hant-CN",label:"繁體中文"},{id:37,tag:"msa-MY",label:"Bahasa Melayu"},{id:38,tag:"heb-IL",label:"עברית"},{id:39,tag:"jva-ID",label:"Basa Jawa"},{id:40,tag:"ron-RO",label:"Română"},{id:41,tag:"fil-PH",label:"Filipino"},{id:42,tag:"hin-IN",label:"हिन्दी"},{id:43,tag:"ben-IN",label:"বাংলা (ভারত)"},{id:44,tag:"khm-KH",label:"ភាសាខ្មែរ"},{id:45,tag:"bos-PH",label:"Bosanski"},{id:46,tag:"est-EE",label:"Eesti"},{id:47,tag:"lav-LV",label:"Latviešu"},{id:48,tag:"slk-SK",label:"Slovenčina"},{id:49,tag:"lit-LT",label:"Lietuvių"},{id:50,tag:"uyg-CN",label:"ئۇيغۇرچە"}],RU=new Map,xU=new Map;for(const gF of LU)RU.set(gF.id,gF.label),xU.set(gF.tag.toLowerCase(),gF.label);function OU(...e){for(const t of e){if("string"!=typeof t)continue;const e=t.trim();if(e)return e}return null}function NU(e){return{albumId:OU(null==e?void 0:e.album_id,null==e?void 0:e.albumId),episodeId:OU(null==e?void 0:e.episode_id,null==e?void 0:e.episodeId,null==e?void 0:e.episodeID)}}const MU=YL.getVeErrorInfo,UU={playAuthToken:"",needDefinitionList:!0},BU=(e,t,i,n=!1)=>{for(const r of t){const t=null==e?void 0:e[r];if(void 0!==t&&(!n||""!==t))return t}return i},HU=(e,t="")=>null==e?t:`${e}`;class FU extends mM{constructor(e){super(e),this.isPlayByToken=!1,this.isEncrypt=!1,this.config=null,this.useUnionInfoDRM=!0,this.retryCount=1,this.init()}static get pluginName(){return"AuthToken"}beforePlayerCreate(){return d(this,null,(function*(){if(this.isPlayByToken){const e=yield this.getVideoInfo();e&&this.playerData.initPlayData(e)}}))}getVideoInfo(e){return d(this,null,(function*(){var t;const i=null==(t=this.sdk)?void 0:t._createPlayerPerf,n=()=>d(this,null,(function*(){var t,n,r,o,s,a,l,u,c,h,p,f,g;try{const y=this.isMinisDramaMode&&(null==(t=null==EH?void 0:EH.ttDramaEnv)?void 0:t.canIUseGetDramaInfo);if(!y&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkPlayAuthTokenValid",(()=>this.checkPlayAuthTokenValid())):this.checkPlayAuthTokenValid()))return;if(!!this.keyTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkKeyTokenValid",(()=>this.checkKeyTokenValid())):this.checkKeyTokenValid()))return;if(!!this.thirdPartyDrmAuthTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkDrmAuthTokenValid",(()=>this.checkDrmAuthTokenValid())):this.checkDrmAuthTokenValid()))return;const v=((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos",(()=>d(this,null,(function*(){return yield this.getVideos(e)})))):yield this.getVideos(e))||{};if(!(null==(n=null==v?void 0:v.playList)?void 0:n.length))return void la.error("get no media info");la.log("getVideo res: ",v);const{type:m,poster:_,vid:E,dashOpts:T,thumbs:S,barrageMaskUrl:b}=v||{},k=v.playList||[];null==(o=null==(r=this.sdk)?void 0:r.assertLiteConfig)||o.call(r,{type:m,playList:k,rtm:v.rtm}),this.playInfo=v,this.setSubtitleConfig(v);const C=m||Sa(this.config);this.getPrivateDrmInfo&&((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo",(()=>d(this,null,(function*(){return yield this.getPrivateDrmInfo(k,E,C)})))):yield this.getPrivateDrmInfo(k,E,C)),this.playerData.options.vid=E;if(_&&(this.config.needPoster||this.isMinisDramaMode)&&("string"==typeof this.playerData.options.poster?this.playerData.options.poster=_:"object"==typeof this.playerData.options.poster?this.playerData.options.poster.poster=_:this.playerData.options.poster=_),this.config.needThumbs&&S.length>0&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(S))):this.getThumbnailConfig(S)),k.length>0){(null==(s=k[0])?void 0:s.drmType)&&this.playerData.setDrmType(k[0].drmType);const t=(null==(l=null==(a=this.playerData)?void 0:a.adapter)?void 0:l.generatePlaylistFromServer(v,this.config.useMasterM3u8))||[...k],n=this.config.defaultDefinition||(null==e?void 0:e.defaultDefinition)||this.playerData.configs.defaultDefinition;let r=t[0];if(n){const e=t.find((e=>(e.mapDefinition||e.definition||e.Definition).toLocaleLowerCase()===n.toLocaleLowerCase()));e&&(r=e)}const o=this.config.needDefinitionList?t:[r];this.isEncrypt=!!(null==o?void 0:o[0].kid);const d=(null==(u=k[0])?void 0:u.codec)||(null==(h=null==(c=k[0])?void 0:c.Codec)?void 0:h.toLowerCase())||(null==(f=null==(p=this.tokenInfo)?void 0:p.Codec)?void 0:f.toLowerCase())||tr.H264,y={vid:E,dashOpts:T,codec:d,playList:o,defaultDefinitionData:r};return(null==i?void 0:i.measure)?(i.measure("beforePlayerCreate.authtoken.getVideoInfo.getDrmConfig",(()=>this.getDrmConfig(y))),i.measure("beforePlayerCreate.authtoken.getVideoInfo.setPluginConfigInVid",(()=>{var e;return null==(e=this.playerData.adapter)?void 0:e.setPluginConfigInVid(y,this)}))):(this.getDrmConfig(y),null==(g=this.playerData.adapter)||g.setPluginConfigInVid(y,this)),{vid:E,playList:o,codec:d,defaultDefinition:r.definition}}la.error("get no media info")}catch(y){if(la.error(y),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==y?void 0:y.code))throw y}}));return(null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo",n):yield n()}))}getDramaInfoViaJSB(e){return d(this,null,(function*(){var t,i;const n=EH.ttDramaEnv,r=e||(null==(t=this.playerData)?void 0:t.configs)||{},{albumId:o,episodeId:s}=NU(r),a=r.vid||"";if((null==n?void 0:n.getDramaInfo)&&o&&s)return new Promise((e=>{const t={clientKey:n.clientKey,albumId:o,episodeId:s,vid:a};!0===n.canIUseGetDramaInfoTranscodeParam&&Object.prototype.hasOwnProperty.call(r,"transcodeParam")&&(t.transcodeParam=nU(r.transcodeParam)||{});const i=t=>{var i;la.error("getDramaInfo error:",t);const n={errorType:"drama",errorCode:xL.FAILED_GET_EPISODE_INFO.code,veError:MU({code:xL.FAILED_GET_EPISODE_INFO.code,message:xL.FAILED_GET_EPISODE_INFO.message,textKey:xL.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:xL.FAILED_GET_EPISODE_INFO.message,ext:{originError:t},originError:t};null==(i=this.sdk)||i.delayError.push(n),e(void 0)};try{n.getDramaInfo((t=>{var n,r,l,u;try{if(la.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:o,episodeId:s,vid:a}),!(null==t?void 0:t.is_success)){la.error("getDramaInfoViaJSB invalid response:",t);const i=aU(null==(n=null==t?void 0:t.error)?void 0:n.error_msg,void 0),o=xL[i]||xL.FAILED_GET_EPISODE_INFO,s={errorType:"drama",errorCode:o.code,veError:MU({code:o.code,message:o.message,textKey:o.textKey}),errorMessage:o.message,ext:{jsbError:null==t?void 0:t.error},originError:t};return null==(r=this.sdk)||r.delayError.push(s),void e(void 0)}const{data:i}=t;if((null==i?void 0:i.status)!==OL.SUCCESS){la.error("getDramaInfoViaJSB invalid response:",t);const n=sU(null==i?void 0:i.status),r=xL[n]||xL.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:r.code,veError:MU({code:r.code,message:r.message,textKey:r.textKey}),errorMessage:r.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(l=this.sdk)||l.delayError.push(o),void e(void 0)}if(!(null==i?void 0:i.video_info)){la.error("getDramaInfoViaJSB invalid response:",t);const n={errorType:"drama",errorCode:xL.FAILED_TO_QUERY.code,veError:MU({code:xL.FAILED_TO_QUERY.code,message:xL.FAILED_TO_QUERY.message,textKey:xL.FAILED_TO_QUERY.textKey}),errorMessage:xL.FAILED_TO_QUERY.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(u=this.sdk)||u.delayError.push(n),void e(void 0)}la.log("videoInfoRes before transformDramaVideoInfoToRes",i.video_info);const c=this.transformDramaVideoInfoToRes(i.video_info,this.config);la.log("videoInfoRes after transformDramaVideoInfoToRes",c),e(c)}catch(c){i(c)}}),t)}catch(l){i(l)}}));{const e=xL.INVALID_PARAM;null==(i=this.sdk)||i.delayError.push({errorType:RL.network,errorCode:e.code,veError:MU({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return sU(e)}mapDramaErrorCode(e,t){return aU(e,t)}transformDramaVideoInfoToRes(e,t){return SU(e,t)}callOnGetMediaInfo(e,t){var i,n,r;if(e)try{null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.onGetMediaInfo)||r.call(n,{data:e,fromCache:t})}catch(o){la.error("onGetMediaInfo callback error:",o)}}reportGetDramaInfoPerf(e,t){var i,n,r,o;const s=null==(i=null==e?void 0:e.data)?void 0:i.perf_info;s&&(null==(o=null==(n=this.sdk)?void 0:n.recordGetDramaInfoPerf)||o.call(n,{perfInfo:s,albumId:t.albumId,episodeId:t.episodeId,vid:t.vid,isSuccess:!!(null==e?void 0:e.is_success),status:null==(r=null==e?void 0:e.data)?void 0:r.status,fromCache:!1,timestamp:Date.now()}))}getVideos(e){return d(this,null,(function*(){var t,i,n,r,o,s;const a=null==(t=this.sdk)?void 0:t._createPlayerPerf;if(la.log("tt drama info: ",this.isMinisDramaMode,null==EH?void 0:EH.ttDramaEnv),this.isMinisDramaMode&&(null==(i=null==EH?void 0:EH.ttDramaEnv)?void 0:i.canIUseGetDramaInfo)){const t=c(u({},e||(null==(n=this.playerData)?void 0:n.configs)||{}),{defaultDefinition:(null==e?void 0:e.defaultDefinition)||(null==(o=null==(r=this.playerData)?void 0:r.configs)?void 0:o.defaultDefinition)||(null==(s=this.config)?void 0:s.defaultDefinition),getVideoByToken:this.config}),i=vU(fU(t,EH.ttDramaEnv));if(i){const e=DU(i);return this.callOnGetMediaInfo(e,!0),e}const l=e=>{mU(fU(t,EH.ttDramaEnv),e);const i=DU(e);return this.callOnGetMediaInfo(i,!1),i};if(null==a?void 0:a.measureAsync){return l(yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB",(()=>d(this,null,(function*(){return yield this.getDramaInfoViaJSB(e)})))))}return l(yield this.getDramaInfoViaJSB(e))}const l=e=>{var t,i,n;try{const i=JSON.parse(e.response);if(100006===Vn(i,"ResponseMetadata.Error.CodeN")){la.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:MU(DL.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken,config:this.config},originError:e};return null==(t=this.sdk)?void 0:t.delayError.push(i)}}catch(o){la.log(o)}null==(i=this._emitter)||i.emit(VD.GET_PLAY_URL_ERR,e);const r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:MU(DL.GET_PLAY_INFO_ERR),ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken},originError:e};null==(n=this.sdk)||n.delayError.push(r)},h=e=>d(this,null,(function*(){if(!this.config.playDomain&&502===(null==e?void 0:e.status)&&this.playerData.apiMap.backupPlayDomain)return this.playerData.playDomainDegrade=!0,yield Ia((()=>Ca(u({playDomain:this.playerData.playDomain},this.config))),this.retryCount,(e=>502===e.status),l);l(e)})),p=()=>d(this,null,(function*(){var e,t;const i=u({playDomain:this.config.playDomain||this.playerData.playDomain},this.config),n=OM(i),r=JM(i);if(r){la.log("[mediaInfoCache] authToken use cached media info",{cacheKey:n,vid:r.vid,playListLength:(null==(e=r.playList)?void 0:e.length)||0});const t=DU(r);return this.callOnGetMediaInfo(t,!0),t}la.log("[mediaInfoCache] authToken request media info",{cacheKey:n,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield Ia((()=>Ca(i)),this.retryCount,(e=>502===e.status),h);eU(i,o);const s=DU(o);return la.log("[mediaInfoCache] authToken request finished",{cacheKey:n,vid:null==o?void 0:o.vid,playListLength:(null==(t=null==o?void 0:o.playList)?void 0:t.length)||0,mediaInfo:o}),this.callOnGetMediaInfo(s,!1),s}));return(null==a?void 0:a.measureAsync)?yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getPlayInfoByAuthToken",p):yield p()}))}getPrivateDrmInfo(e,t,i){return d(this,null,(function*(){var n,r,o,s;const a=null==(n=this.sdk)?void 0:n._createPlayerPerf;if(this.config.getDrmAuthToken&&"function"==typeof this.config.getDrmAuthToken&&this.playerData.unionId){let n;if(this.sessionId=(new Date).getTime().toString(),"hls"===i){const e=(null==a?void 0:a.measureAsync)?yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.hlsEncrypt",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(jw.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(jw.HLSEncrypt);n=null==(r=null==e?void 0:e.updateUnionInfo)?void 0:r.call(e,this.playerData.unionId,this.sessionId)}else if("dash"===i){const e=(null==a?void 0:a.measureAsync)?yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.dash",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(jw.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(jw.DASH);n=null==(o=null==e?void 0:e.updateUnionInfo)?void 0:o.call(e,this.playerData.unionId,this.sessionId)}else if(["mp4","m4a"].includes(i)){const e=(null==a?void 0:a.measureAsync)?yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.mp4Encrypt",(()=>d(this,null,(function*(){return yield Gw.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield Gw.loadMp4Encrypt(this.sdk.sdkUmdLoader);n=null==(s=null==e?void 0:e.updateUnionInfo)?void 0:s.call(e,this.playerData.unionId,this.sessionId)}if(!n)return void la.error("updateUnionInfo fail");const u=[...new Set(e.map((e=>e.kid)))].join(",");try{const i=(null==a?void 0:a.measureAsync)?yield a.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.getDrmAuthToken",(()=>d(this,null,(function*(){return yield Qa(za(this.config.getDrmAuthToken(u,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield Qa(za(this.config.getDrmAuthToken(u,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");if(i&&"string"==typeof i){this.privateDrmAuthToken=i;const t=Ta(i);(null==t?void 0:t.DrmType)&&(this.useUnionInfoDRM="webdevice"===(null==t?void 0:t.DrmType)),e.forEach((e=>{e.drmKeyToken=this.privateDrmAuthToken}))}}catch(l){la.error("get privaterDrmToken fail")}}}))}getThumbnailConfig(e){const t=e[0],i=u({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=u({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},i)}getBarrageMaskUrl(e){var t,i;const n=null==(t=this.playerData.configs)?void 0:t.DanmuPlugin,r="object"==typeof n?n:{},o=u({},(null==r?void 0:r.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.maskActive=null==(i=r.maskActive)||i,this.playerData.options.DanmuPlugin.maskConfig=u({maskUrl:e},o)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:u({maskUrl:e},o)}}setSubtitleConfig(e){var t,i,n,r,o,s,a,l,h;if(!(null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.autoSubtitle)||!e)return;const d=this.getAutoSubtitleList(e),p=null==(n=this.playerData.options)?void 0:n.Subtitle,f=null==(r=this.playerData.configs)?void 0:r.Subtitle,g="object"==typeof p&&p?p:"object"==typeof f&&f?f:{};this.playerData.options.Subtitle=c(u({},g),{list:d}),null==(h=null==(l=null==(a=null==(s=null==(o=this.sdk)?void 0:o.player)?void 0:s.plugins)?void 0:a.subtitle)?void 0:l.updateSubtitles)||h.call(l,d)}getAutoSubtitleList(e){const t=this.getSubtitleSourceData(e),i=BU(t,["SubtitleInfoList","subtitleInfoList","subtitle_info_list"],[]);if(!Array.isArray(i))return[];const n=i.map(((e,t)=>this.getAutoSubtitleItem(e,t))).filter((e=>Boolean(e)));return n.some((e=>void 0!==e._subtitleOrder))&&n.sort(((e,t)=>{var i,n;return(null!=(i=e._subtitleOrder)?i:1/0)-(null!=(n=t._subtitleOrder)?n:1/0)})),n.forEach((e=>{delete e._subtitleOrder})),n}getSubtitleSourceData(e){const t=null==e?void 0:e.dashOpts;return(null==t?void 0:t.Data)||(null==t?void 0:t.data)||e}getAutoSubtitleItem(e,t){const i="string"==typeof e?this.getStringAutoSubtitleItem(e,t):this.getObjectAutoSubtitleItem(e,t);if(i)return this.formatAutoSubtitleItem(i,e,t)}getStringAutoSubtitleItem(e,t){const i=`${t+1}`;return u({id:`${t}`,language:`${t}`,label:i,text:i},!/\n/.test(n=e)&&(/^(https?:)?\/\//.test(n)||/^data:/.test(n)||/\.(vtt|srt)([?#].*)?$/i.test(n))?{url:e}:{stringContent:e});var n}getObjectAutoSubtitleItem(e,t){if(!e||"object"!=typeof e)return;const i=BU(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),n=BU(e,["StringContent","stringContent","string_content"],"",!0),r=BU(e,["List","list"]);if(!i&&!n&&!r)return;const o=function(e,t){const i="string"==typeof e?parseInt(e,10):e;if("number"==typeof i&&!isNaN(i)){const e=RU.get(i);if(e)return e}if(t){const e=xU.get(t.toLowerCase());if(e)return e}}(BU(e,["LanguageId","languageId","language_id"],void 0,!0),BU(e,["Language","language"],"",!0)),s=o||HU(BU(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),a=HU(BU(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),l=HU(BU(e,["Language","language","LanguageId","languageId","language_id","srclang"],`${t}`,!0),`${t}`);return u(u(u(c(u({},e),{id:a,language:l,label:s,text:s}),i?{url:i}:{}),n?{stringContent:n}:{}),r?{list:r}:{})}formatAutoSubtitleItem(e,t,i){var n,r;const o=null==(r=null==(n=this.playerData)?void 0:n.configs)?void 0:r.formatAutoSubtitleItem;if("function"!=typeof o)return e;const s=o(t,i);if(!1!==s&&null!==s){if(!0===s||void 0===s)return e;if("string"==typeof s||"number"==typeof s){const t=`${s}`;return c(u({},e),{label:t,text:t})}if("object"==typeof s){if(!1===s.show||!1===s.visible)return;const t=Object.prototype.hasOwnProperty.call(s,"order"),i=Object.prototype.hasOwnProperty.call(s,"label")||Object.prototype.hasOwnProperty.call(s,"text")?(()=>{var t;const i=HU(null!=(t=s.label)?t:s.text,"");return c(u({},e),{label:i,text:i})})():e;t&&(i._subtitleOrder=s.order);const n=Object.prototype.hasOwnProperty.call(s,"isDefault"),r=Object.prototype.hasOwnProperty.call(s,"default");return(n||r)&&(i.isDefault=n?Boolean(s.isDefault):Boolean(s.default)),i}return e}}getDrmConfig(e){var t,i,n,r,o,s,a,l;const{thirdPartyDrmAuthToken:c,serverCertificatePath:h}=this.config;if(c)try{const{vid:c,playList:d}=e,{kid:p,codec:f}=null==d?void 0:d[0];if(!p||!c)return void la.warn("get kid or vid fail");const g=null==(t=this.playerData.configs)?void 0:t.drm,y="object"==typeof g?g:{},{playDomain:v}=this.config,m=v||this.playerData.playDomain,_=function(e,t="GetPlayInfoToken"){const i=_a(window.atob(e));return i?i[t]:""}(this.config.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken"),E=u({ignoreLicenseHeader:!1,unRecord:null!=(i=this.config.unRecord)&&i,contentType:ir[f],initDataType:"cenc",[Js.FAIRPLAY]:{serverProcessSPCPath:Aa(Js.FAIRPLAY,p,m,_),serverCertificatePath:h},[Js.WIDEVINE]:{serverProcessSPCPath:Aa(Js.WIDEVINE,p,m,_)},[Js.PLAYREADY]:{serverProcessSPCPath:Aa(Js.PLAYREADY,p,m,_)}},y);(null==(o=null==(r=null==(n=this.sdk)?void 0:n.player)?void 0:r.plugins)?void 0:o.drm)&&(null==(l=null==(a=null==(s=this.sdk)?void 0:s.player)?void 0:a.plugins)||l.drm.updateConfig(E)),this.playerData.options.drm=E}catch(d){la.error("generate drm config error:",d)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=EH.ttDramaEnv;return!!(null==e?void 0:e.getDramaInfo)}init(){const e=this.playerData.configs,{getVideoByToken:t={}}=e;this.initConfig(t)}initConfig(e,t){var i;const n=t||(null==(i=this.playerData)?void 0:i.configs)||{},{albumId:r,episodeId:o}=NU(n),s=!(!r||!o),a=!!EH.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||a&&s,this.isPlayByToken&&(this.config=Object.assign({},UU,e),Object.prototype.hasOwnProperty.call(n,"definitionMap")&&(this.config.definitionMap=n.definitionMap),e.playAuthToken)){if(this.tokenInfo=Ea(e.playAuthToken),e.keyToken){const t=(l=e.keyToken,/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(l)?window.atob(e.keyToken):e.keyToken);this.keyTokenInfo=Ta(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=Ea(e.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken")),e.retryCount&&(this.retryCount=e.retryCount)}var l}updateDramaEpisode(e,t){return d(this,null,(function*(){var i,n,r;const o=t||(null==(i=this.playerData)?void 0:i.configs)||{},s=o.getVideoByToken||{},a={config:this.config,isPlayByToken:this.isPlayByToken,tokenInfo:this.tokenInfo,keyTokenInfo:this.keyTokenInfo,thirdPartyDrmAuthTokenInfo:this.thirdPartyDrmAuthTokenInfo,retryCount:this.retryCount};this.initConfig(s,o);const l=yield this.getVideoInfo(o);if(!l)throw this.config=a.config,this.isPlayByToken=a.isPlayByToken,this.tokenInfo=a.tokenInfo,this.keyTokenInfo=a.keyTokenInfo,this.thirdPartyDrmAuthTokenInfo=a.thirdPartyDrmAuthTokenInfo,this.retryCount=a.retryCount,new Error("Failed to get drama media info");if(t&&(this.playerData.configs=t),e)this.playerData.initPlayData(l);else{const e=this.playerData.current.definition,t=(null==(n=l.playList)?void 0:n.find((t=>{var i,n;const r=t.mapDefinition||t.definition||t.Definition;return(null==(i=null==r?void 0:r.toLocaleLowerCase)?void 0:i.call(r))===(null==(n=null==e?void 0:e.toLocaleLowerCase)?void 0:n.call(e))})))||(null==(r=l.playList)?void 0:r[0]),i=(null==t?void 0:t.mapDefinition)||(null==t?void 0:t.definition)||(null==t?void 0:t.Definition);this.playerData.updateConfigs(c(u({},l),{defaultDefinition:i})),this.playerData.updatePlayList(),t&&this.playerData.initCurrent(t),this.playerData.updateCheckExpireData()}}))}updateAuthToken(e,t){return d(this,null,(function*(){const i=Object.assign({},this.config,e);this.initConfig(i);const n=yield this.getVideoInfo();n&&(t?this.playerData.initPlayData(n):(this.playerData.updateConfigs(c(u({},n),{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()))}))}checkPlayAuthTokenValid(){var e,t;if(!this.tokenInfo)return!1;if(ba(this.tokenInfo)){la.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:jD.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:MU(DL.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{playAuthToken:this.config.playAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkKeyTokenValid(){var e,t;if(ba(this.keyTokenInfo)){la.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:jD.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:MU(DL.HLS_KEY_TOKEN_EXPIRED),errorMessage:"keyToken for hls encrypt play has expired",ext:{keyToken:this.config.keyToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkDrmAuthTokenValid(){var e,t;if(ba(this.thirdPartyDrmAuthTokenInfo)){la.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:jD.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:MU(DL.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED),ext:{thirdPartyDrmAuthToken:this.config.thirdPartyDrmAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}}class jU extends mM{static get pluginName(){return"Abr"}constructor(e){super(e)}static get defaultConfig(){return{autoDefiText:"",isOpenAutoDefi:!1,interval:1e3,hurryThreshold:.25,lowThreshold:.4,highThreshold:.7,noStallCheckTime:5,isOpenHint:!1,method:31}}beforePlayerCreate(){return d(this,null,(function*(){if(this.playerData.isOpenVePlayerABR())return yield this.prepareAbrModule()}))}prepareAbrModule(){return d(this,null,(function*(){var e,t;return null==(t=null==(e=this.sdk.playerData)?void 0:e.adapter)?void 0:t.prepareAbrModule(this.playerData,this.sdk.sdkUmdLoader)}))}adaptAbrOptions(){var e;const t=null==(e=this.playerData.configs)?void 0:e.autoBitrateOpts;if(t){const e=this.playerData.defaultDefinition;return c(u(u({},jU.defaultConfig),t),{autoDefiText:t.autoDefinitionText||"",isOpenAutoDefi:this.playerData.isOpenABR(),isPlayAutoDefi:this.playerData.isPlayAutoDefinition(e)})}}applyAbrConfig(e){var t,i;const n=this.adaptAbrOptions();n&&(null==(i=null==(t=this.sdk.playerData)?void 0:t.adapter)||i.applyAbrPluginConfig(e,n))}}class VU extends mM{static get pluginName(){return"AdaptRange"}constructor(e){super(e)}adaptRangeOptions(){var e,t,i,n,r,o,s,a;const l=null!=(t=null==(e=this.playerData.configs)?void 0:e.adaptRange)?t:void 0;if(!(null==l?void 0:l.enable)||!(null==(n=null==(i=this.playerData.adapter)?void 0:i.canAdaptRangeEnable)?void 0:n.call(i)))return;const h=this.playerData.adapter.adaptRangeDefaultOptions();return c(u(u({},null!=h?h:{}),l),{minTargetCacheDur:null!=(r=l.minCacheDuration)?r:null==h?void 0:h.minTargetCacheDur,maxTargetCacheDur:null!=(o=l.maxCacheDuration)?o:null==h?void 0:h.maxTargetCacheDur,rangeMinDuration:null!=(s=l.minRangeDuration)?s:null==h?void 0:h.rangeMinDuration,rangeMaxDuration:null!=(a=l.maxRangeDuration)?a:null==h?void 0:h.rangeMaxDuration})}applyRangeConfig(e){const t=this.adaptRangeOptions();t&&e&&this.playerData.adapter.applyAdaptRangePluginConfig(e,t)}}class KU extends mM{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,n,r;if(vD.isReady()){const o=this.playerData.configs.duration||(null==(i=null==(t=this.playerData.playList)?void 0:t[0])?void 0:i.duration)||-1,s=o>0&&o<=180?"svideo":o>180&&o<=1800?"mvideo":"lvideo",a={vtype:null==(n=this.playerData.adapter)?void 0:n.streamType,duration:o,videoLabel:s},l=vD.getStrategyRecommendations(void 0,a),{result:u}=l;la.log("VodLogCommon Final StrategyConfig:",u);const c=null==u?void 0:u[dD.ADAPT_RANGE];(null==c?void 0:c.enable)&&(null==c?void 0:c.options)&&(null==(r=this.playerData.adapter)||r.applyAdaptRangeStrategy(e,c.options))}}}const GU={init(e){var t;if(!e)return;const i=e.playerData.sdkPlugins;(null==(t=e.playerData)?void 0:t.isLive)?e.sdkPlugins=[...i]:e.sdkPlugins=[FU,jU,VU,KU,...i],e._sdkPlugins={}},registerPlugin(e,t){if(!e||!t)return;let i=null,n=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),n.sdk=t;const r=n.pluginName||i.pluginName;if(!r)throw new Error("The property pluginName is necessary");const o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);const e=new i(n);return o[r.toLowerCase()]=e,o[r.toLowerCase()].func=i,e&&"function"==typeof e.afterCreate&&e.afterCreate(),e}catch(s){la.error(s)}},unRegister(e,t){if(e&&t){e=e.toLowerCase();try{const i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(i){la.error(i)}}},beforePlayerCreate(e){if(!e)return;e._sdkPlugins||this.init(e);const t=e._sdkPlugins,i=null==e?void 0:e._createPlayerPerf,n=[];for(const r of Object.keys(t))if(t[r]&&t[r].beforePlayerCreate)try{const e=()=>za(t[r].beforePlayerCreate());(null==i?void 0:i.measureAsync)?n.push(i.measureAsync(`beforePlayerCreate.${r}`,e)):n.push(e())}catch(pa){throw n.push(za(null)),pa}return new Promise(((e,t)=>{Promise.all([...n]).then((()=>{e(null)})).catch((i=>{la.error(i),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"!==(null==i?void 0:i.code)?e(null):t(i)}))}))},afterPlayerCreate(e){if(!e)return;const t=e._sdkPlugins;for(const i of Object.keys(t))if(t[i]&&t[i].beforePlayerCreate)try{t[i].afterPlayerCreate()}catch(pa){throw pa}},destroy(e){if(!e)return;const t=e._sdkPlugins;if(t){for(const i of Object.keys(t))this.unRegister(i,e);delete e._sdkPlugins}}},WU=GU,YU={[wL.NETWORK]:"Network error",[wL.NETWORK_TIMEOUT]:"Network timeout",[wL.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[wL.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[wL.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[wL.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[wL.NETWORK_URL_EXPIRE]:"The video URL has expired",[wL.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[wL.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[wL.MEDIA_ERR]:"Media error",[wL.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[wL.MEDIA_ERR_NETWORK]:"Network error",[wL.MEDIA_ERR_DECODE]:"Decoding error",[wL.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[wL.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[wL.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[wL.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[wL.MEDIA_ERR_PLAY_ERR]:"Video playback error",[wL.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[wL.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[wL.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[wL.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[wL.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[wL.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[wL.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[wL.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[wL.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[wL.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[wL.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[wL.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[wL.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[wL.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[wL.OTHER]:"Other error",[wL.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[wL.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[wL.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[wL.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[wL.GET_PLAY_INFO_ERR]:"Failed to get media information",[wL.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[wL.LICENSE_VALIDATE_FAIL]:"License validation failed",[wL.DEFINITION_AUTO]:"Auto",[wL.LICENSE_STATUS_INVALID]:"License validation is invalid",[wL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[wL.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[wL.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[wL.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[wL.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[wL.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[wL.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[wL.DRAMA_INVALID_PARAM]:"Invalid parameter",[wL.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[wL.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[wL.DRAMA_UNDER_REVIEW]:"Episode is under review",[wL.DRAMA_FAILED_REVIEW]:"Episode failed review",[wL.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[wL.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[wL.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[wL.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[wL.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},zU={[wL.NETWORK]:"网络错误",[wL.NETWORK_TIMEOUT]:"网络超时",[wL.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[wL.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[wL.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[wL.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[wL.NETWORK_URL_EXPIRE]:"视频地址已过期",[wL.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[wL.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[wL.MEDIA_ERR]:"播放错误",[wL.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[wL.MEDIA_ERR_NETWORK]:"网络错误",[wL.MEDIA_ERR_DECODE]:"解码错误",[wL.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[wL.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[wL.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[wL.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[wL.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[wL.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[wL.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[wL.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[wL.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[wL.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[wL.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[wL.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[wL.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[wL.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[wL.BUSINESS_DRM_KEY_ERROR]:"解密错误",[wL.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[wL.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[wL.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[wL.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[wL.OTHER]:"其他错误",[wL.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[wL.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[wL.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[wL.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[wL.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[wL.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[wL.LICENSE_VALIDATE_FAIL]:"license 校验失败",[wL.DEFINITION_AUTO]:"自动",[wL.LICENSE_STATUS_INVALID]:"license 校验无效",[wL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[wL.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[wL.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[wL.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[wL.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[wL.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[wL.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[wL.DRAMA_INVALID_PARAM]:"参数错误",[wL.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[wL.DRAMA_NOT_SUBMITTED]:"剧集未送审",[wL.DRAMA_UNDER_REVIEW]:"剧集审核中",[wL.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[wL.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[wL.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[wL.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[wL.DRAMA_NOT_ON_SHELF]:"视频未上架",[wL.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},$U={[wL.NETWORK]:"ネットワークエラー",[wL.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[wL.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[wL.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[wL.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[wL.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[wL.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[wL.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[wL.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[wL.MEDIA_ERR]:"再生エラー",[wL.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[wL.MEDIA_ERR_NETWORK]:"ネットワークエラー",[wL.MEDIA_ERR_DECODE]:"デコードエラー",[wL.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[wL.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[wL.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[wL.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[wL.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[wL.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[wL.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[wL.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[wL.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[wL.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[wL.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[wL.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[wL.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[wL.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[wL.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[wL.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[wL.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[wL.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[wL.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[wL.OTHER]:"その他のエラー",[wL.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[wL.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[wL.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[wL.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[wL.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[wL.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[wL.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[wL.DEFINITION_AUTO]:"自動",[wL.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[wL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[wL.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[wL.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[wL.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[wL.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[wL.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[wL.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[wL.DRAMA_INVALID_PARAM]:"パラメータが無効です",[wL.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[wL.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[wL.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[wL.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[wL.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[wL.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[wL.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[wL.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[wL.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},XU=[{LANG:"en",TEXT:YU},{LANG:"zh",TEXT:zU},{LANG:"zh-hk",TEXT:{[wL.NETWORK]:"網路錯誤",[wL.NETWORK_TIMEOUT]:"網路逾時",[wL.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[wL.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[wL.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[wL.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[wL.NETWORK_URL_EXPIRE]:"視頻地址已過期",[wL.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[wL.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[wL.MEDIA_ERR]:"播放錯誤",[wL.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[wL.MEDIA_ERR_NETWORK]:"網路錯誤",[wL.MEDIA_ERR_DECODE]:"解碼錯誤",[wL.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[wL.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[wL.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[wL.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[wL.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[wL.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[wL.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[wL.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[wL.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[wL.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[wL.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[wL.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[wL.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[wL.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[wL.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[wL.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[wL.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[wL.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[wL.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[wL.OTHER]:"其他錯誤",[wL.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[wL.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[wL.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[wL.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[wL.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[wL.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[wL.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[wL.DEFINITION_AUTO]:"自動",[wL.LICENSE_STATUS_INVALID]:"license 校驗無效",[wL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[wL.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[wL.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[wL.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[wL.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[wL.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[wL.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[wL.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[wL.DRAMA_INVALID_PARAM]:"參數錯誤",[wL.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[wL.DRAMA_NOT_SUBMITTED]:"劇集未送審",[wL.DRAMA_UNDER_REVIEW]:"劇集審核中",[wL.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[wL.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[wL.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[wL.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[wL.DRAMA_NOT_ON_SHELF]:"影片未上架",[wL.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"}},{LANG:"jp",TEXT:$U}],qU="ignoreServicePreloadConfigEnable";class QU extends Error{constructor(e,t){super(t),this.code=e}}const ZU=new Map;function JU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eB(e){return!!(e&&dU(e)&&pU(e))}function tB(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function iB(e,t){return e instanceof QU?e:new QU(t.code,t.message)}function nB(e,t,i){const n=`${t.cacheOptions.moduleName}:${t.cacheOptions.cacheKey}`,r=ZU.get(n);if(r)return r;const o="ttDrama"===t.kind?function(e,t){const i=dU(t),n=pU(t);if(!(null==e?void 0:e.getDramaInfo)||!i||!n){const e=xL.INVALID_PARAM;return Promise.reject(new QU(e.code,e.message))}const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return oU(e)&&JU(t,"transcodeParam")&&(r.transcodeParam=nU(t.transcodeParam)||{}),new Promise(((i,n)=>{try{e.getDramaInfo((r=>{var o,s,a,l;try{if(!(null==r?void 0:r.is_success)){const e=aU(null==(o=null==r?void 0:r.error)?void 0:o.error_msg,void 0),t=xL[e];return void n(new QU(t.code,t.message))}if((null==(s=r.data)?void 0:s.status)!==OL.SUCCESS){const e=sU(null==(a=r.data)?void 0:a.status),t=xL[e];return void n(new QU(t.code,t.message))}if(!(null==(l=r.data)?void 0:l.video_info)){const e=xL.FAILED_TO_QUERY;return void n(new QU(e.code,e.message))}const u=SU(r.data.video_info,TU(t,e));if(!RM(u)){const e=xL.FAILED_TO_QUERY;return void n(new QU(e.code,e.message))}i(u)}catch(fF){n(iB(fF,xL.FAILED_GET_EPISODE_INFO))}}),r)}catch(fF){n(iB(fF,xL.FAILED_GET_EPISODE_INFO))}}))}(i,e):function(e,t){return d(this,null,(function*(){const i=TU(e,t);try{const e=Ea(i.playAuthToken);if(ba(e)){const e=DL.PLAY_AUTH_TOKEN_EXPIRED;throw new QU(e.code,e.message)}const t=yield Ca(i);if(!RM(t))throw new QU(DL.GET_PLAY_INFO_ERR.code,DL.GET_PLAY_INFO_ERR.message);return t}catch(fF){throw iB(fF,DL.GET_PLAY_INFO_ERR)}}))}(e,i);ZU.set(n,o);const s=()=>{ZU.get(n)===o&&ZU.delete(n)};return o.then(s,s),o}function rB(e,t){return d(this,null,(function*(){try{const i=function(e,t){if(eB(e)&&!0===(null==t?void 0:t.canIUseGetDramaInfo)){const i=fU(e,t);return{kind:"ttDrama",cacheOptions:{moduleName:SM,cacheKey:gU(i),cacheKeyInfo:yU(i)}}}if(tB(e)){const t=EU(e);return{kind:"playAuthToken",cacheOptions:{moduleName:TM,cacheKey:OM(t),cacheKeyInfo:NM(t)}}}if(eB(e)){const e=xL.INVALID_PARAM;throw new QU(e.code,e.message)}throw new QU(8e3,"Unsupported media info source")}(e,t),n=function(e,t,i){const n=zM(t.cacheOptions);return n||("ttDrama"===t.kind?vU(fU(e,i)):_U(e))}(e,i,t);if(n)return{status:"fulfilled",source:e,data:n,fromCache:!0};const r=yield nB(e,i,t);return $M(i.cacheOptions,r),{status:"fulfilled",source:e,data:r,fromCache:!1}}catch(fF){const i=iB(fF,DL.OTHER);return{status:"rejected",source:e,error:{code:i.code,message:i.message}}}}))}function oB(e,t){const i=TU(e,t);return i.playAuthToken?Ca(i).catch((()=>{})):Promise.resolve(void 0)}function sB(e,t){return d(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return aB(e,t);const i=function(e,t){const i=vU(fU(e,t));return i?kU(i,e):void 0}(e,t);if(i)return wU(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return aB(e,t);const n=yield function(e,t){const i=dU(t),n=pU(t);if(!i||!n)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return oB(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return oU(e)&&JU(t,"transcodeParam")&&(r.transcodeParam=nU(t.transcodeParam)||{}),new Promise((i=>{try{e.getDramaInfo((n=>{try{if(!(null==n?void 0:n.is_success))return la.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const{data:r}=n;if((null==r?void 0:r.status)!==OL.SUCCESS||!(null==r?void 0:r.video_info))return la.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const o=SU(r.video_info,TU(t,e));i(o)}catch(pa){la.error("[ttdrama] getDramaInfo invalid response",n),i(void 0)}}),r)}catch(n){la.error("[ttdrama] getDramaInfo call failed",n),i(void 0)}}))}(t,e);return n?(mU(fU(e,t),n),wU(kU(n,e))):void 0}))}function aB(e,t){return d(this,null,(function*(){const i=function(e){const t=_U(e);return t?kU(t,e):void 0}(e);if(i)return wU(i);const n=yield oB(e,t);var r;return n?(r=n,eU(EU(e),r),wU(kU(n,e))):void 0}))}function lB(e,t){return d(this,null,(function*(){if(bU(e.url))return e;if(eB(e)){const i=yield sB(e,t);return i||t||tB(e)?i:e}return tB(e)?aB(e,t):e}))}function uB(e,t){return d(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(Gr.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const n of e)i.push(yield lB(n,t))}else i=yield Promise.all(e.map((e=>lB(e,t))));return i.filter(Boolean)}))}const cB=["live","rtm","music","danmu","ad"],hB=["configs","options","defaultConfig","current"],dB=["url","src","playUrl","playURL"],pB=["plugins","sdkPlugins","strategiesPlugins","presets"];class fB extends Error{constructor(e){var t;super(`[VEPLAYER_LITE_UNSUPPORTED_FEATURE] ${e} 功能不受精简版支持,请改用 ${function(e){const t=(e||"").toUpperCase();return t.includes("BYTEPLUS")?"@byteplus/veplayer":t.includes("VOLCENGINE")?"@volcengine/veplayer":"@byted-vcloud/veplayer"}("undefined"==typeof process||null==(t=process.env)?void 0:t.LUX_REGION)}。`),this.code="VEPLAYER_LITE_UNSUPPORTED_FEATURE",this.name="VePlayerLiteUnsupportedFeatureError",this.feature=e,Object.setPrototypeOf(this,fB.prototype)}}class gB extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,gB.prototype)}}function yB(e){return"object"==typeof e&&null!==e||"function"==typeof e}function vB(e,t){if(yB(e))try{return e[t]}catch(pa){return}}function mB(e){try{return Array.isArray(e)}catch(pa){return!1}}function _B(e){if(!mB(e))return[];const t=vB(e,"length");if("number"!=typeof t||t<0||t>4294967295||Math.floor(t)!==t)return[];const i=[];for(let n=0;n<t;n+=1)i.push(vB(e,String(n)));return i}function EB(e){return null!=e&&!1!==e}function TB(e){return"string"==typeof e?e.toLowerCase():""}function SB(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function bB(e){return dB.some((t=>function(e){const t=[e],i=new WeakSet;for(let n=0;n<t.length;n+=1){const e=t[n];if(SB(e))return!0;if(yB(e)&&!i.has(e))if(i.add(e),mB(e))for(const i of _B(e))t.push(i);else for(const i of dB)t.push(vB(e,i))}return!1}(vB(e,t))))}function kB(e){if("string"==typeof e)return[e];if(!yB(e))return[];const t=[],i=vB(e,"pluginName"),n=vB(e,"name");return"string"==typeof i&&t.push(i),"string"==typeof n&&t.push(n),t}function CB(e,t){return pB.some((i=>_B(vB(e,i)).some((e=>function(e){const t=kB(e);return t.push(...kB(vB(e,"plugin"))),t.push(...kB(vB(e,"preset"))),t}(e).some((e=>function(e,t){const{compact:i,parts:n}=function(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[\s_]+/g,"-").replace(/-+/g,"-");return{compact:t.replace(/-/g,""),parts:t.split("-")}}(t);switch(e){case"live":return"timeshiftplugin"===i||"liveinfopanel"===i||i.startsWith("livesubtitles");case"rtm":return"rtm"===i||"rtmplugin"===i;case"music":return i.includes("music");case"danmu":return i.includes("danmu");case"ad":return n.some((e=>"ad"===e||"ads"===e))||["ad","ads","adplugin","adsplugin"].includes(i)}}(t,e)))))))}function IB(e,t){switch(t){case"live":return!0===vB(e,"isLive")||"live"===TB(vB(e,"type"))||EB(vB(e,"TimeShiftPlugin"))||EB(vB(e,"LiveInfoPanel"))||EB(vB(e,"LiveSubtitlesPlugin"))||EB(vB(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===TB(vB(e,"streamType"))||EB(vB(e,"rtm"))||bB(e);case"music":return!0===vB(e,"isMusic")||EB(vB(e,"music"));case"danmu":{const t=vB(e,"getVideoByToken");return EB(vB(e,"DanmuPlugin"))||!0===vB(e,"needBarrageMask")||!0===vB(t,"needBarrageMask")}case"ad":return EB(vB(e,"AdsPlugin"))||EB(vB(e,"AdPlugin"))}}function AB(e){const t=function(e){const t=[],i=[e],n=new WeakSet;for(let r=0;r<i.length;r+=1){const e=i[r];if(yB(e)&&!n.has(e)){n.add(e),t.push(e);for(const t of hB)i.push(vB(e,t));for(const t of _B(vB(e,"playList")))i.push(t)}}return t}(e);for(const i of cB)if(t.some((e=>IB(e,i)||CB(e,i))))throw new fB(i)}const PB=()=>Br.generateSessionId(),wB=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0?e:0,DB=e=>u({},e),LB=(e,t)=>t.lastEnteredPlayingAt-e.lastEnteredPlayingAt||t.sequence-e.sequence,RB=(e,t)=>t.lastPlaybackAt-e.lastPlaybackAt||t.sequence-e.sequence,xB=(e,t)=>t.createdAt-e.createdAt||t.sequence-e.sequence,OB=(e,t,i="creating")=>({playbackSessionId:t,playbackState:i,isEnded:!1,isPaused:!1,isBeforePlayerCreate:!0,albumId:e.albumId,episodeId:e.episodeId,duration:0,currentTime:0});const NB=new class{constructor(e=Date.now,t=PB){this.now=e,this.createPlaybackSessionId=t,this.sessions=new Map,this.transactionResolvers=new WeakMap,this.historical=null,this.sequence=0}register(e,t){const i=this.now(),n=++this.sequence,r=this.createPlaybackSessionId();this.sessions.set(e,{vePlayer:e,playbackSessionId:r,pendingPlaybackSessionId:null,identity:u({},t),pendingIdentity:null,identitySwitchCore:null,pendingTransaction:null,identitySwitchArmed:!1,identitySwitchIsSameCore:!1,useStableSnapshot:!1,core:null,state:"creating",creationFailed:!1,hasEverPlayed:!1,isBuffering:!1,createdAt:i,lastEnteredPlayingAt:0,lastPlaybackAt:0,sequence:n,lastStableSnapshot:OB(t,r)})}has(e){return this.sessions.has(e)}getPlaybackSessionId(e){var t,i;return null!=(i=null==(t=this.sessions.get(e))?void 0:t.playbackSessionId)?i:null}beginCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="creating",i.creationFailed=!1,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&(i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1)))}failCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="error",i.creationFailed=!0,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&this.rollbackIdentitySwitch(e,t)))}attachCore(e,t,i){var n;const r=this.sessions.get(e);if(r&&(this.matchesPendingTransaction(r,i)||!r.pendingTransaction)){r.core=t,r.state="ready",r.creationFailed=!1,r.isBuffering=!1,this.matchesPendingTransaction(r,i)&&(r.identitySwitchCore=t,r.identitySwitchArmed=!0,r.identitySwitchIsSameCore=!1);for(const i of["play","playing","waiting","canplay","timeupdate","pause","ended","error"])null==(n=t.on)||n.call(t,i,(()=>this.handleCoreEvent(e,t,i)))}}handleCoreEvent(e,t,i){const n=this.sessions.get(e);if(n&&n.core===t&&("error"!==i&&"canplay"!==i||!n.pendingTransaction||n.identitySwitchArmed||n.identitySwitchCore!==t)){if("play"===i||"playing"===i){const e="playing"!==n.state,t=this.now();return n.hasEverPlayed=!0,n.isBuffering=!1,n.state="playing",n.lastPlaybackAt=t,void(e&&(n.lastEnteredPlayingAt=t))}if("waiting"!==i){if(n.isBuffering=!1,"canplay"===i)return n.pendingTransaction?n.identitySwitchArmed&&n.identitySwitchCore===t&&this.commitIdentitySwitch(e,n.pendingTransaction):(n.useStableSnapshot=!1,n.lastStableSnapshot=null),void(n.hasEverPlayed||(n.state="ready"));if("timeupdate"!==i)if("pause"!==i){if("ended"===i)return n.hasEverPlayed=!0,n.lastPlaybackAt=this.now(),void(n.state="ended");n.state="error",n.pendingTransaction&&n.identitySwitchArmed&&n.identitySwitchCore===t&&this.rollbackIdentitySwitch(e,n.pendingTransaction)}else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state="paused");else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state=t.paused?"paused":"playing")}else n.hasEverPlayed&&(n.isBuffering=!0,n.state="buffering")}}beginIdentitySwitch(e,t,i,n=!1,r){const o=this.sessions.get(e);if(!o)return null;if(!!o.pendingIdentity||!!o.pendingPlaybackSessionId){if(!this.matchesPendingTransaction(o,r))return null}else o.lastStableSnapshot=this.snapshotSession(o,null!=i?i:o.core).snapshot,o.identitySwitchCore=null!=i?i:o.core,o.identitySwitchArmed=!1,o.identitySwitchIsSameCore=!0,o.pendingTransaction=this.createIdentitySwitchTransaction();return o.pendingIdentity=u({},t),n&&!o.pendingPlaybackSessionId&&(o.pendingPlaybackSessionId=this.createPlaybackSessionId()),o.useStableSnapshot=!0,o.pendingTransaction}armIdentitySwitch(e,t,i){const n=this.sessions.get(e);return!(!n||n.core!==i||!this.matchesPendingTransaction(n,t))&&(n.identitySwitchCore=i,n.identitySwitchArmed=!0,n.identitySwitchIsSameCore=!0,!0)}hasActiveIdentitySwitch(e){var t;return!!(null==(t=this.sessions.get(e))?void 0:t.pendingTransaction)}commitIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!i.pendingIdentity&&!i.pendingPlaybackSessionId||!this.matchesPendingTransaction(i,t))return;i.pendingIdentity&&(i.identity=i.pendingIdentity),i.pendingPlaybackSessionId&&(i.playbackSessionId=i.pendingPlaybackSessionId),i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const n=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!1,i.lastStableSnapshot=null,this.settleTransaction(n)}rollbackIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!this.matchesPendingTransaction(i,t))return;const n=!i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore,r=i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore;i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const o=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!r&&!!i.lastStableSnapshot,r&&(i.lastStableSnapshot=null),n&&(i.core=null),this.settleTransaction(o)}destroy(e,t){const i=this.sessions.get(e);if(!i)return;const n=i.useStableSnapshot&&i.lastStableSnapshot?this.rank(i,DB(i.lastStableSnapshot)):this.snapshotSession(i,null!=t?t:i.core);n.snapshot=c(u({},n.snapshot),{playbackState:"destroyed",isBeforePlayerCreate:!1}),n.state="destroyed",this.settleTransaction(i.pendingTransaction),this.sessions.delete(e),n.hasEverPlayed&&(!this.historical||RB(n,this.historical)<0)&&(this.historical=n)}query(e){const t=[];for(const o of this.sessions.values()){if((o.pendingIdentity||o.pendingPlaybackSessionId||o.useStableSnapshot)&&o.lastStableSnapshot){t.push(this.rank(o,DB(o.lastStableSnapshot)));continue}const i=e.find((e=>e===o.core&&e.sdk===o.vePlayer));try{const e=this.snapshotSession(o,null!=i?i:null);o.lastStableSnapshot=DB(e.snapshot),t.push(e)}catch(pa){o.lastStableSnapshot&&t.push(this.rank(o,DB(o.lastStableSnapshot)))}}const i=t.filter((e=>"playing"===e.state||"buffering"===e.state)).sort(LB)[0];if(i)return DB(i.snapshot);const n=t.filter((e=>e.hasEverPlayed)).concat(this.historical?[this.historical]:[]).sort(RB)[0];if(n)return DB(n.snapshot);const r=t.sort(xB)[0];return r?DB(r.snapshot):null}resetForTests(){this.sessions.clear(),this.historical=null,this.sequence=0}createIdentitySwitchTransaction(){let e;const t={settled:new Promise((t=>{e=t}))};return this.transactionResolvers.set(t,e),t}settleTransaction(e){if(!e)return;const t=this.transactionResolvers.get(e);t&&(this.transactionResolvers.delete(e),t())}matchesPendingTransaction(e,t){return!!t&&e.pendingTransaction===t}snapshotSession(e,t){if(!t){const t=e.creationFailed?"error":"creating";return this.rank(e,OB(e.identity,e.playbackSessionId,t))}const i=!!t.paused,n=!!t.ended;let r;return r=t.isError||"error"===e.state?"error":n||"ended"===e.state?"ended":e.hasEverPlayed&&i?"paused":e.hasEverPlayed&&e.isBuffering?"buffering":e.hasEverPlayed?"playing":"ready",this.rank(e,{playbackSessionId:e.playbackSessionId,playbackState:r,isEnded:n,isPaused:i,isBeforePlayerCreate:!1,albumId:e.identity.albumId,episodeId:e.identity.episodeId,duration:wB(t.duration),currentTime:wB(t.currentTime)})}rank(e,t){return{snapshot:t,state:t.playbackState,hasEverPlayed:e.hasEverPlayed,createdAt:e.createdAt,lastEnteredPlayingAt:e.lastEnteredPlayingAt,lastPlaybackAt:e.lastPlaybackAt,sequence:e.sequence}}},MB=e=>{if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e||""===e.trim())return;const t=Number(e);return Number.isFinite(t)?t:void 0},UB=e=>"string"==typeof e&&e.trim()?e.trim().toLowerCase():void 0,BB=(...e)=>e.find((e=>null!=e)),HB=e=>({index:e.index,stableId:UB(e.stableId),bitrate:MB(e.bitrate),width:MB(e.width),height:MB(e.height),videoCodec:UB(e.videoCodec),videoRange:UB(e.videoRange),frameRate:MB(e.frameRate)});function FB(e,t){const i=(e=>({stableId:UB(e.stableId),bitrate:MB(BB(e.bitrate,e.Bitrate,e.bandwidth,e.Bandwidth)),width:MB(BB(e.width,e.Width)),height:MB(BB(e.height,e.Height)),videoCodec:UB(BB(e.videoCodec,e.codec,e.Codec)),videoRange:UB(BB(e.videoRange,e.VideoRange)),frameRate:MB(BB(e.frameRate,e.FrameRate))}))(e),n=t.map(HB);if(i.stableId){const e=n.filter((e=>e.stableId===i.stableId));if(1===e.length)return{matched:!0,levelIndex:e[0].index,strategy:"stable-id"};if(e.length>1)return{matched:!1,reason:"AMBIGUOUS_ATTRIBUTES"}}if(void 0===i.bitrate)return{matched:!1,reason:"NO_MATCH"};const r=["width","height","videoCodec","videoRange","frameRate"].filter((e=>void 0!==i[e]));if(r.length>0){const e=n.filter((e=>e.bitrate===i.bitrate&&r.every((t=>e[t]===i[t]))));return 1===e.length?{matched:!0,levelIndex:e[0].index,strategy:"attributes"}:e.length>1?{matched:!1,reason:"AMBIGUOUS_ATTRIBUTES"}:{matched:!1,reason:"NO_MATCH"}}const o=n.filter((e=>e.bitrate===i.bitrate));return 1===o.length?{matched:!0,levelIndex:o[0].index,strategy:"unique-bitrate"}:o.length>1?{matched:!1,reason:"AMBIGUOUS_BITRATE"}:{matched:!1,reason:"NO_MATCH"}}const jB="hlsManifestLoading",VB="hlsManifestParsed",KB="hlsLevelsUpdated",GB="hlsLevelSwitching",WB="hlsLevelSwitched",YB=e=>({playbackSessionId:e,ready:!1,levels:[],currentLevel:-1,loadLevel:-1,nextLevel:-1,manualLevel:-1,autoLevelEnabled:!1,autoLevelCapping:-1}),zB=e=>({playbackSessionId:e,playbackEngine:"none",configuredEngine:null,engine:"none",decisionSource:"none",available:!1,active:!1,mode:"auto",reason:"NOT_HLS",capabilities:{levelList:!1,manualLevelSwitch:!1,restoreAuto:!1,levelCap:!1,bitrateCap:!1,definitionCap:!1}}),$B=e=>c(u({},e),{capabilities:u({},e.capabilities)}),XB=e=>JSON.stringify({playbackSessionId:e.playbackSessionId,playbackEngine:e.playbackEngine,configuredEngine:e.configuredEngine,engine:e.engine,decisionSource:e.decisionSource,available:e.available,active:e.active,mode:e.mode,reason:e.reason,capabilities:e.capabilities}),qB=e=>"number"==typeof e&&Number.isFinite(e)?e:void 0,QB=e=>e.map((e=>u({},e))),ZB=(e,t)=>{const i=null!=t?t:e;return i&&"object"==typeof i?i:{}},JB=e=>{var t;return null!=(t=qB(e))?t:-1},eH=e=>e?u({},e):null,tH=e=>"string"==typeof e.definition&&e.definition.trim()?e.definition.trim():void 0,iH=e=>{var t;return null!=(t=qB(e.bitrate))?t:qB(e.Bitrate)};class nH{constructor(e){this.options=e,this.runtime=null,this.hls=null,this.lastConfirmedLevel=-1,this.pendingManualLevel=null,this.suppressInternalSwitchingLevel=null,this.destroyed=!1,this.resolvedAbrSessionId="",this.lastEmittedAbrStateSignature="",this.abrLimit=null,this.onManifestLoading=()=>{this.ensureCurrentRuntime()&&(this.clearRuntimeAbrLimit(this.runtime),this.resetState(this.currentPlaybackSessionId()),this.emitLevelsUpdated())},this.onLevelsAvailable=(e,t)=>{var i;if(!this.ensureCurrentRuntime())return;const n=ZB(e,t),r=Array.isArray(n.levels)?n.levels:null==(i=this.hls)?void 0:i.levels;this.updateLevels(null!=r?r:[]),this.emitLevelsUpdated(),this.refreshAbrState(!0)},this.onLevelSwitching=(e,t)=>{if(!this.ensureCurrentRuntime())return;const i=JB(ZB(e,t).level);i<0||i===this.suppressInternalSwitchingLevel||i===this.pendingManualLevel||this.emitLevelEvent(jD.HLS_LEVEL_SWITCHING,{playbackSessionId:this.currentPlaybackSessionId(),from:this.lastConfirmedLevel,to:i,reason:"abr",abrEngine:this.resolveAbrEngine(this.runtime),level:this.cloneLevel(i)})},this.onLevelSwitched=(e,t)=>{if(!this.ensureCurrentRuntime())return;const i=JB(ZB(e,t).level);if(i<0)return;const n=this.lastConfirmedLevel,r=this.pendingManualLevel===i?"manual":"abr";this.lastConfirmedLevel=i,this.syncRuntimeState(),this.state.currentLevel=i,"manual"===r&&(this.pendingManualLevel=null),this.emitLevelEvent(jD.HLS_LEVEL_SWITCHED,{playbackSessionId:this.currentPlaybackSessionId(),from:n,to:i,reason:r,abrEngine:this.resolveAbrEngine(this.runtime),level:this.cloneLevel(i)})};const t=this.currentPlaybackSessionId();this.state=YB(t),this.abrState=zB(t),this.listeners=[[jB,this.onManifestLoading],[VB,this.onLevelsAvailable],[KB,this.onLevelsAvailable],[GB,this.onLevelSwitching],[WB,this.onLevelSwitched]],this.refreshRuntime()}refreshRuntime(){if(this.destroyed)return;const e=this.options.getRuntime(),t=this.currentPlaybackSessionId();if(e.hls!==this.hls)return this.clearRuntimeAbrLimit(this.runtime),this.unbindHls(),this.runtime=e,this.hls="hlsjs"===e.playbackEngine?e.hls:null,this.resetState(t),this.bindHls(),this.hydrateCurrentLevels(),void(this.hls||this.refreshAbrState(!0));this.runtime=e,t!==this.state.playbackSessionId&&(this.clearRuntimeAbrLimit(e),this.resetState(t),this.hydrateCurrentLevels(),this.hls||this.refreshAbrState(!0))}getLevels(){return this.refreshRuntime(),QB(this.state.levels)}getLevelState(){return this.refreshRuntime(),c(u({},this.state),{levels:QB(this.state.levels)})}getAbrState(){return this.refreshRuntime(),$B(this.abrState)}setAbrMode(e){if(this.refreshRuntime(),"auto"!==e&&"manual"!==e)throw new sr("HLS_ABR_UNAVAILABLE","The requested HLS ABR mode is invalid.");if(!this.abrState.available||"native"===this.abrState.engine)throw new sr("HLS_ABR_UNAVAILABLE","HLS ABR mode control is unavailable for this playback session.");if(this.abrState.mode!==e){if("manual"===e)return this.disableCurrentAbrOwner(),this.abrState=c(u({},this.abrState),{mode:"manual",active:!1}),void this.emitAbrStateChange();this.enableResolvedAbrOwner(),this.abrState=c(u({},this.abrState),{mode:"auto",active:!0}),this.emitAbrStateChange()}}getAbrLimit(){return eH(this.abrLimit)}setAbrLimit(e){if(this.refreshRuntime(),!this.abrState.available||"native"===this.abrState.engine)throw new sr("HLS_ABR_UNAVAILABLE","HLS ABR limits are unavailable for this playback session.");const t=eH(e);if("hlsjs"===this.abrState.engine)this.applyHlsJsAbrLimit(t);else{if("veplayer"!==this.abrState.engine)throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","The resolved HLS ABR engine does not support limits.");this.applyVePlayerAbrLimit(t)}this.abrLimit=t,this.abrState.playbackSessionId&&this.options.emit(jD.HLS_ABR_LIMIT_CHANGE,{playbackSessionId:this.abrState.playbackSessionId,engine:this.abrState.engine,limit:eH(this.abrLimit)})}setLevel(e,t={}){var i;this.refreshRuntime();const n=this.runtime,r=this.hls;if(this.destroyed||"hlsjs"!==(null==n?void 0:n.playbackEngine)||!r)throw new sr("HLS_ENGINE_UNSUPPORTED","HLS Level control requires the hls.js playback engine.");const o=this.currentPlaybackSessionId();if(t.playbackSessionId&&t.playbackSessionId!==o)throw new sr("HLS_PLAYBACK_SESSION_EXPIRED","The HLS playback session has expired.");if(!this.state.ready)throw new sr("HLS_MANIFEST_NOT_READY","The HLS Level list is not ready.");if(!Number.isInteger(e)||e<0||e>=this.state.levels.length)throw new sr("HLS_LEVEL_OUT_OF_RANGE","The HLS Level index is out of range.");this.abrState.active&&this.disableCurrentAbrOwner(),("manual"!==this.abrState.mode||this.abrState.active)&&(this.abrState=c(u({},this.abrState),{mode:"manual",active:!1}),this.emitAbrStateChange());const s=this.lastConfirmedLevel;switch(this.pendingManualLevel=e,this.suppressInternalSwitchingLevel=e,null!=(i=t.mode)?i:"next-fragment"){case"immediate":r.currentLevel=e;break;case"smooth":r.loadLevel=e,this.state.loadLevel=e;break;default:r.nextLevel=e,this.state.nextLevel=e}this.suppressInternalSwitchingLevel=null,this.state.manualLevel=e,this.state.autoLevelEnabled=!1,this.emitLevelEvent(jD.HLS_LEVEL_SWITCHING,{playbackSessionId:o,from:s,to:e,reason:"manual",abrEngine:this.resolveAbrEngine(n),level:this.cloneLevel(e)})}destroy(){this.destroyed||(this.destroyed=!0,this.unbindHls(),this.runtime=null,this.hls=null,this.resetState(""))}bindHls(){this.hls&&this.listeners.forEach((([e,t])=>{var i;return null==(i=this.hls)?void 0:i.on(e,t)}))}unbindHls(){this.hls&&this.listeners.forEach((([e,t])=>{var i;return null==(i=this.hls)?void 0:i.off(e,t)}))}ensureCurrentRuntime(){const e=this.hls;return this.refreshRuntime(),!!e&&e===this.hls}resetState(e){this.state=YB(e),this.abrState=zB(e),this.resolvedAbrSessionId="",this.lastEmittedAbrStateSignature="",this.abrLimit=null,this.lastConfirmedLevel=-1,this.pendingManualLevel=null,this.suppressInternalSwitchingLevel=null}syncRuntimeState(){this.hls&&(this.state.currentLevel=JB(this.hls.currentLevel),this.state.loadLevel=JB(this.hls.loadLevel),this.state.nextLevel=JB(this.hls.nextLevel),this.state.manualLevel=JB(this.hls.manualLevel),this.state.autoLevelEnabled=!!this.hls.autoLevelEnabled,this.state.autoLevelCapping=JB(this.hls.autoLevelCapping))}updateLevels(e){this.state.levels=e.map(((e,t)=>((e,t)=>{var i;const n={index:t,bitrate:null!=(i=qB(e.bitrate))?i:0};return["averageBitrate","width","height","frameRate"].forEach((t=>{const i=qB(e[t]);void 0!==i&&(n[t]=i)})),["videoCodec","audioCodec","videoRange","name"].forEach((t=>{const i=(e=>"string"==typeof e?e:void 0)(e[t]);void 0!==i&&(n[t]=i)})),n})(e,t))),this.state.ready=!0,this.syncRuntimeState(),this.lastConfirmedLevel=this.state.currentLevel}hydrateCurrentLevels(){var e,t;(null==(t=null==(e=this.hls)?void 0:e.levels)?void 0:t.length)&&(this.updateLevels(this.hls.levels),this.emitLevelsUpdated(),this.refreshAbrState(!0))}emitLevelsUpdated(){const e=this.currentPlaybackSessionId();e&&this.options.emit(jD.HLS_LEVELS_UPDATED,{playbackSessionId:e,levels:QB(this.state.levels),state:this.getLevelState()})}emitLevelEvent(e,t){t.playbackSessionId&&this.options.emit(e,t)}cloneLevel(e){const t=this.state.levels[e];return t?u({},t):void 0}applyHlsJsAbrLimit(e){if(!this.hls)throw new sr("HLS_ABR_UNAVAILABLE","hls.js is unavailable for this playback session.");if(null===e)return void(this.hls.autoLevelCapping=-1);if("definition"===e.type)throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","hls.js ABR does not support Definition limits.");if("level"===e.type){if(!Number.isInteger(e.maxLevel)||e.maxLevel<0||e.maxLevel>=this.state.levels.length)throw new sr("HLS_LEVEL_OUT_OF_RANGE","The HLS ABR Level cap is out of range.");return void(this.hls.autoLevelCapping=e.maxLevel)}if(!Number.isFinite(e.maxBitrate)||e.maxBitrate<0)throw new sr("HLS_LEVEL_OUT_OF_RANGE","The HLS ABR bitrate cap is out of range.");const t=this.state.levels.filter((t=>{var i;return(null!=(i=t.averageBitrate)?i:t.bitrate)<=e.maxBitrate}));if(0===t.length)throw new sr("HLS_LEVEL_OUT_OF_RANGE","No HLS Level is eligible for the requested bitrate cap.");this.hls.autoLevelCapping=t.reduce(((e,t)=>{var i,n;return(null!=(i=t.averageBitrate)?i:t.bitrate)>(null!=(n=e.averageBitrate)?n:e.bitrate)?t:e})).index}applyVePlayerAbrLimit(e){var t,i,n,r,o;const s=null==(t=this.runtime)?void 0:t.abrBridge;if(!s)throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","The VePlayer ABR limit bridge is unavailable.");if(null===e){if(!s.setDefinitionAbrMaxDefinition(null))throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","The VePlayer ABR limit could not be cleared.");return}const a=null!=(r=null==(n=(i=this.options).getDefinitions)?void 0:n.call(i))?r:[];let l;if("definition"===e.type){if(l=e.maxDefinition.trim(),!l||!a.some((e=>tH(e)===l)))throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","The VePlayer ABR Definition cap is unavailable.")}else if("bitrate"===e.type){if(!Number.isFinite(e.maxBitrate)||e.maxBitrate<0)throw new sr("HLS_LEVEL_OUT_OF_RANGE","The VePlayer ABR bitrate cap is out of range.");const t=a.map((e=>({definition:tH(e),bitrate:iH(e)}))).filter((t=>void 0!==t.definition&&void 0!==t.bitrate&&t.bitrate<=e.maxBitrate)).sort(((e,t)=>{var i,n;return(null!=(i=t.bitrate)?i:0)-(null!=(n=e.bitrate)?n:0)}));l=null==(o=t[0])?void 0:o.definition}else{if(!Number.isInteger(e.maxLevel)||e.maxLevel<0||e.maxLevel>=this.state.levels.length)throw new sr("HLS_LEVEL_OUT_OF_RANGE","The VePlayer ABR Level cap is out of range.");const t=a.filter((t=>{const i=FB(t,this.state.levels);return i.matched&&i.levelIndex===e.maxLevel}));1===t.length&&(l=tH(t[0]))}if(!l)throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","The requested VePlayer ABR limit cannot be mapped safely.");if(!s.setDefinitionAbrMaxDefinition(l))throw new sr("HLS_ABR_LIMIT_UNSUPPORTED","The VePlayer ABR limit bridge rejected the requested limit.")}refreshAbrState(e){var t,i,n,r,o,s,a,l,h,d,p,f,g,y,v,m;const _=this.runtime;if(!_)return void(this.abrState=zB(this.currentPlaybackSessionId()));const E=this.abrState,T=null!=(n=null==(i=(t=this.options).getDefinitions)?void 0:i.call(t))?n:[],S=function(e){var t,i,n;const r=null!=(t=e.playbackSessionId)?t:"",o=PD(e.streamType);if("hls"!==o)return wD(e.options,o),{playbackSessionId:r,playbackEngine:e.playbackEngine,configuredEngine:null,engine:"none",decisionSource:"none",available:!1,active:!1,mode:"auto",reason:"NOT_HLS",capabilities:AD()};const s=DD(e.options);if("native"===e.playbackEngine)return{playbackSessionId:r,playbackEngine:"native",configuredEngine:s,engine:"native",decisionSource:"native",available:!0,active:!0,mode:"auto",capabilities:AD()};if("hlsjs"===(null!=s?s:"hlsjs")){if("hlsjs"!==e.playbackEngine)return{playbackSessionId:r,playbackEngine:e.playbackEngine,configuredEngine:s,engine:"none",decisionSource:"none",available:!1,active:!1,mode:"auto",reason:"NOT_HLSJS_ENGINE",capabilities:AD()};const t=null!=(i=e.manifestReady)?i:e.levelCount>0,n=t&&e.levelCount>0,o=t?0===e.levelCount?"NO_ABR_VARIANTS":1===e.levelCount?"MULTI_LEVEL_MASTER_REQUIRED":void 0:"MANIFEST_NOT_READY",a=void 0===o;return{playbackSessionId:r,playbackEngine:"hlsjs",configuredEngine:s,engine:"hlsjs",decisionSource:"hls-levels",available:a,active:a,mode:"auto",reason:o,capabilities:{levelList:n,manualLevelSwitch:n,restoreAuto:a,levelCap:a,bitrateCap:a,definitionCap:!1}}}if("hlsjs"!==e.playbackEngine&&"veplayer-hls"!==e.playbackEngine)return{playbackSessionId:r,playbackEngine:e.playbackEngine,configuredEngine:s,engine:"veplayer",decisionSource:"definition-list",available:!1,active:!1,mode:"auto",reason:"NOT_HLSJS_ENGINE",capabilities:AD()};const a=0===e.definitionCount?"DEFINITION_LIST_REQUIRED":1===e.definitionCount?"NO_ABR_VARIANTS":e.abrModuleAvailable?e.licenseAvailable?void 0:"LICENSE_UNAVAILABLE":"ABR_MODULE_UNAVAILABLE",l=void 0===a,u="hlsjs"===e.playbackEngine&&(null!=(n=e.manifestReady)?n:e.levelCount>0)&&e.levelCount>0,c=l&&!0===e.abrLimitBridgeAvailable;return{playbackSessionId:r,playbackEngine:e.playbackEngine,configuredEngine:s,engine:"veplayer",decisionSource:"definition-list",available:l,active:l,mode:"auto",reason:a,capabilities:{levelList:u,manualLevelSwitch:u,restoreAuto:l,levelCap:!1,bitrateCap:c,definitionCap:c}}}({playbackSessionId:this.currentPlaybackSessionId(),streamType:null!=(s=null==(o=(r=this.options).getStreamType)?void 0:o.call(r))?s:"none"===_.playbackEngine?"":"hls",options:null==(l=(a=this.options).getAbrOptions)?void 0:l.call(a),playbackEngine:_.playbackEngine,manifestReady:this.state.ready,levelCount:this.state.levels.length,definitionCount:T.length,abrModuleAvailable:null==(p=null==(d=(h=this.options).isAbrModuleAvailable)?void 0:d.call(h))||p,licenseAvailable:null==(y=null==(g=(f=this.options).isAbrLicenseAvailable)?void 0:g.call(f))||y,abrLimitBridgeAvailable:!!_.abrBridge});"manual"===E.mode&&S.engine===E.engine&&(S.mode="manual",S.active=!1),this.state.currentLevel>=0&&(S.currentLevel=this.state.currentLevel);const b=null==(m=(v=this.options).getCurrentDefinition)?void 0:m.call(v);b&&(S.currentDefinition=b),"veplayer"!==S.engine||_.abrBridge||(S.capabilities.restoreAuto=!1);const k="auto"===S.mode&&S.available&&(E.playbackSessionId!==S.playbackSessionId||E.engine!==S.engine||"auto"!==E.mode||!E.active);this.abrState=S;if(!("hlsjs"!==_.playbackEngine||!0===this.state.ready))return;if(k)try{this.enableResolvedAbrOwner()}catch(fF){if(!(fF instanceof sr)||"HLS_ABR_UNAVAILABLE"!==fF.code)throw fF;this.abrState=c(u({},this.abrState),{available:!1,active:!1,reason:"ABR_RUNTIME_UNAVAILABLE",capabilities:c(u({},this.abrState.capabilities),{restoreAuto:!1,levelCap:!1,bitrateCap:!1,definitionCap:!1})})}const C=this.abrState;e&&C.playbackSessionId&&(this.resolvedAbrSessionId!==C.playbackSessionId&&(this.resolvedAbrSessionId=C.playbackSessionId,this.options.emit(jD.HLS_ABR_ENGINE_RESOLVED,$B(C))),XB(E)!==XB(C)&&this.emitAbrStateChange())}enableResolvedAbrOwner(){var e;const t=this.runtime;if(t){if("hlsjs"===this.abrState.engine)return null==(e=t.abrBridge)||e.setDefinitionAbrEnabled(!1),void(this.hls&&!this.hls.autoLevelEnabled&&(this.hls.currentLevel=-1));if("veplayer"===this.abrState.engine&&(this.keepHlsAsManualExecutor(),t.abrBridge&&!t.abrBridge.setDefinitionAbrEnabled(!0)))throw new sr("HLS_ABR_UNAVAILABLE","VePlayer ABR could not be enabled for this playback session.")}}disableCurrentAbrOwner(){var e,t;const i=this.runtime;if(i)if("veplayer"!==this.abrState.engine){if("hlsjs"===this.abrState.engine&&(null==(e=i.abrBridge)||e.setDefinitionAbrEnabled(!1),null==(t=this.hls)?void 0:t.autoLevelEnabled)){const e=this.selectExecutorLevel();this.hls.nextLevel=e}}else if(!i.abrBridge||!i.abrBridge.setDefinitionAbrEnabled(!1))throw new sr("HLS_ABR_UNAVAILABLE","VePlayer ABR cannot be disabled without the supported runtime bridge.")}keepHlsAsManualExecutor(){this.hls&&this.hls.autoLevelEnabled&&(this.hls.nextLevel=this.selectExecutorLevel())}clearRuntimeAbrLimit(e){var t;this.abrLimit&&e&&("hlsjs"!==this.abrState.engine?"veplayer"===this.abrState.engine&&(null==(t=e.abrBridge)||t.setDefinitionAbrMaxDefinition(null)):e.hls&&(e.hls.autoLevelCapping=-1))}selectExecutorLevel(){var e;if(!this.hls||0===this.state.levels.length)return 0;return null!=(e=[this.state.currentLevel,JB(this.hls.currentLevel),JB(this.hls.loadLevel),JB(this.hls.nextLevel)].find((e=>e>=0&&e<this.state.levels.length)))?e:0}emitAbrStateChange(){const e=XB(this.abrState);this.abrState.playbackSessionId&&e!==this.lastEmittedAbrStateSignature&&(this.lastEmittedAbrStateSignature=e,this.options.emit(jD.HLS_ABR_STATE_CHANGE,$B(this.abrState)))}resolveAbrEngine(e){return e?this.abrState.engine:"none"}currentPlaybackSessionId(){var e;return null!=(e=this.options.getPlaybackSessionId())?e:""}}const rH="hlsSubtitleTracksUpdated",oH="hlsSubtitleTrackSwitch",sH="hlsManifestLoading",aH=(e,t)=>{const i=null!=t?t:e;return i&&"object"==typeof i?i:{}},lH=e=>"string"==typeof e&&e.trim()?e.trim():void 0,uH=e=>!0===e||"string"==typeof e&&"YES"===e.toUpperCase(),cH=e=>u({},e),hH=()=>`hls-subtitle-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;class dH{constructor(e){var t,i;this.options=e,this.runtime=null,this.hls=null,this.playbackSessionId="",this.mappings=[],this.selectedId=null,this.hiddenSelectionId=null,this.pending=null,this.destroyed=!1,this.onManifestLoading=()=>{var e;this.resetSession(null!=(e=this.options.getPlaybackSessionId())?e:"","HLS_PLAYBACK_SESSION_EXPIRED"),this.hls&&(this.hls.subtitleTrack=-1,this.hls.subtitleDisplay=!1),0===this.options.getExplicitSubtitleList().length&&(this.options.updatePluginList([],!1),this.options.clearRenderer())},this.onTracksUpdated=(e,t)=>{var i,n;if(!this.ensureCurrentSession())return;const r=aH(e,t),o=Array.isArray(r.subtitleTracks)?r.subtitleTracks:null!=(n=null==(i=this.hls)?void 0:i.subtitleTracks)?n:[];this.applyTracks(o)},this.onTrackSwitched=(e,t)=>{var i,n;if(!this.ensureCurrentSession())return;const r=aH(e,t),o=Number(null!=(n=null!=(i=r.id)?i:r.subtitleTrack)?n:-1);this.confirmPendingSwitch(o)},this.createOpaqueId=null!=(t=e.createOpaqueId)?t:hH,this.switchTimeoutMs=Math.max(1,null!=(i=e.switchTimeoutMs)?i:8e3),this.listeners=[[rH,this.onTracksUpdated],[oH,this.onTrackSwitched],[sH,this.onManifestLoading]],this.refreshRuntime()}refreshRuntime(){var e,t,i;if(this.destroyed)return;const n=this.options.getRuntime(),r=null!=(e=this.options.getPlaybackSessionId())?e:"",o="hlsjs"===n.playbackEngine?n.hls:null,s=o!==this.hls,a=r!==this.playbackSessionId;s?(this.unbind(),this.runtime=n,this.hls=o,this.resetSession(r,"HLS_PLAYBACK_SESSION_EXPIRED"),this.bind()):(this.runtime=n,a&&this.resetSession(r,"HLS_PLAYBACK_SESSION_EXPIRED")),(null==(i=null==(t=this.hls)?void 0:t.subtitleTracks)?void 0:i.length)&&0===this.mappings.length&&this.applyTracks(this.hls.subtitleTracks)}getTracks(){return this.refreshRuntime(),this.mappings.map((e=>cH(e.track)))}getSelectedTrack(){this.refreshRuntime();const e=this.findById(this.selectedId);return e?cH(e.track):null}switchSubtitle(e){if(this.refreshRuntime(),!this.hls||!this.playbackSessionId)return Promise.reject(new sr("HLS_ENGINE_UNSUPPORTED","HLS subtitle switching requires the hls.js playback engine."));let t;try{t=this.resolveTarget(e)}catch(fF){return Promise.reject(fF)}return String(t.track.id)===String(this.selectedId)?Promise.resolve():this.submitSwitch(t)}hide(){var e,t,i;if(this.refreshRuntime(),!this.hls)return;const n=null!=(i=null!=(t=this.selectedId)?t:null==(e=this.pending)?void 0:e.to)?i:null;this.hiddenSelectionId=n,this.rejectPending(new sr("HLS_SUBTITLE_SWITCH_FAILED","The HLS subtitle switch was interrupted by hiding subtitles.")),null!==n&&this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHING,{playbackSessionId:this.playbackSessionId,playbackEngine:"hlsjs",from:n,to:null}),this.hls.subtitleTrack=-1,this.hls.subtitleDisplay=!1,this.selectedId=null,this.options.confirmPluginSelection(null),this.options.clearRenderer(),null!==n&&this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHED,{playbackSessionId:this.playbackSessionId,playbackEngine:"hlsjs",from:n,to:null})}show(){var e;if(this.refreshRuntime(),!this.hls||0===this.mappings.length)return Promise.resolve();const t=null!=(e=this.findById(this.hiddenSelectionId))?e:this.defaultMapping();return t?this.submitSwitch(t):Promise.resolve()}clearForPlaybackSwitch(){this.destroyed||(this.rejectPending(new sr("HLS_PLAYBACK_SESSION_EXPIRED","The HLS subtitle playback session has expired.")),this.mappings=[],this.selectedId=null,this.hiddenSelectionId=null,this.hls&&(this.hls.subtitleTrack=-1,this.hls.subtitleDisplay=!1),this.options.updatePluginList([],!1),this.options.clearRenderer())}destroy(){this.destroyed||(this.destroyed=!0,this.rejectPending(new sr("HLS_PLAYBACK_SESSION_EXPIRED","The HLS subtitle playback session has ended.")),this.unbind(),this.runtime=null,this.hls=null,this.mappings=[],this.selectedId=null,this.hiddenSelectionId=null,this.options.clearRenderer())}confirmPendingSwitch(e){var t,i;const n=this.pending;if(!n||e!==n.runtimeIndex)return;if(n.sessionId!==this.playbackSessionId)return void this.rejectPending(new sr("HLS_PLAYBACK_SESSION_EXPIRED","The HLS subtitle playback session has expired."));clearTimeout(n.timer),this.pending=null,this.selectedId=n.to,this.hiddenSelectionId=n.to;const r=cH(n.track),o=this.findById(n.to);o&&(null==(i=(t=this.options).syncRendererSelection)||i.call(t,o.runtimeIndex)),this.options.confirmPluginSelection(r),this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHED,{playbackSessionId:n.sessionId,playbackEngine:"hlsjs",from:n.from,to:n.to,track:r}),n.resolve()}applyTracks(e){var t;if(!this.hls)return;if(this.options.getExplicitSubtitleList().length>0)return this.rejectPending(new sr("HLS_SUBTITLE_SWITCH_FAILED","Business-configured subtitles take precedence over Master subtitles.")),this.mappings=[],this.selectedId=null,this.hiddenSelectionId=null,this.hls.subtitleTrack=-1,void(this.hls.subtitleDisplay=!1);const i=this.mappings,n=new Map;this.mappings=e.map(((e,t)=>{var r,o,s,a,l,h,d;const p=e.attrs&&"object"==typeof e.attrs?e.attrs:{},f=((e,t)=>{var i,n,r,o;return JSON.stringify([e.groupId,null!=(i=e.lang)?i:e.language,null!=(n=e.name)?n:e.label,e.type,null!=(r=e.forced)?r:t.FORCED,null!=(o=e.characteristics)?o:t.CHARACTERISTICS])})(e,p),g=null!=(r=n.get(f))?r:0;n.set(f,g+1);const y=`${f}:${g}`,v=i.find((e=>e.runtimeKey===y)),m=null!=(o=lH(e.lang))?o:lH(e.language),_=null!=(l=null!=(a=null!=(s=lH(e.name))?s:lH(e.label))?a:m)?l:"Subtitle",E=null!=(h=lH(e.characteristics))?h:lH(p.CHARACTERISTICS),T=u(c(u({id:null!=(d=null==v?void 0:v.track.id)?d:this.createOpaqueId()},m?{language:m}:{}),{text:_,isDefault:uH(e.default)||uH(p.DEFAULT),source:"hls",forced:uH(e.forced)||uH(p.FORCED)}),E?{characteristics:E}:{});return{runtimeIndex:t,runtimeKey:y,track:T}})),this.pending&&(null==(t=this.findById(this.pending.to))?void 0:t.runtimeIndex)!==this.pending.runtimeIndex&&this.rejectPending(new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The pending HLS subtitle track was removed.")),this.findById(this.selectedId)||(this.selectedId=null),this.findById(this.hiddenSelectionId)||(this.hiddenSelectionId=null);const r=this.options.getSubtitleConfig(),o=!!(null==r?void 0:r.isDefaultOpen)&&this.mappings.length>0,s=this.findById(this.selectedId);if(this.setSubtitleDisplay(o||!!s),this.options.updatePluginList(this.getTracksWithoutRefresh(),!!s),this.options.emit(jD.HLS_SUBTITLE_TRACKS_UPDATED,{playbackSessionId:this.playbackSessionId,playbackEngine:"hlsjs",tracks:this.getTracksWithoutRefresh()}),s&&this.options.confirmPluginSelection(cH(s.track)),!o||this.selectedId||this.pending)o||this.selectedId||(this.hls.subtitleTrack=-1);else{const e=this.defaultMapping();e&&this.submitSwitch(e).catch((()=>{}))}}submitSwitch(e){if(!this.hls)return Promise.reject(new sr("HLS_ENGINE_UNSUPPORTED","HLS subtitle switching requires the hls.js playback engine."));this.pending&&this.rejectPending(new sr("HLS_SUBTITLE_SWITCH_FAILED","The previous HLS subtitle switch was superseded."));const t=this.playbackSessionId,i=this.selectedId,n=e.track.id,r=cH(e.track);return this.options.emit(jD.HLS_SUBTITLE_TRACK_SWITCHING,{playbackSessionId:t,playbackEngine:"hlsjs",from:i,to:n,track:r}),new Promise(((o,s)=>{const a=this.hls.subtitleTrack===e.runtimeIndex,l=setTimeout((()=>{var t;(null==(t=this.pending)?void 0:t.runtimeIndex)===e.runtimeIndex&&(this.pending=null,this.hls&&(this.hls.subtitleTrack=this.runtimeIndexForId(this.selectedId)),s(new sr("HLS_SUBTITLE_SWITCH_TIMEOUT","The HLS subtitle switch was not confirmed in time.")))}),this.switchTimeoutMs);this.pending={sessionId:t,runtimeIndex:e.runtimeIndex,from:i,to:n,track:r,resolve:o,reject:s,timer:l},this.setSubtitleDisplay(!0),this.hls.subtitleTrack=e.runtimeIndex,a&&this.confirmPendingSwitch(e.runtimeIndex)}))}resolveTarget(e){if(void 0!==e.id&&null!==e.id&&""!==e.id){const t=this.findById(e.id);if(t)return t;throw new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The HLS subtitle track was not found.")}if(void 0!==e.language&&null!==e.language&&""!==e.language){const t=this.mappings.filter((t=>String(t.track.language)===String(e.language)));if(1===t.length)return t[0];if(t.length>1)throw new sr("HLS_SUBTITLE_TRACK_AMBIGUOUS","More than one HLS subtitle track uses the requested language.")}throw new sr("HLS_SUBTITLE_TRACK_NOT_FOUND","The HLS subtitle track was not found.")}setSubtitleDisplay(e){var t;this.hls&&(this.hls.subtitleDisplay=e&&"native"===(null==(t=this.options.getSubtitleConfig())?void 0:t.mode))}defaultMapping(){var e;return null!=(e=this.mappings.find((e=>e.track.isDefault)))?e:this.mappings[0]}findById(e){if(null!=e&&""!==e)return this.mappings.find((t=>String(t.track.id)===String(e)))}runtimeIndexForId(e){var t,i;return null!=(i=null==(t=this.findById(e))?void 0:t.runtimeIndex)?i:-1}getTracksWithoutRefresh(){return this.mappings.map((e=>cH(e.track)))}ensureCurrentSession(){var e;if(this.destroyed||!this.hls)return!1;const t=null!=(e=this.options.getPlaybackSessionId())?e:"";return t===this.playbackSessionId||(this.resetSession(t,"HLS_PLAYBACK_SESSION_EXPIRED"),!1)}resetSession(e,t){this.rejectPending(new sr(t,"The HLS subtitle playback session has expired.")),this.playbackSessionId=e,this.mappings=[],this.selectedId=null,this.hiddenSelectionId=null}rejectPending(e){const t=this.pending;t&&(clearTimeout(t.timer),this.pending=null,t.reject(e))}bind(){this.hls&&this.listeners.forEach((([e,t])=>{var i;return null==(i=this.hls)?void 0:i.on(e,t)}))}unbind(){this.hls&&this.listeners.forEach((([e,t])=>{var i;return null==(i=this.hls)?void 0:i.off(e,t)}))}}const pH=e=>"string"==typeof e?e.trim().toLowerCase():"",fH=e=>{try{return pH(null==e?void 0:e())}catch(t){return""}},gH=e=>{if(!e||"object"!=typeof e)return!1;try{const t=e;return Array.isArray(t.levels)&&"number"==typeof t.currentLevel&&"number"==typeof t.loadLevel&&"number"==typeof t.nextLevel&&"number"==typeof t.manualLevel&&"boolean"==typeof t.autoLevelEnabled&&"number"==typeof t.autoLevelCapping&&"function"==typeof t.on&&"function"==typeof t.off}catch(t){return!1}},yH=e=>e&&"function"==typeof e.setDefinitionAbrEnabled&&"function"==typeof e.setDefinitionAbrMaxDefinition&&"function"==typeof e.getDefinitionAbrMaxDefinition?{setDefinitionAbrEnabled:t=>{var i;return!0===(null==(i=e.setDefinitionAbrEnabled)?void 0:i.call(e,t))},setDefinitionAbrMaxDefinition:t=>{var i;return!0===(null==(i=e.setDefinitionAbrMaxDefinition)?void 0:i.call(e,t))},getDefinitionAbrMaxDefinition:()=>{var t,i;return null!=(i=null==(t=e.getDefinitionAbrMaxDefinition)?void 0:t.call(e))?i:null}}:null,vH=(e={},t)=>{var i,n,r,o;const s=null!=(i=e.plugins)?i:{},a=s.encrypthlsplugin,l=s.hls,u=gH(null==a?void 0:a.hls)?a:gH(null==l?void 0:l.hls)?l:null;if(u)return{playbackEngine:"hlsjs",hls:u.hls,abrService:null!=(n=u.abrService)?n:null,abrBridge:yH(u)};const c="hls"===((e,t)=>{var i,n,r,o,s,a,l;const u=null!=t?t:null==(i=e.sdk)?void 0:i.playerData;return fH(null==(n=null==u?void 0:u.getCurrentStreamType)?void 0:n.bind(u))||fH(null==(r=null==u?void 0:u.getStreamType)?void 0:r.bind(u))||pH(null==(o=null==u?void 0:u.adapter)?void 0:o.streamType)||pH(null==(s=null==u?void 0:u.configs)?void 0:s.streamType)||pH(null==(a=e.config)?void 0:a.streamType)||("string"!=typeof(c=null==(l=e.config)?void 0:l.url)?"":c.split(/[?#]/,1)[0].toLowerCase().endsWith(".m3u8")?"hls":"");var c})(e,t);return c&&(null==a?void 0:a.isNativeMode)?{playbackEngine:"native",hls:null,abrService:null,abrBridge:null}:c&&(a||l)?{playbackEngine:"veplayer-hls",hls:null,abrService:null!=(o=null!=(r=null==a?void 0:a.abrService)?r:null==l?void 0:l.abrService)?o:null,abrBridge:yH(null!=a?a:l)}:{playbackEngine:c?"native":"none",hls:null,abrService:null,abrBridge:null}};window.Player||(window.Player=Ys);const mH=class{constructor(e){var t;this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._hlsMasterController=null,this._hlsSubtitleAdapter=null,this._explicitSubtitleListSnapshot=[],this._lastSelectedAudioTrack=null,this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null,this._playNextPending=!1,this._isCollectingCreatePlayerPerf=!1,this._getDramaInfoPerfRecords=[],this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this._publicPlayNextOperation=null,this._lifecycleGeneration=0,this._isVolcengine=!1,this._originConfigs={},this.delayEvents=[],this.createPlayer=e=>d(this,null,(function*(){const t=this._lifecycleGeneration||0;NB.beginCoreCreate(this,e);try{const i=yield this._createPlayer(e,t);return this._isStaleLifecycleGeneration(t)?void this._discardStalePlayer(i):i}catch(fF){throw NB.failCoreCreate(this,e),fF}})),this._createPlayer=(e,...t)=>d(this,[e,...t],(function*(e,t=this._lifecycleGeneration||0){var i,n,r,o,s,a,l,p,f,g,y,v;this._createPlayerPerf=new Ba,this._isCollectingCreatePlayerPerf=!0;const m=this._createPlayerPerf;if(yield m.measureAsync("destroyPlayer",(()=>d(this,null,(function*(){yield this._destroyPlayer()})))),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(yield this.beforePlayerCreate(),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();AB(this.playerData);const{options:_,plugins:E,isMobile:T,openSoftDecoding:S,configs:b,strategiesPlugins:k,strategiesPluginConfigs:C}=this.playerData,I=!1,A=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),P=this.playerData.getCurrentStreamType()||Sa(null==b?void 0:b.getVideoByToken);Xa(b,"EncryptHlsPlugin")||A&&P||this.playerData.isOpenABR()||(la.warn(`url is empty or streamType is empty (url:${A}, streamType: ${P})`),this.renderPoster());const w=()=>d(this,null,(function*(){const e=sl(A);return yield this.getSoftDecodingOption(S,e,P)})),D=yield m.measureAsync("createSDKPreset",(()=>d(this,null,(function*(){return yield FN({isLive:I,isMobile:T,streamType:P,playerData:this.playerData,getSoftOptionTask:w},this)}))));if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();const{presets:L,softDecodingOption:R,plugins:x}=D,O=T?function(e=!1){const t=u({},eM),i=u({},e?tM:iM);return u(u({},t),i)}(I):function(e=!1){const t=u({},qN),i=u({},e?QN:ZN);return u(u({},t),i)}(I),{basicPlugins:N=[],iconPlugins:M=[]}=this._analyzeExtendPlugins(),U=R||{},{plugins:B=[]}=U,H=h(U,["plugins"]),F=this.getDefinitionConfig(),j=Br.deepMerge(O,_),V=c(u(c(u(u(u({},{errorKey:HL}),j),H||{}),{definition:F,icons:u(u(u({},O.icons),{}),null!=(i=null==_?void 0:_.icons)?i:{}),MoreButtonPlugin:{iconPlugins:[...null!=(r=null==(n=_.MoreButtonPlugin)?void 0:n.iconPlugins)?r:[],...M,fM,lM,vM]}}),C),{playerData:this.playerData});this.playerData.getLineList().length>1&&V.MoreButtonPlugin.iconPlugins.push(hM),this.setDefaultConfigOptions(V);const K=function(e){const t=[];return e.forEach((e=>{t.find((t=>{var i,n;return(null==(i=null==t?void 0:t.pluginName)?void 0:i.toLowerCase())===(null==(n=null==e?void 0:e.pluginName)?void 0:n.toLowerCase())}))||t.push(e)})),t}([...N,...E,...x,...B,...k]),G=(null!=(o=null==V?void 0:V.ignores)?o:[]).some((e=>"sdkunmuteplugin"===(e+"").toLowerCase()));V.ignores=[...null!=(s=null==V?void 0:V.ignores)?s:[],...G?["AutoplayPlugin"]:[]],this._isFirstCreated?this._isFirstCreated=!1:(V.autoplayMuted=!1,V.ignores=[...null!=(a=null==V?void 0:V.ignores)?a:[],"sdkUnmutePlugin"]),this.setPluginConfig(V);const W={},Y=null==(l=mH.ttDramaEnv)?void 0:l.videoSecurityModule;if(null==Y?void 0:Y.generateSignature){const e=yield m.measureAsync("videoSecuritySignature",(()=>d(this,null,(function*(){return yield Y.generateSignature()}))));e&&(W["data-tt-sign"]=e)}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();this._emitter.emit(jD.READY_CREATE_PLAYER);let z,$={};if(mH.shouldCheckLicense()){const e=yield mH.checkLicenseStatus();e!==kD.LICENSE_STATUS_OK&&e!==kD.LICENSE_STATUS_EXPIRED&&($={progress:{closeMoveSeek:!0,isCloseClickSeek:!0},sdkErrorPlugin:{isNeedRefreshButton:!1}})}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(m.measure("instantiatePlayer",(()=>{var e;z=new Ys(c(u(u({el:this.playerContainer,presets:L,url:A,isLive:!1},V),$),{videoAttributes:u(u({},null!=(e=V.videoAttributes)?e:{}),W),plugins:[...K]}))})),this._isStaleLifecycleGeneration(t))return this._discardStalePlayer(z),this._cancelStalePlayerCreation();this.player=z,z.playerData=this.playerData,z.sdk=this,NB.attachCore(this,z,e),null==(g=null==(p=z._subTitles)?void 0:p.setPlaybackSessionId)||g.call(p,null!=(f=NB.getPlaybackSessionId(this))?f:""),null==(v=null==(y=z._subTitles)?void 0:y.refresh)||v.call(y);const X=m.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=X,this.emit(jD.CREATE_PLAYER_PERF,X),la.log("createPlayer perf: ",X),this._emitter.emit(jD.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),z})),this._onMp4PreloadInfo=e=>{this.emit(VD.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(WD.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:n,mediaError:r}=e||{};if(Br.isMSE(null==(t=this.player)?void 0:t.media))n+""!="403"&&i+""!="9203"||this._emitExpireEvent("error",e);else if(4===(null==r?void 0:r.code)||2===(null==r?void 0:r.code)){const t=sl(this.playerData.getCurrentUrl());t&&Na(t,{range:"0-8",timeout:2e3}).then((t=>{la.log("xhr result",t);const{status:i,response:n}=t;403===i&&"string"==typeof n&&n.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{la.log("xhr error",e)}))}},this._onNativeAddTrack=()=>{var e,t;if(this._getHlsInstance())return;this._playNextPending=!1;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(!i)return;const n=[];for(let r=0;r<i.length;r++){const e=i[r];n.push({id:e.id,name:e.label||e.language||e.id,lang:e.language,default:e.enabled,selected:e.enabled})}this._applyAudioPreferenceNative(i),this._emitter.emit(jD.AUDIO_TRACKS_UPDATED,{audioTracks:n})},this._onNativeTrackChange=()=>{var e,t;if(this._getHlsInstance())return;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(i)for(let n=0;n<i.length;n++){const e=i[n];if(e.enabled){const t={id:n,name:e.label||e.language||String(n),lang:e.language,default:e.enabled,selected:!0};this._playNextPending||(this._lastSelectedAudioTrack=t),this._emitter.emit(jD.AUDIO_TRACK_CHANGE,{id:n,audioTrack:t});break}}},function(e){if(!e)throw new gB}(Boolean(mH.ttDramaEnv)),this.assertLiteConfig(e),this._explicitSubtitleListSnapshot=this._cloneExplicitSubtitleList(null==(t=Xa(e,"Subtitle"))?void 0:t.list),NB.register(this,NU(e)),this._init(e)}static getPlayerPlaybackState(){var e,t,i;const n=null!=(i=null==(t=null==(e=Ys.instManager)?void 0:e.findAll)?void 0:t.call(e,(e=>!!(null==e?void 0:e.sdk)&&NB.has(e.sdk))))?i:[];return NB.query(n)}static registerModules(e){cD.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){!function(e=!0){CU=!!e}(e)}static getAppendVideoUrlTimestamp(){return CU}static setTTDramaEnv(e){var t;la.log("TTDramaEnv: ",e);mH.ttDramaEnv=c(u({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){!function(e){e?("boolean"==typeof e.enable&&(kM.enable=e.enable),e.cacheType&&(kM.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?kM.expireTime=e.expireTime:void 0!==e.expireTime&&AM("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:kM.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?kM.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&AM("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:kM.maxEntries}),AM("config updated",wM())):AM("config skip empty config",{currentConfig:wM()})}(e)}static getMediaInfoCacheConfig(){return wM()}static clearMediaInfoCache(){DM()}static prefetchMediaInfo(e){return function(e,t){return d(this,null,(function*(){if(!Array.isArray(e))throw new TypeError("sources must be an array");if(!e.length)return[];if(Gr.os.isAndroid&&!0===(null==t?void 0:t.canIUseGetDramaInfo)&&!t.canAndroidBatchGetDramaInfo){const i=[];for(const n of e)i.push(yield rB(n,t));return i}return Promise.all(e.map((e=>rB(e,t))))}))}(e,mH.ttDramaEnv)}static setDebug(e){!function(e){la.config.debug=e?3:1}(e)}static setCollector(e){Ha=e}static shouldCheckLicense(){return!1}static prepare(e){return d(this,null,(function*(){let t=e;const i=Boolean(mH.ttDramaEnv);!(null==t?void 0:t.appId)&&i&&(t=c(u({},t),{appId:NL}));const n=null==t?void 0:t.serviceConfigMode,r=function(e,t){return"remote"===e||"local-only"===e?e:t?"local-only":"remote"}(n,i);void 0!==n&&"remote"!==n&&"local-only"!==n&&la.warn("[VePlayer.prepare] Invalid serviceConfigMode; using the environment default.");const o=function(e){var t,i;const n=null==(t=null==e?void 0:e.strategies)?void 0:t.preload,r="boolean"==typeof n;if(!n||!r&&(null==n?void 0:n.disabled))return e;const o=r?{}:n;return c(u({},e),{strategies:c(u({},e.strategies),{preload:c(u({},o),{[qU]:!0,config:c(u({},null!=(i=null==o?void 0:o.config)?i:{}),{[qU]:!0})})})})}(c(u({},t),{serviceConfigMode:r}));if(mH.shouldCheckLicense())try{mH.hasInitVeStrategy=!0;const e=yield mH.checkLicenseStatus(),t=yield mH.checkLicense();if(e===kD.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===TD.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(fF){return void la.error(fF.message)}else mH.hasInitVeStrategy=!0;yield vD.init(o)}))}static setPreloadScene(e,t){return vD.setPreloadScene(e,t)}static get preloader(){return vD.preloader}static get preloaderStatus(){return vD.preloaderStatus}static addPreloadList(e){return uB(e,mH.ttDramaEnv).then((e=>((null==e?void 0:e.length)||la.warn("[addPreloadList] resolved preloadList is empty"),vD.addPreloadList(e))))}static setPreloadList(e){return uB(e,mH.ttDramaEnv).then((e=>((null==e?void 0:e.length)||la.warn("[setPreloadList] resolved preloadList is empty"),la.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),vD.setPreloadList(e))))}static setLicenseConfig(e){return CD.setLicenseConfig(e)}static checkLicense(){return CD.checkLicense()}static checkModuleList(){return CD.checkModuleList()}static checkLicenseStatus(){return CD.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return CD.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return d(this,null,(function*(){try{const i={hls:jw.HLSEncrypt,mp4:jw.MP4Encrypt,dash:jw.DASH};if(!t||!i[t])return void la.warn("param of streamType is invalid");const n=(new Date).getTime().toString(),r="mp4"===t?yield Gw.loadMp4Encrypt(hD):yield hD.loadPlugins(i[t]);return null==r?void 0:r.generateEncryptInfo(e,n)}catch(i){la.error("generate encrypt info error: ",i)}}))}assertLiteConfig(e){AB(e)}_init(e,t){return d(this,null,(function*(){if(mH.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new Rr,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const i=mH.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield mH.checkModuleList():Object.values(bD);this.playerData=dr.observe(new LD(c(u({},e),{licensSupportModuleList:i}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(jD.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins();this.createPlayer(t).catch((e=>{if("VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))return la.error("createPlayer error:",e),void this.emit(WD.ERROR,e);throw e})),this._initI18N(this.playerData.languageData),this._originConfigs={autoBitrateOpts:(null==e?void 0:e.autoBitrateOpts)?u({},e.autoBitrateOpts):void 0,useSoftDecoding:null==e?void 0:e.useSoftDecoding}}))}_initSdkPlugins(){WU.init(this);[...this.sdkPlugins].map((e=>WU.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new Va,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(VD.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new cD,this.updateUmdLoader(this.sdkUmdLoader,e)}updateUmdLoader(e,t){const{umdUrlMap:i,region:n,userRegion:r,pluginPublicPath:o,plugins:s=[]}=t;e.failCallback=(e,t)=>this.umdLoadErr(e,t),i&&"object"==typeof i&&e.updateBackupMap(t.umdUrlMap),e.region=n,e.userRegion=r,o&&"string"==typeof o&&(e.customPluginPublicPath=o),e.importedPlugins=s}checkVodLogOptions(){var e;const{isLive:t,configs:i}=this.playerData,n=Xa(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=mH.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==n?void 0:n.line_app_id)){const e={errorType:"log",errorCode:DL.VOD_LOG_NOT_CONFIGURED.code,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0};this.delayError.push(e)}}}umdLoadErr(e,t){this.emit(jD.UMD_LOAD_FAIL,{name:e,error:t})}_onRepeat(){const{urlExpireTimestamp:e,urlExpireDiff:t=60}=this.playerData.urlCheckData;Math.round((new Date).getTime()/1e3)>=e-t&&(this.playerData.urlCheckData.urlExpireTimestamp=Qs,this._emitExpireEvent("time"))}_emitExpireEvent(e="error",t){const i=Math.round((new Date).getTime()/1e3),n={errorCode:-499897,errorType:"network",errorMessage:"url expire",url:this.playerData.getCurrentUrl(),httpCode:403,version:"1.19.0-rc.1",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,la.warn("media is expired, ",n),this.emit(WD.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,la.warn("media is expired, ",n),this.emit(WD.MEDIA_EXPIRED,n))}on(e,t){this._emitter.on(e,t)}emit(e,t){this._emitter.emit(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}renderDom({id:e,root:t}){const i=document.createElement("div");this.playerContainer=i;const n=t||document.querySelector(`#${e}`);n&&(n.appendChild(i),this.mountingDom=n)}renderPoster(){if(!this.playerContainer)return;const{poster:e="",width:t,height:i}=this.playerData.options;("string"==typeof e?e:null==e?void 0:e.poster)&&(this.playerContainer.style.cssText=`background: url("${e}");\n background-size: cover;\n width:${t?t+"px":"100%"};\n height:${i?i+"px":"100%"};\n `)}getDefinitionConfig(){var e;const{current:{lineId:t},isVidEncrypt:i,configs:n,options:r}=this.playerData,o="hls"===(this.playerData.getCurrentStreamType()||Sa(null==n?void 0:n.getVideoByToken))&&i&&!!(null==(e=Xa(r,"EncryptHlsPlugin"))?void 0:e.keyToken);let s=this.playerData.getDefinitionListByLineId(t).map((e=>o?function(e,t){const i=u({},e);return t.forEach((e=>delete i[e])),i}(e,["secretKey","playAuth"]):e)),a=this.playerData.current.definition;return this.playerData.isOpenABR()&&(a=this.playerData.defaultDefinition,s=(null==s?void 0:s.length)&&!this.adapter.needAbrAutoDefinition()?s.filter((e=>!this.playerData.isAutoDefinition(e.definition))):s),{defaultDefinition:a,list:s}}checkLicenseCallback(){return d(this,null,(function*(){var e,t,i,n,r,o,s,a,l,h,d,p,f,g,y,v,m;const _=yield mH.checkLicense(),E=yield mH.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:E,licenseType:_},E===kD.LICENSE_STATUS_EXPIRED)CD.renderLogo(this.playerContainer),!this.playerData.isOpenABR()&&(null==(t=null==(e=null==this?void 0:this._originConfigs)?void 0:e.autoBitrateOpts)?void 0:t.enable)&&"hlsjs"!==(null==(n=null==(i=null==this?void 0:this._originConfigs)?void 0:i.autoBitrateOpts)?void 0:n.engine)&&this.emit(jD.LICENSE_STATUS_WARNING,LL.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(o=null==(r=this.playerData.configs)?void 0:r.adaptRange)?void 0:o.enable)&&this.emit(jD.LICENSE_STATUS_WARNING,LL.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===mH.hasInitVeStrategy&&this.emit(jD.LICENSE_STATUS_WARNING,LL.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(E!==kD.LICENSE_STATUS_OK){null==(s=this.player.plugins.controls)||s.destroy(),null==(a=this.player.plugins.play)||a.destroy(),null==(l=this.player.plugins.sdkdefinitionplugin)||l.hide(),null==(h=this.player.plugins.definitionmobileplugin)||h.destroy(),null==(d=this.player.media)||d.removeAttribute("src");const e=c(u({errorType:RL.license},E===kD.LICENSE_STATUS_INVALID?{errorCode:DL.LICENSE_STATUS_INVALID.code,errorMessage:DL.LICENSE_STATUS_INVALID.message}:{errorCode:DL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:DL.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else _===TD.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(f=null==(p=this._originConfigs)?void 0:p.autoBitrateOpts)?void 0:f.enable)&&"hlsjs"!==(null==(y=null==(g=this._originConfigs)?void 0:g.autoBitrateOpts)?void 0:y.engine)&&this.emit(jD.LICENSE_STATUS_WARNING,LL.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(m=null==(v=this.playerData.configs)?void 0:v.adaptRange)?void 0:m.enable)&&this.emit(jD.LICENSE_STATUS_WARNING,LL.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===mH.hasInitVeStrategy&&this.emit(jD.LICENSE_STATUS_WARNING,LL.BASE_LICENSE_NOT_SUPPORT_PRELOAD))}))}setPluginConfig(e){var t,i,n,r,o;const{apiMap:s,configs:a,unionInfo:l,playList:h,useHlsPluginForSafari:d,isMobile:p}=this.playerData,f=this.playerData.getCurrentStreamType()||Sa(null==a?void 0:a.getVideoByToken),g=Xa(a,"EncryptHlsPlugin"),y=Xa(e,"EncryptHlsPlugin"),v=Xa(a,"Mp4EncryptPlayer"),m=Xa(e,"Mp4EncryptPlayer"),_=Xa(a,"DASHPlugin"),E=Xa(e,"DASHPlugin"),T=Xa(a,"vodLogOpts"),S=(null==(t=mH.ttDramaEnv)?void 0:t.clientKey)?{appVersion:mH.ttDramaEnv.appVersion,clientKey:mH.ttDramaEnv.clientKey,line_app_id:NL,line_user_id:Ra(mH.ttDramaEnv.clientKey)}:{},b=!!(null==(i=null==h?void 0:h[0])?void 0:i.kid)||!!g;g&&(e.EncryptHlsPlugin=u(u(u({playDomain:s.playDomain,getKeyType:"TOP",preferMMS:!0,preferMMSStreaming:!0},p||!nl||d?{}:{useHls:!1}),y||{}),g)),v&&(e.Mp4EncryptPlayer=u(u({playDomain:s.playDomain,preferMMS:!0,getKeyType:"TOP"},m||{}),v)),_&&(e.DASHPlugin=u(u({playDomain:s.playDomain,getKeyType:"TOP"},E||{}),_));const{vid:k}=a,{encryptSessionId:C,current:I,drmType:A}=this.playerData,{kid:P,secretKey:w}=I;if(A===or.PRIVATE_ENCRYPT_UPGRADE&&C&&w&&("hls"===f?e.EncryptHlsPlugin=u(u({vid:k,kid:P,useUnionInfoDRM:!0,sessionId:C,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:w,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===f?e.DASHPlugin=u(u({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:k,kid:P,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,sessionId:C},E||{}),_||{}):"mp4"===f&&(e.Mp4EncryptPlayer=u(u({vid:k,kid:P,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:C,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,preferMMS:!0},m||{}),v||{}))),a.privateDrmAuthToken&&a.kid&&l&&("hls"===f?e.EncryptHlsPlugin=u(u({kid:a.kid,drmKeyToken:a.privateDrmAuthToken,playDomain:s.playDomain,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===f?e.DASHPlugin=u(u({kid:a.kid,drmKeyToken:a.privateDrmAuthToken,playDomain:s.playDomain},E||{}),_||{}):"mp4"===f&&(e.Mp4EncryptPlayer=u(u({kid:a.kid,drmKeyToken:a.privateDrmAuthToken,playDomain:s.playDomain,preferMMS:!0},m||{}),v||{}))),T||S.clientKey){la.log("codec",this.playerData.codec);const t=rl(this.userRegion,this.region),i=null==t?void 0:t.__LOG_CUSTOM_REGION__,n=null==t?void 0:t.__LOG_CHANNEL_DOMAIN__;e.vodLogOpts=u(u(c(u(u({vtype:(f||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:b?1:0,playerVersion:"1.19.0-rc.1",channel:null==t?void 0:t.__LOG_CHANNEL__,needXhrCheck:!0,enableTeaWebId:!0},i?{trackerConfig:{log_from_region:null==t?void 0:t.__LOG_CUSTOM_REGION__}}:{}),n?{channelDomain:n}:{}),{ext:this.vodLogCommon}),S),T||{})}null==(n=this.getSdkPlugin("Abr"))||n.applyAbrConfig(e),null==(r=this.getSdkPlugin("AdaptRange"))||r.applyRangeConfig(e),null==(o=this.getSdkPlugin("Strategy"))||o.applyFinalStrategy(e)}detectCodec(e){return d(this,null,(function*(){var t;try{const{LoadProbe:i}=(yield this.sdkUmdLoader.loadPlugins(jw.StreamProbe))||{};if(i){const n=yield null==(t=new i)?void 0:t.parseUrl(e),{codec:r}=n||{};"bytevc1"===r?this.playerData.codec=tr.H265:"avc"===r&&(this.playerData.codec=tr.H264)}}catch(pa){la.warn("detect codec error: ",pa)}}))}setDefaultConfigOptions(e){if(!this._isFirstCreated)return;const{defaultConfig:t,isHitDefault:i}=this.playerData;if(!t)return;const{volume:n,startTime:r,DanmuPlugin:o,LiveSubtitlesIconPlugin:s}=null!=t?t:{};n&&(e.volume=e.volume?c(u({},e.volume),{default:n}):n),i&&r&&(e.startTime=r)}getCurrentPlayerConfig(){var e,t;const{isLive:i,current:{lineId:n,definition:r}}=this.playerData,o={type:i?"live":"vod",isLive:i,definition:r,lineId:n,volume:null!=(e=this.player.volume)?e:.6};return i||(o.startTime=null!=(t=this.player.currentTime)?t:0),u({},o)}getStreamType(){var e,t;return this.playerData.getCurrentStreamType()||Sa(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken)}_analyzeExtendPlugins(){var e;const{options:t}=this.playerData,i=t.extendPlugin||[],n=null!=(e=null==t?void 0:t.ignore)?e:[],r=[],o=[];return i.forEach((e=>{const t=rM(e);"inner"!==t.type||n[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}beforePlayerCreate(){return d(this,null,(function*(){const e=this._createPlayerPerf;e?yield e.measureAsync("beforePlayerCreate",(()=>d(this,null,(function*(){yield Promise.all([e.measureAsync("beforePlayerCreate.sdkPlugins",(()=>d(this,null,(function*(){yield WU.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>d(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([WU.beforePlayerCreate(this),this.prepareStrategies()]),this.updateConfigByStrategy())}))}getCreatePlayerPerfReport(){return this._lastCreatePlayerPerfReport}recordGetDramaInfoPerf(e){var t,i,n;if(null==e?void 0:e.perfInfo){this._getDramaInfoPerfRecords=this._getDramaInfoPerfRecords||[],this._getDramaInfoPerfRecords.push(e),this._markGetDramaInfoClientPerf(e);try{null==(n=null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.onGetDramaInfoPerf)||n.call(i,e)}catch(r){la.error("onGetDramaInfoPerf callback error:",r)}}}getDramaInfoPerfRecords(){return[...this._getDramaInfoPerfRecords||[]]}getLastDramaInfoPerf(){const e=this._getDramaInfoPerfRecords||[];return e[e.length-1]}_markGetDramaInfoClientPerf(e){if(!this._isCollectingCreatePlayerPerf||!this._createPlayerPerf)return;const t=e.perfInfo,i=(e,t)=>{var i;"number"==typeof t&&(null==(i=this._createPlayerPerf)||i.markDuration(`beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB.perfInfo.${e}`,t))};i("prepareCost",t.prepare_cost),i("requestCost",t.request_cost),i("parseCost",t.parse_cost),i("totalCost",t.total_cost)}prepareStrategies(){return d(this,null,(function*(){if(yield vD.prepare()){const{plugins:e,pluginConfiguration:t}=vD.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(vD.isReady()){const e=vD.getStrategyRecommendations(),{result:t}=e;if(la.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[dD.H265]){const{configs:e}=this.playerData;if(!e)return;const{url:i,codec:n}=e,r=this.playerData.playList||[],o=r.filter((e=>!e.codec||e.codec===tr.UNKNOWN)),s=r.filter((e=>e.codec===tr.H264)),a=r.filter((e=>e.codec===tr.H265)),l=t[dD.H265].enableH265Hardware,h=er(l?a.concat(s).concat(o):s.concat(o).concat(a),"definition"),d=!l&&!!i&&n===tr.H265&&h.length>0;this.playerData.initPlayData(c(u({},this.playerData.configs),{url:d?null:i,codec:d?tr.UNKNOWN:n,playList:h})),la.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;mH.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._mountHlsMasterController(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),WU.afterPlayerCreate(this)}_mountHlsMasterController(){var e,t,i,n;this._hlsMasterRefreshListener&&(null==(t=null==(e=this.player)?void 0:e.off)||t.call(e,ro,this._hlsMasterRefreshListener)),null==(i=this._hlsMasterController)||i.destroy(),this._hlsMasterController=new nH({getRuntime:()=>vH(this.player,this.playerData),getPlaybackSessionId:()=>NB.getPlaybackSessionId(this),getAbrOptions:()=>{var e,t;return null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.autoBitrateOpts},getDefinitions:()=>{var e,t;return(null!=(t=null==(e=this.playerData)?void 0:e.playList)?t:[]).filter((e=>!this.playerData.isAutoDefinition(e.definition)))},getCurrentDefinition:()=>{var e,t;return null==(t=null==(e=this.playerData)?void 0:e.current)?void 0:t.definition},getStreamType:()=>{var e;return null==(e=this.playerData)?void 0:e.getCurrentStreamType()},isAbrModuleAvailable:()=>{var e,t,i,n,r;return"veplayer"!==(null==(t=null==(e=this.playerData)?void 0:e.getConfiguredHlsAbrEngine)?void 0:t.call(e))||!!(null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.autoBitrateOpts)?void 0:r.module)},isAbrLicenseAvailable:()=>{var e,t,i,n,r;return!!(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.isLive)||!!(null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.licensSupportModuleList)?void 0:r.includes(bD.ABR))},emit:(e,t)=>{var i;return null==(i=this.player)?void 0:i.emit(e,t)}}),null==(n=this.player)||n.on(ro,this._getHlsMasterRefreshListener()),this._mountHlsSubtitleAdapter()}_mountHlsSubtitleAdapter(){var e,t,i,n,r;const o=null==(t=null==(e=this.player)?void 0:e.plugins)?void 0:t.subtitle,s=vH(this.player,this.playerData);if(!o||"hlsjs"!==s.playbackEngine||!s.hls)return null==(i=null==o?void 0:o.setRuntimeSubtitleBridge)||i.call(o,void 0),null==(n=this._hlsSubtitleAdapter)||n.destroy(),void(this._hlsSubtitleAdapter=null);this._hlsSubtitleAdapter?this._hlsSubtitleAdapter.refreshRuntime():(this._hlsSubtitleAdapter=new dH({getRuntime:()=>vH(this.player,this.playerData),getPlaybackSessionId:()=>NB.getPlaybackSessionId(this),getExplicitSubtitleList:()=>this._explicitSubtitleListSnapshot,getSubtitleConfig:()=>{var e;return Xa(null==(e=this.playerData)?void 0:e.configs,"Subtitle")},updatePluginList:(e,t)=>{var i;return null==(i=o.replaceRuntimeSubtitleList)?void 0:i.call(o,e,t)},confirmPluginSelection:e=>{var t;return null==(t=o.confirmRuntimeSubtitleSelection)?void 0:t.call(o,e)},syncRendererSelection:e=>{var t;return null==(t=o.syncRuntimeSubtitleRenderer)?void 0:t.call(o,e)},clearRenderer:()=>{var e;return null==(e=o.clearRuntimeSubtitleView)?void 0:e.call(o)},emit:(e,t)=>this.emit(e,t)}),null==(r=o.setRuntimeSubtitleBridge)||r.call(o,{switchSubtitle:e=>{var t,i;return null!=(i=null==(t=this._hlsSubtitleAdapter)?void 0:t.switchSubtitle(e))?i:Promise.reject(new sr("HLS_SUBTITLE_SWITCH_FAILED","The HLS subtitle adapter is unavailable."))},hide:()=>{var e;return null==(e=this._hlsSubtitleAdapter)?void 0:e.hide()},show:()=>{var e,t;return null!=(t=null==(e=this._hlsSubtitleAdapter)?void 0:e.show())?t:Promise.resolve()}}))}_cloneExplicitSubtitleList(e){return Array.isArray(e)?e.map((e=>c(u({},e),{source:"config"}))):[]}_getHlsMasterRefreshListener(){return this._hlsMasterRefreshListener||(this._hlsMasterRefreshListener=()=>{var e;null==(e=this._hlsMasterController)||e.refreshRuntime(),this._mountHlsSubtitleAdapter()}),this._hlsMasterRefreshListener}_setVeError(){var e;const t=this.playerData.configs,i={oriErrRetryCount:t.oriErrRetryCount,oriErrRetryCycle:t.oriErrRetryCycle,oriErrRetryBaseDelay:t.oriErrRetryBaseDelay,oriErrMaxTotalRetry:t.oriErrMaxTotalRetry,enableOriErrRetry:t.enableOriErrRetry,needSyncAnalyzeError:t.needSyncAnalyzeError,analyzeTimeout:t.analyzeTimeout,clientKey:null==(e=mH.ttDramaEnv)?void 0:e.clientKey};this.veErrorIns=new YL(this.player,i)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(WD.ERROR,e)})),this.delayError=[]}_emitDelayEvent(){this.player&&this.delayEvents.forEach((e=>{const{name:t,payload:i}=e||{};t&&this.emit(t,i)})),this.delayEvents=[]}_setPlayerInfo(){this.player&&(this.player.playerVersion="1.19.0-rc.1",this.player.vtype=this.getVtype())}getVtype(){var e,t,i;const n=this.getStreamType()||Sa(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),r=Br.isMSE(this.player.media);return!this.player.playerType&&(this.player.playerType=n,"hls"===(null==n?void 0:n.toLowerCase())&&(null==(i=this.player)?void 0:i.vodLogger))?r?"HLS_MSE":"HLS":n.toUpperCase()}_mountingPlayerPanel(e){var t;const{options:i,isLive:n}=this.playerData;this.player&&e&&(this.mobilePanel=new oM({config:null!=(t=i.panel)?t:{mode:n?Xs.INNER:Xs.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_onPlayerRebuild(){if(!this._publicPlayNextOperation&&!NB.hasActiveIdentitySwitch(this))return this.createPlayer()}_getPlayerRebuildListener(){return this._playerRebuildListener||(this._playerRebuildListener=()=>this._onPlayerRebuild()),this._playerRebuildListener}_bindPlayerEvents(){var e;if(!this.player)return;this.player.on(jD.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.once(WD.READY,this._emitDelayError.bind(this)),this.player.once(WD.READY,this._emitDelayEvent.bind(this)),this.player.on(WD.ERROR,this._onError),this.player.on(HL,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(VD.PRELOAD_INFO,this._onMp4PreloadInfo)}_onMediaExpiredAction(){var e,t;if(this.emitExpireTimestamp=Math.round((new Date).getTime()/1e3),(null==(e=this.playerData)?void 0:e.onMediaExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onMediaExpired)){const e=za(this.playerData.onMediaExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateMediaSource(e)))}}updateMediaSource(e){try{this.assertLiteConfig(e)}catch(r){return Promise.reject(r)}const{url:t,playList:i,getVideoByToken:n}=e||{};return t||(null==i?void 0:i.length)?new Promise(((t,n)=>{this.playerData.updateConfigs(e),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData();const r=this.playerData.getCurrentUrl();if(this.player.isError||this.player.state<6&&Gr.isWeixin&&Gr.os.isIos){if(!(null==i?void 0:i.length))return this.playNext(u({},e),!1);{const t=this.playerData.current.definition,n=i.find((e=>e.definition===t));if(n&&n.url)return this.playNext(c(u({},e),{url:n.url}),!1)}}else{this.player.setConfig(c(u({},e),{url:r,definition:this.getDefinitionConfig()}));const i=this.player.switchURL(r,{seamless:!0});i&&i.then?(i.then((()=>t(void 0))),i.catch((()=>n()))):t(void 0)}})):(null==n?void 0:n.playAuthToken)?this.updateAuthToken(n):void 0}onTokenExpiredAction(){var e,t;if((null==(e=this.playerData)?void 0:e.onTokenExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onTokenExpired)){const e=za(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(Yo).filter((e=>e!==Jr)),t=[...Object.values(VD),...Object.values(jD),...e];[...new Set(t.filter((e=>"string"==typeof e)))].forEach((e=>{"string"==typeof e&&this.player.on(e,((...t)=>{this._emitter.emit(e,...t)}))})),this.player.on("hlsAudioTracksUpdated",(e=>{this._applyAudioPreference(e.audioTracks),this._emitter.emit(jD.AUDIO_TRACKS_UPDATED,e)})),this.player.on("hlsAudioTrackSwitched",(e=>{var t,i,n,r,o;const s=this._getHlsInstance(),a=null==(t=null==s?void 0:s.audioTracks)?void 0:t.find((t=>t.id===e.id));if(this._suppressAudioTrackMemory)this._clearSuppressAudioTrackMemory();else{a&&(this._lastSelectedAudioTrack=a);const e=null!=(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.audioTrackSwitchSeekOffset)?r:.1,t=null==(o=this.player)?void 0:o.media;e>0&&t&&!t.paused&&isFinite(t.currentTime)&&(t.currentTime+=e)}this._emitter.emit(jD.AUDIO_TRACK_CHANGE,c(u({},e),{audioTrack:a}))})),this._bindNativeAudioTrackEvents()}_bindNativeAudioTrackEvents(){var e,t;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;i&&(i.addEventListener("addtrack",this._onNativeAddTrack),i.addEventListener("change",this._onNativeTrackChange),i.addEventListener("removetrack",this._onNativeAddTrack))}_mountingExtendMethods(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}_getHlsInstance(){var e,t,i;const n=null==(e=this.player)?void 0:e.plugins;return(null==(t=null==n?void 0:n.encrypthlsplugin)?void 0:t.hls)||(null==(i=null==n?void 0:n.hls)?void 0:i.hls)}_applyAudioPreference(e){var t,i,n,r;if(!(null==e?void 0:e.length))return;const o=this._getHlsInstance();if(!o)return;const s=null!=(r=null!=(n=this._lastSelectedAudioTrack)?n:null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference)?r:{};if(0===Object.keys(s).length)return;this._setSuppressAudioTrackMemory();const a=o;if("function"==typeof a.setAudioOption)a.setAudioOption(aL(s));else{const t=s.lang;if(!t)return void this._clearSuppressAudioTrackMemory();const i=e.findIndex((e=>{var i;return(null==(i=e.lang)?void 0:i.toLowerCase())===t.toLowerCase()}));-1!==i&&o.audioTrack!==i?o.audioTrack=i:this._clearSuppressAudioTrackMemory()}}_setSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!0,null!==this._suppressAudioTrackMemoryTimer&&clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=setTimeout((()=>{this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null}),2e3)}_clearSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!1,null!==this._suppressAudioTrackMemoryTimer&&(clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=null)}_applyAudioPreferenceNative(e){var t,i,n;if(!(null==e?void 0:e.length))return;const r=[this._lastSelectedAudioTrack,null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference];for(const o of r){if(!o)continue;const t=o.id,i=o.lang,r=o.name;if(void 0===t&&!i&&!r)continue;let s=-1;for(let o=0;o<e.length;o++){const a=e[o];if((void 0===t||o===Number(t))&&!(i&&(null==(n=a.language)?void 0:n.toLowerCase())!==i.toLowerCase()||r&&a.label!==r)){s=o;break}}if(-1!==s)return void lL(e,s)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(jD.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.off(WD.ERROR,this._onError),this.player.off(HL,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(VD.PRELOAD_INFO,this._onMp4PreloadInfo)}changePluginsIcon(e,t){var i;if(!this.player)return;const n=this.player.getPlugin(e);if(!n||!(null==n?void 0:n.root))return;const r=Br.hasClass(null==n?void 0:n.parent,"panel-icon-svg")?null==(i=null==n?void 0:n.parent)?void 0:i.parentNode:null==n?void 0:n.root;r&&(t?Br.show(r,"block"):Br.hide(r))}getSdkPlugin(e){var t;const i=null==(t=this._sdkPlugins)?void 0:t[e.toLowerCase()];return i&&i.pluginName?i:null}switchAuthToken(e,t=!0){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}return this._performAuthTokenSwitch(e,t)}_switchAuthToken(e,t,i){return this._performAuthTokenSwitch(e,t,i).then((()=>{i&&NB.commitIdentitySwitch(this,i)})).catch((e=>{throw i&&NB.rollbackIdentitySwitch(this,i),e}))}_performAuthTokenSwitch(e,t,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken");return r&&this.player?this._runDestroyableSourceSwitch((o=>r.updateAuthToken(e,t).then((()=>(o(),this._playerPlayNext(n,i)))).then((()=>{})))):(la.error("current is not playAuthToken play or player not created"),Promise.reject())}updateAuthToken(e){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}const t=this.getSdkPlugin("AuthToken");return new Promise(((i,n)=>{t&&this.player?t.updateAuthToken(e,!1).then((()=>{if(this.player.isError)this._playerPlayNext(this.player.currentTime).then((()=>i())).catch((()=>n()));else{const e=this.playerData.getCurrentUrl();this.player.setConfig({url:e,definition:this.getDefinitionConfig()});const t=this.player.switchURL(e,{seamless:!0});t&&t.then?(t.then((()=>i())),t.catch((()=>n()))):i()}})).catch((e=>n(e))):(la.error("current is not playAuthToken play or player not created"),n())}))}_playerPlayNext(e=0,t){const i=this.player;return new Promise(((n,r)=>{var o,s,a;const l=i.paused&&!i.isError;i.addClass(Ps.ENTER);const h=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),d=c(u(u({},this.playerData.options),this._getDramaConfigPatchForPlayer()),{definition:this.getDefinitionConfig(),startTime:e,autoplay:!0,url:h});d.poster&&i.plugins.poster&&i.plugins.poster.update(d.poster),this.setPluginConfig(d);let p=!t,f=!1,g=()=>{};const y=[],v=(e,t)=>{y.push([e,t]),i.once(e,t)},m=e=>{f||(f=!0,g(),(()=>{for(const[e,t]of y)i.off(e,t);y.length=0})(),e())};g=this._registerSourceSwitchAborter((e=>{m((()=>r(e)))}));const _=(e,t)=>{const i=(...n)=>{p?m((()=>t(...n))):v(e,i)};v(e,i)};_(WD.ERROR,(e=>r(e))),_(WD.CANPLAY,(()=>{l&&i.pause(),n(!0)})),v(WD.EMPTIED,(()=>{!p&&t&&(p=NB.armIdentitySwitch(this,t,i))}));try{if(i.plugins.dashplugin){const e=u(u({},Xa(i.config,"DASHPlugin")),this.playerData.options.DASHPlugin||{});e.dashOpts=this.playerData.dashOpts,e.vid=null==(s=null==(o=this.playerData.dashOpts)?void 0:o.Data)?void 0:s.Vid,i.plugins.drm&&(null==(a=i.plugins.drm)||a.restart()),i.setConfig(d),i.plugins.dashplugin.next(i.currentTime,"NEXT",e)}else i.playNext(d)}catch(fF){m((()=>r(fF)))}}))}get src(){var e,t;return(null==(e=this.player)?void 0:e.currentSrc)||(null==(t=this.player)?void 0:t.src)}set src(e){this.player&&(this.player.src=e)}switchURL(e){try{this.assertLiteConfig({url:e})}catch(n){return Promise.reject(n)}const t=this.player.switchURL(e,!1),i=this.player.currentTime;return t&&t.then?t:new Promise((e=>{const t=this.player.paused&&!this.player.isError,n=()=>{this.player.currentTime=i,t&&this.player.once(WD.CANPLAY,(()=>{this.player.pause()})),e()};Gr.os.isAndroid?this.once(WD.TIME_UPDATE,(()=>{n()})):this.once(WD.CANPLAY,(()=>{n()})),this.player.play()}))}next(e,t=!0){try{this.assertLiteConfig(e)}catch(i){return Promise.reject(i)}return this._publicPlayNextOperation||NB.hasActiveIdentitySwitch(this)?Promise.reject(this._createPlayNextInProgressError()):this._next(e,t)}_next(e,t=!0,i){var n;const r=this._lifecycleGeneration||0,o=t?0:this.player.currentTime,s=this.playerData.configs,a=this._applyIncomingIdentityAliases(u(c(u({},s),{startTime:o,autoplay:!0}),e),e);(null==(n=null==e?void 0:e.getVideoByToken)?void 0:n.playAuthToken)&&(a.streamType=Sa(null==e?void 0:e.getVideoByToken)||nr.MP4);const l=NB.beginIdentitySwitch(this,NU(a),this.player,t,i);return l?this._teardown(!0).then((()=>{if(this._isStaleLifecycleGeneration(r))throw this._createDestroyedPlaybackSwitchError();return this._init(a,l)})).catch((e=>{if(NB.rollbackIdentitySwitch(this,l),this._isDestroyedPlaybackSwitchError(e))throw e;if(la.error("next_error",e),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))throw e})):Promise.reject(this._createPlayNextInProgressError())}playNext(e,t=!0){var i;try{this.assertLiteConfig(e)}catch(l){return Promise.reject(l)}if(this._publicPlayNextOperation||NB.hasActiveIdentitySwitch(this))return Promise.reject(this._createPlayNextInProgressError());const n={};this._publicPlayNextOperation=n;const r=this.player;try{r.emit(VD.PLAY_NEXT_START),null==(i=this._hlsSubtitleAdapter)||i.clearForPlaybackSwitch()}catch(l){return this._publicPlayNextOperation===n&&(this._publicPlayNextOperation=null),Promise.reject(l)}let o,s=null;try{const i=this._createDramaPlayNextCandidateConfig(e);if(s=NB.beginIdentitySwitch(this,NU(i),this.player,t),!s)throw this._createPlayNextInProgressError();this._lastSelectedAudioTrack=null,this._clearSuppressAudioTrackMemory(),this._playNextPending=!0,o=this._playNext(e,t,s)}catch(l){s&&NB.rollbackIdentitySwitch(this,s),o=Promise.reject(l)}const a=o.catch((e=>{throw s&&NB.rollbackIdentitySwitch(this,s),e}));return s?s.settled.then((()=>{this._publicPlayNextOperation===n&&(this._publicPlayNextOperation=null)})):a.finally((()=>{this._publicPlayNextOperation===n&&(this._publicPlayNextOperation=null)})).catch((()=>{})),a.finally((()=>{r.emit(VD.PLAY_NEXT_END)})).catch((()=>{})),a}_createPlayNextInProgressError(){return new Error("VePlayer playNext is already in progress")}_registerSourceSwitchAborter(e){this._sourceSwitchAborters||(this._sourceSwitchAborters=new Set);const t=this._sourceSwitchAborters;return t.add(e),()=>{t.delete(e),0===t.size&&this._sourceSwitchAborters===t&&(this._sourceSwitchAborters=void 0)}}_abortSourceSwitches(){const e=this._sourceSwitchAborters;if(this._sourceSwitchAborters=void 0,!e)return;const t=this._createDestroyedPlaybackSwitchError();for(const i of e)i(t)}_runDestroyableSourceSwitch(e){return new Promise(((t,i)=>{let n=!1,r=()=>{};const o=()=>{if(n)throw this._createDestroyedPlaybackSwitchError()},s=e=>{n||(n=!0,r(),e())};r=this._registerSourceSwitchAborter((e=>{s((()=>i(e)))}));try{Promise.resolve(e(o)).then((e=>s((()=>t(e)))),(e=>s((()=>i(e)))))}catch(fF){s((()=>i(fF)))}}))}_createDestroyedPlaybackSwitchError(){return new Error("VePlayer destroyed during playback switch")}_isDestroyedPlaybackSwitchError(e){return e instanceof Error&&"VePlayer destroyed during playback switch"===e.message}_isStaleLifecycleGeneration(e){return e!==(this._lifecycleGeneration||0)}_cancelStalePlayerCreation(){this._isCollectingCreatePlayerPerf=!1}_discardStalePlayer(e){var t;if(e){this.player===e&&(this.player=null);try{const i=null==(t=e.destroy)?void 0:t.call(e);(null==i?void 0:i.catch)&&i.catch((()=>{}))}catch(i){}}}updatePlayNextSubtitleConfig(e,t){var i,n,r,o,s;const a=Xa(e,"Subtitle"),l=Array.isArray(null==a?void 0:a.list);if(!l&&!t)return;const h=l?a.list:[];this._explicitSubtitleListSnapshot=this._cloneExplicitSubtitleList(h);const d=c(u(u(u({},Xa(this.playerData.options,"Subtitle")||{}),Xa(this.playerData.configs,"Subtitle")||{}),a||{}),{list:h});e.Subtitle=d,this.playerData.updateConfigs({Subtitle:d}),this.playerData.options.Subtitle=d,null==(o=null==(r=null==(n=null==(i=this.player)?void 0:i.plugins)?void 0:n.subtitle)?void 0:r.updateSubtitles)||o.call(r,h),null==(s=this._hlsSubtitleAdapter)||s.refreshRuntime()}_playNext(e,t=!0,i){var n,r,o;if(!e)return Promise.reject();const{url:s,playList:a,getVideoByToken:l}=e,h=this.player.paused&&!this.player.isError,d=t?0:this.player.currentTime;if(s||(null==a?void 0:a.length)){this._applyIncomingIdentityAliases(this.playerData.configs,e),this.playerData.updateConfigs(e),this.playerData.initPlayData(e);const n=this.adapter.canOpenAbr()&&this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),r=this.player,o=r.state,s=this.getDefinitionConfig(),a=c(u({startTime:d},e),{url:n,definition:s});return this.updatePlayNextSubtitleConfig(a,t),this.setPluginConfig(a),new Promise(((e,t)=>{let n=!1,s=!1,l=()=>{};const u=[],c=(e,t)=>{const i=(...i)=>{n||e===WD.EMPTIED?t(...i):c(e,t)};u.push([e,i]),r.once(e,i)},d=e=>{s||(s=!0,l(),(()=>{var e;for(const[t,i]of u)null==(e=r.off)||e.call(r,t,i);u.length=0})(),e())};l=this._registerSourceSwitchAborter((e=>{d((()=>t(e)))})),c(WD.ERROR,(e=>{d((()=>t(e)))})),c(WD.CANPLAY,(()=>{d((()=>{6===o&&h?r.pause():6!==o&&r.config.autoplay&&r.play(),e(void 0)}))}));const p=()=>{n||(n=!i||NB.armIdentitySwitch(this,i,r))};u.push([WD.EMPTIED,p]),r.once(WD.EMPTIED,p);try{r.playNext(a)}catch(f){d((()=>t(f)))}}))}if(mH.ttDramaEnv){if(null==(n=e.getVideoByToken)?void 0:n.playAuthToken){if((this.playerData.getCurrentStreamType()||Sa(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||Sa(null==e?void 0:e.getVideoByToken)||"mp4"))return this._next(e,t,i)}const o=this._createDramaPlayNextCandidateConfig(e);return i?this.switchDramaEpisode(o,t,i):this.switchDramaEpisode(o,t)}if(null==l?void 0:l.playAuthToken){return(this.playerData.getCurrentStreamType()||Sa(null==(o=this.playerData.configs)?void 0:o.getVideoByToken))!==(e.streamType||Sa(null==e?void 0:e.getVideoByToken)||"mp4")?this._next(e,t,i):(this.playerData.updateConfigs(e),this._switchAuthToken(l,t,i))}return this._next(e,t,i)}_applyIncomingIdentityAliases(e,t){const i=e,n=t;for(const r of[["albumId","album_id"],["episodeId","episode_id","episodeID"]]){if(r.some((e=>Object.prototype.hasOwnProperty.call(n,e)))){for(const e of r)delete i[e];for(const e of r)Object.prototype.hasOwnProperty.call(n,e)&&(i[e]=n[e])}}return e}_createDramaPlayNextCandidateConfig(e){const t=this._applyIncomingIdentityAliases(this.playerData.getMergedConfigs(e),e);return Object.prototype.hasOwnProperty.call(e,"transcodeParam")&&(t.transcodeParam=e.transcodeParam),t}_getDramaConfigPatchForPlayer(){const e=this.playerData.configs,t=["albumId","album_id","episodeId","episode_id","episodeID"],i={};for(const n of t){const t=e[n];null!=t&&""!==t&&(i[n]=t)}return i}_buildDramaInvalidParamError(){const e=xL.INVALID_PARAM;return{errorType:RL.network,errorCode:e.code,veError:YL.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){return NU(e).albumId||""}_getDramaEpisodeIdFromConfig(e){return NU(e).episodeId||""}switchDramaEpisode(e,t=!0,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken"),o=NB.beginIdentitySwitch(this,NU(e),this.player,t,i);return o?r&&this.player?this._runDestroyableSourceSwitch((i=>r.updateDramaEpisode(t,e).then((()=>(i(),this._playerPlayNext(n,o)))).then((()=>{})))).then((()=>{NB.commitIdentitySwitch(this,o)})).catch((e=>{throw NB.rollbackIdentitySwitch(this,o),e})):(NB.rollbackIdentitySwitch(this,o),la.error("switchDramaEpisode: AuthToken plugin or player not available"),Promise.reject(new Error("AuthToken plugin or player not available"))):Promise.reject(this._createPlayNextInProgressError())}_destroyPlayer(){return d(this,null,(function*(){var e,t,i,n,r,o,s,a,l,u,c;this._hlsMasterRefreshListener&&(null==(t=null==(e=this.player)?void 0:e.off)||t.call(e,ro,this._hlsMasterRefreshListener)),null==(i=this._hlsMasterController)||i.destroy(),this._hlsMasterController=null,null==(s=null==(o=null==(r=null==(n=this.player)?void 0:n.plugins)?void 0:r.subtitle)?void 0:o.setRuntimeSubtitleBridge)||s.call(o,void 0),null==(a=this._hlsSubtitleAdapter)||a.destroy(),this._hlsSubtitleAdapter=null,this._offPlayerEvents(),null==(l=this.veErrorIns)||l.destroy(),this.veErrorIns=null,yield null==(u=this.mobilePanel)?void 0:u.destroy(),yield null==(c=this.player)?void 0:c.destroy(),this.player=null}))}getPlayerInstance(){return this.player}getSoftDecodingOption(e,t,i){return d(this,null,(function*(){var n,r;const{enableH265Degrade:o,codec:s,configs:a,isLive:l}=this.playerData,u=function(e){var t,i;if(!(null==e?void 0:e.playAuthToken))return!1;const n=Ea(null==e?void 0:e.playAuthToken),r=null!=(i=null==(t=null==n?void 0:n.FileType)?void 0:t.toLowerCase())?i:"video";return!!n&&("evideo"===r||"eaudio"===r)}(null==a?void 0:a.getVideoByToken),c=!!(a.enableMp4MSE||Xa(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(s===tr.H265||u||(null==(n=null==a?void 0:a.autoBitrateOpts)?void 0:n.enable)));if(mH.shouldCheckLicense()&&(null==(r=this._originConfigs)?void 0:r.useSoftDecoding)&&!l)try{const e=yield mH.checkLicenseStatus();if(!(yield mH.checkLicenseModuleAuth(SD.SDK_VOD_PLAY,bD.H265)))throw this.emit(jD.LICENSE_STATUS_WARNING,e===kD.LICENSE_STATUS_EXPIRED?LL.EXPIRED_LICENSE_NOT_SUPPORT_265:LL.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(fF){return void la.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(jw.XGVideo);if(null==e?void 0:e.isSupported()){if(s&&e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),c){const e=yield Gw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=s?s:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=s?s:tr.H264}}{this.emit(jD.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),la.error("soft decode is not support by current browser")}}else if(o&&!s&&t&&(yield this.detectCodec(t)),this.playerData.isCurrentH265()&&!function(){const e=window.navigator.userAgent.toLocaleLowerCase(),t=/(iphone)/.test(e)||/(ipad)/.test(e);if(/(VivoBrowser)/.test(e)){const t=e.match(/VivoBrowser\/(\d+)?/);if((null==t?void 0:t[1])>=22)return!0}return!!(t||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"')))}())if(o){if(mH.shouldCheckLicense()&&!l)try{const e=yield mH.checkLicenseStatus();if(!(yield mH.checkLicenseModuleAuth(SD.SDK_VOD_PLAY,bD.H265)))throw this.emit(jD.LICENSE_STATUS_WARNING,e===kD.LICENSE_STATUS_EXPIRED?LL.EXPIRED_LICENSE_NOT_SUPPORT_265:LL.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(fF){return void la.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(jw.XGVideo);if(null==e?void 0:e.isSupported()){if(null==e||e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,c){const e=yield Gw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=s?s:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=s?s:tr.H264}}{this.emit(jD.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),la.error("soft decode is not support by current browser")}}else{this.emit(jD.NOT_SUPPORT_HARDWARE_DECODER);const e={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"};this.delayError.push(e),la.error("h265 hardware decode is not supported by this browser")}return{}}))}setH265SoftPlayList(){if(this.playerData.isCurrentH265()){const e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((e=>{var t;return(null==(t=null==e?void 0:e.codec)?void 0:t.toLowerCase())===tr.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}changeDefinition(e){var t,i,n,r,o,s;if((null==(t=this.getDefinitionList())?void 0:t.length)<=1)return;const{sdkdefinitionplugin:a,definitionmobileplugin:l}=(null==(i=this.player)?void 0:i.plugins)||{};if(a||l)e!==this.playerData.current.definition&&(a?null==a||a.changeDefinition(e):l&&(null==l||l.changeDefinition(e)));else{let t;const{current:{lineId:i}}=this.playerData;t=this.playerData.getDefinitionListByLineId(i).find((t=>t.definition===e)),t||(t=null==(s=null==(o=null==(r=null==(n=this.player)?void 0:n.config)?void 0:r.definition)?void 0:o.list)?void 0:s.find((t=>(null==t?void 0:t.definition)===e))),t&&(this.player.changeDefinition(t),t.definition!==this.playerData.current.definition&&(this.playerData.current.definition=t.definition))}}getDefinitionList(){var e;const{sdkdefinitionplugin:t,definitionmobileplugin:i}=(null==(e=this.player)?void 0:e.plugins)||{};return t||i?(null==t?void 0:t.renderList)||(null==i?void 0:i.renderList):this.player.definitionList.map((e=>{var t;const i=this.playerData.isDefinitionMatch(e.definition,null==(t=this.player.curDefinition)?void 0:t.definition),n=e.url===this.player.url,r=e.url===this.player.src;return c(u({},e),{isDefinitionAuto:this.playerData.isAutoDefinition(e.definition),selected:i||(this.playerData.isOpenABR()&&Gr.os.isIos?r:n)})}))}getHlsLevels(){var e,t;return null!=(t=null==(e=this._hlsMasterController)?void 0:e.getLevels())?t:[]}getHlsLevelState(){var e,t,i;return null!=(i=null==(e=this._hlsMasterController)?void 0:e.getLevelState())?i:{playbackSessionId:null!=(t=NB.getPlaybackSessionId(this))?t:"",ready:!1,levels:[],currentLevel:-1,loadLevel:-1,nextLevel:-1,manualLevel:-1,autoLevelEnabled:!1,autoLevelCapping:-1}}setHlsLevel(e,t){if(!this._hlsMasterController)throw new sr("HLS_ENGINE_UNSUPPORTED","HLS Level control requires the hls.js playback engine.");this._hlsMasterController.setLevel(e,t)}getHlsAbrState(){var e,t,i;return null!=(i=null==(e=this._hlsMasterController)?void 0:e.getAbrState())?i:{playbackSessionId:null!=(t=NB.getPlaybackSessionId(this))?t:"",playbackEngine:"none",configuredEngine:null,engine:"none",decisionSource:"none",available:!1,active:!1,mode:"auto",reason:"NOT_HLS",capabilities:{levelList:!1,manualLevelSwitch:!1,restoreAuto:!1,levelCap:!1,bitrateCap:!1,definitionCap:!1}}}setHlsAbrMode(e){if(!this._hlsMasterController)throw new sr("HLS_ABR_UNAVAILABLE","HLS ABR mode control is unavailable.");this._hlsMasterController.setAbrMode(e)}getHlsAbrLimit(){var e,t;return null!=(t=null==(e=this._hlsMasterController)?void 0:e.getAbrLimit())?t:null}setHlsAbrLimit(e){if(!this._hlsMasterController)throw new sr("HLS_ABR_UNAVAILABLE","HLS ABR limit control is unavailable.");this._hlsMasterController.setAbrLimit(e)}getAudioTracks(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack;return n.audioTracks.map((t=>c(u({},t),{selected:t.id===e})))}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!(null==r?void 0:r.length))return[];const o=[];for(let s=0;s<r.length;s++){const e=r[s];o.push({id:s,name:e.label||e.language||String(s),lang:e.language,default:e.enabled,selected:e.enabled})}return o}getCurrentAudioTrack(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack,t=n.audioTracks.find((t=>t.id===e));return t?c(u({},t),{selected:!0}):null}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!r)return null;for(let o=0;o<r.length;o++){const e=r[o];if(e.enabled)return{id:o,name:e.label||e.language||String(o),lang:e.language,default:!0,selected:!0}}return null}switchAudioTrack(e){var t,i;const{id:n}=e,r=this._getHlsInstance();if(r)return void uL(r,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&lL(o,n)}get preLoadData(){var e;if(!this.player||!this.player.plugins)return{hit:0};const t=this.player.plugins.mp4encryptplayer;if(t&&t.preLoadData)return{hit:!0===t.hitpreload?1:0,duration:t.preLoadData.duration,length:t.preLoadData.byteLength};const i=(null==(e=this.player)?void 0:e.stat)||{};if(i.preLoadData){const{length:e,duration:t}=i.preLoadData,n={hit:e>0?1:0,length:e,duration:0};return t>=0&&(n.duration=t),n}return{hit:0,duration:0,length:0}}_initI18N(e){const{extraLangList:t,extendLangList:i}=e;null==t||t.forEach((e=>{Ns.use(e)})),Ns.extend(XU),i&&Ns.extend(i)}get musicMode(){}set musicMode(e){}get musicTimeScale(){}set musicTimeScale(e){}get musicList(){}set musicList(e){}musicAdd(e){}musicRandom(){}musicNext(){}musicPrev(){}musicSetIndex(e){}musicForward(){}musicBackward(){}musicRemove(e){}musicSetAbCycle(e,t,i,n){}musicRemoveAbCycle(){}getLogUserId(){var e,t,i;const n=null==(e=this.player)?void 0:e.vodLogger;if(n){const e=(null==(t=null==n?void 0:n.tracker)?void 0:t.getConfig())||{};return null==(i=null==e?void 0:e.user)?void 0:i.user_unique_id}}get region(){return this.playerData.region}get userRegion(){return this.playerData.userRegion}getPlugin(e){var t;return null==(t=this.player)?void 0:t.getPlugin(e)}getSubtitleList(){var e,t;const i=this.getPlugin("subtitle");return(null!=(t=null==(e=null==i?void 0:i.config)?void 0:e.list)?t:[]).map((e=>u({},e)))}switchSubtitle(e){const t=this.getPlugin("subtitle");return t?t.switchSubTitle(e):Promise.reject(new Error("subtitle plugin is not registered"))}showSubtitle(){var e,t;const i=this.getPlugin("subtitle");if(i)if(i.curIndex>-1&&i.curItem)i.switchSubTitle(i.curItem);else{const n=null!=(t=null==(e=i.config)?void 0:e.list)?t:[];n.length>0&&i.switchSubTitle(n[0])}}hideSubtitle(){var e;const t=this.getPlugin("subtitle");null==(e=null==t?void 0:t.switchOffSubtitle)||e.call(t)}_teardown(e){return d(this,null,(function*(){var t;const i=this.player;e||(this._lifecycleGeneration=(this._lifecycleGeneration||0)+1,this._abortSourceSwitches(),NB.destroy(this,i)),yield this._destroyPlayer(),this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null,this._onRepeat=null),this.mountingDom&&this.mountingDom.contains(this.playerContainer)&&this.mountingDom.removeChild(this.playerContainer),null==(t=this._emitter)||t.removeAllListeners(),this._emitter=null,WU.destroy(this)}))}destroy(){return d(this,null,(function*(){yield this._teardown(!1)}))}};let _H=mH;_H.isMSESupported=Ja,_H.veStrategy=vD,_H.sdkVersion="1.19.0-rc.1",_H.ttDramaEnv=null,_H.isMMSSupported=el,_H.isRTMSupported=RD.isSupported,_H.hasInitVeStrategy=!1;const EH=_H;function TH(){return Ns}const SH="function"==typeof Buffer,bH=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),kH=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),CH=(e=>{let t={};return kH.forEach(((e,i)=>t[e]=i)),t})(),IH=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,AH=String.fromCharCode.bind(String),PH=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),wH=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),DH=e=>{let t,i,n,r,o="";const s=e.length%3;for(let a=0;a<e.length;){if((i=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=i<<16|n<<8|r,o+=kH[t>>18&63]+kH[t>>12&63]+kH[t>>6&63]+kH[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},LH="function"==typeof btoa?e=>btoa(e):SH?e=>Buffer.from(e,"binary").toString("base64"):DH,RH=SH?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;i<n;i+=4096)t.push(AH.apply(null,e.subarray(i,i+4096)));return LH(t.join(""))},xH=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?AH(192|t>>>6)+AH(128|63&t):AH(224|t>>>12&15)+AH(128|t>>>6&63)+AH(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return AH(240|t>>>18&7)+AH(128|t>>>12&63)+AH(128|t>>>6&63)+AH(128|63&t)},OH=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,NH=e=>e.replace(OH,xH),MH=SH?e=>Buffer.from(e,"utf8").toString("base64"):bH?e=>RH(bH.encode(e)):e=>LH(NH(e)),UH=(e,t=!1)=>t?PH(MH(e)):MH(e),BH=e=>{if(e=e.replace(/\s+/g,""),!IH.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i,n,r="";for(let o=0;o<e.length;)t=CH[e.charAt(o++)]<<18|CH[e.charAt(o++)]<<12|(i=CH[e.charAt(o++)])<<6|(n=CH[e.charAt(o++)]),r+=64===i?AH(t>>16&255):64===n?AH(t>>16&255,t>>8&255):AH(t>>16&255,t>>8&255,255&t);return r},HH=UH;var FH={};!function(e){e._getPrivFilters=function(){var e,t=/</g,i=/"/g,n=/'/g,r=/&/g,o=/\x00/g,s=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,a=/[&<>"'`]/g,l=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,u=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,c={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},h=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,d=/[\x00-\x1F\x7F\[\]{}\\"]/g,p=/[\x00-\x1F\x7F\[\]{}\\']/g,f=/url[\(\u207D\u208D]+/g,g=/['\(\)]/g,y=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,v={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},m=/(?::|&#[xX]0*3[aA];?|&#0*58;?|&colon;)/,_=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,E={Tab:"\t",NewLine:"\n"},T=function(e,t,i){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,i)},S=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function b(e){var t=e.split(m,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function k(t,i,n,r){return i=i||c,n=n||u,void 0===t?"undefined":null===t?"null":t.toString().replace(o,"�").replace(n,(function(t,n,o,s){return n?(n=Number(n[0]<="9"?n:"0"+n),r?S(n):128===n?"€":130===n?"‚":131===n?"ƒ":132===n?"„":133===n?"…":134===n?"†":135===n?"‡":136===n?"ˆ":137===n?"‰":138===n?"Š":139===n?"‹":140===n?"Œ":142===n?"Ž":145===n?"‘":146===n?"’":147===n?"“":148===n?"”":149===n?"•":150===n?"–":151===n?"—":152===n?"˜":153===n?"™":154===n?"š":155===n?"›":156===n?"œ":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":e.frCoPt(n)):i[o||s]||t}))}function C(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function I(e){return e.replace(f,(function(e){return"-x-"+e}))}function A(t){var i=b(t=e.yufull(k(t)));return i&&v[i.toLowerCase()]?"##"+t:t}return e={frCoPt:function(e){return null==e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":S(e)},d:k,yup:function(e){return(e=b(e.replace(o,"")))?k(e,E,null,!0).replace(_,"").toLowerCase():null},y:function(e){return T(e,a,(function(e){return"&"===e?"&amp;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"&#96;"}))},ya:function(e){return T(e,r,"&amp;")},yd:function(e){return T(e,t,"&lt;")},yc:function(e){return T(e,l,(function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"}))},yavd:function(e){return T(e,i,"&quot;")},yavs:function(e){return T(e,n,"&#39;")},yavu:function(e){return T(e,s,(function(e){return"\t"===e?"&#9;":"\n"===e?"&#10;":"\v"===e?"&#11;":"\f"===e?"&#12;":"\r"===e?"&#13;":" "===e?"&#32;":"="===e?"&#61;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"`"===e?"&#96;":"�"}))},yu:encodeURI,yuc:encodeURIComponent,yubl:function(t){return v[e.yup(t)]?"x-"+t:t},yufull:function(t){return e.yu(t).replace(y,(function(e,t){return"//["+t+"]"}))},yublf:function(t){return e.yubl(e.yufull(t))},yceu:function(e){return e=k(e),h.test(e)?e:";-x:'"+I(e.replace(p,C))+"';-v:"},yced:function(e){return I(k(e).replace(d,C))},yces:function(e){return I(k(e).replace(p,C))},yceuu:function(e){return A(e).replace(g,(function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"}))},yceud:function(e){return A(e)},yceus:function(e){return A(e).replace(n,"\\27 ")}}};var t=e._privFilters=e._getPrivFilters();function i(e,i,n){return t.yubl(i((n||t.yufull)(e)))}e.inHTMLData=t.yd,e.inHTMLComment=t.yc,e.inSingleQuotedAttr=t.yavs,e.inDoubleQuotedAttr=t.yavd,e.inUnQuotedAttr=t.yavu,e.uriInSingleQuotedAttr=function(e){return i(e,t.yavs)},e.uriInDoubleQuotedAttr=function(e){return i(e,t.yavd)},e.uriInUnQuotedAttr=function(e){return i(e,t.yavu)},e.uriInHTMLData=t.yufull,e.uriInHTMLComment=function(e){return t.yc(t.yufull(e))},e.uriPathInSingleQuotedAttr=function(e){return i(e,t.yavs,t.yu)},e.uriPathInDoubleQuotedAttr=function(e){return i(e,t.yavd,t.yu)},e.uriPathInUnQuotedAttr=function(e){return i(e,t.yavu,t.yu)},e.uriPathInHTMLData=t.yu,e.uriPathInHTMLComment=function(e){return t.yc(t.yu(e))},e.uriQueryInSingleQuotedAttr=e.uriPathInSingleQuotedAttr,e.uriQueryInDoubleQuotedAttr=e.uriPathInDoubleQuotedAttr,e.uriQueryInUnQuotedAttr=e.uriPathInUnQuotedAttr,e.uriQueryInHTMLData=e.uriPathInHTMLData,e.uriQueryInHTMLComment=e.uriPathInHTMLComment,e.uriComponentInSingleQuotedAttr=function(e){return t.yavs(t.yuc(e))},e.uriComponentInDoubleQuotedAttr=function(e){return t.yavd(t.yuc(e))},e.uriComponentInUnQuotedAttr=function(e){return t.yavu(t.yuc(e))},e.uriComponentInHTMLData=t.yuc,e.uriComponentInHTMLComment=function(e){return t.yc(t.yuc(e))},e.uriFragmentInSingleQuotedAttr=function(e){return t.yubl(t.yavs(t.yuc(e)))},e.uriFragmentInDoubleQuotedAttr=function(e){return t.yubl(t.yavd(t.yuc(e)))},e.uriFragmentInUnQuotedAttr=function(e){return t.yubl(t.yavu(t.yuc(e)))},e.uriFragmentInHTMLData=e.uriComponentInHTMLData,e.uriFragmentInHTMLComment=e.uriComponentInHTMLComment}(FH);const jH="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",VH={SLOW:.5,MODERATE:1,FAST:2},KH={SLOW:5,MODERATE:3.5,FAST:2},GH={style:{node:jH,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function WH(e,t){const i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((e=>{i.setAttribute(e,t[e])})),i}class YH{constructor(e){this.root=e.root,this.config=e,this.wrap=document.createElement("div"),this.img=document.createElement("img"),this.imgSrc="",this.root&&this.root.appendChild(this.wrap),this.moveTimer=null,this.blinkTimer=null,this.pauseAnimation=!1,this.observer=[]}_getWatermarkDom(){const{content:e="",fontFamily:t}=this.config,i=e,n="string"==typeof this.config.fontSize?`${this.config.fontSize}`:`${this.config.fontSize}px`,r=document.createElement("text");r.style.fontSize=n,r.style.whiteSpace="nowrap",t&&(r.style.fontFamily=t),r.innerHTML=FH.inHTMLData(i),document.body.appendChild(r);const o=WH("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.offsetWidth+2,height:r.offsetHeight}),s=WH("text",u({x:r.offsetWidth/2,y:r.offsetHeight/2,style:`\n fill:${this.config.fontColor};\n text-anchor: middle;\n alignment-baseline:middle;\n opacity: ${this.config.opacity};\n font-size: ${n};\n `},t?{"font-family":t}:{}));return s.innerHTML=FH.inHTMLData(i),document.body.removeChild(r),o.appendChild(s),"data:image/svg+xml;base64, "+HH((new XMLSerializer).serializeToString(o))}_startRender(){switch(this.pauseAnimation=!1,this.config.displayType){case 0:this._fixedRender();break;case 1:this._startMove();break;case 2:this._startBlink()}this.observer[0]=this._attrObserver(this.img,["src","class"],"img"),this.observer[1]=this._attrObserver(this.wrap,["class","style","id"],"node"),this.observer[2]=this._attrObserver(this.root,["class","style"],"wrap"),this.observer[3]=this._domObserver(this.wrap),this.observer[4]=this._domObserver(this.root),this.observer[5]=this._domObserver(this.root.parentElement,!0)}_startMove(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;const{offsetX:t,offsetY:i}=this._getOffset(),n=VH[this.config.tickerSpeed]||VH.MODERATE;let r=t,o=n,s=i,a=n;clearInterval(this.moveTimer),this.moveTimer=setInterval((()=>{if(this.pauseAnimation)return;const e=this._getOffsetThreshold();r+=o,s+=a,this.wrap.offsetWidth>this.img.offsetWidth&&r>this.wrap.offsetWidth&&(r=this.wrap.offsetWidth-this.img.offsetWidth),this.wrap.offsetHeight>this.img.offsetHeight&&s>this.wrap.offsetHeight&&(s=this.wrap.offsetHeight-this.img.offsetHeight),this.img.setAttribute("style",`position: relative;left:${r}px; top:${s}px`),r>=e.hRight&&(o=-n),r<=e.hLeft&&(o=n),s>=e.vBottom&&(a=-n),s<=e.vTop&&(a=n)}),30)}_startBlink(){const e=KH[this.config.tickerSpeed]||KH.MODERATE;clearInterval(this.blinkTimer),this._blinkRender(e,!0),this.blinkTimer=setInterval((()=>{this.pauseAnimation||this._blinkRender(e)}),1e3*e)}_randomBetween(e,t){const i=t-e+1;return Math.floor(Math.random()*i)+e}_fixedRender(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;this.img.setAttribute("style","");const{offsetX:t,offsetY:i}=this._getOffset(),n=KH[this.config.tickerSpeed];return n?this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${n}s linear infinite;`):this.img.setAttribute("style",`opacity: 1;transform: translate(${t}px, ${i}px);`)}_getOffset(){const{left:e,top:t,right:i,bottom:n}=this.config,{clientWidth:r,clientHeight:o}=this.wrap,{clientWidth:s,clientHeight:a}=this.img;let l=0,u=0;return void 0!==i&&r&&(l=r-s-i),void 0!==e&&r&&(l=e),void 0!==n&&o&&(u=o-a-n),void 0!==t&&o&&(u=t),{offsetX:l,offsetY:u}}_getOffsetThreshold(){const{clientWidth:e,clientHeight:t}=this.wrap,{clientWidth:i,clientHeight:n}=this.img;return{hLeft:e-i>=0?0:e-i,hRight:e-i>=0?e-i:0,vTop:t-n>=0?0:t-n,vBottom:t-n>=0?t-n:0}}_blinkRender(e,t){var i;if(!this.img||!(null==(i=this.wrap)?void 0:i.clientWidth))return;if(this.img.setAttribute("style","opacity: 0.1;"),t){const{offsetX:t,offsetY:i}=this._getOffset();return this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${e}s linear 1;`)}const n=this._getOffsetThreshold(),{clientWidth:r,clientHeight:o}=this.wrap,s=r?this._randomBetween(n.hLeft,n.hRight):0,a=o?this._randomBetween(n.vTop,n.vBottom):0;setTimeout((()=>{this.img.setAttribute("style",`opacity: 0.1;transform: translate(${s}px, ${a}px);animation: _xg_animation_blink ${e}s linear 1;`)}),10)}_attrObserver(e,t,i){if(!e||!this.wrap||!window.MutationObserver)return;const n=new window.MutationObserver((t=>{e&&this.wrap&&t.forEach((t=>{if("class"===t.attributeName&&e.getAttribute("class")!=GH.class[i]&&e.setAttribute("class",GH.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=GH.style[i]&&e.setAttribute("style",GH.style[i]),"img"===i&&"src"===t.attributeName){if(((null==e?void 0:e.getAttribute("src"))||"")!==this.imgSrc){const t=this._getWatermarkDom();this.wrap&&t&&(this.imgSrc=t,e.setAttribute("src",t))}}}))}));return n.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:t}),n}_domObserver(e,t){if(!e||!this.wrap)return;const i=new window.MutationObserver((i=>{e&&this.wrap&&i.forEach((i=>{i.removedNodes.forEach((i=>{if(!t)return e.appendChild(i);!e.getElementsByClassName(this.config.rootClassName).length&&e.appendChild(i)}))}))}));return i.observe(e,{childList:!0}),i}update(){const e=this._getWatermarkDom();this.wrap&&this.img&&e&&(this.imgSrc=e,this.img.setAttribute("src",e))}start(){if(!(this.root&&this.wrap&&this.img))return;clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.wrap.innerHTML="",this.wrap.setAttribute("style",jH);const e=this._getWatermarkDom();e&&(this.img.src=e,this.img.style.opacity="0",this.img.alt="",this.imgSrc=e,this.wrap.appendChild(this.img),setTimeout((()=>this._startRender())))}pause(){this.pauseAnimation=!0}resume(){this.pauseAnimation=!1}resize(){}destroy(){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.img=null,this.wrap.innerHTML="",this.wrap=null}}const zH="xg-dynamic-watermark";class $H extends ks{constructor(e){super(e),this.wm=null}static get pluginName(){return"DynamicWatermark"}static get defaultConfig(){return{position:ks.POSITIONS.ROOT,displayType:1,tickerSpeed:void 0,fontSize:12,fontColor:"#ffffff",opacity:.3,enable:!1,top:void 0,left:void 0,right:void 0,bottom:void 0,content:""}}afterCreate(){this.config.enable&&(this._initWatermark(),this.once(io,(()=>{this.start()})),this.on(Ro,(()=>{this.resize()})))}start(){var e,t;null==(t=null==(e=this.wm)?void 0:e.start)||t.call(e)}pause(){var e,t;null==(t=null==(e=this.wm)?void 0:e.pause)||t.call(e)}resume(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resume)||t.call(e)}resize(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resize)||t.call(e)}_initWatermark(){this.wm=new YH(c(u({},this.config),{root:this.root,rootClassName:zH}))}destroy(){var e,t;null==(t=null==(e=this.wm)?void 0:e.destroy)||t.call(e),this.offAll()}render(){return`\n <xg-dynamic-watermark class=${zH} />\n `}}class XH extends ks{constructor(e){super(e),this.waitings=[],this.longWaitingEmitTime=0,this.waitingStartTime=0,this.playerData=null,this.playerData=this.playerConfig.playerData}static get pluginName(){return"DefinitionDemotePlugin"}static get defaultConfig(){return{isNeedAutoDemote:!0,toastShowTime:3e3,demotePriority:[],isNeedShowTips:!0,oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3}}registerLanguageTexts(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}afterCreate(){this.bindCtx(),this.bindEvents()}bindCtx(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this),this.demote=this.demote.bind(this)}bindEvents(){this.on(no,this._waiting),this.on(Zr,this._clearTime),this.on(Xr,this._clearTime),this.on(Do,this._clearTime),this.on(VD.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(VD.LONG_WAITING,this.demote)}_waiting(){this._count(),this._time()}_count(){const e=Date.now();this.waitings.push(e);const{oftenWaitingCount:t,oftenWaitingTime:i}=this.config;if(this.waitings.length>=t){const n=this.waitings.shift();n&&e-n<=i&&(la.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(VD.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void la.log("The stuttering was triggered continuously, and the interval since the last stuttering was ",Date.now()-this.waitingStartTime+"ms");this.waitingStartTime=Date.now();const e=this.player.currentTime;this.timer=setTimeout((()=>{this.player&&this.player.currentTime<=e+.1&&(la.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(VD.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&la.log("stuttering last for ",Date.now()-this.waitingStartTime+"ms"),this.clearState()}clearState(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}demote(){if(!this.player.checkBuffer(this.player.currentTime,{endDiff:.5,startDiff:.5})&&!this.player.isSeeking&&this.player.state===Ms.RUNNING&&this.player.currentTime>1){if(!this.playerData)return;const e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(!t||!t.url)return;const i=t.definition;if(!i)return;const{current:{definition:n}}=this.playerData;if(this.player.emit(VD.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){const e=t.url;la.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==n&&this.showToast(t)}else la.log("stuttering but not need demote definition")}changeUrl(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,{seamless:!this.player.config.isLive}).then((()=>{la.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(VD.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}showToast(e){var t;const i=null==(t=this.player)?void 0:t.getPlugin("sdkToastPlugin");if(!i)return;if(this.toastId&&(i.remove(this.toastId),this.toastId=null),!this.config.isNeedShowTips)return;const n=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,r=Br.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=Br.createDom("span",n,void 0,"toast-txt-bt");r.appendChild(o),this.toastId=i.add(r,this.config.toastShowTime,!0),o.addEventListener("click",(()=>{this.playerData&&(this.playerData.current.definition=e.definition,i.remove(this.toastId),this.toastId=null,la.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}}function qH(){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 QH(){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}const{POSITIONS:ZH}=ks,JH="getMirror",eF="exitMirror";class tF extends ks{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:ZH.CONTROLS_RIGHT,index:$D,disable:!1,defaultEnable:!1}}afterCreate(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}registerIcons(){return{[JH]:{icon:qH,class:"xg-get-mirror"},[eF]:{icon:QH,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[JH]),t.appendChild(e[eF])}registerLanguageTexts(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}btnClick(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}action(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(VD.MIRROR_CHANGE,this.isEnableMirror)}updateMirrorState(e){const t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}animate(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}switchTips(e){this.changeLangTextKey(this.find(".xg-tips"),e?eF:JH)}destroy(){this.unbind(["click","touchend"],this.btnClick)}render(){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">${this.langText[JH]}</div>\n </xg-icon>`}}class iF extends ks{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=Br.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=Br.checkIsFunction(this.config.getTime)?this.config.getTime:this.getTimeByStorage,this.startTime=0,this.memoryId=this.config.memoryId,this.showToast=this.showToast.bind(this),this.saveTime=this.saveTime.bind(this),this.visibilitychangeCallback=this.visibilitychangeCallback.bind(this)}static get pluginName(){return"memoryPlay"}static get defaultConfig(){return{getTime:null,saveTime:null,memoryId:"",minStartTime:1,minEndTime:1}}registerLanguageTexts(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}children(){return{toast:wx}}afterCreate(){this.once(to,this.showToast),this.on(io,(()=>{this.curTime=this.player.currentTime}))}beforePlayerInit(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}getTime(){return new Promise((e=>{const t=(i=this.getTimeFun(this.memoryId))&&i.then?i:new Promise((e=>{e(i)}));var i;t.then((t=>{var i,n,r,o,s,a;const l=function(e,t=0){const i=parseFloat(e);return Number.isNaN(i)?t:i}(t);!isNaN(l)&&l>0?(this.startTime=l,this.shouldShowToast=!0,this.playerConfig.startTime=this.startTime,(null==(r=null==(n=null==(i=this.player.plugins)?void 0:i.hls)?void 0:n.hls)?void 0:r.config)&&(this.player.plugins.hls.hls.config.startTime=this.startTime),(null==(a=null==(s=null==(o=this.player.plugins)?void 0:o.encrypthlsplugin)?void 0:s.hls)?void 0:a.config)&&(this.player.plugins.encrypthlsplugin.hls.config.startTime=this.startTime)):la.warn("the time got is invalid",t),e()})).catch((t=>{la.error("getTime function occur error",t),e()}))}))}saveTime(){var e;if(!this.player)return;const{minStartTime:t=1,minEndTime:i=1}=this.config,{currentTime:n,duration:r}=this.player,o=null!=(e=null!=n?n:this.curTime)?e:0;r&&(o<t||Math.abs(r-o)<i?this.saveTimeFun(this.memoryId,0):this.saveTimeFun(this.memoryId,o))}visibilitychangeCallback(){"hidden"===document.visibilityState&&this.saveTime()}setSave(){this.on(Qr,this.saveTime.bind(this)),this.on(Jr,this.saveTime.bind(this)),document.addEventListener("visibilitychange",this.visibilitychangeCallback.bind(this)),document.addEventListener("pagehide",this.saveTime.bind(this)),window.addEventListener("beforeunload",this.saveTime.bind(this))}showToast(){var e;if(this.shouldShowToast){this.shouldShowToast=!1;const t=null==(e=this.player)?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;if(this.startTime>0){const e=Br.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){wa(e,iF.pluginName,t+"")}getTimeByStorage(e){return Da(e,iF.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function nF(){return(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}class rF{constructor(e){this.config=e.config,this.parent=e.root,this.root=Br.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===Gr.device?"touchend":"click";this.modal=Br.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),e.root.appendChild(this.modal),this._delegates=ks.delegate.call(this,this.modal,".xg-play-list-modal",t,this.modalClick.bind(this));const{maxHeight:i}=this.config;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(ks.delegate.call(this,this.root,"li",t,this.onItemClick))}renderItemList(e){const{config:t,root:i}=this;e?t.data=e:e=t.data,t.style&&Object.keys(t.style).map((e=>{i.style[e]=t[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map(((e,t)=>{const i=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=t;const n=e.duration?Br.format(e.duration):"",r=`\n <div style="${e.poster?`background-image: url('${e.poster}')`:""}" class="xg-play-list-poster ${e.selected?"is-active":""} ${e.poster?"":"no-poster"}" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">${n}</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">${e.title}</div>\n </div>\n `,o=Br.createDom("li",r,e,i),s=Br.findDom(o,".bg"),a=null==nF?void 0:nF();!e.poster&&a&&s.appendChild(a),this.root.appendChild(o)}));const n=e.findIndex((e=>e.selected));if(n>=0){const t=Br.findDom(this.root,".xg-play-list-item.selected");if(!t)return;const{height:i}=t.getBoundingClientRect(),{height:r}=this.root.getBoundingClientRect(),o=(e.length-n)*i,s=i*e.length;this.root.scrollTop=o<r?s-r:n*i}}onItemClick(e){e.delegateTarget||(e.delegateTarget=e.target);const t=e.delegateTarget;if(t&&Br.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Br.addClass(t,"selected"),n&&Br.removeClass(n,"selected"),i&&i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}getAttrObj(e,t){if(!e||!t)return{};const i={};t.map((t=>{i[t]=e.getAttribute(t)}));const n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}show(){Br.removeClass(this.modal,"hide"),Br.addClass(this.modal,"active"),Br.removeClass(this.root,"hide"),Br.addClass(this.root,"active")}hide(){Br.removeClass(this.modal,"active"),Br.addClass(this.modal,"hide"),Br.removeClass(this.root,"active"),Br.addClass(this.root,"hide")}modalClick(e){e.stopPropagation(),this.hide();const t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}setStyle(e){Object.keys(e).forEach((t=>{this.root.style[t]=e[t]}))}destroy(){this._delegates&&(this._delegates.map((e=>{e.destroy&&e.destroy()})),this._delegates=null),this.root.parentNode.removeChild(this.root),this.root.innerHTML=null,this.root=null}}function oF(){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 sF(){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}const aF="playListNext",lF="playListToggle",uF="mobile"===Gr.device;function cF(e=[]){if(!Array.isArray(e))return[];return e.filter((e=>e.url||e.playAuthToken)).map(((e,t)=>{const i=u({},e||{});return i.vid||(i.vid=""+t),i}))}function hF(e=[],t=0){const i=Number(t),n=Number.isNaN(i)?0:i;let r=0;return r=n<=0?0:n<e.length?n:0,r<0?0:r}LD.prototype.setVodPlayListConfig=function(e){if(!(e.plugins||[]).find((e=>e.pluginName===dF.pluginName)))return;const t=Xa(e,"playListPlugin");if(t&&function(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}(t)){const{list:i=[],defaultIndex:n=0}=t,r=cF(i),o=hF(r,n),s=null==r?void 0:r[o];if(s){const{url:t,poster:i,playAuthToken:n}=s;n?e.getVideoByToken=c(u({},e.getVideoByToken||{}),{playAuthToken:n}):t&&(e.url=t),i&&(e.poster=i)}}};class dF extends ks{constructor(){super(...arguments),this.timer=null,this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.switchActiveState(e)},this.switchActiveState=e=>{e.stopPropagation();const{toggleMode:t}=this.config;"click"===t?this.toggle(!this.isActive):this.toggle(!0)},this.handleNext=e=>{e.stopPropagation(),this.next()},this._onTimeUpdate=()=>{const{player:e}=this;!this.halfPass&&e.currentTime>e.duration/2&&this.confirmOrder()},this._onEnded=()=>{if("order"===this.mode&&this.curIndex+1>=this.list.length)return this.player.pause(),void(this.player.currentTime=0);this.next()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.isActive&&this.toggle(!1)}}static get pluginName(){return"playListPlugin"}static get defaultConfig(){return{position:ks.POSITIONS.CONTROLS_LEFT,index:qD,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}beforeCreate(e){Object.values(ks.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=ks.POSITIONS.CONTROLS_LEFT,e.position=ks.POSITIONS.CONTROLS_LEFT)}afterCreate(){const{config:e}=this,{list:t=[],mode:i,defaultIndex:n}=e||{};this.initIcons(),this.halfPass=!1,this.list=cF(t),this.timer=setTimeout((()=>{this.emit(VD.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=hF(this.list,n),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(io,this._onTimeUpdate),this.on(Qr,this._onEnded),this.on([Ro,Ao],(()=>{this._resizeList()})),this.once(ro,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),uF&&this.on(po,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),uF?(e.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===e.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===e.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))}registerLanguageTexts(){return{playNext:{jp:"次に遊ぶ",en:"play next",zh:"播放下一个","zh-hk":"播放下一個"},playList:{jp:"プレイリスト",en:"playList",zh:"播放列表","zh-hk":"播放清單"}}}registerIcons(){return{[aF]:{icon:oF,class:"xg-play-next-btn"},[lF]:{icon:sF,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[aF]),this.appendChild(".xg-play-list-btn",e[lF])}show(){!this.list||this.list.length<1||Br.addClass(this.root,"show")}hide(){Br.removeClass(this.root,"show")}prev(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}next(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}changeList(e){this.player.currentTime=0,this.list=cF(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(VD.PLAY_LIST_CHANGE,this.list)}setIndex(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())}change(){if(this.disable)return;const{player:e,list:t,curIndex:i}=this;this.halfPass=!1;const{url:n,playAuthToken:r,title:o="",vid:s="",poster:a=""}=t[i];this.curInfo={url:n,playAuthToken:r,title:o,vid:s,poster:a};const l=e.sdk||e;r?l.playNext({vid:s,poster:a,autoplay:!0,getVideoByToken:{playAuthToken:r}}):l.playNext({vid:s,poster:a,autoplay:!0,url:n}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}confirmOrder(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}_nextCompute(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}_prevCompute(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}_emitChange(){this.emit(VD.PLAY_LIST_ITEM_CHANGE,this.curInfo)}toggle(e){if(e===this.isActive)return;const{controls:t}=this.player;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}onItemClick(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}renderItemList(e){const{list:t,config:i,optionsList:n,player:r}=this;"number"==typeof e&&(this.curIndex=e,this.curInfo=t[e]);const o=t.map(((t,i)=>{const n=c(u({},t),{selected:!1});return i===this.curIndex&&(n.selected=!0,e=i),n}));if(n)return void n.renderItemList(o);const s={config:{data:o,className:"xg-side-play-list",onItemClick:(e,t)=>{this.onItemClick(e,t)},onModalClick:()=>{this.toggle(!1)}},root:r.innerContainer||r.root},{height:a}=this.player.root.getBoundingClientRect(),l=a;l&&i.heightLimit&&(s.config.maxHeight=`${l}px`),this.optionsList=new rF(s),this.show(),this._resizeList()}_resizeList(){if(!this.config.heightLimit)return;const{height:e}=this.player.root.getBoundingClientRect(),t=e;this.optionsList&&this.optionsList.setStyle({maxHeight:`${t}px`})}destroy(){const{config:e}=this;"click"===e.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)}set disable(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}get disable(){return this._disable}render(){if(!this.disable)return`<xg-icon class="xg-options-icon xg-play-list-btn-container ${this.config.className||""}">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">${this.langText.playNext}</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">${this.langText.playList}</div>\n </div>\n </xg-icon>`}}const pF=Object.assign(EH,{Events:WD,Event:GD,DefinitionDemotePlugin:XH,MirrorPlugin:tF,MemoryPlay:iF,Subtitle:Px,DynamicWatermarkPlugin:$H,PlayListPlugin:dF,getI18N:TH,BasePlugin:hs,Plugin:ks,Sniffer:Gr,Util:Br,STATE_CLASS:Ps,I18N:Ns,STATES:Ms});exports.BasePlugin=hs,exports.CodecType=tr,exports.ContentType=ir,exports.DefinitionDemotePlugin=XH,exports.DynamicWatermarkPlugin=$H,exports.EAudioFormat=rr,exports.EDRMTYPE=or,exports.EVideoFormat=nr,exports.Event=GD,exports.Events=WD,exports.HlsControlError=sr,exports.I18N=Ns,exports.MemoryPlay=iF,exports.MirrorPlugin=tF,exports.POSITIONS=ar,exports.PlayListPlugin=dF,exports.Plugin=ks,exports.STATES=Ms,exports.STATE_CLASS=Ps,exports.Sniffer=Gr,exports.Subtitle=Px,exports.UmdKeys=jw,exports.Util=Br,exports.default=pF,exports.getI18N=TH;