@byteplus/veplayer 1.18.0-rc.9 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lite.min.js CHANGED
@@ -1,2 +1,2 @@
1
- // @byteplus/veplayer@1.18.0-rc.9 Built @8/27/2026, 11:49:39 AM
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VePlayerLite=t()}(this,(function(){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(t){r(t)}},a=e=>{try{s(i.throw(e))}catch(t){r(t)}},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}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,b=T.hasOwnProperty,S=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=b.call(e,C),i=e[C];try{e[C]=void 0;var n=!0}catch(o){}var r=S.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(t){}try{return e+""}catch(t){}}return""}var j=/^\[object .+?Constructor\]$/,V=Function.prototype,K=Object.prototype,W=V.toString,G=K.hasOwnProperty,Y=RegExp("^"+W.call(G).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(t){}}();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,pe=ue(function(){return arguments}())?ue:function(e){return ce(e)&&de.call(e,"callee")&&!fe.call(e,"callee")};const ge=pe;const ye=Array.isArray;var ve="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=ve&&"object"==typeof module&&module&&!module.nodeType&&module,_e=me&&me.exports===ve?_.Buffer:void 0;const Ee=(_e?_e.isBuffer:void 0)||function(){return!1};var Te=9007199254740991,be=/^(?:0|[1-9]\d*)$/;function Se(e,t){var i=typeof e;return!!(t=null==t?Te:t)&&("number"==i||"symbol"!=i&&be.test(e))&&e>-1&&e%1==0&&e<t}var Ce=9007199254740991;function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ce}var Ie={};function Pe(e){return function(t){return e(t)}}Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Arguments]"]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object Boolean]"]=Ie["[object DataView]"]=Ie["[object Date]"]=Ie["[object Error]"]=Ie["[object Function]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie["[object Object]"]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object WeakMap]"]=!1;var De="object"==typeof exports&&exports&&!exports.nodeType&&exports,we=De&&"object"==typeof module&&module&&!module.nodeType&&module,Ae=we&&we.exports===De&&v.process;const Re=function(){try{var e=we&&we.require&&we.require("util").types;return e||Ae&&Ae.binding&&Ae.binding("util")}catch(t){}}();var xe=Re&&Re.isTypedArray;const Oe=xe?Pe(xe):function(e){return ce(e)&&ke(e.length)&&!!Ie[w(e)]};var Le=Object.prototype.hasOwnProperty;function Ne(e,t){var i=ye(e),n=!i&&ge(e),r=!i&&!n&&Ee(e),o=!i&&!n&&!r&&Oe(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&&!Le.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 Me=Object.prototype;function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function Be(e,t){return function(i){return e(t(i))}}const Fe=Be(Object.keys,Object);var He=Object.prototype.hasOwnProperty;function je(e){return null!=e&&ke(e.length)&&!N(e)}function Ve(e){return je(e)?Ne(e):function(e){if(!Ue(e))return Fe(e);var t=[];for(var i in Object(e))He.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ke=Object.prototype.hasOwnProperty;function We(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=Ue(e),i=[];for(var n in e)("constructor"!=n||!t&&Ke.call(e,n))&&i.push(n);return i}function Ge(e){return je(e)?Ne(e,!0):We(e)}var Ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,ze=Ye&&"object"==typeof module&&module&&!module.nodeType&&module,$e=ze&&ze.exports===Ye?_.Buffer:void 0,Xe=$e?$e.allocUnsafe:void 0;function qe(e,t){if(t)return e.slice();var i=e.length,n=Xe?Xe(i):new e.constructor(i);return e.copy(n),n}function Ze(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 Je=Object.prototype.propertyIsEnumerable,et=Object.getOwnPropertySymbols;const tt=et?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}(et(e),(function(t){return Je.call(e,t)})))}:Qe;function it(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}const nt=Be(Object.getPrototypeOf,Object);const rt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)it(t,tt(e)),e=nt(e);return t}:Qe;function ot(e,t,i){var n=t(e);return ye(e)?n:it(n,i(e))}function at(e){return ot(e,Ve,tt)}function st(e){return ot(e,Ge,rt)}const lt=$(_,"DataView");const ct=$(_,"Promise");const ut=$(_,"Set");const ht=$(_,"WeakMap");var dt="[object Map]",ft="[object Promise]",pt="[object Set]",gt="[object WeakMap]",yt="[object DataView]",vt=H(lt),mt=H(X),_t=H(ct),Et=H(ut),Tt=H(ht),bt=w;(lt&&bt(new lt(new ArrayBuffer(1)))!=yt||X&&bt(new X)!=dt||ct&&bt(ct.resolve())!=ft||ut&&bt(new ut)!=pt||ht&&bt(new ht)!=gt)&&(bt=function(e){var t=w(e),i="[object Object]"==t?e.constructor:void 0,n=i?H(i):"";if(n)switch(n){case vt:return yt;case mt:return dt;case _t:return ft;case Et:return pt;case Tt:return gt}return t});const St=bt;var Ct=Object.prototype.hasOwnProperty;const kt=_.Uint8Array;function It(e){var t=new e.constructor(e.byteLength);return new kt(t).set(new kt(e)),t}var Pt=/\w*$/;var Dt=E?E.prototype:void 0,wt=Dt?Dt.valueOf:void 0;function At(e,t){var i=t?It(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var Rt="[object Boolean]",xt="[object Date]",Ot="[object Map]",Lt="[object Number]",Nt="[object RegExp]",Mt="[object Set]",Ut="[object String]",Bt="[object Symbol]",Ft="[object ArrayBuffer]",Ht="[object DataView]",jt="[object Float32Array]",Vt="[object Float64Array]",Kt="[object Int8Array]",Wt="[object Int16Array]",Gt="[object Int32Array]",Yt="[object Uint8Array]",zt="[object Uint8ClampedArray]",$t="[object Uint16Array]",Xt="[object Uint32Array]";function qt(e,t,i){var n,r,o,a=e.constructor;switch(t){case Ft:return It(e);case Rt:case xt:return new a(+e);case Ht:return function(e,t){var i=t?It(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case jt:case Vt:case Kt:case Wt:case Gt:case Yt:case zt:case $t:case Xt:return At(e,i);case Ot:return new a;case Lt:case Ut:return new a(e);case Nt:return(o=new(r=e).constructor(r.source,Pt.exec(r))).lastIndex=r.lastIndex,o;case Mt:return new a;case Bt:return n=e,wt?Object(wt.call(n)):{}}}var Zt=Object.create;const Qt=function(){function e(){}return function(t){if(!A(t))return{};if(Zt)return Zt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Jt(e){return"function"!=typeof e.constructor||Ue(e)?{}:Qt(nt(e))}var ei=Re&&Re.isMap;const ti=ei?Pe(ei):function(e){return ce(e)&&"[object Map]"==St(e)};var ii=Re&&Re.isSet;const ni=ii?Pe(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=ye(e);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&Ct.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return Ze(e,a)}else{var h=St(e),d=h==li||h==ci;if(Ee(e))return qe(e,s);if(h==ui||h==si||d&&!r){if(a=l||d?{}:Jt(e),!s)return l?function(e,t){return le(e,rt(e),t)}(e,function(e,t){return e&&le(t,Ge(t),e)}(a,e)):function(e,t){return le(e,tt(e),t)}(e,function(e,t){return e&&le(t,Ve(t),e)}(a,e))}else{if(!hi[h])return r?e:{};a=qt(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?st:at:l?Ge:Ve)(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;var fi;function pi(e){return di(e,5)}function gi(e,t,i){(void 0!==i&&!f(e[t],i)||void 0===i&&!(t in e))&&oe(e,t,i)}const yi=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),a=o.length;a--;){var s=o[fi?a:++n];if(!1===t(r[s],s,r))break}return e};var vi="[object Object]",mi=Function.prototype,_i=Object.prototype,Ei=mi.toString,Ti=_i.hasOwnProperty,bi=Ei.call(Object);function Si(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Ci(e,t,i,n,r,o,a){var s=Si(e,i),l=Si(t,i),c=a.get(l);if(c)gi(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=ye(l),p=!f&&Ee(l),g=!f&&!p&&Oe(l);h=l,f||p||g?ye(s)?h=s:ce(u=s)&&je(u)?h=Ze(s):p?(d=!1,h=qe(l,!0)):g?(d=!1,h=At(l,!0)):h=[]:function(e){if(!ce(e)||w(e)!=vi)return!1;var t=nt(e);if(null===t)return!0;var i=Ti.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Ei.call(i)==bi}(l)||ge(l)?(h=s,ge(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)),gi(e,i,h)}}function ki(e,t,i,n,r){e!==t&&yi(t,(function(o,a){if(r||(r=new ie),A(o))Ci(e,t,a,i,ki,n,r);else{var s=n?n(Si(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),gi(e,a,s)}}),Ge)}function Ii(e){return e}var Pi=Math.max;var Di=re?function(e,t){return re(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ii;const wi=Di;var Ai=Date.now;var Ri,xi,Oi,Li=(Ri=wi,xi=0,Oi=0,function(){var e=Ai(),t=16-(e-Oi);if(Oi=e,t>0){if(++xi>=800)return arguments[0]}else xi=0;return Ri.apply(void 0,arguments)});const Ni=Li;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),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,Ii),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?je(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){ki(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 Wi(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 Gi(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=ye(e),s=ye(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&&Ee(e)){if(!Ee(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new ie),a||Oe(e)?Wi(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 kt(e),new kt(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=Gi;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=Wi(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=at(e),l=s.length;if(l!=at(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 bn(e){var t=function(e){for(var t=Ve(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 Sn="[object Symbol]";function Cn(e){return"symbol"==typeof e||ce(e)&&w(e)==Sn}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;function Pn(e,t){if(ye(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(ye(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 ye(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 Wn(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)&&ke(r)&&Se(a,r)&&(ye(e)||ge(e))}(e,t,Kn)}var Gn=1,Yn=2;function zn(e){return Pn(e)?(t=Hn(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return jn(t,e)}}(e);var t}function $n(e){return"function"==typeof e?e:null==e?Ii:"object"==typeof e?ye(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?Wn(e,t):vn(i,n,Gn|Yn)}):bn(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=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,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="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lr=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 cr=sr(lr)();const ur=new class{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new cr(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 hr(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 dr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(i),!0).forEach((function(t){vr(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):hr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function fr(e){return(fr="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 pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(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,Pr(n.key),n)}}function yr(e,t,i){return t&&gr(e.prototype,t),i&&gr(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function vr(e,t,i){return(t=Pr(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function mr(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&&Er(e,t)}function _r(e){return(_r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Er(e,t){return(Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Tr(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 Tr(e)}function Sr(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(e){return!1}}();return function(){var i,n=_r(e);if(t){var r=_r(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return br(this,i)}}function Cr(){return Cr="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=_r(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}},Cr.apply(this,arguments)}function kr(e){return function(e){if(Array.isArray(e))return Ir(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 Ir(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 Ir(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 Ir(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 Pr(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,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}(Dr);var wr=Dr.exports;const Ar=sr(wr);var Rr="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,xr={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Or="%c[xgplayer]",Lr={config:{debug:Rr?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,[Or,xr.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,[Or,xr.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,[Or,xr.error,e].concat(r))}}};var Nr=function(){function e(t){pr(this,e),this.bufferedList=t}return yr(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}(),Mr={};function Ur(e){var t=fr(e);return null!==e&&("object"===t||"function"===t)}function Br(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,Ur(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},_}Mr.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},Mr.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&&Mr.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return Lr.logError("util.createDomFromHtml",o),null}},Mr.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(n){var i=e.className&&"object"===fr(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Mr.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(i){Mr.hasClass(e,t)||(e.className&&"object"===fr(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Mr.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(i){Mr.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===fr(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},Mr.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Mr.hasClass(e,t)?Mr.removeClass(e,t):Mr.addClass(e,t)}))},Mr.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===Mr.typeOf(e[i])?t.push(e[i]):"Object"===Mr.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(" ")},Mr.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(n){Lr.logError("util.findDom",n),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},Mr.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Mr.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},Mr.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Mr.padStart(Math.floor(e/3600),2,0),i=Mr.padStart(Math.floor((e-3600*t)/60),2,0),n=Mr.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},Mr.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},Mr.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Mr.deepCopy=function(e,t){if("Object"===Mr.typeOf(t)&&"Object"===Mr.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==Mr.typeOf(t[i])||t[i]instanceof Node?"Array"===Mr.typeOf(t[i])?e[i]="Array"===Mr.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]:Mr.deepCopy(e[i],t[i])})),e},Mr.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===Mr.typeOf(t[i])&&"Array"===Mr.typeOf(e[i])?"Array"===Mr.typeOf(e[i])&&(n=e[i]).push.apply(n,kr(t[i])):Mr.typeOf(e[i])!==Mr.typeOf(t[i])||null===e[i]||"Object"!==Mr.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):Mr.deepMerge(e[i],t[i])})),e},Mr.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},Mr.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""},Mr.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},Mr.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Mr.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),Mr.clearTimeout(e,n)}),i);return e._timers.push(n),n},Mr.clearTimeout=function(e,t){var i=e._timers;if("Array"===Mr.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},Mr.clearAllTimers=function(e){var t=e._timers;"Array"===Mr.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Mr.createImgBtn=function(e,t,i,n){var r,o,a,s=Mr.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},Mr.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)"},Mr.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Mr.checkIsFunction=function(e){return e&&"function"==typeof e},Mr.checkIsObject=function(e){return null!==e&&"object"===fr(e)},Mr.hide=function(e){e.style.display="none"},Mr.show=function(e,t){e.style.display=t||"block"},Mr.isUndefined=function(e){if(null==e)return!0},Mr.isNotNull=function(e){return!(null==e)},Mr.setStyleFromCsstext=function(e,t){t&&("String"===Mr.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]})))},Mr.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},Mr.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},Mr.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}},Mr.stopPropagation=function(e){e&&e.stopPropagation()},Mr.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Mr.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Mr.checkTouchSupport=function(){return"ontouchstart"in window},Mr.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 Nr(r)},Mr.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}},Mr.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Mr.getHostFromUrl=function(e){if("String"!==Mr.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},Mr.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Mr.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Mr.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Mr.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(i){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)}))},Mr.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Mr.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},Mr.createPositionBar=function(e,t){var i=Mr.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},Mr.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},Mr.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Mr.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},Mr.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:Mr.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},Mr.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 Fr=/(Android)\s([\d.]+)/,Hr=/(Version)\/([\d.]+)/,jr=["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"],Vr={get device(){return Vr.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)?Hr:Fr)?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&&jr.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(a){return Promise.resolve(t)}}},Kr="3.0.23-rc.3",Wr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},Gr={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Yr=yr((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};pr(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;Gr[f]&&(f=Gr[f]);var p={playerVersion:Kr,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:Mr.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:Kr,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}})),zr="play",$r="playing",Xr="ended",qr="pause",Zr="error",Qr="seeking",Jr="seeked",eo="timeupdate",to="waiting",io="canplay",no="durationchange",ro="volumechange",oo="loadeddata",ao="ratechange",so="progress",lo="loadstart",co="emptied",uo="focus",ho="blur",fo="ready",po="urlNull",go="autoplay_started",yo="autoplay_was_prevented",vo="complete",mo="replay",_o="destroy",Eo="urlchange",To="download_speed_change",bo="leaveplayer",So="enterplayer",Co="loading",ko="fullscreen_change",Io="cssFullscreen_change",Po="mini_state_change",Do="definition_change",wo="after_definition_change",Ao="video_resize",Ro="pip_change",xo="rotate",Oo="screenShot",Lo="playnext",No="shortcut",Mo="xglog",Uo="user_action",Bo="reset",Fo="source_error",Ho="source_success",jo=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],Vo={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Ko="fps_stuck";const Wo=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:wo,AUTOPLAY_PREVENTED:yo,AUTOPLAY_STARTED:go,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:io,CANPLAY_THROUGH:"canplaythrough",COMPLETE:vo,CSS_FULLSCREEN_CHANGE:Io,DEFINITION_CHANGE:Do,DESTROY:_o,DOWNLOAD_SPEED_CHANGE:To,DURATION_CHANGE:no,EMPTIED:co,ENDED:Xr,ENTER_PLAYER:So,ERROR:Zr,FPS_STUCK:Ko,FULLSCREEN_CHANGE:ko,LEAVE_PLAYER:bo,LOADED_DATA:oo,LOADED_METADATA:"loadedmetadata",LOADING:Co,LOAD_START:lo,MINI_STATE_CHANGE:Po,PAUSE:qr,PIP_CHANGE:Ro,PLAY:zr,PLAYER_BLUR:ho,PLAYER_FOCUS:uo,PLAYING:$r,PLAYNEXT:Lo,PROGRESS:so,RATE_CHANGE:ao,READY:fo,REPLAY:mo,RESET:Bo,RETRY:"retry",ROTATE:xo,SCREEN_SHOT:Oo,SEEKED:Jr,SEEKING:Qr,SEI_PARSED:"SEI_PARSED",SHORTCUT:No,SOURCE_ERROR:Fo,SOURCE_SUCCESS:Ho,STALLED:"stalled",STATS_EVENTS:Vo,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:eo,URL_CHANGE:Eo,URL_NULL:po,USER_ACTION:Uo,VIDEO_EVENTS:jo,VIDEO_RESIZE:Ao,VOLUME_CHANGE:ro,WAITING:to,XGLOG:Mo},Symbol.toStringTag,{value:"Module"}));function Go(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var Yo=function(e){mr(i,e);var t=Sr(i);function i(e){var n;pr(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 Vr.isWeixin&&Vr.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):Mr.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===Mr.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 yr(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=jo.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]),vr({},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:Mr.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=Go.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw Go.call(t,e,r),s}}else Go.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(Mr.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(Ho,{src:e.target.currentSrc,host:Mr.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(Fo,new Yr(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 Yr(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?Mr.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(Eo,e),this.emit(to),this._currentTime=0,this._duration=0,Mr.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===Mr.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=Cr(_r(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=Cr(_r(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=Cr(_r(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=Cr(_r(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){Cr(_r(i.prototype),"removeAllListeners",this).call(this)}}]),i}(Ar),zo=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"}};pr(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return yr(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}(),$o=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Xo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],qo=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Zo="data-xgplayerid";function Qo(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 Jo(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(s){throw s.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(s.message),s}if(this.__hooks&&this.__hooks[e])try{var a=sa.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&Qo.apply(void 0,[r,t,i.next].concat(kr(n)))})).catch((function(e){throw e})):Qo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&Qo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(s){throw s.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(s.message),s}else Qo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function ea(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 ta(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===ea.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function ia(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var n=i[e],r=ea.call(this,e,t);-1!==r&&n.splice(r,1)}else i[e]&&(i[e]=null)}function na(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 ra(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 oa(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 aa(e){e.__hooks=null}function sa(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 la(e,t){Lr.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var ca=function(){function e(t){pr(this,e),Mr.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),oa(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return yr(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=Mr.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)})):la(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)})):la(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)})):la(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=dr(dr({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return Jo.call.apply(Jo,[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 ta.call.apply(ta,[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 ia.call.apply(ia,[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(),Mr.clearAllTimers(this),Mr.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),aa(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 ua=Element.prototype;ua.matches=ua.matchesSelector||ua.mozMatchesSelector||ua.msMatchesSelector||ua.oMatchesSelector||ua.webkitMatchesSelector}var ha=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function da(e,t,i,n,r){var o=fa.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function fa(e,t,i,n){return function(i){i.delegateTarget=ha(i.target,t),i.delegateTarget&&n.call(e,i)}}var pa=function(e,t,i,n,r){return"function"==typeof e.addEventListener?da.apply(null,arguments):"function"==typeof i?da.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return da(e,t,i,n,r)})))};const ga=sr(pa);var ya={CONTROLS:"controls",ROOT:"root"},va={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"},ma="xg-icon-disable";function _a(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Ea(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 Mr.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(_a(e)||_a(e.url))return n.src=_a(e)?e:e.url||"",o=Mr.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Mr.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Lr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(a){return Lr.logError("Plugin named [".concat(r,"]:createIcon"),a),null}return"string"==typeof e?Mr.createDomFromHtml(e,n,i):(Lr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Ta(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"===fr(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===fr(e)&&e.attr&&"object"===fr(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Ea(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Ea(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var ba=function(e){mr(i,e);var t=Sr(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pr(this,i),(e=t.call(this,n)).__delegates=[],e}return yr(i,[{key:"__init",value:function(e){if(Cr(_r(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=[],Ta(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(u){throw Lr.logError("Plugin:".concat(this.pluginName,":render"),u),new Error("Plugin:".concat(this.pluginName,":render:").concat(u.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=Mr.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"===fr(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"===fr(a)&&"function"==typeof a.plugin&&(n=a.options?Mr.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,Mr.addClass(this.find(".xgplayer-icon"),ma)}},{key:"enable",value:function(){this.config.disable=!1,Mr.removeClass(this.find(".xgplayer-icon"),ma)}},{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=Cr(_r(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"===Mr.typeOf(e)?this.root.style[e]=t:void("Object"===Mr.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"===Mr.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Mr.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 Lr.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)),Cr(_r(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=ga(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=ga(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return ya}},{key:"POSITIONS",get:function(){return va}}]),i}(ca),Sa=function(){function e(){var t=this;if(pr(this,e),vr(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 Ur(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Br(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(i){console.error(i)}}return yr(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(Zo),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(n){}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}(),Ca=null;var ka={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()},Ca||(Ca=new Sa),Ca.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"===Mr.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"===Mr.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===Mr.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(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}},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(n){throw a.push(i(null)),n}})),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=Ca)||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}}},Ia={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 Pa(){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 Da=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=Tr(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),vr(Tr(e),"onMouseLeave",(function(t){Tr(e).player.focus()})),e}return yr(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Vr.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(Ia.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(Po,(function(t){t?Mr.addClass(e.root,"mini-controls"):Mr.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Vr.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&&Mr.addClass(this.root,Ia.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){Mr.removeClass(this.root,Ia.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 va.CONTROLS_LEFT:t.root=this.left;break;case va.CONTROLS_RIGHT:t.root=this.right;break;case va.CONTROLS_CENTER:t.root=this.center;break;case va.CONTROLS:t.root=this.root;break;default:t.root=this.left}return Cr(_r(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Vr.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=Mr.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},vr({},Ia.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}(ba),wa={lang:{},langKeys:[],textKeys:[]};function Aa(e,t){return Object.keys(t).forEach((function(i){var n,r=Mr.typeOf(t[i]),o=Mr.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,kr(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Aa(e[i],t[i])):e[i]=t[i]})),e}function Ra(){Object.keys(wa.lang.en).map((function(e){wa.textKeys[e]=e}))}function xa(e,t){var i=e.LANG;if(t||(t=wa),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Aa(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),Ra()}}xa({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 Oa={get textKeys(){return wa.textKeys},get langKeys(){return wa.langKeys},get lang(){var e={};return wa.langKeys.map((function(t){e[t]=wa.lang[t]})),wa.lang["zh-cn"]&&(e.zh=wa.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=wa),t.lang){i="Array"!==Mr.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]?Aa(n[e.LANG]||{},e.TEXT||{}):xa(e,t)})),Ra()}},use:xa,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Aa(i.lang,wa.lang),(t=i.langKeys).push.apply(t,kr(wa.langKeys)),Aa(i.textKeys,wa.textKeys),i}},La={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Na=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Ma={},Ua=null,Ba=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"add",value:function(e){e&&(Ma[e.playerId]=e,1===Object.keys(Ma).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Ma[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Ma)if(Object.prototype.hasOwnProperty.call(Ma,i)){var n=Ma[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(Ma[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Ma[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Ma),t=0;t<e.length;t++){var i=Ma[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(Ma[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Ma[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Ua||(Ua=new i),Ua}}]),i}(wr.EventEmitter);var Fa=["play","pause","replay","retry"],Ha=0,ja=0,Va=null,Ka=function(e){mr(i,e);var t=Sr(i);function i(e){var n;pr(this,i);var r,o=Mr.deepMerge(Pa(),e);vr(Tr(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Lr.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(io,n.canPlayFunc),n.removeClass(Ia.ENTER)}})),vr(Tr(n),"onFullscreenChange",(function(e,t){var i=function(){Mr.setTimeout(Tr(n),(function(){n.resize()}),100)},r=Mr.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Uo,{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,Zo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Ia.FULLSCREEN),n.emit(ko,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=Tr(n),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Mr.setTimeout(Tr(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(Ia.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Ia.FULLSCREEN)}n._fullscreenEl=null,n.emit(ko,!1)}})),vr(Tr(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),vr(Tr(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),oa(Tr(n),Fa),n.config=o,n._pluginInfoId=Mr.generateSessionId(),(r=Tr(n)).logInfo=Lr.logInfo.bind(r),r.logWarn=Lr.logWarn.bind(r),r.logError=Lr.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=La.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=Oa.init(n._pluginInfoId),Vr.os.isAndroid&&Vr.osVersion>0&&Vr.osVersion<6&&(n.config.autoplay=!1),n.database=new zo,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=Va,!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(),ka.onPluginsReady(Tr(n)),n.getInitDefinition(),n.setState(La.READY),Mr.setTimeout(Tr(n),(function(){n.emit(fo)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<La.ATTACHED)&&n.start(),n}return yr(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(Zr,new Yr("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(Ma),i=0;i<t.length;i++){var n=Ma[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(Lr.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Zo,this.playerId),this.media.setAttribute(Zo,this.playerId),null===(e=Va)||void 0===e||e.add(this),ka.init(this),this._initBaseDoms(),this.config.controls){var r=this.config.controls.root||null,o=ka.register(this,Da,{root:r});this.controls=o}var a="mobile"===this.config.isMobileSimulateMode?"mobile":Vr.device;if(this.addClass("".concat(Ia.DEFAULT," ").concat(Ia.INACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Ia.NO_CONTROLS)),this.config.autoplay?this.addClass(Ia.ENTER):this.addClass(Ia.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=Mr.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)])})),$o.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Vr.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(oo,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(zr,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),$o.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(zr,this.playFunc),this.off(io,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(Mr.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"!==Mr.typeOf(e)||0!==e.length)||(e="",this.emit(po),Lr.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){Mr.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===Mr.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"===Mr.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;Lr.logInfo("_startInit readyState",r),this.config.autoplay&&(!Mr.isMSE(this.media)&&this.load(),(Vr.os.isIpad||Vr.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(io,this.canPlayFunc),(!this.hasStart||this.state<La.ATTACHED)&&ka.afterInit(this),this.hasStart=!0,this.setState(La.ATTACHED),Mr.setTimeout(this,(function(){t.emit(vo)}),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&&Oa.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=ka.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Lr.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(s){Lr.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,kr(a)),(n=e.config.ignores).push.apply(n,kr(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,kr(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case va.ROOT_RIGHT:this.rightBar||(this.rightBar=Mr.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case va.ROOT_LEFT:this.leftBar||(this.leftBar=Mr.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case va.ROOT_TOP:this.topBar||(this.topBar=Mr.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&Mr.addClass(this.topBar,Ia.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=ka.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!ka.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=ka.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)),ka.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?ka.unRegister(this,e):e instanceof ca&&ka.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 ca&&(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 ka.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=ka.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Mr.hasClass(this.root,e)||Mr.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Mr.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Mr.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>La.ATTACHING)){var i=this._playSessionId;return Mr.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(La.ATTACHING),this._registerPlugins(!1),ka.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",Lr.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===Mr.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?(Vr.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<La.ATTACHED)return this.removeClass(Ia.NO_START),this.addClass(Ia.ENTER),this.start(),void(this._useAutoplay=!0);this.state<La.RUNNING&&(this.removeClass(Ia.NO_START),!this.isCanplay&&this.addClass(Ia.ENTER));var t=Cr(_r(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Ia.NOT_ALLOW_AUTOPLAY),e.addClass(Ia.PLAYING),e.state<La.RUNNING&&(Lr.logInfo(">>>>playPromise.then"),e.setState(La.RUNNING),e.emit(go))})).catch((function(t){if(Lr.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Ia.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Mr.setTimeout(e,(function(){e._errorTimer=null,e.emit(yo),e.addClass(Ia.NOT_ALLOW_AUTOPLAY),e.removeClass(Ia.ENTER),e.pause(),e.setState(La.NOTALLOW)}),0))})):(Lr.logWarn("video.play not return promise"),this.state<La.RUNNING&&(this.setState(La.RUNNING),this.removeClass(Ia.NOT_ALLOW_AUTOPLAY),this.removeClass(Ia.NO_START),this.removeClass(Ia.ENTER),this.addClass(Ia.PLAYING),this.emit(go))),t}},{key:"mediaPause",value:function(){Cr(_r(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){Cr(_r(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Ia.PAUSED),sa(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;sa(this,"pause",(function(){Cr(_r(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(Jr,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Ia.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(Jr,this._onceSeekCanplay),this.state<La.RUNNING?(this.removeClass(Ia.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,dr({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(wo,{from:t,to:e})})):this.emit(wo,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(oo,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Ia.NOT_ALLOW_AUTOPLAY,Ia.PLAYING,Ia.NO_START,Ia.PAUSED,Ia.REPLAY,Ia.ENTER,Ia.ENDED,Ia.ERROR,Ia.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(Ia.NO_START),this.emit(Bo)}},{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=Pa();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(Zo),o.removeAttribute(Zo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),Mr.clearAllTimers(this),this.emit(_o),null===(e=Va)||void 0===e||e.remove(this),ka.destroy(this),aa(this),Cr(_r(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(Ia.ENDED),this.currentTime=0,this.isSeeking=!1,sa(this,"replay",(function(){e.once(Jr,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(mo),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Ia.ERROR),this.addClass(Ia.LOADING),sa(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=Mr.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(io,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Ia.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Mr.filterStyleFromText(e)),Mr.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Mr.filterStyleFromText(t),Mr.addClass(t,n),t.setAttribute(Zo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Ia.PARENT_FULLSCREEN),this._orgCss&&(Mr.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Mr.removeClass(e,i),t&&t!==e&&this._orgPCss&&(Mr.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Mr.removeClass(t,n),t.removeAttribute(Zo))}},{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:Mr.scrollTop(),left:Mr.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",Mr.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<Xo.length;n++){var r=Xo[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||Mr.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<qo.length;i++){var n=qo[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(Ia.INNER_FULLSCREEN," ").concat(Ia.CSS_FULLSCREEN):Ia.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(ko,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Io,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Ia.INNER_FULLSCREEN," ").concat(Ia.CSS_FULLSCREEN):Ia.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(ko,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Io,!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(Ia.INNER_FULLSCREEN," ").concat(Ia.ROTATE_FULLSCREEN):Ia.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Ia.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(ko,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Ia.INNER_FULLSCREEN," ").concat(Ia.ROTATE_FULLSCREEN):Ia.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Ia.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(ko,!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(uo,dr({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(ho,dr({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(Ia.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=Mr.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(Ia.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Ia.ENTER),this.removeClass(Ia.ERROR),this.removeClass(Ia.LOADING),this.isCanplay=!0,this.waitTimer&&Mr.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(no,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Ia.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===La.ENDED&&this.setState(La.RUNNING),this.removeClass(Ia.PAUSED),this.ended&&this.removeClass(Ia.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Ia.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Ia.ENDED),this.setState(La.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Ia.NOT_ALLOW_AUTOPLAY),this.removeClass(Ia.NO_START),this.removeClass(Ia.ENTER),this.removeClass(Ia.LOADING),this.addClass(Ia.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Ia.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Mr.clearTimeout(this,this.waitTimer),this.removeClass(Ia.LOADING),this.removeClass(Ia.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Mr.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Mr.setTimeout(this,(function(){e.addClass(Ia.LOADING),e.emit(Co),Mr.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Ia.NO_START,Ia.PAUSED,Ia.ENDED,Ia.ERROR,Ia.REPLAY,Ia.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(Ia.LOADING))&&this.media.readyState>2&&(this.removeClass(Ia.LOADING),Mr.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===La.NOTALLOW&&this.duration&&(this.setState(La.RUNNING),this.emit(go)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Mr.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"===Mr.typeOf(e)?e:e.type||"";i.props&&"Array"!==Mr.typeOf(i.props)&&(i.props=[i.props]),this.emit(Uo,dr({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=Mr.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"===Mr.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,sa(this,"playnext",(function(){t.start(),t.emit(Lo,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(Ao,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){Lr.logInfo("setState","state from:".concat(Na[this.state]," to:").concat(Na[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 Mr.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(La.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===La.RUNNING||this._state===La.ENDED},set:function(e){e?this.setState(La.RUNNING):this._state>=La.RUNNING&&this.setState(La.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,i=this.config.definition,n=null,r=null;i.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(n=e),i.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),n?this.changeDefinition(n):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==Oa.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,ka.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(Oa.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 Kr}},{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 Cr(_r(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=Cr(_r(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return Cr(_r(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=Mr.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return ja},set:function(e){ja=e}},{key:"realTimeSpeed",get:function(){return Ha},set:function(e){Ha=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 Jo.call.apply(Jo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return ta.call.apply(ta,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return ia.call.apply(ia,[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 na.call.apply(na,[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 ra.call.apply(ra,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),Mr.typeOf(t)===Boolean&&(this.muted=t)),null===(i=Va)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Lr.config.debug},set:function(e){Lr.config.debug=e}},{key:"instManager",get:function(){return Va},set:function(e){Va=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=Va)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=Va)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return Vr.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Vr.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}(Yo);vr(Ka,"defaultPreset",null),vr(Ka,"XgVideoProxy",null),Ka.instManager=Ba.getInstance();const Wa={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"}},Ga=["zh","en","jp","zh-hk"],Ya={NORMAL:0,INNER:1,FULLSCREEN:2};var za=(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))(za||{});const $a=5e9,Xa={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var qa=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(qa||{}),Za={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:"生放送"}},Qa={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 Ja="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,es="color: #fff; background-color: #5f5f5f;",ts="color: #fff; background-color: #f53f3f;",is="color: #fff; background-color: #ff7d00;",ns="color: #fff; background: #4281ff",rs="%c VePlayer %c 1.18.0-rc.9 ",os={config:{debug:Ja?3:1},log:function(e,...t){this.config.debug>=3&&console.log(rs,es,ns,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(rs,is,ns,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](rs,ts,ns,e,...t)}};localStorage.getItem("velog")&&(os.config.debug=3);var as={exports:{}};as.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},b=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&&_},S=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=b,C.i=T,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function y(e){this.$L=b(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=S(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return S(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<S(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=S(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=S(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=b(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 S.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])}})),S.extend=function(e,t){return e.$i||(e(t,k,S),e.$i=!0),S},S.locale=b,S.isDayjs=T,S.unix=function(e){return S(1e3*e)},S.en=E[_],S.Ls=E,S.p={},S}();const ss=sr(as.exports);var ls={exports:{}};!function(e,t){var i,n,r;e.exports=(i="minute",n=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(e,t,o){var a=t.prototype;o.utc=function(e){return new t({date:e,utc:!0,args:arguments})},a.utc=function(e){var t=o(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),i):t},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(e,t){var o=this.$utils().u;if(o(e))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(n);if(!t)return null;var i=(""+t[0]).match(r)||["-",0,0],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(e)))return this;var a=Math.abs(e)<=16?60*e:e,s=this;if(t)return s.$offset=a,s.$u=0===e,s;if(0!==e){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,i)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(e,t,i){if(e&&this.$u===e.$u)return d.call(this,e,t,i);var n=this.local(),r=o(e).local();return d.call(n,r,t,i)}})}(ls);const cs=sr(ls.exports);var us=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),b=i(43),S=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(S("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 S("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 b(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 hs=sr(us);ss.extend(cs);var ds=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(ds||{});function fs(e){try{return JSON.parse(e)}catch(t){return os.warn(`[utils/json] decode fail: ${e}`,t),null}}function ps(e,t="GetPlayInfoToken"){if(!e)return;const i={},n=fs(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 gs(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 ys=e=>{var t,i,n;if(!(null==e?void 0:e.playAuthToken))return;const r=ps(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(ds).includes(o)?nr.MP4:rr.M4A)},vs=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=ss.utc(i,"YYYYMMDD hhmmss");if(!n.isValid())return!1;return n.add(t,"seconds").isBefore(ss())};function ms(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 _s(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)=>{hs.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===za.VALID&&o.length){const i=o.map((e=>{var t;const i=h?Vs(e.MainPlayUrl,h):e.MainPlayUrl,n=h?Vs(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:tl(e.MainUrlExpire,10,$a),drmType:e.DrmType},e),Ns(e,{definitionMap:r,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l}))})).sort(ms);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}),os.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{os.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function Es(e,t,i,n){return d(this,null,(function*(){try{return yield e()}catch(r){if(--t&&i(r))return Es(e,t,i,n);if(n&&"function"==typeof n)return yield n(r);throw r}}))}function Ts(e,t,i,n){return i+"/?"+n+"&"+Js({ThirdPartyDrmType:e,Kid:t})}const bs="__veplayer_";function Ss(e,t="",i){if(!e)return;const n=bs+t+"_"+e;localStorage.setItem(n,i+"")}function Cs(e,t=""){if(!e)return;const i=bs+t+"_"+e;return localStorage.getItem(i)}function ks(){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(i){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function Is(e){if(!e)return ks();const t=`line_user_${encodeURIComponent(e)}`;try{const e=Cs(t,"ttdrama");if(e)return e;const i=ks();return Ss(t,"ttdrama",i),i}catch(i){return ks()}}function Ps(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var Ds=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(Ds||{});function ws(e,t){return new Promise(((i,n)=>{try{e||n(new Error("url is undefined"));let r=Ps();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=Ps()-o,s.status=a.status,s.statusText=a.statusText,r=Ps())},a.onload=()=>{s.response=a.response,i(s)},a.onprogress=e=>{const t=Ps()-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=Ps()-r),n(s)},a.ontimeout=()=>{s.status||(s.status=-2,s.costTime=Ps()-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(r){n(r)}}))}function As(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:+Mr.isMSE(e.media)}function Rs(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class xs{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=Rs(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:Rs(this.now()-this.startAt),timings:[...this.timings],timingMap:c({},this.timingMap)}}}let Os;const Ls=()=>Os,Ns=function(e,t){var i;const{definitionMap:n,autoDemoteDefinition:r,autoDemoteDefinitionTextKey:o}=t||{},a=e,s=a.Definition||a.Quality||a.definition||a.quality;if(!e||!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 Ms=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}},Us='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',Bs=['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"'],Fs={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]};function Hs(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(Fs)){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 js(e){return e&&e.then?e:Promise.resolve(e)}const Vs=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+Js(t):e,Ks=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((n=>{n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function Ws(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function Gs(e,t=200,i=""){let n=setTimeout((()=>{i&&os.warn(i),n=null}),t);return e.then?e.then((()=>clearTimeout(n))):(clearTimeout(n),n=null),e}function Ys(e,t=1,i=0){return new Promise(((n,r)=>{e().then(n).catch((o=>{setTimeout((()=>{1!==t?Ys(e,t-1,i).then(n,r):r(o)}),i)}))}))}function zs(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return os.error("mse error",t),!1}}function $s(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(Us):"h265"===e?Bs.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const Xs="undefined"!=typeof window,qs=Xs&&navigator.userAgent.toLocaleLowerCase(),Zs=Xs&&/^((?!chrome|android).)*safari/.test(qs);function Qs(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-rc.9/plugin"}},n=t||"sg";return e&&i[e]||i[n]}function Js(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 el(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function tl(e,t=10,i=0){const n=parseInt(e,t);return Number.isNaN(n)?i:n}function il(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 nl(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 rl=/["'&<>]/;function ol(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 al(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ol(Object(i),!0).forEach((function(t){hl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ol(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function sl(e){return(sl="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 ll(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cl(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,fl(n.key),n)}}function ul(e,t,i){return t&&cl(e.prototype,t),i&&cl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function hl(e,t,i){return(t=fl(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function dl(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 fl(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 pl=function(e){return e&&e.Math==Math&&e},gl=pl("object"==typeof globalThis&&globalThis)||pl("object"==typeof window&&window)||pl("object"==typeof self&&self)||pl("object"==typeof ar&&ar)||function(){return this}()||Function("return this")(),yl={},vl=function(e){try{return!!e()}catch(t){return!0}},ml=!vl((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),_l=!vl((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),El=_l,Tl=Function.prototype.call,bl=El?Tl.bind(Tl):function(){return Tl.apply(Tl,arguments)},Sl={},Cl={}.propertyIsEnumerable,kl=Object.getOwnPropertyDescriptor,Il=kl&&!Cl.call({1:2},1);Sl.f=Il?function(e){var t=kl(this,e);return!!t&&t.enumerable}:Cl;var Pl,Dl,wl=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Al=_l,Rl=Function.prototype,xl=Rl.call,Ol=Al&&Rl.bind.bind(xl,xl),Ll=Al?Ol:function(e){return function(){return xl.apply(e,arguments)}},Nl=Ll,Ml=Nl({}.toString),Ul=Nl("".slice),Bl=function(e){return Ul(Ml(e),8,-1)},Fl=vl,Hl=Bl,jl=Object,Vl=Ll("".split),Kl=Fl((function(){return!jl("z").propertyIsEnumerable(0)}))?function(e){return"String"==Hl(e)?Vl(e,""):jl(e)}:jl,Wl=function(e){return null==e},Gl=Wl,Yl=TypeError,zl=function(e){if(Gl(e))throw Yl("Can't call method on "+e);return e},$l=Kl,Xl=zl,ql=function(e){return $l(Xl(e))},Zl="object"==typeof document&&document.all,Ql={all:Zl,IS_HTMLDDA:void 0===Zl&&void 0!==Zl},Jl=Ql.all,ec=Ql.IS_HTMLDDA?function(e){return"function"==typeof e||e===Jl}:function(e){return"function"==typeof e},tc=ec,ic=Ql.all,nc=Ql.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:tc(e)||e===ic}:function(e){return"object"==typeof e?null!==e:tc(e)},rc=gl,oc=ec,ac=function(e,t){return arguments.length<2?(i=rc[e],oc(i)?i:void 0):rc[e]&&rc[e][t];var i},sc=Ll({}.isPrototypeOf),lc=ac("navigator","userAgent")||"",cc=gl,uc=lc,hc=cc.process,dc=cc.Deno,fc=hc&&hc.versions||dc&&dc.version,pc=fc&&fc.v8;pc&&(Dl=(Pl=pc.split("."))[0]>0&&Pl[0]<4?1:+(Pl[0]+Pl[1])),!Dl&&uc&&(!(Pl=uc.match(/Edge\/(\d+)/))||Pl[1]>=74)&&(Pl=uc.match(/Chrome\/(\d+)/))&&(Dl=+Pl[1]);var gc=Dl,yc=gc,vc=vl,mc=!!Object.getOwnPropertySymbols&&!vc((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&yc&&yc<41})),_c=mc&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ec=ac,Tc=ec,bc=sc,Sc=Object,Cc=_c?function(e){return"symbol"==typeof e}:function(e){var t=Ec("Symbol");return Tc(t)&&bc(t.prototype,Sc(e))},kc=String,Ic=function(e){try{return kc(e)}catch(t){return"Object"}},Pc=ec,Dc=Ic,wc=TypeError,Ac=function(e){if(Pc(e))return e;throw wc(Dc(e)+" is not a function")},Rc=Ac,xc=Wl,Oc=function(e,t){var i=e[t];return xc(i)?void 0:Rc(i)},Lc=bl,Nc=ec,Mc=nc,Uc=TypeError,Bc={exports:{}},Fc=gl,Hc=Object.defineProperty,jc=function(e,t){try{Hc(Fc,e,{value:t,configurable:!0,writable:!0})}catch(i){Fc[e]=t}return t},Vc=jc,Kc="__core-js_shared__",Wc=gl[Kc]||Vc(Kc,{}),Gc=Wc;(Bc.exports=function(e,t){return Gc[e]||(Gc[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 Yc=Bc.exports,zc=zl,$c=Object,Xc=function(e){return $c(zc(e))},qc=Xc,Zc=Ll({}.hasOwnProperty),Qc=Object.hasOwn||function(e,t){return Zc(qc(e),t)},Jc=Ll,eu=0,tu=Math.random(),iu=Jc(1..toString),nu=function(e){return"Symbol("+(void 0===e?"":e)+")_"+iu(++eu+tu,36)},ru=gl,ou=Qc,au=nu,su=mc,lu=_c,cu=Yc("wks"),uu=ru.Symbol,hu=uu&&uu.for,du=lu?uu:uu&&uu.withoutSetter||au,fu=function(e){if(!ou(cu,e)||!su&&"string"!=typeof cu[e]){var t="Symbol."+e;su&&ou(uu,e)?cu[e]=uu[e]:cu[e]=lu&&hu?hu(t):du(t)}return cu[e]},pu=bl,gu=nc,yu=Cc,vu=Oc,mu=function(e,t){var i,n;if("string"===t&&Nc(i=e.toString)&&!Mc(n=Lc(i,e)))return n;if(Nc(i=e.valueOf)&&!Mc(n=Lc(i,e)))return n;if("string"!==t&&Nc(i=e.toString)&&!Mc(n=Lc(i,e)))return n;throw Uc("Can't convert object to primitive value")},_u=TypeError,Eu=fu("toPrimitive"),Tu=function(e,t){if(!gu(e)||yu(e))return e;var i,n=vu(e,Eu);if(n){if(void 0===t&&(t="default"),i=pu(n,e,t),!gu(i)||yu(i))return i;throw _u("Can't convert object to primitive value")}return void 0===t&&(t="number"),mu(e,t)},bu=Tu,Su=Cc,Cu=function(e){var t=bu(e,"string");return Su(t)?t:t+""},ku=nc,Iu=gl.document,Pu=ku(Iu)&&ku(Iu.createElement),Du=function(e){return Pu?Iu.createElement(e):{}},wu=Du,Au=!ml&&!vl((function(){return 7!=Object.defineProperty(wu("div"),"a",{get:function(){return 7}}).a})),Ru=ml,xu=bl,Ou=Sl,Lu=wl,Nu=ql,Mu=Cu,Uu=Qc,Bu=Au,Fu=Object.getOwnPropertyDescriptor;yl.f=Ru?Fu:function(e,t){if(e=Nu(e),t=Mu(t),Bu)try{return Fu(e,t)}catch(i){}if(Uu(e,t))return Lu(!xu(Ou.f,e,t),e[t])};var Hu={},ju=ml&&vl((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Vu=nc,Ku=String,Wu=TypeError,Gu=function(e){if(Vu(e))return e;throw Wu(Ku(e)+" is not an object")},Yu=ml,zu=Au,$u=ju,Xu=Gu,qu=Cu,Zu=TypeError,Qu=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,eh="enumerable",th="configurable",ih="writable";Hu.f=Yu?$u?function(e,t,i){if(Xu(e),t=qu(t),Xu(i),"function"==typeof e&&"prototype"===t&&"value"in i&&ih in i&&!i[ih]){var n=Ju(e,t);n&&n[ih]&&(e[t]=i.value,i={configurable:th in i?i[th]:n[th],enumerable:eh in i?i[eh]:n[eh],writable:!1})}return Qu(e,t,i)}:Qu:function(e,t,i){if(Xu(e),t=qu(t),Xu(i),zu)try{return Qu(e,t,i)}catch(n){}if("get"in i||"set"in i)throw Zu("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var nh=Hu,rh=wl,oh=ml?function(e,t,i){return nh.f(e,t,rh(1,i))}:function(e,t,i){return e[t]=i,e},ah={exports:{}},sh=ml,lh=Qc,ch=Function.prototype,uh=sh&&Object.getOwnPropertyDescriptor,hh=lh(ch,"name"),dh={EXISTS:hh,PROPER:hh&&"something"===function(){}.name,CONFIGURABLE:hh&&(!sh||sh&&uh(ch,"name").configurable)},fh=ec,ph=Wc,gh=Ll(Function.toString);fh(ph.inspectSource)||(ph.inspectSource=function(e){return gh(e)});var yh,vh,mh,_h=ph.inspectSource,Eh=ec,Th=gl.WeakMap,bh=Eh(Th)&&/native code/.test(String(Th)),Sh=nu,Ch=Yc("keys"),kh=function(e){return Ch[e]||(Ch[e]=Sh(e))},Ih={},Ph=bh,Dh=gl,wh=nc,Ah=oh,Rh=Qc,xh=Wc,Oh=kh,Lh=Ih,Nh="Object already initialized",Mh=Dh.TypeError,Uh=Dh.WeakMap;if(Ph||xh.state){var Bh=xh.state||(xh.state=new Uh);Bh.get=Bh.get,Bh.has=Bh.has,Bh.set=Bh.set,yh=function(e,t){if(Bh.has(e))throw Mh(Nh);return t.facade=e,Bh.set(e,t),t},vh=function(e){return Bh.get(e)||{}},mh=function(e){return Bh.has(e)}}else{var Fh=Oh("state");Lh[Fh]=!0,yh=function(e,t){if(Rh(e,Fh))throw Mh(Nh);return t.facade=e,Ah(e,Fh,t),t},vh=function(e){return Rh(e,Fh)?e[Fh]:{}},mh=function(e){return Rh(e,Fh)}}var Hh={set:yh,get:vh,has:mh,enforce:function(e){return mh(e)?vh(e):yh(e,{})},getterFor:function(e){return function(t){var i;if(!wh(t)||(i=vh(t)).type!==e)throw Mh("Incompatible receiver, "+e+" required");return i}}},jh=vl,Vh=ec,Kh=Qc,Wh=ml,Gh=dh.CONFIGURABLE,Yh=_h,zh=Hh.enforce,$h=Hh.get,Xh=Object.defineProperty,qh=Wh&&!jh((function(){return 8!==Xh((function(){}),"length",{value:8}).length})),Zh=String(String).split("String"),Qh=ah.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),(!Kh(e,"name")||Gh&&e.name!==t)&&(Wh?Xh(e,"name",{value:t,configurable:!0}):e.name=t),qh&&i&&Kh(i,"arity")&&e.length!==i.arity&&Xh(e,"length",{value:i.arity});try{i&&Kh(i,"constructor")&&i.constructor?Wh&&Xh(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=zh(e);return Kh(n,"source")||(n.source=Zh.join("string"==typeof t?t:"")),e};Function.prototype.toString=Qh((function(){return Vh(this)&&$h(this).source||Yh(this)}),"toString");var Jh=ah.exports,ed=ec,td=Hu,id=Jh,nd=jc,rd=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(ed(i)&&id(i,o,n),n.global)r?e[t]=i:nd(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=i:td.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},od={},ad=Math.ceil,sd=Math.floor,ld=Math.trunc||function(e){var t=+e;return(t>0?sd:ad)(t)},cd=function(e){var t=+e;return t!=t||0===t?0:ld(t)},ud=cd,hd=Math.max,dd=Math.min,fd=function(e,t){var i=ud(e);return i<0?hd(i+t,0):dd(i,t)},pd=cd,gd=Math.min,yd=function(e){return e>0?gd(pd(e),9007199254740991):0},vd=yd,md=function(e){return vd(e.length)},_d=ql,Ed=fd,Td=md,bd=function(e){return function(t,i,n){var r,o=_d(t),a=Td(o),s=Ed(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}},Sd={includes:bd(!0),indexOf:bd(!1)},Cd=Qc,kd=ql,Id=Sd.indexOf,Pd=Ih,Dd=Ll([].push),wd=function(e,t){var i,n=kd(e),r=0,o=[];for(i in n)!Cd(Pd,i)&&Cd(n,i)&&Dd(o,i);for(;t.length>r;)Cd(n,i=t[r++])&&(~Id(o,i)||Dd(o,i));return o},Ad=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Rd=wd,xd=Ad.concat("length","prototype");od.f=Object.getOwnPropertyNames||function(e){return Rd(e,xd)};var Od={};Od.f=Object.getOwnPropertySymbols;var Ld=ac,Nd=od,Md=Od,Ud=Gu,Bd=Ll([].concat),Fd=Ld("Reflect","ownKeys")||function(e){var t=Nd.f(Ud(e)),i=Md.f;return i?Bd(t,i(e)):t},Hd=Qc,jd=Fd,Vd=yl,Kd=Hu,Wd=function(e,t,i){for(var n=jd(t),r=Kd.f,o=Vd.f,a=0;a<n.length;a++){var s=n[a];Hd(e,s)||i&&Hd(i,s)||r(e,s,o(t,s))}},Gd=vl,Yd=ec,zd=/#|\.prototype\./,$d=function(e,t){var i=qd[Xd(e)];return i==Qd||i!=Zd&&(Yd(t)?Gd(t):!!t)},Xd=$d.normalize=function(e){return String(e).replace(zd,".").toLowerCase()},qd=$d.data={},Zd=$d.NATIVE="N",Qd=$d.POLYFILL="P",Jd=$d,ef=gl,tf=yl.f,nf=oh,rf=rd,of=jc,af=Wd,sf=Jd,lf=function(e,t){var i,n,r,o,a,s=e.target,l=e.global,c=e.stat;if(i=l?ef:c?ef[s]||of(s,{}):(ef[s]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(a=tf(i,n))&&a.value:i[n],!sf(l?n:s+(c?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;af(o,r)}(e.sham||r&&r.sham)&&nf(o,"sham",!0),rf(i,n,o,e)}},cf=Bl,uf=Array.isArray||function(e){return"Array"==cf(e)},hf=TypeError,df=function(e){if(e>9007199254740991)throw hf("Maximum allowed index exceeded");return e},ff=Cu,pf=Hu,gf=wl,yf=function(e,t,i){var n=ff(t);n in e?pf.f(e,n,gf(0,i)):e[n]=i},vf={};vf[fu("toStringTag")]="z";var mf="[object z]"===String(vf),_f=mf,Ef=ec,Tf=Bl,bf=fu("toStringTag"),Sf=Object,Cf="Arguments"==Tf(function(){return arguments}()),kf=_f?Tf: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=Sf(e),bf))?i:Cf?Tf(t):"Object"==(n=Tf(t))&&Ef(t.callee)?"Arguments":n},If=Ll,Pf=vl,Df=ec,wf=kf,Af=_h,Rf=function(){},xf=[],Of=ac("Reflect","construct"),Lf=/^\s*(?:class|function)\b/,Nf=If(Lf.exec),Mf=!Lf.exec(Rf),Uf=function(e){if(!Df(e))return!1;try{return Of(Rf,xf,e),!0}catch(t){return!1}},Bf=function(e){if(!Df(e))return!1;switch(wf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mf||!!Nf(Lf,Af(e))}catch(t){return!0}};Bf.sham=!0;var Ff=!Of||Pf((function(){var e;return Uf(Uf.call)||!Uf(Object)||!Uf((function(){e=!0}))||e}))?Bf:Uf,Hf=uf,jf=Ff,Vf=nc,Kf=fu("species"),Wf=Array,Gf=function(e){var t;return Hf(e)&&(t=e.constructor,(jf(t)&&(t===Wf||Hf(t.prototype))||Vf(t)&&null===(t=t[Kf]))&&(t=void 0)),void 0===t?Wf:t},Yf=function(e,t){return new(Gf(e))(0===t?0:t)},zf=vl,$f=gc,Xf=fu("species"),qf=function(e){return $f>=51||!zf((function(){var t=[];return(t.constructor={})[Xf]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Zf=lf,Qf=vl,Jf=uf,ep=nc,tp=Xc,ip=md,np=df,rp=yf,op=Yf,ap=qf,sp=gc,lp=fu("isConcatSpreadable"),cp=sp>=51||!Qf((function(){var e=[];return e[lp]=!1,e.concat()[0]!==e})),up=ap("concat"),hp=function(e){if(!ep(e))return!1;var t=e[lp];return void 0!==t?!!t:Jf(e)};Zf({target:"Array",proto:!0,arity:1,forced:!cp||!up},{concat:function(e){var t,i,n,r,o,a=tp(this),s=op(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(hp(o=-1===t?a:arguments[t]))for(r=ip(o),np(l+r),i=0;i<r;i++,l++)i in o&&rp(s,l,o[i]);else np(l+1),rp(s,l++,o);return s.length=l,s}});var dp=Bl,fp=Ll,pp=function(e){if("Function"===dp(e))return fp(e)},gp=Ac,yp=_l,vp=pp(pp.bind),mp=function(e,t){return gp(e),void 0===t?e:yp?vp(e,t):function(){return e.apply(t,arguments)}},_p=mp,Ep=Kl,Tp=Xc,bp=md,Sp=Yf,Cp=Ll([].push),kp=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=Tp(l),g=Ep(p),y=_p(c,u),v=bp(g),m=0,_=h||Sp,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:Cp(E,d)}else switch(e){case 4:return!1;case 7:Cp(E,d)}return o?-1:n||r?r:E}},Ip={forEach:kp(0),map:kp(1),filter:kp(2),some:kp(3),every:kp(4),find:kp(5),findIndex:kp(6),filterReject:kp(7)},Pp=Ip.map;lf({target:"Array",proto:!0,forced:!qf("map")},{map:function(e){return Pp(this,e,arguments.length>1?arguments[1]:void 0)}});var Dp=wd,wp=Ad,Ap=Object.keys||function(e){return Dp(e,wp)},Rp=Xc,xp=Ap;lf({target:"Object",stat:!0,forced:vl((function(){xp(1)}))},{keys:function(e){return xp(Rp(e))}});var Op=kf,Lp=String,Np=function(e){if("Symbol"===Op(e))throw TypeError("Cannot convert a Symbol value to a string");return Lp(e)},Mp=Ll,Up=cd,Bp=Np,Fp=zl,Hp=Mp("".charAt),jp=Mp("".charCodeAt),Vp=Mp("".slice),Kp=function(e){return function(t,i){var n,r,o=Bp(Fp(t)),a=Up(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=jp(o,a))<55296||n>56319||a+1===s||(r=jp(o,a+1))<56320||r>57343?e?Hp(o,a):n:e?Vp(o,a,a+2):r-56320+(n-55296<<10)+65536}},Wp={codeAt:Kp(!1),charAt:Kp(!0)},Gp=Wp.charAt,Yp=zl,zp=cd,$p=Np;lf({target:"String",proto:!0,forced:!0},{at:function(e){var t=$p(Yp(this)),i=t.length,n=zp(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:Gp(t,r)}});var Xp=kf,qp=mf?{}.toString:function(){return"[object "+Xp(this)+"]"};mf||rd(Object.prototype,"toString",qp,{unsafe:!0});var Zp=Gu,Qp=function(){var e=Zp(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},Jp=bl,eg=Qc,tg=sc,ig=Qp,ng=RegExp.prototype,rg=function(e){var t=e.flags;return void 0!==t||"flags"in ng||eg(e,"flags")||!tg(ng,e)?t:Jp(ig,e)},og=dh.PROPER,ag=rd,sg=Gu,lg=Np,cg=vl,ug=rg,hg="toString",dg=RegExp.prototype[hg],fg=cg((function(){return"/a/b"!=dg.call({source:"a",flags:"b"})})),pg=og&&dg.name!=hg;(fg||pg)&&ag(RegExp.prototype,hg,(function(){var e=sg(this);return"/"+lg(e.source)+"/"+lg(ug(e))}),{unsafe:!0});var gg=Du("span").classList,yg=gg&&gg.constructor&&gg.constructor.prototype,vg=yg===Object.prototype?void 0:yg,mg=vl,_g=function(e,t){var i=[][e];return!!i&&mg((function(){i.call(null,t||function(){return 1},1)}))},Eg=Ip.forEach,Tg=_g("forEach")?[].forEach:function(e){return Eg(this,e,arguments.length>1?arguments[1]:void 0)},bg=gl,Sg={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},Cg=vg,kg=Tg,Ig=oh,Pg=function(e){if(e&&e.forEach!==kg)try{Ig(e,"forEach",kg)}catch(t){e.forEach=kg}};for(var Dg in Sg)Sg[Dg]&&Pg(bg[Dg]&&bg[Dg].prototype);Pg(Cg);var wg=ec,Ag=String,Rg=TypeError,xg=Ll,Og=Gu,Lg=function(e){if("object"==typeof e||wg(e))return e;throw Rg("Can't set "+Ag(e)+" as a prototype")},Ng=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=xg(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return Og(i),Lg(n),t?e(i,n):i.__proto__=n,i}}():void 0),Mg=ec,Ug=nc,Bg=Ng,Fg=function(e,t,i){var n,r;return Bg&&Mg(n=t.constructor)&&n!==i&&Ug(r=n.prototype)&&r!==i.prototype&&Bg(e,r),e},Hg=Ll(1..valueOf),jg="\t\n\v\f\r                 \u2028\u2029\ufeff",Vg=zl,Kg=Np,Wg=jg,Gg=Ll("".replace),Yg="["+Wg+"]",zg=RegExp("^"+Yg+Yg+"*"),$g=RegExp(Yg+Yg+"*$"),Xg=function(e){return function(t){var i=Kg(Vg(t));return 1&e&&(i=Gg(i,zg,"")),2&e&&(i=Gg(i,$g,"")),i}},qg={start:Xg(1),end:Xg(2),trim:Xg(3)},Zg=ml,Qg=gl,Jg=Ll,ey=Jd,ty=rd,iy=Qc,ny=Fg,ry=sc,oy=Cc,ay=Tu,sy=vl,ly=od.f,cy=yl.f,uy=Hu.f,hy=Hg,dy=qg.trim,fy="Number",py=Qg[fy],gy=py.prototype,yy=Qg.TypeError,vy=Jg("".slice),my=Jg("".charCodeAt),_y=function(e){var t,i,n,r,o,a,s,l,c=ay(e,"number");if(oy(c))throw yy("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=dy(c),43===(t=my(c,0))||45===t){if(88===(i=my(c,2))||120===i)return NaN}else if(48===t){switch(my(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=vy(c,2)).length,s=0;s<a;s++)if((l=my(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c};if(ey(fy,!py(" 0o1")||!py("0b1")||py("+0x1"))){for(var Ey,Ty=function(e){var t=arguments.length<1?0:py(function(e){var t=ay(e,"number");return"bigint"==typeof t?t:_y(t)}(e)),i=this;return ry(gy,i)&&sy((function(){hy(i)}))?ny(Object(t),i,Ty):t},by=Zg?ly(py):"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(","),Sy=0;by.length>Sy;Sy++)iy(py,Ey=by[Sy])&&!iy(Ty,Ey)&&uy(Ty,Ey,cy(py,Ey));Ty.prototype=gy,gy.constructor=Ty,ty(Qg,fy,Ty,{constructor:!0})}var Cy=ml,ky=dh.EXISTS,Iy=Ll,Py=Hu.f,Dy=Function.prototype,wy=Iy(Dy.toString),Ay=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ry=Iy(Ay.exec);Cy&&!ky&&Py(Dy,"name",{configurable:!0,get:function(){try{return Ry(Ay,wy(this))[1]}catch(e){return""}}});var xy=lf,Oy=Kl,Ly=ql,Ny=_g,My=Ll([].join),Uy=Oy!=Object,By=Ny("join",",");xy({target:"Array",proto:!0,forced:Uy||!By},{join:function(e){return My(Ly(this),void 0===e?",":e)}});var Fy,Hy,jy,Vy,Ky="process"==Bl(gl.process),Wy=Hu.f,Gy=Qc,Yy=fu("toStringTag"),zy=function(e,t,i){e&&!i&&(e=e.prototype),e&&!Gy(e,Yy)&&Wy(e,Yy,{configurable:!0,value:t})},$y=ac,Xy=Hu,qy=ml,Zy=fu("species"),Qy=function(e){var t=$y(e),i=Xy.f;qy&&t&&!t[Zy]&&i(t,Zy,{configurable:!0,get:function(){return this}})},Jy=sc,ev=TypeError,tv=Ff,iv=Ic,nv=TypeError,rv=Gu,ov=function(e){if(tv(e))return e;throw nv(iv(e)+" is not a constructor")},av=Wl,sv=fu("species"),lv=function(e,t){var i,n=rv(e).constructor;return void 0===n||av(i=rv(n)[sv])?t:ov(i)},cv=_l,uv=Function.prototype,hv=uv.apply,dv=uv.call,fv="object"==typeof Reflect&&Reflect.apply||(cv?dv.bind(hv):function(){return dv.apply(hv,arguments)}),pv=ac("document","documentElement"),gv=Ll([].slice),yv=TypeError,vv=/(?:ipad|iphone|ipod).*applewebkit/i.test(lc),mv=gl,_v=fv,Ev=mp,Tv=ec,bv=Qc,Sv=vl,Cv=pv,kv=gv,Iv=Du,Pv=function(e,t){if(e<t)throw yv("Not enough arguments");return e},Dv=vv,wv=Ky,Av=mv.setImmediate,Rv=mv.clearImmediate,xv=mv.process,Ov=mv.Dispatch,Lv=mv.Function,Nv=mv.MessageChannel,Mv=mv.String,Uv=0,Bv={},Fv="onreadystatechange";try{Fy=mv.location}catch(KB){}var Hv=function(e){if(bv(Bv,e)){var t=Bv[e];delete Bv[e],t()}},jv=function(e){return function(){Hv(e)}},Vv=function(e){Hv(e.data)},Kv=function(e){mv.postMessage(Mv(e),Fy.protocol+"//"+Fy.host)};Av&&Rv||(Av=function(e){Pv(arguments.length,1);var t=Tv(e)?e:Lv(e),i=kv(arguments,1);return Bv[++Uv]=function(){_v(t,void 0,i)},Hy(Uv),Uv},Rv=function(e){delete Bv[e]},wv?Hy=function(e){xv.nextTick(jv(e))}:Ov&&Ov.now?Hy=function(e){Ov.now(jv(e))}:Nv&&!Dv?(Vy=(jy=new Nv).port2,jy.port1.onmessage=Vv,Hy=Ev(Vy.postMessage,Vy)):mv.addEventListener&&Tv(mv.postMessage)&&!mv.importScripts&&Fy&&"file:"!==Fy.protocol&&!Sv(Kv)?(Hy=Kv,mv.addEventListener("message",Vv,!1)):Hy=Fv in Iv("script")?function(e){Cv.appendChild(Iv("script"))[Fv]=function(){Cv.removeChild(this),Hv(e)}}:function(e){setTimeout(jv(e),0)});var Wv,Gv,Yv,zv,$v,Xv,qv,Zv,Qv={set:Av,clear:Rv},Jv=gl,em=/ipad|iphone|ipod/i.test(lc)&&void 0!==Jv.Pebble,tm=/web0s(?!.*chrome)/i.test(lc),im=gl,nm=mp,rm=yl.f,om=Qv.set,am=vv,sm=em,lm=tm,cm=Ky,um=im.MutationObserver||im.WebKitMutationObserver,hm=im.document,dm=im.process,fm=im.Promise,pm=rm(im,"queueMicrotask"),gm=pm&&pm.value;gm||(Wv=function(){var e,t;for(cm&&(e=dm.domain)&&e.exit();Gv;){t=Gv.fn,Gv=Gv.next;try{t()}catch(KB){throw Gv?zv():Yv=void 0,KB}}Yv=void 0,e&&e.enter()},am||cm||lm||!um||!hm?!sm&&fm&&fm.resolve?((qv=fm.resolve(void 0)).constructor=fm,Zv=nm(qv.then,qv),zv=function(){Zv(Wv)}):cm?zv=function(){dm.nextTick(Wv)}:(om=nm(om,im),zv=function(){om(Wv)}):($v=!0,Xv=hm.createTextNode(""),new um(Wv).observe(Xv,{characterData:!0}),zv=function(){Xv.data=$v=!$v}));var ym=gm||function(e){var t={fn:e,next:void 0};Yv&&(Yv.next=t),Gv||(Gv=t,zv()),Yv=t},vm=gl,mm=function(e){try{return{error:!1,value:e()}}catch(KB){return{error:!0,value:KB}}},_m=function(){this.head=null,this.tail=null};_m.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 Em=_m,Tm=gl.Promise,bm="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Sm=!bm&&!Ky&&"object"==typeof window&&"object"==typeof document,Cm=gl,km=Tm,Im=ec,Pm=Jd,Dm=_h,wm=fu,Am=Sm,Rm=bm,xm=gc;km&&km.prototype;var Om=wm("species"),Lm=!1,Nm=Im(Cm.PromiseRejectionEvent),Mm={CONSTRUCTOR:Pm("Promise",(function(){var e=Dm(km),t=e!==String(km);if(!t&&66===xm)return!0;if(!xm||xm<51||!/native code/.test(e)){var i=new km((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[Om]=n,!(Lm=i.then((function(){}))instanceof n))return!0}return!t&&(Am||Rm)&&!Nm})),REJECTION_EVENT:Nm,SUBCLASSING:Lm},Um={},Bm=Ac,Fm=TypeError,Hm=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw Fm("Bad Promise constructor");t=e,i=n})),this.resolve=Bm(t),this.reject=Bm(i)};Um.f=function(e){return new Hm(e)};var jm,Vm,Km,Wm=lf,Gm=Ky,Ym=gl,zm=bl,$m=rd,Xm=Ng,qm=zy,Zm=Qy,Qm=Ac,Jm=ec,e_=nc,t_=function(e,t){if(Jy(t,e))return e;throw ev("Incorrect invocation")},i_=lv,n_=Qv.set,r_=ym,o_=function(e,t){var i=vm.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},a_=mm,s_=Em,l_=Hh,c_=Tm,u_=Um,h_="Promise",d_=Mm.CONSTRUCTOR,f_=Mm.REJECTION_EVENT,p_=Mm.SUBCLASSING,g_=l_.getterFor(h_),y_=l_.set,v_=c_&&c_.prototype,m_=c_,__=v_,E_=Ym.TypeError,T_=Ym.document,b_=Ym.process,S_=u_.f,C_=S_,k_=!!(T_&&T_.createEvent&&Ym.dispatchEvent),I_="unhandledrejection",P_=function(e){var t;return!(!e_(e)||!Jm(t=e.then))&&t},D_=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&&O_(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(E_("Promise-chain cycle")):(n=P_(i))?zm(n,i,l,c):l(i)):c(o)}catch(KB){u&&!r&&u.exit(),c(KB)}},w_=function(e,t){e.notified||(e.notified=!0,r_((function(){for(var i,n=e.reactions;i=n.get();)D_(i,e);e.notified=!1,t&&!e.rejection&&R_(e)})))},A_=function(e,t,i){var n,r;k_?((n=T_.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),Ym.dispatchEvent(n)):n={promise:t,reason:i},!f_&&(r=Ym["on"+e])?r(n):e===I_&&o_("Unhandled promise rejection",i)},R_=function(e){zm(n_,Ym,(function(){var t,i=e.facade,n=e.value;if(x_(e)&&(t=a_((function(){Gm?b_.emit("unhandledRejection",n,i):A_(I_,i,n)})),e.rejection=Gm||x_(e)?2:1,t.error))throw t.value}))},x_=function(e){return 1!==e.rejection&&!e.parent},O_=function(e){zm(n_,Ym,(function(){var t=e.facade;Gm?b_.emit("rejectionHandled",t):A_("rejectionhandled",t,e.value)}))},L_=function(e,t,i){return function(n){e(t,n,i)}},N_=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,w_(e,!0))},M_=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw E_("Promise can't be resolved itself");var n=P_(t);n?r_((function(){var i={done:!1};try{zm(n,t,L_(M_,i,e),L_(N_,i,e))}catch(KB){N_(i,KB,e)}})):(e.value=t,e.state=1,w_(e,!1))}catch(KB){N_({done:!1},KB,e)}}};if(d_&&(__=(m_=function(e){t_(this,__),Qm(e),zm(jm,this);var t=g_(this);try{e(L_(M_,t),L_(N_,t))}catch(KB){N_(t,KB)}}).prototype,(jm=function(e){y_(this,{type:h_,done:!1,notified:!1,parent:!1,reactions:new s_,rejection:!1,state:0,value:void 0})}).prototype=$m(__,"then",(function(e,t){var i=g_(this),n=S_(i_(this,m_));return i.parent=!0,n.ok=!Jm(e)||e,n.fail=Jm(t)&&t,n.domain=Gm?b_.domain:void 0,0==i.state?i.reactions.add(n):r_((function(){D_(n,i)})),n.promise})),Vm=function(){var e=new jm,t=g_(e);this.promise=e,this.resolve=L_(M_,t),this.reject=L_(N_,t)},u_.f=S_=function(e){return e===m_||undefined===e?new Vm(e):C_(e)},Jm(c_)&&v_!==Object.prototype)){Km=v_.then,p_||$m(v_,"then",(function(e,t){var i=this;return new m_((function(e,t){zm(Km,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete v_.constructor}catch(KB){}Xm&&Xm(v_,__)}Wm({global:!0,constructor:!0,wrap:!0,forced:d_},{Promise:m_}),qm(m_,h_,!1),Zm(h_);var U_={},B_=U_,F_=fu("iterator"),H_=Array.prototype,j_=kf,V_=Oc,K_=Wl,W_=U_,G_=fu("iterator"),Y_=function(e){if(!K_(e))return V_(e,G_)||V_(e,"@@iterator")||W_[j_(e)]},z_=bl,$_=Ac,X_=Gu,q_=Ic,Z_=Y_,Q_=TypeError,J_=bl,eE=Gu,tE=Oc,iE=mp,nE=bl,rE=Gu,oE=Ic,aE=function(e){return void 0!==e&&(B_.Array===e||H_[F_]===e)},sE=md,lE=sc,cE=function(e,t){var i=arguments.length<2?Z_(e):t;if($_(i))return X_(z_(i,e));throw Q_(q_(e)+" is not iterable")},uE=Y_,hE=function(e,t,i){var n,r;eE(e);try{if(!(n=tE(e,"return"))){if("throw"===t)throw i;return i}n=J_(n,e)}catch(KB){r=!0,n=KB}if("throw"===t)throw i;if(r)throw n;return eE(n),i},dE=TypeError,fE=function(e,t){this.stopped=e,this.result=t},pE=fE.prototype,gE=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=iE(t,u),y=function(e){return n&&hE(n,"normal",e),new fE(!0,e)},v=function(e){return h?(rE(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=uE(e)))throw dE(oE(e)+" is not iterable");if(aE(r)){for(o=0,a=sE(e);a>o;o++)if((s=v(e[o]))&&lE(pE,s))return s;return new fE(!1)}n=cE(e,r)}for(l=d?e.next:n.next;!(c=nE(l,n)).done;){try{s=v(c.value)}catch(KB){hE(n,"throw",KB)}if("object"==typeof s&&s&&lE(pE,s))return s}return new fE(!1)},yE=fu("iterator"),vE=!1;try{var mE=0,_E={next:function(){return{done:!!mE++}},return:function(){vE=!0}};_E[yE]=function(){return this},Array.from(_E,(function(){throw 2}))}catch(KB){}var EE=Tm,TE=Mm.CONSTRUCTOR||!function(e,t){if(!t&&!vE)return!1;var i=!1;try{var n={};n[yE]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(KB){}return i}((function(e){EE.all(e).then(void 0,(function(){}))})),bE=bl,SE=Ac,CE=Um,kE=mm,IE=gE;lf({target:"Promise",stat:!0,forced:TE},{all:function(e){var t=this,i=CE.f(t),n=i.resolve,r=i.reject,o=kE((function(){var i=SE(t.resolve),o=[],a=0,s=1;IE(e,(function(e){var l=a++,c=!1;s++,bE(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 PE=lf,DE=Mm.CONSTRUCTOR,wE=Tm,AE=ac,RE=ec,xE=rd,OE=wE&&wE.prototype;if(PE({target:"Promise",proto:!0,forced:DE,real:!0},{catch:function(e){return this.then(void 0,e)}}),RE(wE)){var LE=AE("Promise").prototype.catch;OE.catch!==LE&&xE(OE,"catch",LE,{unsafe:!0})}var NE=bl,ME=Ac,UE=Um,BE=mm,FE=gE;lf({target:"Promise",stat:!0,forced:TE},{race:function(e){var t=this,i=UE.f(t),n=i.reject,r=BE((function(){var r=ME(t.resolve);FE(e,(function(e){NE(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var HE=bl,jE=Um;lf({target:"Promise",stat:!0,forced:Mm.CONSTRUCTOR},{reject:function(e){var t=jE.f(this);return HE(t.reject,void 0,e),t.promise}});var VE=Gu,KE=nc,WE=Um,GE=function(e,t){if(VE(e),KE(t)&&t.constructor===e)return t;var i=WE.f(e);return(0,i.resolve)(t),i.promise},YE=lf,zE=Mm.CONSTRUCTOR,$E=GE;ac("Promise"),YE({target:"Promise",stat:!0,forced:zE},{resolve:function(e){return $E(this,e)}});var XE=lf,qE=Tm,ZE=vl,QE=ac,JE=ec,eT=lv,tT=GE,iT=rd,nT=qE&&qE.prototype;if(XE({target:"Promise",proto:!0,real:!0,forced:!!qE&&ZE((function(){nT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=eT(this,QE("Promise")),i=JE(e);return this.then(i?function(i){return tT(t,e()).then((function(){return i}))}:e,i?function(i){return tT(t,e()).then((function(){throw i}))}:e)}}),JE(qE)){var rT=QE("Promise").prototype.finally;nT.finally!==rT&&iT(nT,"finally",rT,{unsafe:!0})}var oT=ml,aT=uf,sT=TypeError,lT=Object.getOwnPropertyDescriptor,cT=oT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(KB){return KB instanceof TypeError}}(),uT=Ic,hT=TypeError,dT=lf,fT=Xc,pT=fd,gT=cd,yT=md,vT=cT?function(e,t){if(aT(e)&&!lT(e,"length").writable)throw sT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},mT=df,_T=Yf,ET=yf,TT=function(e,t){if(!delete e[t])throw hT("Cannot delete property "+uT(t)+" of "+uT(e))},bT=qf("splice"),ST=Math.max,CT=Math.min;dT({target:"Array",proto:!0,forced:!bT},{splice:function(e,t){var i,n,r,o,a,s,l=fT(this),c=yT(l),u=pT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=CT(ST(gT(t),0),c-u)),mT(c+i-n),r=_T(l,n),o=0;o<n;o++)(a=u+o)in l&&ET(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]:TT(l,s);for(o=c;o>c-n+i;o--)TT(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]:TT(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return vT(l,c-n+i),r}});var kT=cd,IT=Np,PT=zl,DT=RangeError,wT=lf,AT=Ll,RT=cd,xT=Hg,OT=function(e){var t=IT(PT(this)),i="",n=kT(e);if(n<0||n==1/0)throw DT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},LT=vl,NT=RangeError,MT=String,UT=Math.floor,BT=AT(OT),FT=AT("".slice),HT=AT(1..toFixed),jT=function(e,t,i){return 0===t?i:t%2==1?jT(e,t-1,i*e):jT(e*e,t/2,i)},VT=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=UT(r/1e7)},KT=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=UT(n/t),n=n%t*1e7},WT=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=MT(e[t]);i=""===i?n:i+BT("0",7-n.length)+n}return i};wT({target:"Number",proto:!0,forced:LT((function(){return"0.000"!==HT(8e-5,3)||"1"!==HT(.9,0)||"1.25"!==HT(1.255,2)||"1000000000000000128"!==HT(0xde0b6b3a7640080,0)}))||!LT((function(){HT({})}))},{toFixed:function(e){var t,i,n,r,o=xT(this),a=RT(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw NT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return MT(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*jT(2,69,1))-69)<0?o*jT(2,-t,1):o/jT(2,t,1),i*=4503599627370496,(t=52-t)>0){for(VT(s,0,i),n=a;n>=7;)VT(s,1e7,0),n-=7;for(VT(s,jT(10,n,1),0),n=t-1;n>=23;)KT(s,1<<23),n-=23;KT(s,1<<n),VT(s,1,1),KT(s,2),c=WT(s)}else VT(s,0,i),VT(s,1<<-t,0),c=WT(s)+BT("0",a);return c=a>0?l+((r=c.length)<=a?"0."+BT("0",a-r)+c:FT(c,0,r-a)+"."+FT(c,r-a)):l+c}}),lf({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var GT=vl,YT=gl.RegExp,zT=GT((function(){var e=YT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),$T=zT||GT((function(){return!YT("a","y").sticky})),XT={BROKEN_CARET:zT||GT((function(){var e=YT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:$T,UNSUPPORTED_Y:zT},qT={},ZT=ml,QT=ju,JT=Hu,eb=Gu,tb=ql,ib=Ap;qT.f=ZT&&!QT?Object.defineProperties:function(e,t){eb(e);for(var i,n=tb(t),r=ib(t),o=r.length,a=0;o>a;)JT.f(e,i=r[a++],n[i]);return e};var nb,rb=Gu,ob=qT,ab=Ad,sb=Ih,lb=pv,cb=Du,ub="prototype",hb="script",db=kh("IE_PROTO"),fb=function(){},pb=function(e){return"<"+hb+">"+e+"</"+hb+">"},gb=function(e){e.write(pb("")),e.close();var t=e.parentWindow.Object;return e=null,t},yb=function(){try{nb=new ActiveXObject("htmlfile")}catch(KB){}var e,t,i;yb="undefined"!=typeof document?document.domain&&nb?gb(nb):(t=cb("iframe"),i="java"+hb+":",t.style.display="none",lb.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(pb("document.F=Object")),e.close(),e.F):gb(nb);for(var n=ab.length;n--;)delete yb[ub][ab[n]];return yb()};sb[db]=!0;var vb,mb,_b=Object.create||function(e,t){var i;return null!==e?(fb[ub]=rb(e),i=new fb,fb[ub]=null,i[db]=e):i=yb(),void 0===t?i:ob.f(i,t)},Eb=vl,Tb=gl.RegExp,bb=Eb((function(){var e=Tb(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Sb=vl,Cb=gl.RegExp,kb=Sb((function(){var e=Cb("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ib=bl,Pb=Ll,Db=Np,wb=Qp,Ab=XT,Rb=_b,xb=Hh.get,Ob=bb,Lb=kb,Nb=Yc("native-string-replace",String.prototype.replace),Mb=RegExp.prototype.exec,Ub=Mb,Bb=Pb("".charAt),Fb=Pb("".indexOf),Hb=Pb("".replace),jb=Pb("".slice),Vb=(mb=/b*/g,Ib(Mb,vb=/a/,"a"),Ib(Mb,mb,"a"),0!==vb.lastIndex||0!==mb.lastIndex),Kb=Ab.BROKEN_CARET,Wb=void 0!==/()??/.exec("")[1];(Vb||Wb||Kb||Ob||Lb)&&(Ub=function(e){var t,i,n,r,o,a,s,l=this,c=xb(l),u=Db(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=Ib(Ub,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=Kb&&l.sticky,p=Ib(wb,l),g=l.source,y=0,v=u;if(f&&(p=Hb(p,"y",""),-1===Fb(p,"g")&&(p+="g"),v=jb(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Bb(u,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),i=new RegExp("^(?:"+g+")",p)),Wb&&(i=new RegExp("^"+g+"$(?!\\s)",p)),Vb&&(n=l.lastIndex),r=Ib(Mb,f?i:l,v),f?r?(r.input=jb(r.input,y),r[0]=jb(r[0],y),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:Vb&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),Wb&&r&&r.length>1&&Ib(Nb,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=Rb(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var Gb=Ub;lf({target:"RegExp",proto:!0,forced:/./.exec!==Gb},{exec:Gb});var Yb=pp,zb=rd,$b=Gb,Xb=vl,qb=fu,Zb=oh,Qb=qb("species"),Jb=RegExp.prototype,eS=function(e,t,i,n){var r=qb(e),o=!Xb((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!Xb((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[Qb]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=Yb(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=Yb(e),l=t.exec;return l===$b||l===Jb.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));zb(String.prototype,e,l[0]),zb(Jb,r,l[1])}n&&Zb(Jb[r],"sham",!0)},tS=Wp.charAt,iS=function(e,t,i){return t+(i?tS(e,t).length:1)},nS=Ll,rS=Xc,oS=Math.floor,aS=nS("".charAt),sS=nS("".replace),lS=nS("".slice),cS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,uS=/\$([$&'`]|\d{1,2})/g,hS=bl,dS=Gu,fS=ec,pS=Bl,gS=Gb,yS=TypeError,vS=function(e,t){var i=e.exec;if(fS(i)){var n=hS(i,e,t);return null!==n&&dS(n),n}if("RegExp"===pS(e))return hS(gS,e,t);throw yS("RegExp#exec called on incompatible receiver")},mS=fv,_S=bl,ES=Ll,TS=eS,bS=vl,SS=Gu,CS=ec,kS=Wl,IS=cd,PS=yd,DS=Np,wS=zl,AS=iS,RS=Oc,xS=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=uS;return void 0!==r&&(r=rS(r),l=cS),sS(o,l,(function(o,l){var c;switch(aS(l,0)){case"$":return"$";case"&":return e;case"`":return lS(t,0,i);case"'":return lS(t,a);case"<":c=r[lS(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=oS(u/10);return 0===h?o:h<=s?void 0===n[h-1]?aS(l,1):n[h-1]+aS(l,1):o}c=n[u-1]}return void 0===c?"":c}))},OS=vS,LS=fu("replace"),NS=Math.max,MS=Math.min,US=ES([].concat),BS=ES([].push),FS=ES("".indexOf),HS=ES("".slice),jS="$0"==="a".replace(/./,"$0"),VS=!!/./[LS]&&""===/./[LS]("a","$0");TS("replace",(function(e,t,i){var n=VS?"$":"$0";return[function(e,i){var n=wS(this),r=kS(e)?void 0:RS(e,LS);return r?_S(r,e,n,i):_S(t,DS(n),e,i)},function(e,r){var o=SS(this),a=DS(e);if("string"==typeof r&&-1===FS(r,n)&&-1===FS(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=CS(r);l||(r=DS(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=OS(o,a);if(null===d)break;if(BS(h,d),!c)break;""===DS(d[0])&&(o.lastIndex=AS(a,PS(o.lastIndex),u))}for(var f,p="",g=0,y=0;y<h.length;y++){for(var v=DS((d=h[y])[0]),m=NS(MS(IS(d.index),a.length),0),_=[],E=1;E<d.length;E++)BS(_,void 0===(f=d[E])?f:String(f));var T=d.groups;if(l){var b=US([v],_,m,a);void 0!==T&&BS(b,T);var S=DS(mS(r,void 0,b))}else S=xS(v,a,m,_,T,r);m>=g&&(p+=HS(a,g,m)+S,g=m+v.length)}return p+HS(a,g)}]}),!!bS((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!jS||VS);var KS=nc,WS=Bl,GS=fu("match"),YS=function(e){var t;return KS(e)&&(void 0!==(t=e[GS])?!!t:"RegExp"==WS(e))},zS=fd,$S=md,XS=yf,qS=Array,ZS=Math.max,QS=function(e,t,i){for(var n=$S(e),r=zS(t,n),o=zS(void 0===i?n:i,n),a=qS(ZS(o-r,0)),s=0;r<o;r++,s++)XS(a,s,e[r]);return a.length=s,a},JS=fv,eC=bl,tC=Ll,iC=eS,nC=Gu,rC=Wl,oC=YS,aC=zl,sC=lv,lC=iS,cC=yd,uC=Np,hC=Oc,dC=QS,fC=vS,pC=Gb,gC=vl,yC=XT.UNSUPPORTED_Y,vC=4294967295,mC=Math.min,_C=[].push,EC=tC(/./.exec),TC=tC(_C),bC=tC("".slice),SC=!gC((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]}));iC("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=uC(aC(this)),r=void 0===i?vC:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!oC(e))return eC(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=eC(pC,h,n))&&!((a=h.lastIndex)>u&&(TC(l,bC(n,u,o.index)),o.length>1&&o.index<n.length&&JS(_C,l,dC(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&EC(h,"")||TC(l,""):TC(l,bC(n,u)),l.length>r?dC(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:eC(t,this,e,i)}:t,[function(t,i){var r=aC(this),o=rC(t)?void 0:hC(t,e);return o?eC(o,t,r,i):eC(n,uC(r),t,i)},function(e,r){var o=nC(this),a=uC(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=sC(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(yC?"g":"y"),h=new l(yC?"^(?:"+o.source+")":o,u),d=void 0===r?vC:r>>>0;if(0===d)return[];if(0===a.length)return null===fC(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=yC?0:p;var y,v=fC(h,yC?bC(a,p):a);if(null===v||(y=mC(cC(h.lastIndex+(yC?p:0)),a.length))===f)p=lC(a,p,c);else{if(TC(g,bC(a,f,p)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(TC(g,v[m]),g.length===d)return g;p=f=y}}return TC(g,bC(a,f)),g}]}),!SC,yC);var CC=dh.PROPER,kC=vl,IC=jg,PC=qg.trim;lf({target:"String",proto:!0,forced:function(e){return kC((function(){return!!IC[e]()||"​…᠎"!=="​…᠎"[e]()||CC&&IC[e].name!==e}))}("trim")},{trim:function(){return PC(this)}});var DC=Ip.filter;lf({target:"Array",proto:!0,forced:!qf("filter")},{filter:function(e){return DC(this,e,arguments.length>1?arguments[1]:void 0)}});var wC=bl,AC=Gu,RC=Wl,xC=yd,OC=Np,LC=zl,NC=Oc,MC=iS,UC=vS;eS("match",(function(e,t,i){return[function(t){var i=LC(this),n=RC(t)?void 0:NC(t,e);return n?wC(n,t,i):new RegExp(t)[e](OC(i))},function(e){var n=AC(this),r=OC(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return UC(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=UC(n,r));){var u=OC(s[0]);l[c]=u,""===u&&(n.lastIndex=MC(r,xC(n.lastIndex),a)),c++}return 0===c?null:l}]}));var BC=Hu.f,FC=ml,HC=gl,jC=Ll,VC=Jd,KC=Fg,WC=oh,GC=od.f,YC=sc,zC=YS,$C=Np,XC=rg,qC=XT,ZC=function(e,t,i){i in e||BC(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},QC=rd,JC=vl,ek=Qc,tk=Hh.enforce,ik=Qy,nk=bb,rk=kb,ok=fu("match"),ak=HC.RegExp,sk=ak.prototype,lk=HC.SyntaxError,ck=jC(sk.exec),uk=jC("".charAt),hk=jC("".replace),dk=jC("".indexOf),fk=jC("".slice),pk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,gk=/a/g,yk=/a/g,vk=new ak(gk)!==gk,mk=qC.MISSED_STICKY,_k=qC.UNSUPPORTED_Y,Ek=FC&&(!vk||mk||nk||rk||JC((function(){return yk[ok]=!1,ak(gk)!=gk||ak(yk)==yk||"/a/i"!=ak(gk,"i")})));if(VC("RegExp",Ek)){for(var Tk=function(e,t){var i,n,r,o,a,s,l=YC(sk,this),c=zC(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===Tk)return e;if((c||YC(sk,e))&&(e=e.source,u&&(t=XC(d))),e=void 0===e?"":$C(e),t=void 0===t?"":$C(t),d=e,nk&&"dotAll"in gk&&(n=!!t&&dk(t,"s")>-1)&&(t=hk(t,/s/g,"")),i=t,mk&&"sticky"in gk&&(r=!!t&&dk(t,"y")>-1)&&_k&&(t=hk(t,/y/g,"")),rk&&(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=uk(e,n)))t+=uk(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:ck(pk,fk(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||ek(a,u))throw new lk("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=KC(ak(e,t),l?this:sk,Tk),(n||r||h.length)&&(s=tk(a),n&&(s.dotAll=!0,s.raw=Tk(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=uk(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+uk(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{WC(a,"source",""===d?"(?:)":d)}catch(KB){}return a},bk=GC(ak),Sk=0;bk.length>Sk;)ZC(Tk,ak,bk[Sk++]);sk.constructor=Tk,Tk.prototype=sk,QC(HC,"RegExp",Tk,{constructor:!0})}ik("RegExp");var Ck="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function kk(){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 Ik(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 Pk(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(KB){return t}return t}function Dk(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];Ck&&(t=console).log.apply(t,["[logger]",e].concat(n))}function wk(){try{return Math.round(window.performance.now())}catch(KB){return(new Date).getTime()}}function Ak(){return(new Date).getTime()}function Rk(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=wk(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=Pk(s),a.connectTime=wk()-o,a.status=s.status,a.statusText=s.statusText,r=wk())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=wk()-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=wk()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=wk()-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(l){n(l)}}))}function xk(e){return!e||window.location.href.indexOf(e)>-1}function Ok(e){return!!e&&/^blob:/.test(e)}var Lk={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function Nk(e){if(!e)return{};var t={};return Object.keys(Lk).map((function(i){if(e[i]||"string"!=typeof Lk[i]){if(!e[i]&&Lk[i]instanceof Array){var n=Lk[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[Lk[i]]||""})),t}function Mk(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Uk(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(n){var i=e.className&&"object"===sl(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function Bk(e){return"String"===Mk(e)?e.replace("P","p"):e?"Number"===Mk(e)?"".concat(e):void 0:""}function Fk(e){try{return JSON.stringify(e)}catch(t){return""}}var Hk=0,jk=1,Vk=2;function Kk(e,t){return Math.round(t/e*1e3*100)}var Wk=[];"undefined"!=typeof window&&function(){try{new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");Wk.length>30&&Wk.splice(0,Wk.length-30);for(var i=0;i<t.length;i++)Wk.push(t[i])})).observe({entryTypes:["resource"]})}catch(e){console.warn("PerformanceObserver not support",e)}}();var Gk="videoplayer_oneplay",Yk="videoplayer_oneopera",zk="videoplayer_oneerror",$k="videoplayer_oneevent",Xk="videoplayer_onetemp",qk={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},Zk={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},Qk=0,Jk=1,eI=2,tI=3,iI=4,nI=0,rI=1,oI=2,aI=3,sI=1,lI=2,cI=3,uI=4,hI=5,dI=6,fI=7,pI="error_retry",gI="oneerror",yI="oneevent",vI="onetemp",mI=0,_I=1,EI=864e5,TI=36e5,bI=["tag","subtag","device_type"],SI={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var CI=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(e){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(t){return!0}}()?window.localStorage:{},kI="__xgplayerlogkey",II={set:function(e){try{var t=this.get();t.push(e),CI.setItem(kI,JSON.stringify(t))}catch(KB){}},get:function(){try{var e=CI.getItem(kI);return e=e?JSON.parse(e):[]}catch(KB){return[]}},remove:function(){try{CI.removeItem(kI)}catch(KB){}},clear:function(){try{CI.clear()}catch(KB){}}},PI={},DI=Bl,wI=ql,AI=od.f,RI=QS,xI="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];PI.f=function(e){return xI&&"Window"==DI(e)?function(e){try{return AI(e)}catch(KB){return RI(xI)}}(e):AI(wI(e))};var OI={},LI=fu;OI.f=LI;var NI=gl,MI=Qc,UI=OI,BI=Hu.f,FI=bl,HI=ac,jI=fu,VI=rd,KI=lf,WI=gl,GI=bl,YI=Ll,zI=ml,$I=mc,XI=vl,qI=Qc,ZI=sc,QI=Gu,JI=ql,eP=Cu,tP=Np,iP=wl,nP=_b,rP=Ap,oP=od,aP=PI,sP=Od,lP=yl,cP=Hu,uP=qT,hP=Sl,dP=rd,fP=Yc,pP=Ih,gP=nu,yP=fu,vP=OI,mP=function(e){var t=NI.Symbol||(NI.Symbol={});MI(t,e)||BI(t,e,{value:UI.f(e)})},_P=function(){var e=HI("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=jI("toPrimitive");t&&!t[n]&&VI(t,n,(function(e){return FI(i,this)}),{arity:1})},EP=zy,TP=Hh,bP=Ip.forEach,SP=kh("hidden"),CP="Symbol",kP="prototype",IP=TP.set,PP=TP.getterFor(CP),DP=Object[kP],wP=WI.Symbol,AP=wP&&wP[kP],RP=WI.TypeError,xP=WI.QObject,OP=lP.f,LP=cP.f,NP=aP.f,MP=hP.f,UP=YI([].push),BP=fP("symbols"),FP=fP("op-symbols"),HP=fP("wks"),jP=!xP||!xP[kP]||!xP[kP].findChild,VP=zI&&XI((function(){return 7!=nP(LP({},"a",{get:function(){return LP(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=OP(DP,t);n&&delete DP[t],LP(e,t,i),n&&e!==DP&&LP(DP,t,n)}:LP,KP=function(e,t){var i=BP[e]=nP(AP);return IP(i,{type:CP,tag:e,description:t}),zI||(i.description=t),i},WP=function(e,t,i){e===DP&&WP(FP,t,i),QI(e);var n=eP(t);return QI(i),qI(BP,n)?(i.enumerable?(qI(e,SP)&&e[SP][n]&&(e[SP][n]=!1),i=nP(i,{enumerable:iP(0,!1)})):(qI(e,SP)||LP(e,SP,iP(1,{})),e[SP][n]=!0),VP(e,n,i)):LP(e,n,i)},GP=function(e,t){QI(e);var i=JI(t),n=rP(i).concat(XP(i));return bP(n,(function(t){zI&&!GI(YP,i,t)||WP(e,t,i[t])})),e},YP=function(e){var t=eP(e),i=GI(MP,this,t);return!(this===DP&&qI(BP,t)&&!qI(FP,t))&&(!(i||!qI(this,t)||!qI(BP,t)||qI(this,SP)&&this[SP][t])||i)},zP=function(e,t){var i=JI(e),n=eP(t);if(i!==DP||!qI(BP,n)||qI(FP,n)){var r=OP(i,n);return!r||!qI(BP,n)||qI(i,SP)&&i[SP][n]||(r.enumerable=!0),r}},$P=function(e){var t=NP(JI(e)),i=[];return bP(t,(function(e){qI(BP,e)||qI(pP,e)||UP(i,e)})),i},XP=function(e){var t=e===DP,i=NP(t?FP:JI(e)),n=[];return bP(i,(function(e){!qI(BP,e)||t&&!qI(DP,e)||UP(n,BP[e])})),n};$I||(wP=function(){if(ZI(AP,this))throw RP("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?tP(arguments[0]):void 0,t=gP(e),i=function(e){this===DP&&GI(i,FP,e),qI(this,SP)&&qI(this[SP],t)&&(this[SP][t]=!1),VP(this,t,iP(1,e))};return zI&&jP&&VP(DP,t,{configurable:!0,set:i}),KP(t,e)},dP(AP=wP[kP],"toString",(function(){return PP(this).tag})),dP(wP,"withoutSetter",(function(e){return KP(gP(e),e)})),hP.f=YP,cP.f=WP,uP.f=GP,lP.f=zP,oP.f=aP.f=$P,sP.f=XP,vP.f=function(e){return KP(yP(e),e)},zI&&(LP(AP,"description",{configurable:!0,get:function(){return PP(this).description}}),dP(DP,"propertyIsEnumerable",YP,{unsafe:!0}))),KI({global:!0,constructor:!0,wrap:!0,forced:!$I,sham:!$I},{Symbol:wP}),bP(rP(HP),(function(e){mP(e)})),KI({target:CP,stat:!0,forced:!$I},{useSetter:function(){jP=!0},useSimple:function(){jP=!1}}),KI({target:"Object",stat:!0,forced:!$I,sham:!zI},{create:function(e,t){return void 0===t?nP(e):GP(nP(e),t)},defineProperty:WP,defineProperties:GP,getOwnPropertyDescriptor:zP}),KI({target:"Object",stat:!0,forced:!$I},{getOwnPropertyNames:$P}),_P(),EP(wP,CP),pP[SP]=!0;var qP=mc&&!!Symbol.for&&!!Symbol.keyFor,ZP=lf,QP=ac,JP=Qc,eD=Np,tD=Yc,iD=qP,nD=tD("string-to-symbol-registry"),rD=tD("symbol-to-string-registry");ZP({target:"Symbol",stat:!0,forced:!iD},{for:function(e){var t=eD(e);if(JP(nD,t))return nD[t];var i=QP("Symbol")(t);return nD[t]=i,rD[i]=t,i}});var oD=lf,aD=Qc,sD=Cc,lD=Ic,cD=qP,uD=Yc("symbol-to-string-registry");oD({target:"Symbol",stat:!0,forced:!cD},{keyFor:function(e){if(!sD(e))throw TypeError(lD(e)+" is not a symbol");if(aD(uD,e))return uD[e]}});var hD=lf,dD=ac,fD=fv,pD=bl,gD=Ll,yD=vl,vD=uf,mD=ec,_D=nc,ED=Cc,TD=gv,bD=mc,SD=dD("JSON","stringify"),CD=gD(/./.exec),kD=gD("".charAt),ID=gD("".charCodeAt),PD=gD("".replace),DD=gD(1..toString),wD=/[\uD800-\uDFFF]/g,AD=/^[\uD800-\uDBFF]$/,RD=/^[\uDC00-\uDFFF]$/,xD=!bD||yD((function(){var e=dD("Symbol")();return"[null]"!=SD([e])||"{}"!=SD({a:e})||"{}"!=SD(Object(e))})),OD=yD((function(){return'"\\udf06\\ud834"'!==SD("\udf06\ud834")||'"\\udead"'!==SD("\udead")})),LD=function(e,t){var i=TD(arguments),n=t;if((_D(t)||void 0!==e)&&!ED(e))return vD(t)||(t=function(e,t){if(mD(n)&&(t=pD(n,this,e,t)),!ED(t))return t}),i[1]=t,fD(SD,null,i)},ND=function(e,t,i){var n=kD(i,t-1),r=kD(i,t+1);return CD(AD,e)&&!CD(RD,r)||CD(RD,e)&&!CD(AD,n)?"\\u"+DD(ID(e,0),16):e};SD&&hD({target:"JSON",stat:!0,arity:3,forced:xD||OD},{stringify:function(e,t,i){var n=TD(arguments),r=fD(xD?LD:SD,null,n);return OD&&"string"==typeof r?PD(r,wD,ND):r}});var MD=Od,UD=Xc;lf({target:"Object",stat:!0,forced:!mc||vl((function(){MD.f(1)}))},{getOwnPropertySymbols:function(e){var t=MD.f;return t?t(UD(e)):[]}});var BD=lf,FD=ml,HD=gl,jD=Ll,VD=Qc,KD=ec,WD=sc,GD=Np,YD=Hu.f,zD=Wd,$D=HD.Symbol,XD=$D&&$D.prototype;if(FD&&KD($D)&&(!("description"in XD)||void 0!==$D().description)){var qD={},ZD=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:GD(arguments[0]),t=WD(XD,this)?new $D(e):void 0===e?$D():$D(e);return""===e&&(qD[t]=!0),t};zD(ZD,$D),ZD.prototype=XD,XD.constructor=ZD;var QD="Symbol(test)"==String($D("test")),JD=jD(XD.valueOf),ew=jD(XD.toString),tw=/^Symbol\((.*)\)[^)]+$/,iw=jD("".replace),nw=jD("".slice);YD(XD,"description",{configurable:!0,get:function(){var e=JD(this);if(VD(qD,e))return"";var t=ew(e),i=QD?nw(t,7,-1):iw(t,tw,"$1");return""===i?void 0:i}}),BD({global:!0,constructor:!0,forced:!0},{Symbol:ZD})}var rw=[{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)/}],ow=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}],aw=["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 sw=["Baiduspider","YandexBot"],lw=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];var cw="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?(aw.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=rw;/trident/.test(e)&&(u=ow);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;sw.map((function(t){t===e&&(i=!0)}));for(var n=0;n<lw.length;n++){var r=lw[n];if(-1!==t.indexOf(r)){i=!0;break}}return i}(o.name,e),o}(navigator.userAgent);function uw(){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 hw=[1,1,1,1,1];function dw(){return parseInt(hw.join(""),10)}hw[0]=cw.isSupportMP4?hw[1]+1:hw[1],hw[1]=uw()?hw[1]+1:hw[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(a){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?hw[2]=hw[2]+1:hw[2]=1})).catch((function(){hw[2]=hw[2]-1}));var fw={range:"0-1048576",timer:6e4,timeout:15e3},pw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ll(this,e),Object.keys(fw).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=fw[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 ul(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=Nk(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)?Dk("task>>cant`t trigger url",this.ishangUp,this.intervalId):(Dk("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),Rk(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){Dk("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){Dk("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}(),gw="ProgressInfo";var yw=function(){function e(){ll(this,e),this._init()}return ul(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,Dk(gw,"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(),Dk(gw,"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){Dk(gw,"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 vw="0.12.10";var mw=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];Dk("xgVodLogger version is ".concat(vw));var _w,Ew=(_w="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(_w,"]")}),Tw=1300,bw="__tea_cache_tokens_".concat(Tw),Sw="",Cw=null,kw=function(){function e(t,i){var n=this;if(ll(this,e),hl(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===Mk(e)?e:"";"String"!==Mk(t)&&(t=""),n.urlLog={initial_url:t,initial_host:Ik(t),initial_ip:""}})),hl(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())})),hl(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),hl(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),hl(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),hl(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),hl(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=wk(),n._endType="switch"})),hl(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),hl(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),Dk("onDefinitionChange from:".concat(t,", to:").concat(i))})),hl(this,"onDefiChangeSuccess",(function(){Dk("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),hl(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;Dk("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:wk(),operaType:"abr_switch",abrInfo:r})}})),hl(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=Ak(),Dk("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=Bk(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})),hl(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),hl(this,"onCanplay",(function(){Dk("onCanplay","this.startStep:".concat(n.startStep," ").concat(Ak())),n.setVt()})),hl(this,"onLoadeddata",(function(){Dk("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(Ak())),n.setVt(),n.updateVideoSize()})),hl(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=xk(n.player.currentSrc);n.triggerTask("start"),Dk("onLoadStart","this.startStep:".concat(n.startStep," ").concat(Ak()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),hl(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=Ak())}})),hl(this,"onPlayerInited",(function(){Dk("player init"),n._playerCreatedTime=Ak(),n.playlogs.rt=Ak()})),hl(this,"onNotAutoPlay",(function(){Dk("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),hl(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(Dk("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(cw.isSupportMP4," isPC:").concat(cw.isPC)),Dk("onPlayerError",e),n.load_state=aI,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),cw.isPC&&!cw.isSupportMP4||cw.isSpider)return t.errc=Zk[5],t.errt=qk.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&&qk[e.errorType]?qk[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&Zk[e.errorCode]?Zk[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&Zk[e.code]?Zk[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(sI),n.onOnePlay(sI),n.onOneTemp(sI),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:fI,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),hl(this,"onPlayInterfaceInfo",(function(e){Dk("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=wk()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),hl(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=Wk||[],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(o){return t}}(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=Pk(a));var c=al(al({},l=Nk(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(al(al({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:Ik(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:Ik(u)},c,"error"===e.type?0:2)}})),hl(this,"onNext",(function(){if(Dk("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(lI))return;n.sendSwitchOpera(lI),n.onOnePlay(lI),n.onOneTemp(lI),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),hl(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=Bk(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),hl(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){Dk("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=wk();Dk("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)}}})),hl(this,"onSeeking",(function(){if(!xk(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;Dk("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=wk(),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)}})),hl(this,"onSeeked",(function(){xk(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),hl(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=rI;var e=wk();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),hl(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(Dk("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(al({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:dI,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),hl(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;Dk("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(al({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},Nk(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),hl(this,"onLog",(function(e){Dk("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case pI:break;case vI: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=_I);break;case gI: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 yI: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)}})),hl(this,"onPlay",(function(){Dk("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),hl(this,"onPause",(function(){Dk("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=wk()})),hl(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(Dk("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=wk(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;Dk("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(wk()-n.inWaitingStart)),n._endType="wait",n.load_state=oI,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,wk()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),hl(this,"onEnded",(function(){if(n.initial_url){Dk("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:wk(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(cI),n.onOnePlay(cI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(cI),n.sendEventsQueue(),n.playlogs.lc++}})),hl(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(uI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(uI)||(n.sendSwitchOpera(uI),n.onOnePlay(uI,!0)))})),hl(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),hl(this,"onDestroy",(function(){Dk("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(hI),n.startStep>0&&n.initial_url&&(n.onOneTemp(hI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:wk(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(cI),n.sendEventsQueue(),cw.isPC?window.removeEventListener("beforeunload",n.onUnload):(cw.isMobile||cw.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()})),hl(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(Dk("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=Ak();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,b=v.pcdnVideoCached,S=n._progressInfo.getFileSize(s.duration),C=n.seekLog,k=C.sc,I=C.sat,P={bc:Kk(d,n.bc),bu_acu_t:Kk(d,n.bu_acu_t),sc:Kk(d,k),sat:Kk(d,I)};n.setExt();var D=n._getCompatibilityInfo();n.setNovv(null,e);var w=al(al(al(al({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||Ak(),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:S.video,audio_length:S.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:Fk(n.merror),ex:Fk(n.exInfo),perf:Fk(g),bufs:Fk(n.buffers.allBuffer),vds:_,pvds:E,vps:m,vvds:T,pvvds:b,pcdn:Fk(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:Fk(n.encryptedInfo),per100_info:Fk(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=Fk(n.abrInfo);var R=D.is_support_mp4&&D.is_support_mse_mp4;if(D.is_spider||cw.isPC&&!R&&0===n.fvt)Dk("is_spider",D.is_spider,"is_support_mp4",D.is_support_mp4);else if(t){var x=!n._options.disableLocalCache;n.reportLog(Gk,w,x?1:0)}else n.reportLog(Gk,w)}})),hl(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;Dk("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=al(al({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:wk()-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:Fk(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,b=p.first_frame_interval,S=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($k,al({end_type:"longwait",local_time:m,v:_,cost_time:E,cdn_url:T,first_frame_interval:b,cur_play_pos:S,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>TI&&(p.cost_time=TI);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=Fk(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog($k,p,c)})),hl(this,"onOneTemp",(function(){if(Dk("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=al(al(al({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>EI?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>EI?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:Fk(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=Ak()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,s)})),n.reportLog(Xk,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 pw),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 yw,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),Dk("logger constructor:".concat(this.player.video))}catch(r){console.error(r)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return ul(e,[{key:"resetLoggerParams",value:function(){Dk("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:Ak(),vt:0,rt:this.isEnded?Ak():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:Ak()},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=Ak(),this._novv.novv_lpt=Ak()-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:wk(),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:cw.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=nI,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=mI}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(bw).web_id||"0"}catch(KB){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(i){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),Dk("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 Cw("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?Tw:1300===Tw?323254:Tw,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:vw,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:cw.isPad?"pad":cw.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:dw(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};Dk("commonParams ",this.commonParams,a);var s=al({evtParams:this.commonParams,disable_auto_pv:!0},a);!cw.name||cw.isChrome||cw.isSafari||(s.browser=cw.name,cw.appVersion&&(s.browser_version=cw.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=Ik(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),Dk("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=II.get();II.remove(),t.map((function(t){Object.keys(t).map((function(i){if(Dk("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===Gk?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;Dk(">>>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(Ew(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=Bk(t),i=Bk(i),l.ldet=wk(),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:kk(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=wk(),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(){cw.isPC?window.addEventListener("beforeunload",this.onUnload):(cw.isMobile||cw.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]:{};Dk("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},al({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>EI?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?SI.FULLSCREEN_TYPE:this.player.isCssfullScreen?SI.CSS:SI.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:Fk(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(Yk,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];Dk("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=Nk(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||sI);var f=al(al(al({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:Fk(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||sI,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:Fk(this.exInfo),pref:Fk(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=Ok(p)?Ok(t.url)?this.initial_url:t.url:p,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:Ok(p)?1:0};if(n&&"String"===Mk(g)){var v={};Rk(g,{range:"0-8",timeout:2e3}).then((function(e){Dk("getXhr>>check result ",e);var t=Nk(e.headers||{});f.server_ip=t.x_response_sinfo,v=al(al({},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=al(al({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=function(e){if(!e||"String"!==Mk(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)?jk:Vk:Hk}catch(o){return Hk}}(g);v.isexpired=t,f.net=Fk(v),e.reportLog(zk,f,i)}))}else f.net=Fk(y),this.reportLog(zk,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<aw.length;i++){var n='video/mp4; codecs="'.concat(aw[i],'"'),r=MediaSource.isTypeSupported(n);t+="".concat(n," is ").concat(r," "),r&&(e=!0)}return{support:e,message:t}}();return{is_spider:cw.isSpider?1:0,is_support_mp4:cw.isSupportMP4?1:0,is_support_hevc:uw()?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"===Mk(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,Ew(c)&&(bI.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=Fk(this._envInfo||{}),i.support=dw(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0;var u=function(){if(1===n){var e={};return e[t]=i,void II.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;Dk("triggerTask>>",e),!xk(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)}Dk("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=wk(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(Dk("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=rI,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=wk()-i.lastSeekStartTime;Dk("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>TI?0:o,n.sc++,n.sat+=o>TI?0:o,o>TI&&(o=TI),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=Ak(),Dk("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=Ak(),Dk("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>EI?0:e}},{key:"pt",get:function(){return this.playlogs.pt||Ak()}},{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(i){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:xk(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:Ik(xk(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?Nk(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 Uk(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return Uk(this.player.root,"xgplayer-ended")||Uk(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return Uk(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return Uk(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&&(Dk("lt init",this.playlogs.lt),e=Ak()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?tI:this.isStop?Qk:this.isPause?eI:this.isLoading?iI:Jk}},{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:kk(t.played);return i>=0?i>EI?EI: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=wk()-this.inWaitingStart;return e>TI?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 al({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},dl(e,mw))}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];Dk("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)}Dk("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(kk(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);Dk("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 Dk("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return Tw},set:function(e){bw="__tea_cache_tokens_".concat(Tw=e)}},{key:"AB_SDK_VERSION",get:function(){return Sw},set:function(e){Sw="Array"===Mk(e)?e.join(","):e}},{key:"Collector",set:function(e){Cw=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 Iw=null==(e=Qs())?void 0:e.__LOG_TEA_ID__;function Pw(e){let t={};const i=(i,n)=>{const r=(e=>Object.assign({},t,null!=e?e:{}))(n);os.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 Dw(){var e;const t=null==(e=eB.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}kw.TEA_ID=Iw,kw.Collector=function(e){const t=Dw();if(t)return Pw(t);const i=Ls();return i?new i(e):void 0};const ww="beforePlayerCreate.authtoken.getVideoInfo.getVideos",Aw=`${ww}.getDramaInfoViaJSB.perfInfo`,Rw={prepareCost:`${Aw}.prepareCost`,requestCost:`${Aw}.requestCost`,parseCost:`${Aw}.parseCost`,totalCost:`${Aw}.totalCost`};function xw(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 Ow=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=As(a),i.drm_encrypt_type=il(a)||"",i.initial_url=Mr.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=eB.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=xw(s,ww);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:xw(e,Rw.prepareCost),server_fetch_request_cost:xw(e,Rw.requestCost),server_fetch_parse_cost:xw(e,Rw.parseCost),server_fetch_total_cost:xw(e,Rw.totalCost)}}(s)),i.create_player_total_duration=c,i.prepare_play=c-l,i.is_preload_enabled=2===eB.preloaderStatus,t===Gk||t===zk){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 kw(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new kw(this,this.config.vodLogOpts||{})};Ow.pluginName="__xgVodLogger",Ow.playerConfig={},Ow.Collector=kw.Collector,Ow.setABSdkVersion=e=>{kw.AB_SDK_VERSION=e};const Lw=Ui((function(e,t,i){ki(e,t,i)}));class Nw{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const Mw={"@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 Uw=(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))(Uw||{});const Bw={[Uw.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${Mw["xgplayer-hls"]}/dist/index.min.js`},[Uw.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${Mw["xgplayer-flv"]}/dist/index.min.js`},[Uw.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${Mw["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[Uw.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Mw["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[Uw.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${Mw["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[Uw.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${Mw["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[Uw.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${Mw["@byted/streamprobe"]}/dist/index.min.js`},[Uw.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${Mw["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[Uw.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${Mw["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[Uw.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${Mw["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[Uw.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${Mw["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[Uw.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${Mw["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[Uw.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${Mw["@byted/xgplayer-vod-preload"]}/dist/index.min.js`}},Fw={h265:Uw.VeStrategyH265,preload:Uw.VeStrategyPreload,adaptRange:Uw.VeStrategyAdaptRange},Hw={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(Uw.VeStrategyPreload))},loadVeStrategy(e){return d(this,null,(function*(){return e.loadPlugins(Uw.VeStrategy)}))},loadStrategy(e,t){return d(this,null,(function*(){return e.loadPlugins(Fw[t])}))},loadPreloader(e){return d(this,null,(function*(){return e.loadPlugins(Uw.Preloader)}))},loadMp4Encrypt(e){return d(this,null,(function*(){return e.loadPlugins(Uw.MP4Encrypt)}))},loadHlsjsPro(e){return d(this,null,(function*(){return e.loadPlugins(Uw.HLSjsPro)}))}};let jw=!1;class Vw extends Nw{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(Uw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){jw=!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 jw&&os.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."),jw=!1,!1}return!((null==(t=Vr.os)?void 0:t.isIos)&&!$s())}canAdaptRangeEnable(){var e;return!((null==(e=Vr.os)?void 0:e.isIos)&&!$s())}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 Hw.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=gs(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 Kw=!1;class Ww extends Nw{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(Uw.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 Kw&&os.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."),Kw=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=Vr.os)?void 0:e.isIos)}generatePlaylistFromServer(e){Kw=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===ds.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(Uw.DASH);return(null==(i=null==(t=null==n?void 0:n.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[n]:(os.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=gs(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 Gw=/\s/;var Yw=/^\s+/;function zw(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Gw.test(e.charAt(t)););return t}(e)+1).replace(Yw,""):e}var $w=NaN,Xw=/^[-+]0x[0-9a-f]+$/i,qw=/^0b[01]+$/i,Zw=/^0o[0-7]+$/i,Qw=parseInt;function Jw(e){if("number"==typeof e)return e;if(Cn(e))return $w;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=zw(e);var i=qw.test(e);return i||Zw.test(e)?Qw(e.slice(2),i?2:8):Xw.test(e)?$w:+e}const eA=function(){return _.Date.now()};var tA="Expected a function",iA=Math.max,nA=Math.min;function rA(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(tA);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=eA();if(p(e))return y(e);s=setTimeout(g,function(e){var i=t-(e-l);return h?nA(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=eA(),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=Jw(t)||0,A(i)&&(u=!!i.leading,o=(h="maxWait"in i)?iA(Jw(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(eA())},v}const oA=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(Uw).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(oA.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete oA.jsLoadMap[t],delete oA.jsLoadPromiseMap[t]}constructor(){this.umdMap=Bw,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=Qs(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(oA.registeredModules,e))return this.triggerSuccessCallback(t),i(oA.registeredModules[e]);if(Reflect.get(oA.jsLoadMap,r))return i(oA.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 os.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 oA.jsLoadMap[r]=l,this.triggerSuccessCallback(t),i(l);const c=`${this.pluginPublicPath}/${e+".js"}`;let u=oA.jsLoadPromiseMap[r];os.log(`umdLoader cache hit ${r}=${!!u}`),u||(u=Ys((()=>this.loadExtraCdn(c,!0)),2),oA.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;oA.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):(os.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 os.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=>{os.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let aA=oA;aA.jsLoadMap={},aA.jsLoadPromiseMap={},aA.registeredModules={};const sA=new aA;var lA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(lA||{});function cA(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 uA=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(uA||{});class hA{constructor(e){this.strategyKey=lA.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new aA}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[lA.PRELOAD],p="boolean"==typeof f;if(!f||!p&&(null==f?void 0:f.disabled))return this.preloaderStatus=0,!1;const g=null==(i=cA(f))?void 0:i.config,y=null==(a=null==(o=null==(r=null==(n=this._strategyManager.config)?void 0:n.strategies)?void 0:r[lA.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*(){os.log("preloader init");const[e,t]=yield Promise.all([Hw.loadPreloader(this.sdkUmdLoader),p||"hls"!==(null==f?void 0:f.format)?Hw.loadMp4Encrypt(this.sdkUmdLoader):Hw.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void os.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 os.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 os.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 os.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=[],os.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=c(c({},this.preloadCacheConfig),null!=t?t:{}),void os.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 dA{constructor(e){this.strategyKey=lA.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[lA.H265])?void 0:t.enableH265Hardware)}}const fA=new class{constructor(){var e,t;this.teaId=null==(e=Qs())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=Qs())?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:uA.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new aA}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=Qs(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=Qs(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 Hw.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=u(c({},this.config),{Module:e}))}))}fetchStrategies(){return d(this,null,(function*(){const e={};return Hw.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 Hw.loadStrategy(this.sdkUmdLoader,i);n&&(e[t]=u(c({},this.config.strategies[t]),{Strategy:n}))}e[t]=cA(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return d(this,null,(function*(){if(!e||!e.appId)return;this.collector=Ls(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(r){}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:os}})),this.status=2,this.preloadWrapper=new hA(this),this.h265Wrapper=new dA(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&&os.warn("[VeStrategy] Ignoring conflicting serviceConfigMode after initialization has started."):((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&Hw.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 os.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 os.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[lA.H265])?void 0:t.enableH265Hardware)}};let pA=!1;class gA extends Nw{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(Uw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,n,r;pA=!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 Vr.os.isIos||"safari"===Vr.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 pA&&os.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."),pA=!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=fA.config)?void 0:t.strategies)?void 0:i[lA.PRELOAD]){return[yield e.loadPlugins(Uw.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=Ks(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(Uw.HLSEncrypt)]}{const t=Ks(o,"Subtitle"),i=c&&t,n=(zs()||window.WebAssembly)&&u,l=r.enableHlsMSE,d=r.enableMobileHlsPlugin&&(Vr.os.isAndroid&&zs()||Vr.os.isIos&&$s()),p=f&&Vr.os.isAndroid,g=f&&Zs,y=h&&!document.createElement("video").canPlayType("application/vnd.apple.mpegurl");if(h&&(n||i||l||d||p||y)||!(h||Zs&&!a||g)){return[yield e.loadPlugins(s?Uw.HLSjsPro:Uw.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=gs(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 yA extends Nw{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 vA=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(vA||{}),mA=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(mA||{}),_A=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(_A||{}),EA=(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))(EA||{});const TA={setLicenseConfig:e=>d(this,null,(function*(){})),checkLicense:()=>d(this,null,(function*(){return"premium_edition"})),checkModuleList:()=>d(this,null,(function*(){return Object.values(_A)})),checkLicenseStatus:()=>d(this,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>d(this,null,(function*(){return!0})),renderLogo:e=>{}};class bA{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:$a,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:b=!0,enableHlsJs:S=!0,enableMenu:C=!1,region:k={}.__DEFAULT_REGION__,userRegion:I,debug:P=!1,licensSupportModuleList:D=Object.values(_A),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&&(os.config.debug=3),this.options=Object.assign({},o,A),this.options.poster="string"==typeof this.options.poster?function(e){const t=""+e,i=rl.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"===Vr.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=ur.observe(this.current),this.plugins=[...u],this.isMusic=E,this.unionId=_,this.sdkPlugins=T,this.useHlsPluginForSafari=b,this.enableHlsJs=S,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),ur.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=pi([...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]:os.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 Vw(i);case"dash":return new Ww(i);case"hls":return new gA(i);default:return os.log(`no adapter match ${e}, use others adapter by default`),new yA(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!(Vr.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 os.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const r=this.getUrlList({lineId:i,definition:n});return r.length>0?(this.isHitDefault=!0,r[0]):(os.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;Lw(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=tl(""+(i||this.configs.urlExpireTimestamp));n?this.urlCheckData.urlExpireTimestamp=n:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=$a,os.warn("not provide urlExpireTimestamp, url expire check will not work")),os.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[Za,Qa],i=e&&Object.entries(e).reduce(((e,[i,n])=>(Ga.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||Hs(e.url):this.configs.streamType||ys(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||Hs(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||ys(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(_A.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 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()),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)||Wa;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});os.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=eB.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=Qs(this.userRegion,this.region);!function(e){kw.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(ye(e))return t})),t}updateConfigs(e){Bi(this.configs,pi(e),((e,t)=>{if(ye(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)}}var SA=function(){function e(t){pr(this,e),this.config=t.config,this.parent=t.root,this.root=Mr.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 yr(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(Mr.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&&Mr.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Mr.addClass(t,"selected"),n&&Mr.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(){Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"active")}},{key:"hide",value:function(){Mr.removeClass(this.root,"active"),Mr.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}(),CA="side",kA="middle",IA="default",PA="click",DA="hover";var wA="mobile"===Vr.device,AA=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),vr(Tr(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===PA?n.toggle(!n.isActive):n.toggle(!0)})),vr(Tr(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==CA&&n.isActive&&n.toggle(!1)})),vr(Tr(n),"onListEnter",(function(e){n.enterType=2})),vr(Tr(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 yr(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(),(wA=wA||"touch"===this.domEventType)&&"mobile"===Vr.device&&t.listType===IA&&(t.listType=CA),t.hidePortrait&&Mr.addClass(this.root,"portrait"),this.on([Ao,ko],(function(){e._resizeList()})),this.once(io,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),wA&&this.on(uo,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),wA?(t.toggleMode=PA,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===PA?"click":"mouseenter",t.toggleMode===PA?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",Mr.createDom("span","",{},"icon-text")),Mr.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Mr.addClass(this.root,"show")}},{key:"hide",value:function(){Mr.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||Mr.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===fr(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===CA?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===CA?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||wA||n===CA)&&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===CA?s===va.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:wA?"touch":"mouse"},root:n.listType===CA?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===kA?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new SA(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===kA?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===PA?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:va.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:DA,heightLimit:!0}}}]),i}(ba);const RA={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"},xA=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"}),OA=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"}),RA),xA),LA={SDKEvents:RA,PluginEvents:xA},NA=OA,MA=70,UA=30,BA=50,FA=60,HA=20,jA=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"===Vr.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 Ms,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(xA.PLAY_NEXT_START,(()=>{this.definitionSubscribeId&&ur.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&ur.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(xA.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(wo,this.toastInfo.remove),this.player.off(Zr,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(wo,this.toastInfo.remove),this.player.once(Zr,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=ur.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(xA.INNER_DEFINITION_CHANGE,{from:e,to:t,url:n.url}),this.player.emit(xA.PlAY_URL_CHANGE,{url:n.url,from:xA.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=ur.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 VA extends(jA(AA)){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),rA(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:UA,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||Mr.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(!Mr.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 KA(e){const t={};for(const i of["lang","name"]){const n=e[i];void 0!==n&&(t[i]=n)}return t}function WA(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function GA(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(KA(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 YA={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=YA[e.toLowerCase()])?t:e.toUpperCase()}function $A(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 XA(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 qA extends AA{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({},AA.defaultConfig),{position:ba.POSITIONS.CONTROLS_RIGHT,index:MA,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;WA(e,t.to.id)}else{const e=this._getHls();if(!e)return;GA(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=XA(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:$A(e,o),iconText:$A(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 ZA(){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:QA,os:JA,device:eR}=Vr,tR=JA.isAndroid,iR=JA.isIos,nR="mobile"===eR;let rR=0,oR=!1;class aR 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((()=>{os.log("wechat autoplay success")})).catch((e=>{os.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):os.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():tR?this.player.once(io,this.wxCanPlayFn):iR&&this.player.once(vo,this.wxCanPlayFn)},this.userClickPlay=()=>{if(oR)return;const e=this.player.play();e&&e.then?e.then((()=>{os.log("user action autoplay success"),oR=!0})).catch((e=>{os.warn("user action autoplay fail:",e)})):(os.warn("no play promise"),oR=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(os.warn("unmute autoplay fail"),this.player.emit(xA.AUTOPLAY_FAILED,{mode:"unmute"}),tR&&QA?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(os.warn("mute autoplay fail"),this.player.emit(xA.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(xA.AUTOPLAY_FAILED,{mode:"noSupport"}),void os.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(xA.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(xA.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(xA.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-rR>200&&(rR=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:ZA,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(yo,this.handleAutoplayPrevented),this.player.on(go,this.handleAutoplayStart),this.player.on(ro,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){QA&&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(xA.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((()=>{os.log("degrade mute autoplay success")})).catch((e=>{os.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):os.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=Mr.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(yo,this.handleAutoplayPrevented),this.player.off(go,this.handleAutoplayStart),this.player.off(ro,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=nR?"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>'}}function sR(){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 lR 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:sR,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=Mr.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const n=Mr.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),t.appendChild(n)}renderPanel(e){this.panelContainer||(this.panelContainer=Mr.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,n;const r=Mr.createDom("div","",{},"panel-icon-bt"),o=Mr.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(Mr.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 cR(){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 uR=(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))(uR||{});const hR={NETWORK:{code:2100,message:"Network error",textKey:uR.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:uR.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:uR.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:uR.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:uR.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:uR.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:uR.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:uR.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:uR.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:uR.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:uR.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:uR.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:uR.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:uR.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:uR.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:uR.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:uR.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:uR.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:uR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:uR.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:uR.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:uR.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:uR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:uR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:uR.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:uR.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:uR.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:uR.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:uR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:uR.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:uR.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:uR.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:uR.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:uR.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:uR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:uR.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:uR.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:uR.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:uR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},dR={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:uR.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:uR.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:uR.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:uR.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:uR.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:uR.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:uR.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:uR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}};var fR=(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))(fR||{});const pR={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:uR.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:uR.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:uR.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:uR.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:uR.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:uR.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:uR.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:uR.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:uR.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:uR.DRAMA_FAILED_GET_EPISODE_INFO}};const gR={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},yR=1002305;class vR{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(js(t))}catch(t){throw a.push(js(null)),t}})),Promise.all([...a]).then((e=>{e.every((e=>!e))&&n(r,i)})).catch((e=>{os.error(e),n(r,e)}))}))}}}const mR="xgplayer-error-analysing",_R="xgplayer-error-retrying",ER="ve_error",TR={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},bR={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},SR="http:",CR="https:";let kR=null;function IR(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(SR)&&i===CR){if(new URL(e).protocol===SR)return PR.getVeErrorInfo(hR.NETWORK_PROTOCOL)}}class PR{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(mR);const i=yield this.transformToVeError(e);this.player.veError=i,os.error("error: ",i),this.player.removeClass(mR),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?os.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit(ER,i)})),this.player=e,this.config={},t&&Object.keys(PR.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=PR.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;TR[m]&&(m=TR[m]);const{code:_,message:E,textKey:T}=e.veError||{},b=o||t.message,S=_||m,C=PR.getErrorType(e),k=E||b,I=T||(e=>{for(const[t,{code:i,textKey:n}]of Object.entries(hR))if(i===e)return n})(S)||function(e){for(const t of Object.values(pR))if(t.code===e)return t.textKey}(S),P=this.player.i18n[I]||k||this.player.i18n[uR.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-rc.9",currentTime:h,duration:i,ended:f,readyState:y,networkState:v,src:p||g,errorType:n,errorCode:m,httpCode:e.httpCode,message:b,mediaError:t,originError:a?a.stack:"",host:Mr.getHostFromUrl(p||g),veErrorCode:S,veErrorType:C,veErrorMessage:k,displayMessage:P},w),{videoInfo:c({isMSE:As(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:il(this.player)||"",vid:D.vid},A),ext:s})}if(arguments.length>1){const e={playerVersion:"1.18.0-rc.9",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?fR[e.slice(0,2)]:fR[e.slice(0,1)]}if(null==i?void 0:i.code)return bR[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;kR||(kR=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;os.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(Zr,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(Zr,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(_R))}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 vR,this.eventMiddleware.addMiddleware(Zr,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(Zr)})}defaultErrorMiddleWare(e){return d(this,null,(function*(){var t,i;if(!Mr.isMSE(this.player.media)){const{error:n}=e||{};if(!n)return os.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?os.warn(`max total retry count ${n} reached, stop retrying`):os.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===r)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=el(nl(this.player));if(t){const i=IR(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 os.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(_R),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(_R),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=Mr.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 ws(e,{range:"0-8",timeout:i});os.log("xhr result",t);const{status:o,response:a}=t;if(403===o){if("string"==typeof a){if(a.includes("expire"))return PR.getVeErrorInfo(hR.NETWORK_URL_EXPIRE);if(a.includes("sign"))return PR.getVeErrorInfo(hR.NETWORK_URL_SIGN)}return PR.getVeErrorInfo(hR.NETWORK_FORBIDDEN)}if(416===o)return PR.getVeErrorInfo(hR.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return PR.getVeErrorInfo(hR.NETWORK_NOTFOUND);if(o===Ds.TIMEOUT)return PR.getVeErrorInfo(hR.NETWORK_TIMEOUT);if(o===Ds.ERROR)return PR.getVeErrorInfo(hR.NETWORK,r);if(200===o||206===o){if(4===n)return r?PR.getVeErrorInfo(hR.MEDIA_ERR_PLAY_ERR,r):PR.getVeErrorInfo(hR.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===n)return PR.getVeErrorInfo(hR.MEDIA_ERR_DECODE,r);if(2===n)return PR.getVeErrorInfo(hR.MEDIA_ERR_NETWORK,r);if(1===n)return PR.getVeErrorInfo(hR.MEDIA_ERR_ABORTED,r);if(-9996===n){return il(this.player)===or.PRIVATE_ENCRYPT_UPGRADE?PR.getVeErrorInfo(hR.PRIVATE_DRM_GET_KEY_FAILED):PR.getVeErrorInfo(hR.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(o){return os.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."),PR.getVeErrorInfo(hR.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:fR.network,errorCode:t,httpCode:i,errorMessage:r,originError:e};if(i){if(404===i)o.veError=PR.getVeErrorInfo(hR.NETWORK_NOTFOUND);else if(416===i)o.veError=PR.getVeErrorInfo(hR.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=PR.getVeErrorInfo(hR.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=PR.getVeErrorInfo(hR.NETWORK_URL_SIGN):o.veError=PR.getVeErrorInfo(hR.NETWORK_FORBIDDEN),this.createVeError(o)}catch(a){os.warn("get response text error")}return o.veError=PR.getVeErrorInfo(hR.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=el(nl(this.player));if(e){const t=IR(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:n}){return this.createVeError({errorType:fR.serve,errorCode:t||hR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:PR.getVeErrorInfo(hR.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:n}){try{const r=el(nl(this.player)),o=yield this.analyseNet(r,e,3e3);return o?this.createVeError({errorType:fR.network,errorCode:t||hR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:o}):this.createVeError({errorCode:t||hR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:PR.getVeErrorInfo(hR.NETWORK_ENCRYPT_HLS_ERR)})}catch(r){return os.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||hR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:PR.getVeErrorInfo(hR.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:n}){const r={errorType:fR.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=PR.getVeErrorInfo(hR.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||hR.OTHER.code,httpCode:t,errorMessage:s,originError:e},e||{}))}))}}const DR=new Set(Object.values(pR).map((e=>e.code)));let wR=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)===hR.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(xA.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(Ia.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(hR).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:cR,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(ER,this.handleError),this.on(io,this.closeError),this.on($r,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(Ia.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(Ia.ENTER),this.state.retryTimes===t&&this.player.emit(xA.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),os.log(`retry times: ${this.state.retryTimes}`,n),this.player.emit(xA.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(xA.PlAY_URL_CHANGE,{url:e,from:xA.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(xA.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:ss().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:n}=this.getErrorInfo(e),r=Mr.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(Mr.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(Mr.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(Mr.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){os.error("copy error info err ",r)}}getActionDom(e){const t=e.errorType,i=Mr.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),n=!(t&&[fR[10],fR[11],fR[12]].includes(t));if(this.config.isNeedRefreshButton&&n){const e=Mr.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=Mr.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=!!eB.ttDramaEnv,d="number"==typeof u&&DR.has(u);if("drama"===(h&&d?"drama":"normal")){if(!this.$errorDom){this.$errorDom=Mr.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=Mr.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=Mr.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=Mr.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=Mr.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=Mr.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(Zr,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};const AR=void 0;function RR(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 xR(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?RR(Object(i),!0).forEach((function(t){UR(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):RR(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function OR(e){return(OR="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 LR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NR(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,qR(n.key),n)}}function MR(e,t,i){return t&&NR(e.prototype,t),i&&NR(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function UR(e,t,i){return(t=qR(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function BR(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&&HR(e,t)}function FR(e){return(FR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function HR(e,t){return(HR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function jR(){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(e){return!1}}function VR(e,t,i){return(VR=jR()?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&&HR(r,i.prototype),r}).apply(null,arguments)}function KR(e){var t="function"==typeof Map?new Map:void 0;return KR=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 VR(e,arguments,FR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),HR(n,e)},KR(e)}function WR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GR(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 WR(e)}function YR(e){var t=jR();return function(){var i,n=FR(e);if(t){var r=FR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return GR(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=FR(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 $R(e){return function(e){if(Array.isArray(e))return XR(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 XR(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 XR(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 XR(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 qR(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 ZR=["b","i","u","span","c","ruby","rt","v","lang"],QR=["br"];var JR=/^WEBVTT/i,ex=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,tx=/^STYLE+$/,ix=/^\:\:cue/,nx=/^}+$/,rx=/^\[Script Info\].*/,ox=[/[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}/],ax=/^Format:\s/,sx=/^Style:\s/,lx=/^Dialogue:\s/,cx=/^([0-5]?\d)[.,](\d{1,3})$/;function ux(e){var t=cx.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function hx(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+ux(e[2]):2===t?60*Number(e[0])+ux(e[1]):ux(e[0])}function dx(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function fx(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function px(e,t){return e>=0&&e<t.length?t[e]:""}function gx(e){return t=function(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}(e),ZR.includes(t)||QR.includes(t);var t}var yx=function(){function e(){LR(this,e)}return MR(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(KB){console.error(KB),i({format:n},KB)}}},{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=fx(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]=hx(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(KB){return console.error(KB),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(ax.test(i[r]))s=(s=i[r].replace(ax,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(sx.test(i[r]))a.push(i[r].replace(sx,"").replace(/\s+/g,""));else if(lx.test(i[r])){var c=e.parseASSItem(i[r].replace(lx,""),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(KB){console.error(KB)}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(JR,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=px(n,t).trim();if(!h||a&&dx(h))a=!h;else if(ix.test(h)&&tx.test(px(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)nx.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<ox.length&&!(i=ox[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(gx(n=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:fx(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:fx(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=hx(r),n=hx(o)}return{start:i,end:n,time:e}}},{key:"isVTT",value:function(e){return JR.test(e)}},{key:"isASS",value:function(e){return rx.test(e)}},{key:"checkFormat",value:function(e){return e?JR.test(e)?"vtt":rx.test(e)?"ass":ex.test(e)?"srt":"":""}}]),e}(),vx=[{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"}],mx=function(e){BR(i,e);var t=YR(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 LR(this,i),e||(e=vx[r||7].msg),(n=t.call(this,e)).code=r||7,n.message=e,n.type=vx[r||7].msg,n.orgError=o||null,n.data=a||null,n}return MR(i)}(KR(Error));function _x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={code:vx[e].code,msg:vx[e].msg,message:vx[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var Ex=MR((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 LR(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("&"))}}))})),Tx=function(){function e(){var t,i;LR(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 MR(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function bx(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"===OR(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function Sx(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):bx(e,t)||(e.className&&"object"===OR(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function Cx(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 kx(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 Ix(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Px(){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 Dx(e){return e&&e instanceof window.HTMLMediaElement}function wx(e,t,i){if(i||(i=new Tx),"json"===t){var n=yx.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&yx.parse(e,(function(e,t){if(t){var n=_x(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=_x(3);i.reject(r)}}));return i}function Ax(e,t){t||(t=new Tx);var i=[];"String"===Ix(e.url)?i=[e.url]:"Array"===Ix(e.url)&&(i=$R(e.url));return function n(){var r=i.shift();if(r)new Ex({url:r,type:"text"}).then((function(i){wx(i.res.response,"string").then((function(i){t.resolve(xR(xR({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)n();else{var a=_x(1,xR({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:r},e));t.reject(a)}}));else{var o=_x(1,xR({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function Rx(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 xx(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function Ox(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function Lx(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var Nx=function(){function e(){var t=this;LR(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return MR(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(KB){console.error(KB)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),Mx=null;var Ux="resize",Bx="change",Fx="off",Hx="update",jx="error",Vx=/^[A-Za-z0-9_-]+$/,Kx=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function Wx(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 Gx(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&&ZR.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(!ZR.includes(l)&&!QR.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 Vx.test(e)})).join(" ")),selfClosing:r,tagName:l}}function Yx(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 Kx.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;){Wx(n[n.length-1].dom,i.slice(o,a.index));var s=a[0],l=Gx(s);if(l)if(l.closing){var c=n.map((function(e){return e.tagName})).lastIndexOf(l.tagName);c>0?n.length=c:Wx(n[n.length-1].dom,s)}else if("br"===l.tagName)n[n.length-1].dom.appendChild(document.createElement("br"));else{var u=Yx(l);n[n.length-1].dom.appendChild(u),l.selfClosing||n.push({dom:u,tagName:l.tagName})}else Wx(n[n.length-1].dom,s);o=r.lastIndex,a=r.exec(i)}Wx(n[n.length-1].dom,i.slice(o))}function $x(e){var t=[];if(e&&"String"===Ix(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===Ix(e)){if(0===e.length)return t;"String"===Ix(e[0])?t.push({url:$R(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 Xx=!1,qx=function(e){BR(i,e);var t=YR(i);function i(e){var n,r,o,a,s,l,c;return LR(this,i),UR(WR(n=t.call(this)),"_onPause",(function(){n.stopRender()})),UR(WR(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),UR(WR(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)))}})),UR(WR(n),"_onResize",(function(e){var t=WR(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=Rx(a/o*100)}n.__startResize(e)}})),UR(WR(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)}})),UR(WR(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=WR(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))}})),UR(WR(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),Xx=/(?: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"===Ix(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.setSubTitles(e.subTitles,n.config.defaultOpen),n):GR(n)}return MR(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=$x(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(xx(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=xx(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=$x(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(e){}};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&&Sx(this.root,"text-track-hide"),!s&&Sx(this.root,"text-track-no-fitvideo"),a&&Sx(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,Mx||(Mx=new Nx),Mx.addObserver(i,n))),Dx(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&&(Dx(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,Mx&&Mx.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 mx("no default subtitle",5);return e.emitError(r),void n(r)}if(e.currentText&&xx(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(_x(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var a=0;a<e.textTrack.length;a++)if(xx(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(_x(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(_x(0));else{var a=new mx("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 mx("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(xx(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!xx(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(_x(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(_x(0))}))}},{key:"emitError",value:function(e){this.emit(jx,{type:jx,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(Bx,{type:Bx,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(Fx,{type:Fx,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 Tx,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 wx(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):(Ax(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=xR({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){Ax(xR(xR({},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=Cx(e,this.currentText.list,this._gid);if(n>-1&&(i=kx(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(Hx,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=Cx(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=kx(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(Hx,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(Hx,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:Hx,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 Rx(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}}))};xx(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=Rx(h*e)/100,i=e):(d=t,i=Rx(t/h*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;p=Rx(h>120?(f=a)*d/1080:(f=o)*i/1920);var g=Xx?s:l,y={fontSize:p=p<g?g:p>f?f:p},v=Rx((t-d)/2),m=Rx((e-i)/2),_=Rx(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(Ux,{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=Px("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=Px("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(Ox(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(/^[ ]*$/)||Lx(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=Rx(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)})):bx(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===OR(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(Sx(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(FR(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(FR(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(FR(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(FR(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){zR(FR(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}(Ar);class Zx extends Ar{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)):os.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 Qx(){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 Jx(){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:eO}=ba,tO="mobile"===Vr.device,iO="text-close";function nO(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 rO 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||(tO?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===iO?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",Vr.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:eO.CONTROLS_RIGHT,index:FA,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=nO(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 Zx(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(uo,this.onPlayerFocus),this.on(ho,this.onPlayerBlur));const{player:s}=this;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new qx(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&&Mr.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?Mr.addClass(this.root,"isOpen"):Mr.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;!tO&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!tO&&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:Qx,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:Jx,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(tO)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 SA(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,Mr.removeClass(this.root,"isClose"),Mr.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>os.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,Mr.addClass(this.root,"isClose"),Mr.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null==(e=this.optionList)||e.hide()}renderItemList(){tO?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&&this.show();const o=[];e.list.map((e=>{o.push(e)}));const a=nO(o);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?o[a]:null,Mr.removeClass(this.root,"isClose"),Mr.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,Mr.removeClass(this.root,"isOpen"),Mr.addClass(this.root,"isClose"),this.changeTipText(),null==(t=this.optionList)||t.hide()),this.config.list=o,o.length>0?tO||null==(i=this.optionList)||i.hide():(this.switchOffSubtitle(),tO?this.showMobilePanel():null==(n=this.optionList)||n.show(),tO||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=Mr.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":iO,selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,n=Mr.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=tO?"touchend":"click",o=ba.delegate(n,".panel-Item",r,(t=>{e["data-type"]===iO?(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||Mr.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(){return`\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">${this.langText.subOpen}</div>\n </xg-icon>\n `}}const oO=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=Mr.createDom("div","",void 0,"toast-container"),r=Mr.checkIsObject(e)?e:Mr.createDom("div",e,void 0,"toast-txt");if(n.appendChild(r),t){const e=Mr.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 aO(){return(new Date).getTime()}var sO="loadstart",lO="loadeddata",cO="firstFrame",uO="waitingStart",hO="waitingEnd",dO="seekStart",fO="seekEnd",pO=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Lr.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),vr(Tr(e),"_onAutoplayStart",(function(){Lr.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),vr(Tr(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=aO(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Mr.clearTimeout(Tr(e),e._waitTimer),e._waittTimer&&Mr.clearTimeout(Tr(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),vr(Tr(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=aO(),e.emitLog(dO,{start:aO()}))})),vr(Tr(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),vr(Tr(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=aO(),e.fixedWaitingStart=aO(),e._waitType=1,e.emitLog(uO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),vr(Tr(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=aO(),e._waitTimer=Mr.setTimeout(Tr(e),(function(){e._isWaiting&&(e.waitingStart=aO(),Mr.clearTimeout(Tr(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(uO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),vr(Tr(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),vr(Tr(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return yr(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=aO(),this.loadedCostTime=0,this.startCostTime=0,this.on(lo,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=aO()-e.newPointTime,Lr.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(sO,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=aO(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(oo,(function(){e.vt=aO(),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;Lr.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(lO,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Qr,this._onSeeking),this.on(Jr,this._onSeeked),this.on(_o,(function(){e.endState("destroy")})),this.on(Eo,(function(){e.endState("urlChange"),Lr.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([$r,io],this._onPlaying),this.on(to,this._onWaiting),this.on(Zr,this._onError),this.on(Bo,(function(){Lr.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(go,this._onAutoplayStart),this.off(eo,this._onTimeupdate),this.once(go,this._onAutoplayStart),this.once(eo,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=aO();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Lr.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Lr.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(cO,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Mr.clearTimeout(this,this._waittTimer),this._waittTimer=Mr.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Mr.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=aO(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(fO,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Mr.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Mr.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=aO(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(hO,{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(Mo,dr({t:aO(),host:Mr.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}(ba);function gO(){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 yO=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"registerIcons",value:function(){return{replay:gO}}},{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(Xr,(function(){if(e.playerConfig.loop||Mr.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(zr,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Mr.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}(ba);function vO(){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 mO(){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 _O={};function EO(e){e?window.clearTimeout(e):Object.keys(_O).map((function(e){window.clearTimeout(_O[e].id),delete _O[e]}))}var TO=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),Mr.removeClass(n.root,e),n.show()})),vr(Tr(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";Mr.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return yr(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(fo,(function(){i&&(i.lang&&"en"===i.lang?Mr.addClass(t.root,"lang-is-en"):"jp"===i.lang&&Mr.addClass(t.root,"lang-is-jp"))})),this.on(go,this.onAutoplayStart),this.on(yo,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Mr.removeClass(e.root,t),e.show()})),this.on(zr,(function(){e.toggleTo("play")})),this.on(qr,(function(){e.toggleTo("pause")})),this.on(Bo,(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:vO,class:"xg-icon-play"},startPause:{icon:mO,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(){Mr.addClass(this.root,"hide")}},{key:"show",value:function(e){Mr.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Mr.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Mr.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 _O[e]&&window.clearTimeout(_O[e].id),_O[e]={},i.start&&i.start(),_O[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(_O[e].id),delete _O[e]}),t),_O[e].id}("pauseplay",400,{start:function(){Mr.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Mr.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){Mr.removeClass(this.root,"interact"),EO(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<La.READY)||(this.player.paused||t.state!==La.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<La.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),EO(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}(ba),bO=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=Mr.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}(ba);function SO(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(n){return'<div class="xg-tips hide"></div>'}}var CO=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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:va.CONTROLS_RIGHT,index:10}}}]),i}(ba);function kO(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var IO=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],PO=IO.length;function DO(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===fr(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<PO;t++)e[IO[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<PO;r++){var o=IO[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=kO(t.width);!1!==g&&(i.width=g+(p?0:l+d));var y=kO(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 wO(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var AO="dragStart",RO="dragMove",xO="dragEnded",OO={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},LO=function(e){mr(i,e);var t=Sr(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pr(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 yr(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)]),OO[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=OO[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=wO(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=wO(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=wO(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=DO(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(AO,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(xO)),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(RO,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=DO(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(Ar),NO=function(e){mr(i,e);var t=Sr(i);function i(e){var n;pr(this,i),vr(Tr(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),vr(Tr(n),"onCenterClick",(function(e){var t=Tr(n).player;t.paused?t.play():t.pause()})),vr(Tr(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(Mr.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=Tr(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 yr(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(qr,(function(){e.setAttr("data-state","pause")})),this.on(zr,(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(CO,i,CO.pluginName)}var n=Mr.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new LO(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:vO,class:"xg-icon-play"},pause:{icon:mO,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={},Mr.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(Po,!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;Mr.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(Po,!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=Mr.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(SO(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}(ba),MO={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},UO=["videoClick","videoDbClick"],BO=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=Tr(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),vr(Tr(e),"onMouseEnter",(function(t){var i=Tr(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(So)})),vr(Tr(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)})),vr(Tr(e),"onVideoClick",(function(t){var i=Tr(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--,sa(Tr(e),UO[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),vr(Tr(e),"onVideoDblClick",(function(t){var i=Tr(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(),sa(Tr(e),UO[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 yr(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,UO.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Vr.device&&!Vr.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(MO).map((function(t){n.addEventListener(t,e[MO[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(MO).map((function(t){n.removeEventListener(t,e[MO[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(ca),FO="press",HO="pressend",jO="doubleclick",VO="click",KO="touchmove",WO="touchstart",GO="touchend",YO={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},zO={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function $O(e){return e&&e.length>0?e[e.length-1]:null}var XO=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};pr(this,e),vr(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=$O(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(WO,e)})),vr(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),vr(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(HO,e),i.trigger(GO,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),vr(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=$O(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(HO,e),t.press=!1,t.moving=!0,i.trigger(KO,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:YO,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return yr(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(FO,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(jO,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(VO,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(KB){console.error("trigger>>:".concat(e),KB)}}))}},{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 qO(){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 ZO="auto",QO="seeking",JO="playbackrate",eL=["videoClick","videoDbClick"],tL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onTouchStart",(function(e){var t=Tr(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),Mr.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=Mr.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}})),vr(Tr(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=Tr(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}}})),vr(Tr(n),"onTouchEnd",(function(e){var t=Tr(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(),Mr.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(ZO)}})),vr(Tr(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),vr(Tr(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 yr(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:qO,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;eL.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(),Mr.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Mr.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new XO(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(no,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([io,Xr],(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(ZO)}))})))}}},{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&&Mr.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:Vr.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(ZO)}},{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<La.RUNNING?n.closeVideoClick||(this.sendUseAction(Mr.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(Mr.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=La.RUNNING&&(this.sendUseAction(Mr.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;sa(this,eL[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;sa(this,eL[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(JO))}},{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(ZO))}},{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(QO);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Mr.format(this.duration),this.find(".xg-cur").innerHTML=Mr.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Mr.removeClass(this.find(".xg-seek-show"),"xg-back"):Mr.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<La.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}(ba);function iL(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var nL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=Tr(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||iL(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!iL(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),vr(Tr(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),vr(Tr(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=Tr(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)}})),vr(Tr(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return yr(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=Mr.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=Mr.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var n,r=Object.keys(this.keyCodeMap),o=0;o<r.length;o++){var a=this.keyCodeMap[r[o]],s=a.action,l=a.keyCode,c=a.disable,u=a.pressAction,h=a.disablePress;if(l===e){if(!(c||i&&h)){var d=i&&u||s;"function"==typeof d?s(t,this.player,i):"string"==typeof d&&"function"==typeof this[d]&&this[d](t,this.player,i),this.emit(No,dr({key:r[o],target:t.target,isPress:i},this.keyCodeMap[r[o]]))}(n=t).preventDefault(),n.returnValue=!1,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}(ca);function rL(){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 oL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"registerIcons",value:function(){return{loadingIcon:rL}}},{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:va.ROOT}}}]),i}(ba),aL=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],sL=function(){function e(t){pr(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 yr(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"!==Mr.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"!==Mr.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(Mr.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++)Mr.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Mr.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=Mr.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=Mr.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),aL.forEach((function(t){o.appendChild(Mr.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}(),lL={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},cL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=Tr(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){Mr.event(e);var l=Mr.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)})),vr(Tr(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),vr(Tr(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),vr(Tr(n),"_mouseUpHandler",(function(e,t){Tr(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),vr(Tr(n),"_mouseMoveHandler",(function(e,t){var i=Tr(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)})),vr(Tr(n),"onMouseDown",(function(e){var t=Tr(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=Mr.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(),Mr.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Mr.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Mr.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,Mr.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()}})),vr(Tr(n),"onMouseUp",(function(e){var t=Tr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;if(o){e.stopPropagation(),e.preventDefault(),Mr.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Mr.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Mr.event(e),Mr.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)),Mr.setTimeout(Tr(n),(function(){n.resetSeekState()}),1),i.focus()}})),vr(Tr(n),"onMouseMove",(function(e){var t=Tr(n),i=t._state,r=t.pos,o=t.player,a=t.config;Mr.checkTouchSupport()&&e.preventDefault(),Mr.event(e);var s=Mr.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)}})),vr(Tr(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),vr(Tr(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),vr(Tr(n),"onMouseEnter",(function(e){var t=Tr(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),Mr.event(e);var o=Mr.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),vr(Tr(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),vr(Tr(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 yr(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=dr(dr({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new sL(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"===Vr.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(no,(function(){e.onMouseLeave()})),this.on(eo,(function(){e.onTimeupdate()})),this.on(Jr,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(so,(function(){e.onCacheUpdate()})),this.on(Xr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(co,(function(){e.onReset()})),this.on(Ao,(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"===fr(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(KB){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),KB)}}))}},{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(),Mr.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Mr.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:Mr.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=Mr.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=Mr.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:va.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:lL.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return lL}}]),i}(ba),uL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),vr(Tr(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return yr(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}(ba),hL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=Tr(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 yr(i,[{key:"afterCreate",value:function(){Cr(_r(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([zr,qr,Zr,co],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:vO,class:"xg-icon-play"},pause:{icon:mO,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(){Cr(_r(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(SO(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_LEFT,index:0,disable:!1}}}]),i}(uL);function dL(){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 fL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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:dL,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Mr.addClass(this.root,"show")}},{key:"hide",value:function(){Mr.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:va.ROOT_TOP,index:0}}}]),i}(ba);function pL(){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 gL(){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 yL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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 yr(i,[{key:"afterCreate",value:function(){var e=this;Cr(_r(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=Mr.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(ko,(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:fL,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Vr.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:pL,class:"xg-get-fullscreen"},exitFullscreen:{icon:gL,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){Cr(_r(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Vr.device?"touchend":"click",this.handleFullscreen),"mobile"===Vr.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(SO(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(t){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(uL),vL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).isActiving=!1,n}return yr(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([no,Jr,eo],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(Xr,(function(){e.onTimeUpdate(!0)})),this.on(co,(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=Mr.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Mr.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=Mr.format(n))):(this.timeDom.innerHTML=this.minWidthTime(Mr.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=Mr.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Mr.format(0)),this.centerDurDom.innerHTML=Mr.format(0)):(this.timeDom.innerHTML=this.minWidthTime(Mr.format(0)),this.durationDom.innerHTML=Mr.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Mr.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=Mr.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?(Mr.hide(this.durationDom),Mr.hide(this.timeDom),Mr.hide(this.find(".time-separator")),Mr.show(this.find(".time-live-tag"))):Mr.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Mr.hide(this.durationDom),Mr.hide(this.timeDom),Mr.hide(this.find(".time-separator")),Mr.show(this.find(".time-live-tag"))):(Mr.hide(this.find(".time-live-tag")),Mr.show(this.find(".time-separator")),Mr.show(this.durationDom),Mr.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(Mr.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(Mr.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(Jr,i),t.isSeeking&&t.media.seeking?this.once(Jr,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:va.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(ba),mL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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=Mr.getIndexByTime(i,n),o=Mr.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),vr(Tr(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=Mr.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),vr(Tr(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=Mr.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=Mr.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()}}})),vr(Tr(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=Mr.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),vr(Tr(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 yr(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(no,this._onDurationChange),this.on(oo,this._onLoadedData),this.on(eo,this._onTimeupdate),this.on(Qr,this._onSeeking),this.on(zr,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}(ca);function _L(){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 EL(){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 TL(){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 bL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=Tr(e).player,n=e.find(".xgplayer-bar");Mr.event(t);var r=n.getBoundingClientRect(),o=Mr.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})),vr(Tr(e),"onBarMouseMove",(function(t){var i=Tr(e)._d;if(i.isStart){var n=Tr(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),Mr.event(t);var a=Mr.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),vr(Tr(e),"onBarMouseUp",(function(t){Mr.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=Tr(e)._d;i.isStart=!1,i.isMoving=!1})),vr(Tr(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),vr(Tr(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),vr(Tr(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 yr(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:EL,class:"xg-volume-small"},volumeLarge:{icon:_L,class:"xg-volume"},volumeMuted:{icon:TL,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"!==Vr.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(ro,this.onVolumeChange),this.once(oo,this.onVolumeChange),"Number"!==Mr.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&&(Mr.clearTimeout(this,this._timerId),this._timerId=null),Mr.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&&(Mr.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Mr.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),Mr.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&&(Mr.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"===Vr.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:va.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}(ba);function SL(){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 CL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return yr(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){Cr(_r(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(Ao,(function(){e.rotateDeg&&e.config.innerRotate&&Mr.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(){Cr(_r(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(xo,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:SL}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(SO(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}(uL);function kL(){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 IL(){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 PL="picture-in-picture",DL="inline",wL="fullscreen",AL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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 yr(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()&&(Cr(_r(i.prototype),"afterCreate",this).call(this),this.pMode=DL,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(vo,(function(){e.config.showIcon&&(Mr.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:kL,class:"xg-get-pip"},pipIconExit:{icon:IL,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;Mr.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(Ro,!1)},this.enterPIPCallback=function(i){t.emit(Ro,!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===wL&&n!==wL&&t.onFullscreenChange(null,!1),e.pMode=n,n===PL?e.enterPIPCallback(i):n===DL&&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=kr(document.styleSheets).map((function(t){try{return kr(t.cssRules).map((function(e){return e.cssText})).join("")}catch(n){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"===Mr.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===PL}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===Mr.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===Mr.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Mr.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){Cr(_r(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(SO(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:va.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}(uL);function RL(){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 xL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"playNext",(function(e){var t=Tr(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(Lo,n.idx+1)):(n.nextHandler(),t.emit(Lo))})),n.idx=-1,n}return yr(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:RL}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Vr.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(SO(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(ba),OL={exports:{}};!function(e,t){e.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}}(OL);const LL=sr(OL.exports);function NL(){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 ML=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===Mr.typeOf(t)?i=t:"Array"===Mr.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);LL(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 yr(i,[{key:"afterCreate",value:function(){Cr(_r(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:NL}}},{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(){Cr(_r(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(SO(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(uL),UL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){Cr(_r(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(Ao,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(r){console.error("MouseEvent unsupported",r)}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(Oo,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(){Cr(_r(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Ao,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:va.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(uL),BL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return yr(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;Cr(_r(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||Mr.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=dr(dr({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));Cr(_r(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;Cr(_r(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 dr(dr({},AA.defaultConfig),{},{position:va.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(AA),FL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).curRate=1,n}return yr(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;Cr(_r(i.prototype),"afterCreate",this).call(this),this.on(ao,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&Cr(_r(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){Cr(_r(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}));Cr(_r(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(){Cr(_r(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return dr(dr({},AA.defaultConfig),{},{position:va.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}(AA);function HL(){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 jL(){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 VL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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;Cr(_r(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Io,(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:HL,class:"xg-get-cssfull"},exitCssFullscreen:{icon:jL,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){Cr(_r(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(SO(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(uL),KL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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(Zr,(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}(ba),WL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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),Mr.addClass(this.root,"show"),"arrow"===i.mode&&Mr.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(){Mr.removeClass(this.root,"show"),Mr.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Ia.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}(ba),GL={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function YL(e){Object.keys(GL).map((function(t){void 0===e[t]&&(e[t]=GL[t])}))}var zL={_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?Mr.addClass(t,"mini"):Mr.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&&(YL(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=Mr.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=Mr.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 $L={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},XL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(Mr.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||Mr.hasClass(e.target,"xg-spot-content"))&&(Mr.event(e),e.stopPropagation()))})),vr(Tr(n),"onMousedown",(function(e){n.config.disable||(n._state.f||Mr.hasClass(e.target,"xg-spot-content"))&&(Mr.event(e),e.stopPropagation())})),vr(Tr(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))}})),vr(Tr(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()}})),vr(Tr(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&Mr.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 yr(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(Mr.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(zL).map((function(t){e[t]=zL[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return YL(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(no,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Ao,(function(){e.positionDots()}))}(this),this.on(no,(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($L).map((function(i){e[$L[i]]=e[$L[i]].bind(e),t.addCallBack(i,e[$L[i]])})),"mobile"!==Vr.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&&Mr.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Mr.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||Mr.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&&Mr.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"!==Vr.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){Mr.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&Mr.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=Mr.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Mr.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")),Mr.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Mr.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Mr.addClass(this.root,"no-timepoint"),e&&(Mr.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Mr.addClass(this.root,"product"),this.tipText.textContent=e):(Mr.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){Mr.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Mr.removeClass(this.find(".xg-spot-content"),"show-text"),Mr.removeClass(this.root,"product")}},{key:"hide",value:function(){Mr.addClass(this.root,"hide")}},{key:"show",value:function(e){Mr.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($L).map((function(i){t.removeCallBack(i,e[$L[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"===Vr.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}(ba),qL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return yr(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([no],(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,Mr.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=Mr.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}(ba);function ZL(e){return e?"background:".concat(e,";"):""}var QL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=Tr(e).offsetDuration,n=e.currentTime;n=Mr.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return yr(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(eo,this.onTimeupdate),this.on(co,(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:ZL(t.cachedColor),played:ZL(t.playedColor),progress:ZL(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}(ba),JL="realtime",eN="firstframe",tN="poster";var iN=null,nN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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(eo,e.renderOnTimeupdate),e.on(eo,e.renderOnTimeupdate))})),vr(Tr(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),vr(Tr(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(eo,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),vr(Tr(e),"start",(function(t,i){var n=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(e){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===JL||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Mr.setTimeout(Tr(e),e.start,i):Mr.requestAnimationFrame(e.start))})),vr(Tr(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Mr.clearTimeout(Tr(e),e.frameId):Mr.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return yr(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!==JL&&this.interval>=1e3?"timer":"animation",this.once(vo,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==tN&&(r!==eN&&(this.on(co,(function(){e.stop()})),this.on(zr,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(qr,(function(){e.stop()}))),this.on(oo,this.onLoadedData),this.on(lo,(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(o){Lr.logError("plugin:DynamicBg",o)}}},{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"!==Vr.browser||!Mr.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"===Mr.typeOf(e)?e:"String"===Mr.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!==eN&&e!==tN}},{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(u){Lr.logError("plugin:DynamicBg",u)}}},{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 iN?iN:iN=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Vr.browser||"firefox"===Vr.browser)}}]),i}(ba),rN="info",oN=Vo,aN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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[rN].push(dr(dr({type:"userAction"},i),{},{payload:n}))})),vr(Tr(e),"_onReset",(function(){e.reset()})),vr(Tr(e),"_recordInfo",(function(t){e.info(t)})),vr(Tr(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 yr(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Uo,this._recordUserActions),this.on(oN.STATS_INFO,this._recordInfo),this.on(oN.STATS_DOWNLOAD,this._downloadStats),this.on(oN.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[rN].push(dr(dr({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=dr({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=(vr(e={},rN,[]),vr(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[rN].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(KB){console.log("err",KB)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[rN].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(ca),sN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Tr(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 yr(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(to,this.onGapJump),this.on(zr,(function(){e.hasPlayed=!0})),this.on(Qr,(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}(ba);sN.BROWSER_GAP_TOLERANCE=.001;var lN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Tr(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),vr(Tr(e),"onJump",(function(){var t=Tr(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 yr(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(to,this.onWaiting),this.on([$r,io],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(zr,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(ba),cN="cdn",uN=["cdn"],hN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cN;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)})),vr(Tr(e),"startTimer",(function(){Mr.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),vr(Tr(e),"initSpeedList",(function(){e.speedListCache={},uN.forEach((function(t){e.speedListCache[t]=[]}))})),vr(Tr(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||cN)})),vr(Tr(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(d){console.error(d)}}}})),vr(Tr(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cN;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=Tr(e).player;r&&(i===cN?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),vr(Tr(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cN,i=e.getSpeed(t),n=Tr(e).player;if(n)if(t===cN)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(To,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(To,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return yr(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&uN.push.apply(uN,kr(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([oo,mo],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([oo,mo],this.startTimer),uN.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}(ba),dN=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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(zr,(function(){e._startTick()})),this.on(qr,(function(){e._stopTick()})),this.on(Xr,(function(){e._stopTick()})),this.on(co,(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(Ko,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}(ba);const fN=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(){Mr.addClass(this.root,"hide")}show(){return Mr.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(Xr,(()=>{this.isEndedShow&&Mr.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(eo,(()=>{this.onTimeUpdate()})),this.on(Eo,(()=>{Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"xg-showplay"),this.once(eo,(()=>{this.onTimeUpdate()}))}))):this.on(zr,(()=>{Mr.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?Mr.removeClass(this.root,"xg-showplay"):this.once(eo,(()=>{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>`}};Oa.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 pN{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:n}=t,r=[...n?[]:[mL,cL,QL,XL,vL],hL,yL,CL,xL,BL,FL,ML,UL,bL,AL],o=[yO,fN,TO,oL,bO,KL,WL,qL,NO];this.plugins=[aN,pO,...r,...o,sN,lN];const a=i?"mobile":Vr.device;switch(a){case"pc":this.plugins.push(nL,BO,VL,hN,dN);break;case"mobile":this.plugins.push(tL);break;default:this.plugins.push(nL,BO,VL)}(Vr.os.isIpad||"pc"===a)&&this.plugins.push(nN),this.ignores=[],this.i18n=[]}}function gN(e,t){return d(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:n,playerData:r},o){const a=[pN,yN()],{openSoftDecoding:s,isMusic:l}=r,c=[],u=[];if(i?a.push(function({isLive:e,playerData:t}){const i=["error","playbackRate"],n=t.configs,r=Ks(n,"EncryptHlsPlugin");(null==r?void 0:r.playAuthToken)||i.push("definition");const o=[lR];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=[qA],r=t.configs,o=Ks(r,"EncryptHlsPlugin");(null==o?void 0:o.playAuthToken)||(i.push("definition"),n.push(VA));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(zs()||$s()||s){const e=yield o.sdkUmdLoader.loadPlugins(Uw.FLV);c.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(Uw.FLV);c.push(e)}})))());Ks(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&c.push(rO);const[h,f]=yield Promise.all([n(),vN({playerData:o.playerData},o),...u]);return{presets:a,softDecodingOption:h,plugins:[...c,...f].filter(Boolean)}}))}function yN(e){const t=[wR,oO,aR];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 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(Dw()||Ls())&&o.push(Ow),e.enableMenu&&o.push(AR),o}))}function mN(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function _N(){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 EN(){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 TN(){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 bN(){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 SN(){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 CN=u(c({startPlay:EN,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:_N,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:TN,volumeMuted:bN,volumeSmall:SN}),kN={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:Ws(),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({},CN),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}},IN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},PN={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 DN=u(c({startPlay:EN,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:_N,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:TN,volumeMuted:bN,volumeSmall:SN}),wN=u(c({width:"100%",height:"100%",lang:Ws(),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({},DN),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}}),AN={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}},RN={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:xN}=ba,ON=e=>{const t="mobile"===Vr.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:n=(t?"inner":"normal"),position:r=xN.CONTROLS_LEFT,icon:o=mN,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=rA(this.handleCallback.bind(this),200);const t="mobile"===Vr.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),s&&(null==(e=this.player)||e.on(ko,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(xA.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),s&&(null==(e=this.player)||e.off(ko,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 LN{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:Ya.INNER;Object.values(Ya).includes(s)||(s=Ya.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(ko,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(Ya.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:Ya.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(xA.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["normal","inner","fullscreen"][this.mode]}`;switch(this.root=Mr.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case Ya.NORMAL:{const e=Mr.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=Mr.createDom("div",Xa[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case Ya.INNER:this.container=this.root;break;case Ya.FULLSCREEN:{const e=Mr.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&&Mr.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&&Mr.hasClass(this.children,"item-list-panel-content")&&Mr.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!==Ya.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return Mr.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"active")}hide(){this.isShow=!1,Mr.removeClass(this.root,"active"),Mr.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(ko,this.handleOrientationChange.bind(this))}}function NN(){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:MN}=ba;class UN extends(jA(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:MN.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:NN,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=Mr.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=Mr.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 BN(){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:FN}=ba;class HN 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:FN.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&ur.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:BN,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=Mr.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=Mr.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(xA.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(RA.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 jN(){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:VN}=ba;class KN 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:VN.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:jN,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(ao,(()=>{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=Mr.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=Mr.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 WN(){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:GN}=ba;class YN 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:GN.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:WN,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=Mr.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=Mr.createDom("div","",{},"panel-Item "+(t?"select-in":""));i.innerHTML=$A(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=Mr.createDom("div","",{},"audiotrack-panel-content");r.forEach((t=>{const i=Mr.createDom("div","",{},"panel-Item "+(t.id===e?"select-in":""));i.innerHTML=$A(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){GA(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=Mr.createDom("div","",{},"audiotrack-panel-content");for(let a=0;a<i.length;a++){const e=i[a],t=XA(e,a,n),o=Mr.createDom("div","",{},"panel-Item "+(e.enabled?"select-in":""));o.innerHTML=t,o.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=this._getNativeTrackList();t&&WA(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=YN.textTips[this.player.lang||"en"])?e:YN.textTips.en}}class zN{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){zN.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 $N=18e5,XN=1e3,qN="media_info",ZN="ttdrama_media_info",QN="[mediaInfoCache]";let JN=c({},{enable:!1,expireTime:$N,cacheType:"memory",maxEntries:100});const eM=new Map;function tM(e,t={}){os.log(`${QN} ${e}`,t)}function iM(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:aM(e)}}function nM(){return c({},JN)}function rM(){const e=eM.size;eM.clear();tM("clear success",{memoryCacheCount:e,localStorageCacheCount:function(){const e=dM();if(!e)return 0;const t=[`${bs}${qN}_`,`${bs}${ZN}_`],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}()})}function oM(e){return"string"==typeof e?e.trim():""}function aM(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function sM(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function lM(e){const t=cM(e);return t.playAuthTokenHash?sM(JSON.stringify(t)):""}function cM(e){const t=oM(e.playAuthToken);return{playAuthTokenHash:t?sM(t):"",reqParams:uM(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function uM(e){if(!e)return;const t=c({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const hM={getItem:e=>eM.get(e)||null,setItem(e,t){eM.delete(e),eM.set(e,t)},removeItem(e){eM.delete(e)}};function dM(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(e){return}}function fM(e){return e.startsWith(`${bs}${qN}_`)||e.startsWith(`${bs}${ZN}_`)}function pM(){if("memory"===JN.cacheType)return Array.from(eM.keys()).filter(fM);const e=dM();return e?function(e){const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);n&&fM(n)&&t.push(n)}return t}(e):[]}function gM(){return"memory"===JN.cacheType?hM:dM()}function yM(e){try{return JSON.parse(e)}catch(t){return}}function vM(e){const t=oM(e.moduleName),i=oM(e.cacheKey);return t&&i?`${bs}${t}_${i}`:""}function mM(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 _M(e){return{moduleName:oM(e.moduleName),cacheKey:oM(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:JN.cacheType}}function EM(e){const t=gM(),i=vM(e),n=_M(e);if(!t)return void tM("get skip no storage",n);if(!i)return void tM("get skip empty storage key",n);const r=t.getItem(i)||"";if(!r)return void tM("get miss empty cache",n);const o=yM(r);if(!o)return void tM("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 tM("get miss expired and removed",u(c({},n),{expireAt:o.expireAt,now:Date.now()}))):(tM("get hit",c(u(c({},n),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),iM(a))),function(e,t,i,n){try{e.setItem(t,JSON.stringify(u(c({},i),{lastAccessedAt:Date.now()})))}catch(KB){tM("touch failed",u(c({},n),{error:KB}))}}(t,i,o,n),a);tM("get miss invalid cache payload",n)}function TM(e,t,i=$N){const n=gM(),r=vM(e),o=_M(e);if(!n)return void tM("set skip no storage",c(c({},o),iM(t)));if(!r)return void tM("set skip empty storage key",c(c({},o),iM(t)));if(!aM(t))return void tM("set skip invalid media info",c(c({},o),iM(t)));const a=function(e,t){const i=Date.now()+t,n=mM(e);return n?Math.min(i,n-XN):i}(t,i);if(a<=Date.now())return void tM("set skip expired media info",c(u(c({},o),{expireTime:i,expireAt:a}),iM(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=pM(),i=JN.maxEntries;if(t.length<=i)return;const n=t.map((t=>{const i=yM(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))),tM("prune success",{removeCount:r,maxEntries:i,cacheType:JN.cacheType})}(n),tM("set success",c(u(c({},o),{cacheKeyInfo:s.cacheKeyInfo,expireTime:i,expireAt:a}),iM(t)))}catch(KB){tM("set failed",c(u(c({},o),{error:KB}),iM(t)))}}function bM(e){if(JN.enable)return function(e){return EM({moduleName:qN,cacheKey:lM(e),cacheKeyInfo:cM(e)})}(e)}function SM(e,t){JN.enable&&function(e,t,i=$N){TM({moduleName:qN,cacheKey:lM(e),cacheKeyInfo:cM(e)},t,i)}(e,t,JN.expireTime)}let CM=!1;const kM=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function IM(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(i){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${a}?${l.join("&")}${n}`}function PM(e,t){return"string"==typeof e?IM(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?IM(e,t):e&&"object"==typeof e&&"string"==typeof e.src?u(c({},e),{src:IM(e.src,t)}):e)):e}function DM(e,t=Date.now()){if(!CM||!e)return e;const i=c({},e);return kM.forEach((e=>{i[e]&&(i[e]=PM(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>PM(e,t)))),i}function wM(e,t=Date.now()){return CM&&e?u(c({},e),{playList:(e.playList||[]).map((e=>DM(e,t)))}):e}const AM=[["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 RM(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xM(e){if(!e)return;const t={};return AM.forEach((([i,n])=>{const r=e[i];"string"==typeof r&&(t[n]=r)})),t}function OM(e){return sM(JSON.stringify(xM(e)||{}))}function LM(e){return!0===(null==e?void 0:e.canIUseGetDramaInfoTranscodeParam)}function NM(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 MM(e,t=10,i=0){const n=parseInt(`${e}`,t);return Number.isNaN(n)?i:n}function UM(e){var t;return oM(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function BM(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 FM(e){return oM(e.albumId||e.album_id)}function HM(e){return oM(e.episodeId||e.episode_id||e.episodeID)}function jM(e,t){const i={episodeId:HM(e)};return!RM(e,"transcodeParam")||t&&!LM(t)||(i.transcodeParam=e.transcodeParam),i}function VM(e){const t=oM(e.episodeId);return t?RM(e,"transcodeParam")?`${t}_${OM(e.transcodeParam||{})}`:t:""}function KM(e){const t={episodeId:oM(e.episodeId)};return RM(e,"transcodeParam")&&(t.transcodeParamHash=OM(e.transcodeParam||{})),t}function WM(e){return function(e){if(JN.enable)return EM(e);tM("get skip disabled",u(c({},_M(e)),{config:nM()}))}({moduleName:ZN,cacheKey:VM(e),cacheKeyInfo:KM(e)})}function GM(e,t){!function(e,t){JN.enable?TM(e,t,JN.expireTime):tM("set skip disabled",c(u(c({},_M(e)),{config:nM()}),iM(t)))}({moduleName:ZN,cacheKey:VM(e),cacheKeyInfo:KM(e)},t)}function YM(e){const t=e.getVideoByToken||{};return u(c({},t),{defaultDefinition:UM(e),reqParams:c({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function zM(e,t){const i=YM(e);return u(c({},i),{playDomain:i.playDomain||BM(null==t?void 0:t.channel)})}function $M(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=NM(i,y),a=NM(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:MM(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,$a),drmType:t(["DrmType","drmType","drm_type"])},e),Ns(e,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}))})).sort(ms);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 XM(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function qM(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function ZM(e,t){var i,n;const r=UM(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=qM(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:MM(o.bitrate||o.Bitrate),duration:MM(o.duration||o.Duration||e.duration),size:MM(o.size||o.Size)}}function QM(e){const t=function(e){return bM(YM(e))}(e);return t?ZM(t,e):void 0}function JM(e,t){const i=zM(e,t);return i.playAuthToken?_s(i).catch((()=>{})):Promise.resolve(void 0)}function eU(e,t){return d(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return tU(e,t);const i=function(e,t){const i=WM(jM(e,t));return i?ZM(i,e):void 0}(e,t);if(i)return DM(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return tU(e,t);const n=yield function(e,t){const i=FM(t),n=HM(t);if(!i||!n)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return JM(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return LM(e)&&RM(t,"transcodeParam")&&(r.transcodeParam=xM(t.transcodeParam)||{}),new Promise((i=>{try{e.getDramaInfo((n=>{try{if(!(null==n?void 0:n.is_success))return os.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const{data:r}=n;if((null==r?void 0:r.status)!==gR.SUCCESS||!(null==r?void 0:r.video_info))return os.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const o=$M(r.video_info,zM(t,e));i(o)}catch(r){os.error("[ttdrama] getDramaInfo invalid response",n),i(void 0)}}),r)}catch(n){os.error("[ttdrama] getDramaInfo call failed",n),i(void 0)}}))}(t,e);return n?(GM(jM(e,t),n),DM(ZM(n,e))):void 0}))}function tU(e,t){return d(this,null,(function*(){const i=QM(e);if(i)return DM(i);const n=yield JM(e,t);var r;return n?(r=n,SM(YM(e),r),DM(ZM(n,e))):void 0}))}function iU(e,t){return d(this,null,(function*(){if(qM(e.url))return e;if(function(e){return!!(e&&FM(e)&&HM(e))}(e)){const i=yield eU(e,t);return i||t||XM(e)?i:e}return XM(e)?tU(e,t):e}))}function nU(e,t){return d(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(Vr.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const n of e)i.push(yield iU(n,t))}else i=yield Promise.all(e.map((e=>iU(e,t))));return i.filter(Boolean)}))}const rU=[{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:"ئۇيغۇرچە"}],oU=new Map,aU=new Map;for(const WB of rU)oU.set(WB.id,WB.label),aU.set(WB.tag.toLowerCase(),WB.label);function sU(...e){for(const t of e){if("string"!=typeof t)continue;const e=t.trim();if(e)return e}return null}function lU(e){return{albumId:sU(null==e?void 0:e.album_id,null==e?void 0:e.albumId),episodeId:sU(null==e?void 0:e.episode_id,null==e?void 0:e.episodeId,null==e?void 0:e.episodeID)}}const cU=PR.getVeErrorInfo,uU={playAuthToken:"",needDefinitionList:!0},hU=(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},dU=(e,t="")=>null==e?t:`${e}`,fU=e=>{switch(e){case gR.NOT_SUBMITTED:return"NOT_SUBMITTED";case gR.UNDER_REVIEW:return"UNDER_REVIEW";case gR.FAILED_REVIEW:return"FAILED_REVIEW";case gR.WITHDRAWN:return"WITHDRAWN_REVIEW";case gR.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}},pU=(e,t)=>void 0!==t?fU(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";class gU extends zN{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==eB?void 0:eB.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 os.error("get no media info");os.log("getVideo res: ",v);const{type:m,poster:_,vid:E,dashOpts:T,thumbs:b,barrageMaskUrl:S}=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||ys(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&&b.length>0&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(b))):this.getThumbnailConfig(b)),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}}os.error("get no media info")}catch(y){if(os.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=eB.ttDramaEnv,r=e||(null==(t=this.playerData)?void 0:t.configs)||{},{albumId:o,episodeId:a}=lU(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=xM(r.transcodeParam)||{});const i=t=>{var i;os.error("getDramaInfo error:",t);const n={errorType:"drama",errorCode:pR.FAILED_GET_EPISODE_INFO.code,veError:cU({code:pR.FAILED_GET_EPISODE_INFO.code,message:pR.FAILED_GET_EPISODE_INFO.message,textKey:pR.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:pR.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(os.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:o,episodeId:a,vid:s}),!(null==t?void 0:t.is_success)){os.error("getDramaInfoViaJSB invalid response:",t);const i=pU(null==(n=null==t?void 0:t.error)?void 0:n.error_msg,void 0),o=pR[i]||pR.FAILED_GET_EPISODE_INFO,a={errorType:"drama",errorCode:o.code,veError:cU({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)!==gR.SUCCESS){os.error("getDramaInfoViaJSB invalid response:",t);const n=fU(null==i?void 0:i.status),r=pR[n]||pR.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:r.code,veError:cU({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)){os.error("getDramaInfoViaJSB invalid response:",t);const n={errorType:"drama",errorCode:pR.FAILED_TO_QUERY.code,veError:cU({code:pR.FAILED_TO_QUERY.code,message:pR.FAILED_TO_QUERY.message,textKey:pR.FAILED_TO_QUERY.textKey}),errorMessage:pR.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)}os.log("videoInfoRes before transformDramaVideoInfoToRes",i.video_info);const u=this.transformDramaVideoInfoToRes(i.video_info,this.config);os.log("videoInfoRes after transformDramaVideoInfoToRes",u),e(u)}catch(u){i(u)}}),t)}catch(l){i(l)}}));{const e=pR.INVALID_PARAM;null==(i=this.sdk)||i.delayError.push({errorType:fR.network,errorCode:e.code,veError:cU({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return fU(e)}mapDramaErrorCode(e,t){return pU(e,t)}transformDramaVideoInfoToRes(e,t){return $M(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){os.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(os.log("tt drama info: ",this.isMinisDramaMode,null==eB?void 0:eB.ttDramaEnv),this.isMinisDramaMode&&(null==(i=null==eB?void 0:eB.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=WM(jM(t,eB.ttDramaEnv));if(i){const e=wM(i);return this.callOnGetMediaInfo(e,!0),e}const l=e=>{GM(jM(t,eB.ttDramaEnv),e);const i=wM(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")){os.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:cU(hR.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){os.log(o)}null==(i=this._emitter)||i.emit(xA.GET_PLAY_URL_ERR,e);const r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:cU(hR.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 Es((()=>_s(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=lM(i),r=bM(i);if(r){os.log("[mediaInfoCache] authToken use cached media info",{cacheKey:n,vid:r.vid,playListLength:(null==(e=r.playList)?void 0:e.length)||0});const t=wM(r);return this.callOnGetMediaInfo(t,!0),t}os.log("[mediaInfoCache] authToken request media info",{cacheKey:n,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield Es((()=>_s(i)),this.retryCount,(e=>502===e.status),h);SM(i,o);const a=wM(o);return os.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(Uw.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Uw.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(Uw.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Uw.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 Hw.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield Hw.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 os.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 Gs(js(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield Gs(js(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=gs(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){os.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=hU(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=hU(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),n=hU(e,["StringContent","stringContent","string_content"],"",!0),r=hU(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=oU.get(i);if(e)return e}if(t){const e=aU.get(t.toLowerCase());if(e)return e}}(hU(e,["LanguageId","languageId","language_id"],void 0,!0),hU(e,["Language","language"],"",!0)),a=o||dU(hU(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),s=dU(hU(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),l=dU(hU(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=dU(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 os.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=fs(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:Ts(qa.FAIRPLAY,f,m,_),serverCertificatePath:h},[qa.WIDEVINE]:{serverProcessSPCPath:Ts(qa.WIDEVINE,f,m,_)},[qa.PLAYREADY]:{serverProcessSPCPath:Ts(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){os.error("generate drm config error:",d)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=eB.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}=lU(n),a=!(!r||!o),s=!!eB.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||s&&a,this.isPlayByToken&&(this.config=Object.assign({},uU,e),Object.prototype.hasOwnProperty.call(n,"definitionMap")&&(this.config.definitionMap=n.definitionMap),e.playAuthToken)){if(this.tokenInfo=ps(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=gs(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=ps(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(vs(this.tokenInfo)){os.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:RA.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:cU(hR.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(vs(this.keyTokenInfo)){os.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:RA.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:cU(hR.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(vs(this.thirdPartyDrmAuthTokenInfo)){os.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:RA.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:cU(hR.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 yU extends zN{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({},yU.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 zN{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 mU extends zN{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,n,r;if(fA.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=fA.getStrategyRecommendations(void 0,s),{result:c}=l;os.log("VodLogCommon Final StrategyConfig:",c);const u=null==c?void 0:c[lA.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 _U={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=[gU,yU,vU,mU,...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){os.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){os.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 o of Object.keys(t))if(t[o]&&t[o].beforePlayerCreate)try{const e=()=>js(t[o].beforePlayerCreate());(null==i?void 0:i.measureAsync)?n.push(i.measureAsync(`beforePlayerCreate.${o}`,e)):n.push(e())}catch(r){throw n.push(js(null)),r}return new Promise(((e,t)=>{Promise.all([...n]).then((()=>{e(null)})).catch((i=>{os.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 n of Object.keys(t))if(t[n]&&t[n].beforePlayerCreate)try{t[n].afterPlayerCreate()}catch(i){throw i}},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}}},EU={[uR.NETWORK]:"Network error",[uR.NETWORK_TIMEOUT]:"Network timeout",[uR.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[uR.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[uR.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[uR.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[uR.NETWORK_URL_EXPIRE]:"The video URL has expired",[uR.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[uR.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[uR.MEDIA_ERR]:"Media error",[uR.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[uR.MEDIA_ERR_NETWORK]:"Network error",[uR.MEDIA_ERR_DECODE]:"Decoding error",[uR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[uR.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[uR.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[uR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[uR.MEDIA_ERR_PLAY_ERR]:"Video playback error",[uR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[uR.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[uR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[uR.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[uR.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[uR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[uR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[uR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[uR.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[uR.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[uR.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[uR.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[uR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[uR.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[uR.OTHER]:"Other error",[uR.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[uR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[uR.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[uR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[uR.GET_PLAY_INFO_ERR]:"Failed to get media information",[uR.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[uR.LICENSE_VALIDATE_FAIL]:"License validation failed",[uR.DEFINITION_AUTO]:"Auto",[uR.LICENSE_STATUS_INVALID]:"License validation is invalid",[uR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[uR.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[uR.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[uR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[uR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[uR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[uR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[uR.DRAMA_INVALID_PARAM]:"Invalid parameter",[uR.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[uR.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[uR.DRAMA_UNDER_REVIEW]:"Episode is under review",[uR.DRAMA_FAILED_REVIEW]:"Episode failed review",[uR.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[uR.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[uR.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[uR.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[uR.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},TU={[uR.NETWORK]:"网络错误",[uR.NETWORK_TIMEOUT]:"网络超时",[uR.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[uR.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[uR.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[uR.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[uR.NETWORK_URL_EXPIRE]:"视频地址已过期",[uR.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[uR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[uR.MEDIA_ERR]:"播放错误",[uR.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[uR.MEDIA_ERR_NETWORK]:"网络错误",[uR.MEDIA_ERR_DECODE]:"解码错误",[uR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[uR.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[uR.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[uR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[uR.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[uR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[uR.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[uR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[uR.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[uR.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[uR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[uR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[uR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[uR.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[uR.BUSINESS_DRM_KEY_ERROR]:"解密错误",[uR.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[uR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[uR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[uR.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[uR.OTHER]:"其他错误",[uR.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[uR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[uR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[uR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[uR.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[uR.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[uR.LICENSE_VALIDATE_FAIL]:"license 校验失败",[uR.DEFINITION_AUTO]:"自动",[uR.LICENSE_STATUS_INVALID]:"license 校验无效",[uR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[uR.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[uR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[uR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[uR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[uR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[uR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[uR.DRAMA_INVALID_PARAM]:"参数错误",[uR.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[uR.DRAMA_NOT_SUBMITTED]:"剧集未送审",[uR.DRAMA_UNDER_REVIEW]:"剧集审核中",[uR.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[uR.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[uR.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[uR.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[uR.DRAMA_NOT_ON_SHELF]:"视频未上架",[uR.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},bU={[uR.NETWORK]:"ネットワークエラー",[uR.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[uR.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[uR.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[uR.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[uR.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[uR.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[uR.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[uR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[uR.MEDIA_ERR]:"再生エラー",[uR.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[uR.MEDIA_ERR_NETWORK]:"ネットワークエラー",[uR.MEDIA_ERR_DECODE]:"デコードエラー",[uR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[uR.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[uR.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[uR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[uR.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[uR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[uR.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[uR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[uR.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[uR.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[uR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[uR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[uR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[uR.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[uR.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[uR.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[uR.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[uR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[uR.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[uR.OTHER]:"その他のエラー",[uR.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[uR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[uR.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[uR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[uR.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[uR.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[uR.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[uR.DEFINITION_AUTO]:"自動",[uR.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[uR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[uR.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[uR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[uR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[uR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[uR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[uR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[uR.DRAMA_INVALID_PARAM]:"パラメータが無効です",[uR.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[uR.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[uR.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[uR.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[uR.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[uR.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[uR.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[uR.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[uR.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},SU=[{LANG:"en",TEXT:EU},{LANG:"zh",TEXT:TU},{LANG:"zh-hk",TEXT:{[uR.NETWORK]:"網路錯誤",[uR.NETWORK_TIMEOUT]:"網路逾時",[uR.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[uR.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[uR.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[uR.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[uR.NETWORK_URL_EXPIRE]:"視頻地址已過期",[uR.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[uR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[uR.MEDIA_ERR]:"播放錯誤",[uR.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[uR.MEDIA_ERR_NETWORK]:"網路錯誤",[uR.MEDIA_ERR_DECODE]:"解碼錯誤",[uR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[uR.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[uR.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[uR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[uR.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[uR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[uR.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[uR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[uR.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[uR.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[uR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[uR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[uR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[uR.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[uR.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[uR.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[uR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[uR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[uR.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[uR.OTHER]:"其他錯誤",[uR.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[uR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[uR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[uR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[uR.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[uR.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[uR.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[uR.DEFINITION_AUTO]:"自動",[uR.LICENSE_STATUS_INVALID]:"license 校驗無效",[uR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[uR.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[uR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[uR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[uR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[uR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[uR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[uR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[uR.DRAMA_INVALID_PARAM]:"參數錯誤",[uR.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[uR.DRAMA_NOT_SUBMITTED]:"劇集未送審",[uR.DRAMA_UNDER_REVIEW]:"劇集審核中",[uR.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[uR.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[uR.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[uR.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[uR.DRAMA_NOT_ON_SHELF]:"影片未上架",[uR.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"}},{LANG:"jp",TEXT:bU}];class CU{}CU.isSupported=()=>!1,CU.isSupportedH264=e=>!1;const kU="ignoreServicePreloadConfigEnable";const IU=["live","rtm","music","danmu","ad"],PU=["configs","options","defaultConfig","current"],DU=["url","src","playUrl","playURL"],wU=["plugins","sdkPlugins","strategiesPlugins","presets"];class AU extends Error{constructor(e){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"}("BYTEPLUS")}。`),this.code="VEPLAYER_LITE_UNSUPPORTED_FEATURE",this.name="VePlayerLiteUnsupportedFeatureError",this.feature=e,Object.setPrototypeOf(this,AU.prototype)}}class RU extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,RU.prototype)}}function xU(e){return"object"==typeof e&&null!==e||"function"==typeof e}function OU(e,t){if(xU(e))try{return e[t]}catch(i){return}}function LU(e){try{return Array.isArray(e)}catch(t){return!1}}function NU(e){if(!LU(e))return[];const t=OU(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(OU(e,String(n)));return i}function MU(e){return null!=e&&!1!==e}function UU(e){return"string"==typeof e?e.toLowerCase():""}function BU(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function FU(e){return DU.some((t=>function(e){const t=[e],i=new WeakSet;for(let n=0;n<t.length;n+=1){const e=t[n];if(BU(e))return!0;if(xU(e)&&!i.has(e))if(i.add(e),LU(e))for(const i of NU(e))t.push(i);else for(const i of DU)t.push(OU(e,i))}return!1}(OU(e,t))))}function HU(e){if("string"==typeof e)return[e];if(!xU(e))return[];const t=[],i=OU(e,"pluginName"),n=OU(e,"name");return"string"==typeof i&&t.push(i),"string"==typeof n&&t.push(n),t}function jU(e,t){return wU.some((i=>NU(OU(e,i)).some((e=>function(e){const t=HU(e);return t.push(...HU(OU(e,"plugin"))),t.push(...HU(OU(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 VU(e,t){switch(t){case"live":return!0===OU(e,"isLive")||"live"===UU(OU(e,"type"))||MU(OU(e,"TimeShiftPlugin"))||MU(OU(e,"LiveInfoPanel"))||MU(OU(e,"LiveSubtitlesPlugin"))||MU(OU(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===UU(OU(e,"streamType"))||MU(OU(e,"rtm"))||FU(e);case"music":return!0===OU(e,"isMusic")||MU(OU(e,"music"));case"danmu":{const t=OU(e,"getVideoByToken");return MU(OU(e,"DanmuPlugin"))||!0===OU(e,"needBarrageMask")||!0===OU(t,"needBarrageMask")}case"ad":return MU(OU(e,"AdsPlugin"))||MU(OU(e,"AdPlugin"))}}function KU(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(xU(e)&&!n.has(e)){n.add(e),t.push(e);for(const t of PU)i.push(OU(e,t));for(const t of NU(OU(e,"playList")))i.push(t)}}return t}(e);for(const i of IU)if(t.some((e=>VU(e,i)||jU(e,i))))throw new AU(i)}const WU=()=>Mr.generateSessionId(),GU=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0?e:0,YU=e=>c({},e),zU=(e,t)=>t.lastEnteredPlayingAt-e.lastEnteredPlayingAt||t.sequence-e.sequence,$U=(e,t)=>t.lastPlaybackAt-e.lastPlaybackAt||t.sequence-e.sequence,XU=(e,t)=>t.createdAt-e.createdAt||t.sequence-e.sequence,qU=(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 ZU=new class{constructor(e=Date.now,t=WU){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:qU(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,YU(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||$U(n,this.historical)<0)&&(this.historical=n)}query(e){const t=[];for(const a of this.sessions.values()){if((a.pendingIdentity||a.pendingPlaybackSessionId||a.useStableSnapshot)&&a.lastStableSnapshot){t.push(this.rank(a,YU(a.lastStableSnapshot)));continue}const i=e.find((e=>e===a.core&&e.sdk===a.vePlayer));try{const e=this.snapshotSession(a,null!=i?i:null);a.lastStableSnapshot=YU(e.snapshot),t.push(e)}catch(o){a.lastStableSnapshot&&t.push(this.rank(a,YU(a.lastStableSnapshot)))}}const i=t.filter((e=>"playing"===e.state||"buffering"===e.state)).sort(zU)[0];if(i)return YU(i.snapshot);const n=t.filter((e=>e.hasEverPlayed)).concat(this.historical?[this.historical]:[]).sort($U)[0];if(n)return YU(n.snapshot);const r=t.sort(XU)[0];return r?YU(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,qU(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:GU(t.duration),currentTime:GU(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=Ka);const QU=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;ZU.beginCoreCreate(this,e);try{const i=yield this._createPlayer(e,t);return this._isStaleLifecycleGeneration(t)?void this._discardStalePlayer(i):i}catch(KB){throw ZU.failCoreCreate(this,e),KB}})),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 xs,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();KU(this.playerData);const{options:p,plugins:g,isMobile:y,openSoftDecoding:v,configs:m,strategiesPlugins:_,strategiesPluginConfigs:E}=this.playerData,T=!1,b=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),S=this.playerData.getCurrentStreamType()||ys(null==m?void 0:m.getVideoByToken);Ks(m,"EncryptHlsPlugin")||b&&S||this.playerData.isOpenABR()||(os.warn(`url is empty or streamType is empty (url:${b}, streamType: ${S})`),this.renderPoster());const C=()=>d(this,null,(function*(){const e=el(b);return yield this.getSoftDecodingOption(v,e,S)})),k=yield f.measureAsync("createSDKPreset",(()=>d(this,null,(function*(){return yield gN({isLive:T,isMobile:y,streamType:S,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({},wN),i=c({},e?AN:RN);return c(c({},t),i)}(T):function(e=!1){const t=c({},kN),i=c({},e?IN:PN);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=Mr.deepMerge(w,p),U=u(c(u(c(c(c({},{errorKey:ER}),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,KN,UN,YN]}}),E),{playerData:this.playerData});this.playerData.getLineList().length>1&&U.MoreButtonPlugin.iconPlugins.push(HN),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=QU.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&&(console.log("data-tt-sign: ",e),H["data-tt-sign"]=e)}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();this._emitter.emit(RA.READY_CREATE_PLAYER);let V,K={};if(QU.shouldCheckLicense()){const e=yield QU.checkLicenseStatus();e!==EA.LICENSE_STATUS_OK&&e!==EA.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 Ka(u(c(c({el:this.playerContainer,presets:I,url:b,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,ZU.attachCore(this,V,e);const W=f.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=W,this.emit(RA.CREATE_PLAYER_PERF,W),os.log("createPlayer perf: ",W),this._emitter.emit(RA.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),V})),this._onMp4PreloadInfo=e=>{this.emit(xA.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(NA.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:n,mediaError:r}=e||{};if(Mr.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=el(this.playerData.getCurrentUrl());t&&ws(t,{range:"0-8",timeout:2e3}).then((t=>{os.log("xhr result",t);const{status:i,response:n}=t;403===i&&"string"==typeof n&&n.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{os.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(RA.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(RA.AUDIO_TRACK_CHANGE,{id:n,audioTrack:t});break}}},function(e){if(!e)throw new RU}(Boolean(QU.ttDramaEnv)),this.assertLiteConfig(e),ZU.register(this,lU(e)),this._init(e)}static getPlayerPlaybackState(){var e,t,i;const n=null!=(i=null==(t=null==(e=Ka.instManager)?void 0:e.findAll)?void 0:t.call(e,(e=>!!(null==e?void 0:e.sdk)&&ZU.has(e.sdk))))?i:[];return ZU.query(n)}static registerModules(e){aA.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){!function(e=!0){CM=!!e}(e)}static getAppendVideoUrlTimestamp(){return CM}static setTTDramaEnv(e){var t;os.log("TTDramaEnv: ",e);QU.ttDramaEnv=u(c({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){!function(e){e?("boolean"==typeof e.enable&&(JN.enable=e.enable),e.cacheType&&(JN.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?JN.expireTime=e.expireTime:void 0!==e.expireTime&&tM("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:JN.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?JN.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&tM("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:JN.maxEntries}),tM("config updated",nM())):tM("config skip empty config",{currentConfig:nM()})}(e)}static getMediaInfoCacheConfig(){return nM()}static clearMediaInfoCache(){rM()}static setDebug(e){!function(e){os.config.debug=e?3:1}(e)}static setCollector(e){Os=e}static shouldCheckLicense(){return!1}static prepare(e){return d(this,null,(function*(){let t=e;const i=Boolean(QU.ttDramaEnv);!(null==t?void 0:t.appId)&&i&&(t=u(c({},t),{appId:yR}));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&&os.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),{[kU]:!0,config:u(c({},null!=(i=null==o?void 0:o.config)?i:{}),{[kU]:!0})})})})}(u(c({},t),{serviceConfigMode:r}));if(QU.shouldCheckLicense())try{QU.hasInitVeStrategy=!0;const e=yield QU.checkLicenseStatus(),t=yield QU.checkLicense();if(e===EA.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===vA.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(KB){return void os.error(KB.message)}else QU.hasInitVeStrategy=!0;yield fA.init(o)}))}static setPreloadScene(e,t){return fA.setPreloadScene(e,t)}static get preloader(){return fA.preloader}static get preloaderStatus(){return fA.preloaderStatus}static addPreloadList(e){return nU(e,QU.ttDramaEnv).then((e=>((null==e?void 0:e.length)||os.warn("[addPreloadList] resolved preloadList is empty"),fA.addPreloadList(e))))}static setPreloadList(e){return nU(e,QU.ttDramaEnv).then((e=>((null==e?void 0:e.length)||os.warn("[setPreloadList] resolved preloadList is empty"),os.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),fA.setPreloadList(e))))}static setLicenseConfig(e){return TA.setLicenseConfig(e)}static checkLicense(){return TA.checkLicense()}static checkModuleList(){return TA.checkModuleList()}static checkLicenseStatus(){return TA.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return TA.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return d(this,null,(function*(){try{const i={hls:Uw.HLSEncrypt,mp4:Uw.MP4Encrypt,dash:Uw.DASH};if(!t||!i[t])return void os.warn("param of streamType is invalid");const n=(new Date).getTime().toString(),r="mp4"===t?yield Hw.loadMp4Encrypt(sA):yield sA.loadPlugins(i[t]);return null==r?void 0:r.generateEncryptInfo(e,n)}catch(i){os.error("generate encrypt info error: ",i)}}))}assertLiteConfig(e){KU(e)}_init(e,t){return d(this,null,(function*(){var i;if(QU.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new Ar,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const n=QU.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield QU.checkModuleList():Object.values(_A);this.playerData=ur.observe(new bA(u(c({},e),{licensSupportModuleList:n}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(RA.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 os.error("createPlayer error:",e),void this.emit(NA.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(){_U.init(this);[...this.sdkPlugins].map((e=>_U.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new Ms,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(xA.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new aA,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=Ks(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=QU.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==n?void 0:n.line_app_id)){const e={errorType:"log",errorCode:hR.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(RA.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=$a,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-rc.9",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,os.warn("media is expired, ",n),this.emit(NA.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,os.warn("media is expired, ",n),this.emit(NA.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()||ys(null==n?void 0:n.getVideoByToken))&&i&&!!(null==(e=Ks(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 QU.checkLicense(),y=yield QU.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:y,licenseType:g},y===EA.LICENSE_STATUS_EXPIRED)TA.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(RA.LICENSE_STATUS_WARNING,dR.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(n=null==(i=this.playerData.configs)?void 0:i.adaptRange)?void 0:n.enable)&&this.emit(RA.LICENSE_STATUS_WARNING,dR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===QU.hasInitVeStrategy&&this.emit(RA.LICENSE_STATUS_WARNING,dR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(y!==EA.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:fR.license},y===EA.LICENSE_STATUS_INVALID?{errorCode:hR.LICENSE_STATUS_INVALID.code,errorMessage:hR.LICENSE_STATUS_INVALID.message}:{errorCode:hR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:hR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else g===vA.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(d=null==(h=this._originConfigs)?void 0:h.autoBitrateOpts)?void 0:d.enable)&&this.emit(RA.LICENSE_STATUS_WARNING,dR.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(p=null==(f=this.playerData.configs)?void 0:f.adaptRange)?void 0:p.enable)&&this.emit(RA.LICENSE_STATUS_WARNING,dR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===QU.hasInitVeStrategy&&this.emit(RA.LICENSE_STATUS_WARNING,dR.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()||ys(null==s?void 0:s.getVideoByToken),g=Ks(s,"EncryptHlsPlugin"),y=Ks(e,"EncryptHlsPlugin"),v=Ks(s,"Mp4EncryptPlayer"),m=Ks(e,"Mp4EncryptPlayer"),_=Ks(s,"DASHPlugin"),E=Ks(e,"DASHPlugin"),T=Ks(s,"vodLogOpts"),b=(null==(t=QU.ttDramaEnv)?void 0:t.clientKey)?{appVersion:QU.ttDramaEnv.appVersion,clientKey:QU.ttDramaEnv.clientKey,line_app_id:yR,line_user_id:Is(QU.ttDramaEnv.clientKey)}:{},S=!!(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||!Zs||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||b.clientKey){os.log("codec",this.playerData.codec);const t=Qs(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:S?1:0,playerVersion:"1.18.0-rc.9",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}),b),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(Uw.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(i){os.warn("detect codec error: ",i)}}))}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()||ys(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=ON(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 _U.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>d(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([_U.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){os.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 fA.prepare()){const{plugins:e,pluginConfiguration:t}=fA.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(fA.isReady()){const e=fA.getStrategyRecommendations(),{result:t}=e;if(os.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[lA.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[lA.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})),os.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;QU.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),_U.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=QU.ttDramaEnv)?void 0:e.clientKey};this.veErrorIns=new PR(this.player,i)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(NA.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-rc.9",this.player.vtype=this.getVtype())}getVtype(){var e,t,i;const n=this.getStreamType()||ys(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),r=Mr.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 LN({config:null!=(t=i.panel)?t:{mode:n?Ya.INNER:Ya.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_onPlayerRebuild(){if(!this._publicPlayNextOperation&&!ZU.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(RA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.once(NA.READY,this._emitDelayError.bind(this)),this.player.once(NA.READY,this._emitDelayEvent.bind(this)),this.player.on(NA.ERROR,this._onError),this.player.on(ER,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(xA.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=js(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&&Vr.isWeixin&&Vr.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=js(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(Wo).filter((e=>e!==Zr)),t=[...Object.values(xA),...Object.values(RA),...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(RA.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(RA.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(KA(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 WA(e,a)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(RA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.off(NA.ERROR,this._onError),this.player.off(ER,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(xA.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=Mr.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?Mr.show(r,"block"):Mr.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&&ZU.commitIdentitySwitch(this,i)})).catch((e=>{throw i&&ZU.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((()=>{})))):(os.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))):(os.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(Ia.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)};_(NA.ERROR,(e=>r(e))),_(NA.CANPLAY,(()=>{l&&i.pause(),n(!0)})),v(NA.EMPTIED,(()=>{!f&&t&&(f=ZU.armIdentitySwitch(this,t,i))}));try{if(i.plugins.dashplugin){const e=c(c({},Ks(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(KB){m((()=>r(KB)))}}))}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(NA.CANPLAY,(()=>{this.player.pause()})),e()};Vr.os.isAndroid?this.once(NA.TIME_UPDATE,(()=>{n()})):this.once(NA.CANPLAY,(()=>{n()})),this.player.play()}))}next(e,t=!0){try{this.assertLiteConfig(e)}catch(i){return Promise.reject(i)}return this._publicPlayNextOperation||ZU.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=ys(null==e?void 0:e.getVideoByToken)||nr.MP4);const l=ZU.beginIdentitySwitch(this,lU(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(ZU.rollbackIdentitySwitch(this,l),this._isDestroyedPlaybackSwitchError(e))throw e;if(os.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||ZU.hasActiveIdentitySwitch(this))return Promise.reject(this._createPlayNextInProgressError());const i={};this._publicPlayNextOperation=i;const n=this.player;try{n.emit(xA.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=ZU.beginIdentitySwitch(this,lU(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&&ZU.rollbackIdentitySwitch(this,o),r=Promise.reject(s)}const a=r.catch((e=>{throw o&&ZU.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(xA.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(KB){a((()=>i(KB)))}}))}_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=Ks(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({},Ks(this.playerData.options,"Subtitle")||{}),Ks(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===NA.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(NA.ERROR,(e=>{d((()=>t(e)))})),u(NA.CANPLAY,(()=>{d((()=>{6===o&&h?r.pause():6!==o&&r.config.autoplay&&r.play(),e(void 0)}))}));const f=()=>{n||(n=!i||ZU.armIdentitySwitch(this,i,r))};c.push([NA.EMPTIED,f]),r.once(NA.EMPTIED,f);try{r.playNext(s)}catch(p){d((()=>t(p)))}}))}if(QU.ttDramaEnv){if(null==(n=e.getVideoByToken)?void 0:n.playAuthToken){if((this.playerData.getCurrentStreamType()||ys(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||ys(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()||ys(null==(o=this.playerData.configs)?void 0:o.getVideoByToken))!==(e.streamType||ys(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=pR.INVALID_PARAM;return{errorType:fR.network,errorCode:e.code,veError:PR.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){return lU(e).albumId||""}_getDramaEpisodeIdFromConfig(e){return lU(e).episodeId||""}switchDramaEpisode(e,t=!0,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken"),o=ZU.beginIdentitySwitch(this,lU(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((()=>{ZU.commitIdentitySwitch(this,o)})).catch((e=>{throw ZU.rollbackIdentitySwitch(this,o),e})):(ZU.rollbackIdentitySwitch(this,o),os.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=ps(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||Ks(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(a===tr.H265||c||(null==(n=null==s?void 0:s.autoBitrateOpts)?void 0:n.enable)));if(QU.shouldCheckLicense()&&(null==(r=this._originConfigs)?void 0:r.useSoftDecoding)&&!l)try{const e=yield QU.checkLicenseStatus();if(!(yield QU.checkLicenseModuleAuth(mA.SDK_VOD_PLAY,_A.H265)))throw this.emit(RA.LICENSE_STATUS_WARNING,e===EA.LICENSE_STATUS_EXPIRED?dR.EXPIRED_LICENSE_NOT_SUPPORT_265:dR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(KB){return void os.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(Uw.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 Hw.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(RA.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),os.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(QU.shouldCheckLicense()&&!l)try{const e=yield QU.checkLicenseStatus();if(!(yield QU.checkLicenseModuleAuth(mA.SDK_VOD_PLAY,_A.H265)))throw this.emit(RA.LICENSE_STATUS_WARNING,e===EA.LICENSE_STATUS_EXPIRED?dR.EXPIRED_LICENSE_NOT_SUPPORT_265:dR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(KB){return void os.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(Uw.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 Hw.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(RA.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),os.error("soft decode is not support by current browser")}}else{this.emit(RA.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),os.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()&&Vr.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 GA(r,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&WA(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=>{Oa.use(e)})),Oa.extend(SU),i&&Oa.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(),ZU.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,_U.destroy(this)}))}destroy(){return d(this,null,(function*(){yield this._teardown(!1)}))}};let JU=QU;JU.isMSESupported=zs,JU.veStrategy=fA,JU.sdkVersion="1.18.0-rc.9",JU.ttDramaEnv=null,JU.isMMSSupported=$s,JU.isRTMSupported=CU.isSupported,JU.hasInitVeStrategy=!1;const eB=JU;const tB="function"==typeof Buffer,iB=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),nB=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),rB=(e=>{let t={};return e.forEach(((e,i)=>t[e]=i)),t})(nB),oB=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,aB=String.fromCharCode.bind(String),sB=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),lB=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),cB=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+=nB[t>>18&63]+nB[t>>12&63]+nB[t>>6&63]+nB[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},uB="function"==typeof btoa?e=>btoa(e):tB?e=>Buffer.from(e,"binary").toString("base64"):cB,hB=tB?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;i<n;i+=4096)t.push(aB.apply(null,e.subarray(i,i+4096)));return uB(t.join(""))},dB=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?aB(192|t>>>6)+aB(128|63&t):aB(224|t>>>12&15)+aB(128|t>>>6&63)+aB(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return aB(240|t>>>18&7)+aB(128|t>>>12&63)+aB(128|t>>>6&63)+aB(128|63&t)},fB=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,pB=e=>e.replace(fB,dB),gB=tB?e=>Buffer.from(e,"utf8").toString("base64"):iB?e=>hB(iB.encode(e)):e=>uB(pB(e)),yB=(e,t=!1)=>t?sB(gB(e)):gB(e),vB=e=>{if(e=e.replace(/\s+/g,""),!oB.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=rB[e.charAt(o++)]<<18|rB[e.charAt(o++)]<<12|(i=rB[e.charAt(o++)])<<6|(n=rB[e.charAt(o++)]),r+=64===i?aB(t>>16&255):64===n?aB(t>>16&255,t>>8&255):aB(t>>16&255,t>>8&255,255&t);return r},mB=yB;var _B={};!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)},b=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function S(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?b(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=S(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)?"�":b(e)},d:C,yup:function(e){return(e=S(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}(_B);const EB="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",TB={SLOW:.5,MODERATE:1,FAST:2},bB={SLOW:5,MODERATE:3.5,FAST:2},SB={style:{node:EB,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function CB(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 kB{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=_B.inHTMLData(i),document.body.appendChild(r);const o=CB("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.offsetWidth+2,height:r.offsetHeight}),a=CB("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=_B.inHTMLData(i),document.body.removeChild(r),o.appendChild(a),"data:image/svg+xml;base64, "+mB((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=TB[this.config.tickerSpeed]||TB.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=bB[this.config.tickerSpeed]||bB.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=bB[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")!=SB.class[i]&&e.setAttribute("class",SB.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=SB.style[i]&&e.setAttribute("style",SB.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",EB);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 IB="xg-dynamic-watermark";function PB(){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 DB(){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:wB}=ba,AB="getMirror",RB="exitMirror";class xB extends ba{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=Mr.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=Mr.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:oO}}afterCreate(){this.once(Jr,this.showToast),this.on(eo,(()=>{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)):os.warn("the time got is invalid",t),e()})).catch((t=>{os.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(Xr,this.saveTime.bind(this)),this.on(Zr,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=Mr.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){Ss(e,xB.pluginName,t+"")}getTimeByStorage(e){return Cs(e,xB.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function OB(){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 LB{constructor(e){this.config=e.config,this.parent=e.root,this.root=Mr.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===Vr.device?"touchend":"click";this.modal=Mr.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?Mr.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=Mr.createDom("li",r,e,i),a=Mr.findDom(o,".bg"),s=null==OB?void 0:OB();!e.poster&&s&&a.appendChild(s),this.root.appendChild(o)}));const n=e.findIndex((e=>e.selected));if(n>=0){const t=Mr.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&&Mr.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Mr.addClass(t,"selected"),n&&Mr.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(){Mr.removeClass(this.modal,"hide"),Mr.addClass(this.modal,"active"),Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"active")}hide(){Mr.removeClass(this.modal,"active"),Mr.addClass(this.modal,"hide"),Mr.removeClass(this.root,"active"),Mr.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 NB(){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 MB(){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 UB="playListNext",BB="playListToggle",FB="mobile"===Vr.device;function HB(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 jB(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}bA.prototype.setVodPlayListConfig=function(e){if(!(e.plugins||[]).find((e=>e.pluginName===VB.pluginName)))return;const t=Ks(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=HB(i),o=jB(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 VB 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:HA,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=HB(t),this.timer=setTimeout((()=>{this.emit(xA.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=jB(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(eo,this._onTimeUpdate),this.on(Xr,this._onEnded),this.on([Ao,ko],(()=>{this._resizeList()})),this.once(io,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),FB&&this.on(uo,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),FB?(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{[UB]:{icon:NB,class:"xg-play-next-btn"},[BB]:{icon:MB,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[UB]),this.appendChild(".xg-play-list-btn",e[BB])}show(){!this.list||this.list.length<1||Mr.addClass(this.root,"show")}hide(){Mr.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=HB(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(xA.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(xA.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 LB(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>`}}return Object.assign(eB,{Events:NA,Event:LA,DefinitionDemotePlugin:class 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(to,this._waiting),this.on(qr,this._clearTime),this.on(zr,this._clearTime),this.on(Do,this._clearTime),this.on(xA.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(xA.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&&(os.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(xA.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void os.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&&(os.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(xA.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&os.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===La.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(xA.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){const e=t.url;os.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==n&&this.showToast(t)}else os.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((()=>{os.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(xA.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=Mr.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=Mr.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,os.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}},MirrorPlugin:class extends ba{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:wB.CONTROLS_RIGHT,index:BA,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{[AB]:{icon:PB,class:"xg-get-mirror"},[RB]:{icon:DB,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[AB]),t.appendChild(e[RB])}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(xA.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?RB:AB)}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[AB]}</div>\n </xg-icon>`}},MemoryPlay:xB,Subtitle:rO,DynamicWatermarkPlugin:class 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(eo,(()=>{this.start()})),this.on(Ao,(()=>{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 kB(u(c({},this.config),{root:this.root,rootClassName:IB}))}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=${IB} />\n `}},PlayListPlugin:VB,getI18N:function(){return Oa},BasePlugin:ca,Plugin:ba,Sniffer:Vr,Util:Mr,STATE_CLASS:Ia,I18N:Oa,STATES:La})}));
1
+ // @byteplus/veplayer@1.18.0 Built @9/1/2026, 4:36:00 PM
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VePlayerLite=t()}(this,(function(){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(t){r(t)}},a=e=>{try{s(i.throw(e))}catch(t){r(t)}},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}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,b=T.hasOwnProperty,S=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=b.call(e,C),i=e[C];try{e[C]=void 0;var n=!0}catch(o){}var r=S.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(t){}try{return e+""}catch(t){}}return""}var j=/^\[object .+?Constructor\]$/,V=Function.prototype,K=Object.prototype,W=V.toString,G=K.hasOwnProperty,Y=RegExp("^"+W.call(G).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(t){}}();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,pe=ue(function(){return arguments}())?ue:function(e){return ce(e)&&de.call(e,"callee")&&!fe.call(e,"callee")};const ge=pe;const ye=Array.isArray;var ve="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=ve&&"object"==typeof module&&module&&!module.nodeType&&module,_e=me&&me.exports===ve?_.Buffer:void 0;const Ee=(_e?_e.isBuffer:void 0)||function(){return!1};var Te=9007199254740991,be=/^(?:0|[1-9]\d*)$/;function Se(e,t){var i=typeof e;return!!(t=null==t?Te:t)&&("number"==i||"symbol"!=i&&be.test(e))&&e>-1&&e%1==0&&e<t}var Ce=9007199254740991;function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ce}var Ie={};function Pe(e){return function(t){return e(t)}}Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Arguments]"]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object Boolean]"]=Ie["[object DataView]"]=Ie["[object Date]"]=Ie["[object Error]"]=Ie["[object Function]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie["[object Object]"]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object WeakMap]"]=!1;var De="object"==typeof exports&&exports&&!exports.nodeType&&exports,we=De&&"object"==typeof module&&module&&!module.nodeType&&module,Ae=we&&we.exports===De&&v.process;const Re=function(){try{var e=we&&we.require&&we.require("util").types;return e||Ae&&Ae.binding&&Ae.binding("util")}catch(t){}}();var xe=Re&&Re.isTypedArray;const Oe=xe?Pe(xe):function(e){return ce(e)&&ke(e.length)&&!!Ie[w(e)]};var Le=Object.prototype.hasOwnProperty;function Ne(e,t){var i=ye(e),n=!i&&ge(e),r=!i&&!n&&Ee(e),o=!i&&!n&&!r&&Oe(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&&!Le.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 Me=Object.prototype;function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function Be(e,t){return function(i){return e(t(i))}}const Fe=Be(Object.keys,Object);var He=Object.prototype.hasOwnProperty;function je(e){return null!=e&&ke(e.length)&&!N(e)}function Ve(e){return je(e)?Ne(e):function(e){if(!Ue(e))return Fe(e);var t=[];for(var i in Object(e))He.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ke=Object.prototype.hasOwnProperty;function We(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=Ue(e),i=[];for(var n in e)("constructor"!=n||!t&&Ke.call(e,n))&&i.push(n);return i}function Ge(e){return je(e)?Ne(e,!0):We(e)}var Ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,ze=Ye&&"object"==typeof module&&module&&!module.nodeType&&module,$e=ze&&ze.exports===Ye?_.Buffer:void 0,Xe=$e?$e.allocUnsafe:void 0;function qe(e,t){if(t)return e.slice();var i=e.length,n=Xe?Xe(i):new e.constructor(i);return e.copy(n),n}function Ze(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 Je=Object.prototype.propertyIsEnumerable,et=Object.getOwnPropertySymbols;const tt=et?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}(et(e),(function(t){return Je.call(e,t)})))}:Qe;function it(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}const nt=Be(Object.getPrototypeOf,Object);const rt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)it(t,tt(e)),e=nt(e);return t}:Qe;function ot(e,t,i){var n=t(e);return ye(e)?n:it(n,i(e))}function at(e){return ot(e,Ve,tt)}function st(e){return ot(e,Ge,rt)}const lt=$(_,"DataView");const ct=$(_,"Promise");const ut=$(_,"Set");const ht=$(_,"WeakMap");var dt="[object Map]",ft="[object Promise]",pt="[object Set]",gt="[object WeakMap]",yt="[object DataView]",vt=H(lt),mt=H(X),_t=H(ct),Et=H(ut),Tt=H(ht),bt=w;(lt&&bt(new lt(new ArrayBuffer(1)))!=yt||X&&bt(new X)!=dt||ct&&bt(ct.resolve())!=ft||ut&&bt(new ut)!=pt||ht&&bt(new ht)!=gt)&&(bt=function(e){var t=w(e),i="[object Object]"==t?e.constructor:void 0,n=i?H(i):"";if(n)switch(n){case vt:return yt;case mt:return dt;case _t:return ft;case Et:return pt;case Tt:return gt}return t});const St=bt;var Ct=Object.prototype.hasOwnProperty;const kt=_.Uint8Array;function It(e){var t=new e.constructor(e.byteLength);return new kt(t).set(new kt(e)),t}var Pt=/\w*$/;var Dt=E?E.prototype:void 0,wt=Dt?Dt.valueOf:void 0;function At(e,t){var i=t?It(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var Rt="[object Boolean]",xt="[object Date]",Ot="[object Map]",Lt="[object Number]",Nt="[object RegExp]",Mt="[object Set]",Ut="[object String]",Bt="[object Symbol]",Ft="[object ArrayBuffer]",Ht="[object DataView]",jt="[object Float32Array]",Vt="[object Float64Array]",Kt="[object Int8Array]",Wt="[object Int16Array]",Gt="[object Int32Array]",Yt="[object Uint8Array]",zt="[object Uint8ClampedArray]",$t="[object Uint16Array]",Xt="[object Uint32Array]";function qt(e,t,i){var n,r,o,a=e.constructor;switch(t){case Ft:return It(e);case Rt:case xt:return new a(+e);case Ht:return function(e,t){var i=t?It(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case jt:case Vt:case Kt:case Wt:case Gt:case Yt:case zt:case $t:case Xt:return At(e,i);case Ot:return new a;case Lt:case Ut:return new a(e);case Nt:return(o=new(r=e).constructor(r.source,Pt.exec(r))).lastIndex=r.lastIndex,o;case Mt:return new a;case Bt:return n=e,wt?Object(wt.call(n)):{}}}var Zt=Object.create;const Qt=function(){function e(){}return function(t){if(!A(t))return{};if(Zt)return Zt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Jt(e){return"function"!=typeof e.constructor||Ue(e)?{}:Qt(nt(e))}var ei=Re&&Re.isMap;const ti=ei?Pe(ei):function(e){return ce(e)&&"[object Map]"==St(e)};var ii=Re&&Re.isSet;const ni=ii?Pe(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=ye(e);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&Ct.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return Ze(e,a)}else{var h=St(e),d=h==li||h==ci;if(Ee(e))return qe(e,s);if(h==ui||h==si||d&&!r){if(a=l||d?{}:Jt(e),!s)return l?function(e,t){return le(e,rt(e),t)}(e,function(e,t){return e&&le(t,Ge(t),e)}(a,e)):function(e,t){return le(e,tt(e),t)}(e,function(e,t){return e&&le(t,Ve(t),e)}(a,e))}else{if(!hi[h])return r?e:{};a=qt(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?st:at:l?Ge:Ve)(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;var fi;function pi(e){return di(e,5)}function gi(e,t,i){(void 0!==i&&!f(e[t],i)||void 0===i&&!(t in e))&&oe(e,t,i)}const yi=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),a=o.length;a--;){var s=o[fi?a:++n];if(!1===t(r[s],s,r))break}return e};var vi="[object Object]",mi=Function.prototype,_i=Object.prototype,Ei=mi.toString,Ti=_i.hasOwnProperty,bi=Ei.call(Object);function Si(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Ci(e,t,i,n,r,o,a){var s=Si(e,i),l=Si(t,i),c=a.get(l);if(c)gi(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=ye(l),p=!f&&Ee(l),g=!f&&!p&&Oe(l);h=l,f||p||g?ye(s)?h=s:ce(u=s)&&je(u)?h=Ze(s):p?(d=!1,h=qe(l,!0)):g?(d=!1,h=At(l,!0)):h=[]:function(e){if(!ce(e)||w(e)!=vi)return!1;var t=nt(e);if(null===t)return!0;var i=Ti.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Ei.call(i)==bi}(l)||ge(l)?(h=s,ge(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)),gi(e,i,h)}}function ki(e,t,i,n,r){e!==t&&yi(t,(function(o,a){if(r||(r=new ie),A(o))Ci(e,t,a,i,ki,n,r);else{var s=n?n(Si(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),gi(e,a,s)}}),Ge)}function Ii(e){return e}var Pi=Math.max;var Di=re?function(e,t){return re(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ii;const wi=Di;var Ai=Date.now;var Ri,xi,Oi,Li=(Ri=wi,xi=0,Oi=0,function(){var e=Ai(),t=16-(e-Oi);if(Oi=e,t>0){if(++xi>=800)return arguments[0]}else xi=0;return Ri.apply(void 0,arguments)});const Ni=Li;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),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,Ii),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?je(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){ki(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 Wi(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 Gi(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=ye(e),s=ye(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&&Ee(e)){if(!Ee(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new ie),a||Oe(e)?Wi(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 kt(e),new kt(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=Gi;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=Wi(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=at(e),l=s.length;if(l!=at(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 bn(e){var t=function(e){for(var t=Ve(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 Sn="[object Symbol]";function Cn(e){return"symbol"==typeof e||ce(e)&&w(e)==Sn}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;function Pn(e,t){if(ye(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(ye(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 ye(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 Wn(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)&&ke(r)&&Se(a,r)&&(ye(e)||ge(e))}(e,t,Kn)}var Gn=1,Yn=2;function zn(e){return Pn(e)?(t=Hn(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return jn(t,e)}}(e);var t}function $n(e){return"function"==typeof e?e:null==e?Ii:"object"==typeof e?ye(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?Wn(e,t):vn(i,n,Gn|Yn)}):bn(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=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,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="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lr=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 cr=sr(lr)();const ur=new class{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new cr(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 hr(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 dr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(i),!0).forEach((function(t){vr(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):hr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function fr(e){return(fr="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 pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(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,Pr(n.key),n)}}function yr(e,t,i){return t&&gr(e.prototype,t),i&&gr(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function vr(e,t,i){return(t=Pr(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function mr(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&&Er(e,t)}function _r(e){return(_r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Er(e,t){return(Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Tr(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 Tr(e)}function Sr(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(e){return!1}}();return function(){var i,n=_r(e);if(t){var r=_r(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return br(this,i)}}function Cr(){return Cr="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=_r(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}},Cr.apply(this,arguments)}function kr(e){return function(e){if(Array.isArray(e))return Ir(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 Ir(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 Ir(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 Ir(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 Pr(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,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}(Dr);var wr=Dr.exports;const Ar=sr(wr);var Rr="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,xr={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Or="%c[xgplayer]",Lr={config:{debug:Rr?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,[Or,xr.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,[Or,xr.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,[Or,xr.error,e].concat(r))}}};var Nr=function(){function e(t){pr(this,e),this.bufferedList=t}return yr(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}(),Mr={};function Ur(e){var t=fr(e);return null!==e&&("object"===t||"function"===t)}function Br(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,Ur(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},_}Mr.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},Mr.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&&Mr.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return Lr.logError("util.createDomFromHtml",o),null}},Mr.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(n){var i=e.className&&"object"===fr(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Mr.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(i){Mr.hasClass(e,t)||(e.className&&"object"===fr(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Mr.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(i){Mr.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===fr(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},Mr.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Mr.hasClass(e,t)?Mr.removeClass(e,t):Mr.addClass(e,t)}))},Mr.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===Mr.typeOf(e[i])?t.push(e[i]):"Object"===Mr.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(" ")},Mr.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(n){Lr.logError("util.findDom",n),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},Mr.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Mr.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},Mr.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Mr.padStart(Math.floor(e/3600),2,0),i=Mr.padStart(Math.floor((e-3600*t)/60),2,0),n=Mr.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},Mr.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},Mr.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Mr.deepCopy=function(e,t){if("Object"===Mr.typeOf(t)&&"Object"===Mr.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==Mr.typeOf(t[i])||t[i]instanceof Node?"Array"===Mr.typeOf(t[i])?e[i]="Array"===Mr.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]:Mr.deepCopy(e[i],t[i])})),e},Mr.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===Mr.typeOf(t[i])&&"Array"===Mr.typeOf(e[i])?"Array"===Mr.typeOf(e[i])&&(n=e[i]).push.apply(n,kr(t[i])):Mr.typeOf(e[i])!==Mr.typeOf(t[i])||null===e[i]||"Object"!==Mr.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):Mr.deepMerge(e[i],t[i])})),e},Mr.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},Mr.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""},Mr.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},Mr.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Mr.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),Mr.clearTimeout(e,n)}),i);return e._timers.push(n),n},Mr.clearTimeout=function(e,t){var i=e._timers;if("Array"===Mr.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},Mr.clearAllTimers=function(e){var t=e._timers;"Array"===Mr.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Mr.createImgBtn=function(e,t,i,n){var r,o,a,s=Mr.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},Mr.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)"},Mr.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Mr.checkIsFunction=function(e){return e&&"function"==typeof e},Mr.checkIsObject=function(e){return null!==e&&"object"===fr(e)},Mr.hide=function(e){e.style.display="none"},Mr.show=function(e,t){e.style.display=t||"block"},Mr.isUndefined=function(e){if(null==e)return!0},Mr.isNotNull=function(e){return!(null==e)},Mr.setStyleFromCsstext=function(e,t){t&&("String"===Mr.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]})))},Mr.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},Mr.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},Mr.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}},Mr.stopPropagation=function(e){e&&e.stopPropagation()},Mr.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Mr.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Mr.checkTouchSupport=function(){return"ontouchstart"in window},Mr.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 Nr(r)},Mr.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}},Mr.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Mr.getHostFromUrl=function(e){if("String"!==Mr.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},Mr.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Mr.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Mr.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Mr.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(i){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)}))},Mr.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Mr.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},Mr.createPositionBar=function(e,t){var i=Mr.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},Mr.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},Mr.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Mr.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},Mr.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:Mr.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},Mr.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 Fr=/(Android)\s([\d.]+)/,Hr=/(Version)\/([\d.]+)/,jr=["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"],Vr={get device(){return Vr.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)?Hr:Fr)?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&&jr.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(a){return Promise.resolve(t)}}},Kr="3.0.23-rc.3",Wr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},Gr={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Yr=yr((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};pr(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;Gr[f]&&(f=Gr[f]);var p={playerVersion:Kr,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:Mr.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:Kr,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}})),zr="play",$r="playing",Xr="ended",qr="pause",Zr="error",Qr="seeking",Jr="seeked",eo="timeupdate",to="waiting",io="canplay",no="durationchange",ro="volumechange",oo="loadeddata",ao="ratechange",so="progress",lo="loadstart",co="emptied",uo="focus",ho="blur",fo="ready",po="urlNull",go="autoplay_started",yo="autoplay_was_prevented",vo="complete",mo="replay",_o="destroy",Eo="urlchange",To="download_speed_change",bo="leaveplayer",So="enterplayer",Co="loading",ko="fullscreen_change",Io="cssFullscreen_change",Po="mini_state_change",Do="definition_change",wo="after_definition_change",Ao="video_resize",Ro="pip_change",xo="rotate",Oo="screenShot",Lo="playnext",No="shortcut",Mo="xglog",Uo="user_action",Bo="reset",Fo="source_error",Ho="source_success",jo=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],Vo={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Ko="fps_stuck";const Wo=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:wo,AUTOPLAY_PREVENTED:yo,AUTOPLAY_STARTED:go,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:io,CANPLAY_THROUGH:"canplaythrough",COMPLETE:vo,CSS_FULLSCREEN_CHANGE:Io,DEFINITION_CHANGE:Do,DESTROY:_o,DOWNLOAD_SPEED_CHANGE:To,DURATION_CHANGE:no,EMPTIED:co,ENDED:Xr,ENTER_PLAYER:So,ERROR:Zr,FPS_STUCK:Ko,FULLSCREEN_CHANGE:ko,LEAVE_PLAYER:bo,LOADED_DATA:oo,LOADED_METADATA:"loadedmetadata",LOADING:Co,LOAD_START:lo,MINI_STATE_CHANGE:Po,PAUSE:qr,PIP_CHANGE:Ro,PLAY:zr,PLAYER_BLUR:ho,PLAYER_FOCUS:uo,PLAYING:$r,PLAYNEXT:Lo,PROGRESS:so,RATE_CHANGE:ao,READY:fo,REPLAY:mo,RESET:Bo,RETRY:"retry",ROTATE:xo,SCREEN_SHOT:Oo,SEEKED:Jr,SEEKING:Qr,SEI_PARSED:"SEI_PARSED",SHORTCUT:No,SOURCE_ERROR:Fo,SOURCE_SUCCESS:Ho,STALLED:"stalled",STATS_EVENTS:Vo,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:eo,URL_CHANGE:Eo,URL_NULL:po,USER_ACTION:Uo,VIDEO_EVENTS:jo,VIDEO_RESIZE:Ao,VOLUME_CHANGE:ro,WAITING:to,XGLOG:Mo},Symbol.toStringTag,{value:"Module"}));function Go(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var Yo=function(e){mr(i,e);var t=Sr(i);function i(e){var n;pr(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 Vr.isWeixin&&Vr.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):Mr.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===Mr.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 yr(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=jo.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]),vr({},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:Mr.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=Go.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw Go.call(t,e,r),s}}else Go.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(Mr.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(Ho,{src:e.target.currentSrc,host:Mr.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(Fo,new Yr(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 Yr(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?Mr.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(Eo,e),this.emit(to),this._currentTime=0,this._duration=0,Mr.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===Mr.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=Cr(_r(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=Cr(_r(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=Cr(_r(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=Cr(_r(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){Cr(_r(i.prototype),"removeAllListeners",this).call(this)}}]),i}(Ar),zo=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"}};pr(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return yr(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}(),$o=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Xo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],qo=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Zo="data-xgplayerid";function Qo(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 Jo(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(s){throw s.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(s.message),s}if(this.__hooks&&this.__hooks[e])try{var a=sa.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&Qo.apply(void 0,[r,t,i.next].concat(kr(n)))})).catch((function(e){throw e})):Qo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&Qo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(s){throw s.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(s.message),s}else Qo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function ea(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 ta(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===ea.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function ia(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var n=i[e],r=ea.call(this,e,t);-1!==r&&n.splice(r,1)}else i[e]&&(i[e]=null)}function na(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 ra(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 oa(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 aa(e){e.__hooks=null}function sa(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 la(e,t){Lr.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var ca=function(){function e(t){pr(this,e),Mr.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),oa(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return yr(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=Mr.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)})):la(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)})):la(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)})):la(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=dr(dr({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return Jo.call.apply(Jo,[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 ta.call.apply(ta,[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 ia.call.apply(ia,[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(),Mr.clearAllTimers(this),Mr.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),aa(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 ua=Element.prototype;ua.matches=ua.matchesSelector||ua.mozMatchesSelector||ua.msMatchesSelector||ua.oMatchesSelector||ua.webkitMatchesSelector}var ha=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function da(e,t,i,n,r){var o=fa.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function fa(e,t,i,n){return function(i){i.delegateTarget=ha(i.target,t),i.delegateTarget&&n.call(e,i)}}var pa=function(e,t,i,n,r){return"function"==typeof e.addEventListener?da.apply(null,arguments):"function"==typeof i?da.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return da(e,t,i,n,r)})))};const ga=sr(pa);var ya={CONTROLS:"controls",ROOT:"root"},va={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"},ma="xg-icon-disable";function _a(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Ea(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 Mr.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(_a(e)||_a(e.url))return n.src=_a(e)?e:e.url||"",o=Mr.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Mr.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Lr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(a){return Lr.logError("Plugin named [".concat(r,"]:createIcon"),a),null}return"string"==typeof e?Mr.createDomFromHtml(e,n,i):(Lr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Ta(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"===fr(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===fr(e)&&e.attr&&"object"===fr(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Ea(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Ea(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var ba=function(e){mr(i,e);var t=Sr(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pr(this,i),(e=t.call(this,n)).__delegates=[],e}return yr(i,[{key:"__init",value:function(e){if(Cr(_r(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=[],Ta(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(u){throw Lr.logError("Plugin:".concat(this.pluginName,":render"),u),new Error("Plugin:".concat(this.pluginName,":render:").concat(u.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=Mr.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"===fr(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"===fr(a)&&"function"==typeof a.plugin&&(n=a.options?Mr.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,Mr.addClass(this.find(".xgplayer-icon"),ma)}},{key:"enable",value:function(){this.config.disable=!1,Mr.removeClass(this.find(".xgplayer-icon"),ma)}},{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=Cr(_r(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"===Mr.typeOf(e)?this.root.style[e]=t:void("Object"===Mr.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"===Mr.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Mr.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 Lr.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)),Cr(_r(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=ga(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=ga(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return ya}},{key:"POSITIONS",get:function(){return va}}]),i}(ca),Sa=function(){function e(){var t=this;if(pr(this,e),vr(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 Ur(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Br(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(i){console.error(i)}}return yr(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(Zo),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(n){}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}(),Ca=null;var ka={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()},Ca||(Ca=new Sa),Ca.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"===Mr.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"===Mr.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===Mr.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(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}},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(n){throw a.push(i(null)),n}})),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=Ca)||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}}},Ia={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 Pa(){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 Da=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=Tr(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),vr(Tr(e),"onMouseLeave",(function(t){Tr(e).player.focus()})),e}return yr(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Vr.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(Ia.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(Po,(function(t){t?Mr.addClass(e.root,"mini-controls"):Mr.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Vr.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&&Mr.addClass(this.root,Ia.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){Mr.removeClass(this.root,Ia.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 va.CONTROLS_LEFT:t.root=this.left;break;case va.CONTROLS_RIGHT:t.root=this.right;break;case va.CONTROLS_CENTER:t.root=this.center;break;case va.CONTROLS:t.root=this.root;break;default:t.root=this.left}return Cr(_r(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Vr.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=Mr.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},vr({},Ia.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}(ba),wa={lang:{},langKeys:[],textKeys:[]};function Aa(e,t){return Object.keys(t).forEach((function(i){var n,r=Mr.typeOf(t[i]),o=Mr.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,kr(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Aa(e[i],t[i])):e[i]=t[i]})),e}function Ra(){Object.keys(wa.lang.en).map((function(e){wa.textKeys[e]=e}))}function xa(e,t){var i=e.LANG;if(t||(t=wa),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Aa(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),Ra()}}xa({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 Oa={get textKeys(){return wa.textKeys},get langKeys(){return wa.langKeys},get lang(){var e={};return wa.langKeys.map((function(t){e[t]=wa.lang[t]})),wa.lang["zh-cn"]&&(e.zh=wa.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=wa),t.lang){i="Array"!==Mr.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]?Aa(n[e.LANG]||{},e.TEXT||{}):xa(e,t)})),Ra()}},use:xa,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Aa(i.lang,wa.lang),(t=i.langKeys).push.apply(t,kr(wa.langKeys)),Aa(i.textKeys,wa.textKeys),i}},La={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Na=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Ma={},Ua=null,Ba=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"add",value:function(e){e&&(Ma[e.playerId]=e,1===Object.keys(Ma).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Ma[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Ma)if(Object.prototype.hasOwnProperty.call(Ma,i)){var n=Ma[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(Ma[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Ma[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Ma),t=0;t<e.length;t++){var i=Ma[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(Ma[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Ma[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Ua||(Ua=new i),Ua}}]),i}(wr.EventEmitter);var Fa=["play","pause","replay","retry"],Ha=0,ja=0,Va=null,Ka=function(e){mr(i,e);var t=Sr(i);function i(e){var n;pr(this,i);var r,o=Mr.deepMerge(Pa(),e);vr(Tr(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Lr.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(io,n.canPlayFunc),n.removeClass(Ia.ENTER)}})),vr(Tr(n),"onFullscreenChange",(function(e,t){var i=function(){Mr.setTimeout(Tr(n),(function(){n.resize()}),100)},r=Mr.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Uo,{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,Zo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Ia.FULLSCREEN),n.emit(ko,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=Tr(n),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Mr.setTimeout(Tr(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(Ia.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Ia.FULLSCREEN)}n._fullscreenEl=null,n.emit(ko,!1)}})),vr(Tr(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),vr(Tr(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),oa(Tr(n),Fa),n.config=o,n._pluginInfoId=Mr.generateSessionId(),(r=Tr(n)).logInfo=Lr.logInfo.bind(r),r.logWarn=Lr.logWarn.bind(r),r.logError=Lr.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=La.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=Oa.init(n._pluginInfoId),Vr.os.isAndroid&&Vr.osVersion>0&&Vr.osVersion<6&&(n.config.autoplay=!1),n.database=new zo,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=Va,!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(),ka.onPluginsReady(Tr(n)),n.getInitDefinition(),n.setState(La.READY),Mr.setTimeout(Tr(n),(function(){n.emit(fo)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<La.ATTACHED)&&n.start(),n}return yr(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(Zr,new Yr("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(Ma),i=0;i<t.length;i++){var n=Ma[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(Lr.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Zo,this.playerId),this.media.setAttribute(Zo,this.playerId),null===(e=Va)||void 0===e||e.add(this),ka.init(this),this._initBaseDoms(),this.config.controls){var r=this.config.controls.root||null,o=ka.register(this,Da,{root:r});this.controls=o}var a="mobile"===this.config.isMobileSimulateMode?"mobile":Vr.device;if(this.addClass("".concat(Ia.DEFAULT," ").concat(Ia.INACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Ia.NO_CONTROLS)),this.config.autoplay?this.addClass(Ia.ENTER):this.addClass(Ia.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=Mr.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)])})),$o.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Vr.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(oo,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(zr,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),$o.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(zr,this.playFunc),this.off(io,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(Mr.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"!==Mr.typeOf(e)||0!==e.length)||(e="",this.emit(po),Lr.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){Mr.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===Mr.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"===Mr.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;Lr.logInfo("_startInit readyState",r),this.config.autoplay&&(!Mr.isMSE(this.media)&&this.load(),(Vr.os.isIpad||Vr.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(io,this.canPlayFunc),(!this.hasStart||this.state<La.ATTACHED)&&ka.afterInit(this),this.hasStart=!0,this.setState(La.ATTACHED),Mr.setTimeout(this,(function(){t.emit(vo)}),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&&Oa.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=ka.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Lr.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(s){Lr.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,kr(a)),(n=e.config.ignores).push.apply(n,kr(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,kr(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case va.ROOT_RIGHT:this.rightBar||(this.rightBar=Mr.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case va.ROOT_LEFT:this.leftBar||(this.leftBar=Mr.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case va.ROOT_TOP:this.topBar||(this.topBar=Mr.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&Mr.addClass(this.topBar,Ia.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=ka.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!ka.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=ka.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)),ka.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?ka.unRegister(this,e):e instanceof ca&&ka.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 ca&&(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 ka.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=ka.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Mr.hasClass(this.root,e)||Mr.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Mr.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Mr.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>La.ATTACHING)){var i=this._playSessionId;return Mr.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(La.ATTACHING),this._registerPlugins(!1),ka.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",Lr.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===Mr.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?(Vr.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<La.ATTACHED)return this.removeClass(Ia.NO_START),this.addClass(Ia.ENTER),this.start(),void(this._useAutoplay=!0);this.state<La.RUNNING&&(this.removeClass(Ia.NO_START),!this.isCanplay&&this.addClass(Ia.ENTER));var t=Cr(_r(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Ia.NOT_ALLOW_AUTOPLAY),e.addClass(Ia.PLAYING),e.state<La.RUNNING&&(Lr.logInfo(">>>>playPromise.then"),e.setState(La.RUNNING),e.emit(go))})).catch((function(t){if(Lr.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Ia.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Mr.setTimeout(e,(function(){e._errorTimer=null,e.emit(yo),e.addClass(Ia.NOT_ALLOW_AUTOPLAY),e.removeClass(Ia.ENTER),e.pause(),e.setState(La.NOTALLOW)}),0))})):(Lr.logWarn("video.play not return promise"),this.state<La.RUNNING&&(this.setState(La.RUNNING),this.removeClass(Ia.NOT_ALLOW_AUTOPLAY),this.removeClass(Ia.NO_START),this.removeClass(Ia.ENTER),this.addClass(Ia.PLAYING),this.emit(go))),t}},{key:"mediaPause",value:function(){Cr(_r(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){Cr(_r(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Ia.PAUSED),sa(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;sa(this,"pause",(function(){Cr(_r(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(Jr,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Ia.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(Jr,this._onceSeekCanplay),this.state<La.RUNNING?(this.removeClass(Ia.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,dr({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(wo,{from:t,to:e})})):this.emit(wo,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(oo,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Ia.NOT_ALLOW_AUTOPLAY,Ia.PLAYING,Ia.NO_START,Ia.PAUSED,Ia.REPLAY,Ia.ENTER,Ia.ENDED,Ia.ERROR,Ia.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(Ia.NO_START),this.emit(Bo)}},{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=Pa();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(Zo),o.removeAttribute(Zo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),Mr.clearAllTimers(this),this.emit(_o),null===(e=Va)||void 0===e||e.remove(this),ka.destroy(this),aa(this),Cr(_r(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(Ia.ENDED),this.currentTime=0,this.isSeeking=!1,sa(this,"replay",(function(){e.once(Jr,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(mo),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Ia.ERROR),this.addClass(Ia.LOADING),sa(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=Mr.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(io,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Ia.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Mr.filterStyleFromText(e)),Mr.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Mr.filterStyleFromText(t),Mr.addClass(t,n),t.setAttribute(Zo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Ia.PARENT_FULLSCREEN),this._orgCss&&(Mr.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Mr.removeClass(e,i),t&&t!==e&&this._orgPCss&&(Mr.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Mr.removeClass(t,n),t.removeAttribute(Zo))}},{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:Mr.scrollTop(),left:Mr.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",Mr.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<Xo.length;n++){var r=Xo[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||Mr.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<qo.length;i++){var n=qo[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(Ia.INNER_FULLSCREEN," ").concat(Ia.CSS_FULLSCREEN):Ia.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(ko,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Io,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Ia.INNER_FULLSCREEN," ").concat(Ia.CSS_FULLSCREEN):Ia.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(ko,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Io,!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(Ia.INNER_FULLSCREEN," ").concat(Ia.ROTATE_FULLSCREEN):Ia.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Ia.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(ko,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Ia.INNER_FULLSCREEN," ").concat(Ia.ROTATE_FULLSCREEN):Ia.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Ia.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(ko,!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(uo,dr({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(ho,dr({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(Ia.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=Mr.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(Ia.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Ia.ENTER),this.removeClass(Ia.ERROR),this.removeClass(Ia.LOADING),this.isCanplay=!0,this.waitTimer&&Mr.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(no,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Ia.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===La.ENDED&&this.setState(La.RUNNING),this.removeClass(Ia.PAUSED),this.ended&&this.removeClass(Ia.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Ia.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Ia.ENDED),this.setState(La.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Ia.NOT_ALLOW_AUTOPLAY),this.removeClass(Ia.NO_START),this.removeClass(Ia.ENTER),this.removeClass(Ia.LOADING),this.addClass(Ia.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Ia.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Mr.clearTimeout(this,this.waitTimer),this.removeClass(Ia.LOADING),this.removeClass(Ia.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Mr.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Mr.setTimeout(this,(function(){e.addClass(Ia.LOADING),e.emit(Co),Mr.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Ia.NO_START,Ia.PAUSED,Ia.ENDED,Ia.ERROR,Ia.REPLAY,Ia.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(Ia.LOADING))&&this.media.readyState>2&&(this.removeClass(Ia.LOADING),Mr.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===La.NOTALLOW&&this.duration&&(this.setState(La.RUNNING),this.emit(go)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Mr.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"===Mr.typeOf(e)?e:e.type||"";i.props&&"Array"!==Mr.typeOf(i.props)&&(i.props=[i.props]),this.emit(Uo,dr({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=Mr.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"===Mr.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,sa(this,"playnext",(function(){t.start(),t.emit(Lo,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(Ao,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){Lr.logInfo("setState","state from:".concat(Na[this.state]," to:").concat(Na[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 Mr.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(La.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===La.RUNNING||this._state===La.ENDED},set:function(e){e?this.setState(La.RUNNING):this._state>=La.RUNNING&&this.setState(La.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,i=this.config.definition,n=null,r=null;i.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(n=e),i.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),n?this.changeDefinition(n):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==Oa.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,ka.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(Oa.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 Kr}},{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 Cr(_r(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=Cr(_r(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return Cr(_r(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=Mr.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return ja},set:function(e){ja=e}},{key:"realTimeSpeed",get:function(){return Ha},set:function(e){Ha=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 Jo.call.apply(Jo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return ta.call.apply(ta,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return ia.call.apply(ia,[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 na.call.apply(na,[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 ra.call.apply(ra,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),Mr.typeOf(t)===Boolean&&(this.muted=t)),null===(i=Va)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Lr.config.debug},set:function(e){Lr.config.debug=e}},{key:"instManager",get:function(){return Va},set:function(e){Va=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=Va)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=Va)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return Vr.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Vr.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}(Yo);vr(Ka,"defaultPreset",null),vr(Ka,"XgVideoProxy",null),Ka.instManager=Ba.getInstance();const Wa=Object.assign(Ka,{BasePlugin:ca,Errors:Yr,Events:Wo,InstManager:Ba,Sniffer:Vr,Util:Mr}),Ga={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"}},Ya=["zh","en","jp","zh-hk"],za={NORMAL:0,INNER:1,FULLSCREEN:2};var $a=(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))($a||{});const Xa=5e9,qa={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var Za=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(Za||{}),Qa={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:"生放送"}},Ja={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 es="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,ts="color: #fff; background-color: #5f5f5f;",is="color: #fff; background-color: #f53f3f;",ns="color: #fff; background-color: #ff7d00;",rs="color: #fff; background: #4281ff",os="%c VePlayer %c 1.18.0 ",as={config:{debug:es?3:1},log:function(e,...t){this.config.debug>=3&&console.log(os,ts,rs,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(os,ns,rs,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](os,is,rs,e,...t)}};localStorage.getItem("velog")&&(as.config.debug=3);var ss={exports:{}};ss.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},b=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&&_},S=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=b,C.i=T,C.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function y(e){this.$L=b(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=S(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return S(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<S(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=S(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=S(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=b(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 S.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])}})),S.extend=function(e,t){return e.$i||(e(t,k,S),e.$i=!0),S},S.locale=b,S.isDayjs=T,S.unix=function(e){return S(1e3*e)},S.en=E[_],S.Ls=E,S.p={},S}();const ls=sr(ss.exports);var cs={exports:{}};!function(e,t){var i,n,r;e.exports=(i="minute",n=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(e,t,o){var a=t.prototype;o.utc=function(e){return new t({date:e,utc:!0,args:arguments})},a.utc=function(e){var t=o(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),i):t},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(e,t){var o=this.$utils().u;if(o(e))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(n);if(!t)return null;var i=(""+t[0]).match(r)||["-",0,0],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(e)))return this;var a=Math.abs(e)<=16?60*e:e,s=this;if(t)return s.$offset=a,s.$u=0===e,s;if(0!==e){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,i)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(e,t,i){if(e&&this.$u===e.$u)return d.call(this,e,t,i);var n=this.local(),r=o(e).local();return d.call(n,r,t,i)}})}(cs);const us=sr(cs.exports);var hs=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),b=i(43),S=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(S("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 S("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 b(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 ds=sr(hs);ls.extend(us);var fs=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(fs||{});function ps(e){try{return JSON.parse(e)}catch(t){return as.warn(`[utils/json] decode fail: ${e}`,t),null}}function gs(e,t="GetPlayInfoToken"){if(!e)return;const i={},n=ps(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 ys(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 vs=e=>{var t,i,n;if(!(null==e?void 0:e.playAuthToken))return;const r=gs(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(fs).includes(o)?nr.MP4:rr.M4A)},ms=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=ls.utc(i,"YYYYMMDD hhmmss");if(!n.isValid())return!1;return n.add(t,"seconds").isBefore(ls())};function _s(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 Es(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)=>{ds.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===$a.VALID&&o.length){const i=o.map((e=>{var t;const i=h?Ks(e.MainPlayUrl,h):e.MainPlayUrl,n=h?Ks(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:il(e.MainUrlExpire,10,Xa),drmType:e.DrmType},e),Ms(e,{definitionMap:r,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l}))})).sort(_s);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}),as.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{as.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function Ts(e,t,i,n){return d(this,null,(function*(){try{return yield e()}catch(r){if(--t&&i(r))return Ts(e,t,i,n);if(n&&"function"==typeof n)return yield n(r);throw r}}))}function bs(e,t,i,n){return i+"/?"+n+"&"+el({ThirdPartyDrmType:e,Kid:t})}const Ss="__veplayer_";function Cs(e,t="",i){if(!e)return;const n=Ss+t+"_"+e;localStorage.setItem(n,i+"")}function ks(e,t=""){if(!e)return;const i=Ss+t+"_"+e;return localStorage.getItem(i)}function Is(){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(i){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function Ps(e){if(!e)return Is();const t=`line_user_${encodeURIComponent(e)}`;try{const e=ks(t,"ttdrama");if(e)return e;const i=Is();return Cs(t,"ttdrama",i),i}catch(i){return Is()}}function Ds(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var ws=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(ws||{});function As(e,t){return new Promise(((i,n)=>{try{e||n(new Error("url is undefined"));let r=Ds();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=Ds()-o,s.status=a.status,s.statusText=a.statusText,r=Ds())},a.onload=()=>{s.response=a.response,i(s)},a.onprogress=e=>{const t=Ds()-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=Ds()-r),n(s)},a.ontimeout=()=>{s.status||(s.status=-2,s.costTime=Ds()-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(r){n(r)}}))}function Rs(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:+Mr.isMSE(e.media)}function xs(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class Os{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=xs(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:xs(this.now()-this.startAt),timings:[...this.timings],timingMap:c({},this.timingMap)}}}let Ls;const Ns=()=>Ls,Ms=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 Us=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}},Bs='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',Fs=['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"'],Hs={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]};function js(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(Hs)){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 Vs(e){return e&&e.then?e:Promise.resolve(e)}const Ks=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+el(t):e,Ws=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((n=>{n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function Gs(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function Ys(e,t=200,i=""){let n=setTimeout((()=>{i&&as.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 $s(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return as.error("mse error",t),!1}}function Xs(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(Bs):"h265"===e?Fs.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const qs="undefined"!=typeof window,Zs=qs&&navigator.userAgent.toLocaleLowerCase(),Qs=qs&&/^((?!chrome|android).)*safari/.test(Zs);function Js(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 el(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 tl(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function il(e,t=10,i=0){const n=parseInt(e,t);return Number.isNaN(n)?i:n}function nl(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 rl(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 ol=/["'&<>]/;function al(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 sl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?al(Object(i),!0).forEach((function(t){dl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):al(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ll(e){return(ll="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 cl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ul(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,pl(n.key),n)}}function hl(e,t,i){return t&&ul(e.prototype,t),i&&ul(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function dl(e,t,i){return(t=pl(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function fl(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 pl(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 gl=function(e){return e&&e.Math==Math&&e},yl=gl("object"==typeof globalThis&&globalThis)||gl("object"==typeof window&&window)||gl("object"==typeof self&&self)||gl("object"==typeof ar&&ar)||function(){return this}()||Function("return this")(),vl={},ml=function(e){try{return!!e()}catch(t){return!0}},_l=!ml((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),El=!ml((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Tl=El,bl=Function.prototype.call,Sl=Tl?bl.bind(bl):function(){return bl.apply(bl,arguments)},Cl={},kl={}.propertyIsEnumerable,Il=Object.getOwnPropertyDescriptor,Pl=Il&&!kl.call({1:2},1);Cl.f=Pl?function(e){var t=Il(this,e);return!!t&&t.enumerable}:kl;var Dl,wl,Al=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Rl=El,xl=Function.prototype,Ol=xl.call,Ll=Rl&&xl.bind.bind(Ol,Ol),Nl=Rl?Ll:function(e){return function(){return Ol.apply(e,arguments)}},Ml=Nl,Ul=Ml({}.toString),Bl=Ml("".slice),Fl=function(e){return Bl(Ul(e),8,-1)},Hl=ml,jl=Fl,Vl=Object,Kl=Nl("".split),Wl=Hl((function(){return!Vl("z").propertyIsEnumerable(0)}))?function(e){return"String"==jl(e)?Kl(e,""):Vl(e)}:Vl,Gl=function(e){return null==e},Yl=Gl,zl=TypeError,$l=function(e){if(Yl(e))throw zl("Can't call method on "+e);return e},Xl=Wl,ql=$l,Zl=function(e){return Xl(ql(e))},Ql="object"==typeof document&&document.all,Jl={all:Ql,IS_HTMLDDA:void 0===Ql&&void 0!==Ql},ec=Jl.all,tc=Jl.IS_HTMLDDA?function(e){return"function"==typeof e||e===ec}:function(e){return"function"==typeof e},ic=tc,nc=Jl.all,rc=Jl.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:ic(e)||e===nc}:function(e){return"object"==typeof e?null!==e:ic(e)},oc=yl,ac=tc,sc=function(e,t){return arguments.length<2?(i=oc[e],ac(i)?i:void 0):oc[e]&&oc[e][t];var i},lc=Nl({}.isPrototypeOf),cc=sc("navigator","userAgent")||"",uc=yl,hc=cc,dc=uc.process,fc=uc.Deno,pc=dc&&dc.versions||fc&&fc.version,gc=pc&&pc.v8;gc&&(wl=(Dl=gc.split("."))[0]>0&&Dl[0]<4?1:+(Dl[0]+Dl[1])),!wl&&hc&&(!(Dl=hc.match(/Edge\/(\d+)/))||Dl[1]>=74)&&(Dl=hc.match(/Chrome\/(\d+)/))&&(wl=+Dl[1]);var yc=wl,vc=yc,mc=ml,_c=!!Object.getOwnPropertySymbols&&!mc((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&vc&&vc<41})),Ec=_c&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Tc=sc,bc=tc,Sc=lc,Cc=Object,kc=Ec?function(e){return"symbol"==typeof e}:function(e){var t=Tc("Symbol");return bc(t)&&Sc(t.prototype,Cc(e))},Ic=String,Pc=function(e){try{return Ic(e)}catch(t){return"Object"}},Dc=tc,wc=Pc,Ac=TypeError,Rc=function(e){if(Dc(e))return e;throw Ac(wc(e)+" is not a function")},xc=Rc,Oc=Gl,Lc=function(e,t){var i=e[t];return Oc(i)?void 0:xc(i)},Nc=Sl,Mc=tc,Uc=rc,Bc=TypeError,Fc={exports:{}},Hc=yl,jc=Object.defineProperty,Vc=function(e,t){try{jc(Hc,e,{value:t,configurable:!0,writable:!0})}catch(i){Hc[e]=t}return t},Kc=Vc,Wc="__core-js_shared__",Gc=yl[Wc]||Kc(Wc,{}),Yc=Gc;(Fc.exports=function(e,t){return Yc[e]||(Yc[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=Fc.exports,$c=$l,Xc=Object,qc=function(e){return Xc($c(e))},Zc=qc,Qc=Nl({}.hasOwnProperty),Jc=Object.hasOwn||function(e,t){return Qc(Zc(e),t)},eu=Nl,tu=0,iu=Math.random(),nu=eu(1..toString),ru=function(e){return"Symbol("+(void 0===e?"":e)+")_"+nu(++tu+iu,36)},ou=yl,au=Jc,su=ru,lu=_c,cu=Ec,uu=zc("wks"),hu=ou.Symbol,du=hu&&hu.for,fu=cu?hu:hu&&hu.withoutSetter||su,pu=function(e){if(!au(uu,e)||!lu&&"string"!=typeof uu[e]){var t="Symbol."+e;lu&&au(hu,e)?uu[e]=hu[e]:uu[e]=cu&&du?du(t):fu(t)}return uu[e]},gu=Sl,yu=rc,vu=kc,mu=Lc,_u=function(e,t){var i,n;if("string"===t&&Mc(i=e.toString)&&!Uc(n=Nc(i,e)))return n;if(Mc(i=e.valueOf)&&!Uc(n=Nc(i,e)))return n;if("string"!==t&&Mc(i=e.toString)&&!Uc(n=Nc(i,e)))return n;throw Bc("Can't convert object to primitive value")},Eu=TypeError,Tu=pu("toPrimitive"),bu=function(e,t){if(!yu(e)||vu(e))return e;var i,n=mu(e,Tu);if(n){if(void 0===t&&(t="default"),i=gu(n,e,t),!yu(i)||vu(i))return i;throw Eu("Can't convert object to primitive value")}return void 0===t&&(t="number"),_u(e,t)},Su=bu,Cu=kc,ku=function(e){var t=Su(e,"string");return Cu(t)?t:t+""},Iu=rc,Pu=yl.document,Du=Iu(Pu)&&Iu(Pu.createElement),wu=function(e){return Du?Pu.createElement(e):{}},Au=wu,Ru=!_l&&!ml((function(){return 7!=Object.defineProperty(Au("div"),"a",{get:function(){return 7}}).a})),xu=_l,Ou=Sl,Lu=Cl,Nu=Al,Mu=Zl,Uu=ku,Bu=Jc,Fu=Ru,Hu=Object.getOwnPropertyDescriptor;vl.f=xu?Hu:function(e,t){if(e=Mu(e),t=Uu(t),Fu)try{return Hu(e,t)}catch(i){}if(Bu(e,t))return Nu(!Ou(Lu.f,e,t),e[t])};var ju={},Vu=_l&&ml((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ku=rc,Wu=String,Gu=TypeError,Yu=function(e){if(Ku(e))return e;throw Gu(Wu(e)+" is not an object")},zu=_l,$u=Ru,Xu=Vu,qu=Yu,Zu=ku,Qu=TypeError,Ju=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th="enumerable",ih="configurable",nh="writable";ju.f=zu?Xu?function(e,t,i){if(qu(e),t=Zu(t),qu(i),"function"==typeof e&&"prototype"===t&&"value"in i&&nh in i&&!i[nh]){var n=eh(e,t);n&&n[nh]&&(e[t]=i.value,i={configurable:ih in i?i[ih]:n[ih],enumerable:th in i?i[th]:n[th],writable:!1})}return Ju(e,t,i)}:Ju:function(e,t,i){if(qu(e),t=Zu(t),qu(i),$u)try{return Ju(e,t,i)}catch(n){}if("get"in i||"set"in i)throw Qu("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var rh=ju,oh=Al,ah=_l?function(e,t,i){return rh.f(e,t,oh(1,i))}:function(e,t,i){return e[t]=i,e},sh={exports:{}},lh=_l,ch=Jc,uh=Function.prototype,hh=lh&&Object.getOwnPropertyDescriptor,dh=ch(uh,"name"),fh={EXISTS:dh,PROPER:dh&&"something"===function(){}.name,CONFIGURABLE:dh&&(!lh||lh&&hh(uh,"name").configurable)},ph=tc,gh=Gc,yh=Nl(Function.toString);ph(gh.inspectSource)||(gh.inspectSource=function(e){return yh(e)});var vh,mh,_h,Eh=gh.inspectSource,Th=tc,bh=yl.WeakMap,Sh=Th(bh)&&/native code/.test(String(bh)),Ch=ru,kh=zc("keys"),Ih=function(e){return kh[e]||(kh[e]=Ch(e))},Ph={},Dh=Sh,wh=yl,Ah=rc,Rh=ah,xh=Jc,Oh=Gc,Lh=Ih,Nh=Ph,Mh="Object already initialized",Uh=wh.TypeError,Bh=wh.WeakMap;if(Dh||Oh.state){var Fh=Oh.state||(Oh.state=new Bh);Fh.get=Fh.get,Fh.has=Fh.has,Fh.set=Fh.set,vh=function(e,t){if(Fh.has(e))throw Uh(Mh);return t.facade=e,Fh.set(e,t),t},mh=function(e){return Fh.get(e)||{}},_h=function(e){return Fh.has(e)}}else{var Hh=Lh("state");Nh[Hh]=!0,vh=function(e,t){if(xh(e,Hh))throw Uh(Mh);return t.facade=e,Rh(e,Hh,t),t},mh=function(e){return xh(e,Hh)?e[Hh]:{}},_h=function(e){return xh(e,Hh)}}var jh={set:vh,get:mh,has:_h,enforce:function(e){return _h(e)?mh(e):vh(e,{})},getterFor:function(e){return function(t){var i;if(!Ah(t)||(i=mh(t)).type!==e)throw Uh("Incompatible receiver, "+e+" required");return i}}},Vh=ml,Kh=tc,Wh=Jc,Gh=_l,Yh=fh.CONFIGURABLE,zh=Eh,$h=jh.enforce,Xh=jh.get,qh=Object.defineProperty,Zh=Gh&&!Vh((function(){return 8!==qh((function(){}),"length",{value:8}).length})),Qh=String(String).split("String"),Jh=sh.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),(!Wh(e,"name")||Yh&&e.name!==t)&&(Gh?qh(e,"name",{value:t,configurable:!0}):e.name=t),Zh&&i&&Wh(i,"arity")&&e.length!==i.arity&&qh(e,"length",{value:i.arity});try{i&&Wh(i,"constructor")&&i.constructor?Gh&&qh(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=$h(e);return Wh(n,"source")||(n.source=Qh.join("string"==typeof t?t:"")),e};Function.prototype.toString=Jh((function(){return Kh(this)&&Xh(this).source||zh(this)}),"toString");var ed=sh.exports,td=tc,id=ju,nd=ed,rd=Vc,od=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(td(i)&&nd(i,o,n),n.global)r?e[t]=i:rd(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=i:id.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},ad={},sd=Math.ceil,ld=Math.floor,cd=Math.trunc||function(e){var t=+e;return(t>0?ld:sd)(t)},ud=function(e){var t=+e;return t!=t||0===t?0:cd(t)},hd=ud,dd=Math.max,fd=Math.min,pd=function(e,t){var i=hd(e);return i<0?dd(i+t,0):fd(i,t)},gd=ud,yd=Math.min,vd=function(e){return e>0?yd(gd(e),9007199254740991):0},md=vd,_d=function(e){return md(e.length)},Ed=Zl,Td=pd,bd=_d,Sd=function(e){return function(t,i,n){var r,o=Ed(t),a=bd(o),s=Td(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}},Cd={includes:Sd(!0),indexOf:Sd(!1)},kd=Jc,Id=Zl,Pd=Cd.indexOf,Dd=Ph,wd=Nl([].push),Ad=function(e,t){var i,n=Id(e),r=0,o=[];for(i in n)!kd(Dd,i)&&kd(n,i)&&wd(o,i);for(;t.length>r;)kd(n,i=t[r++])&&(~Pd(o,i)||wd(o,i));return o},Rd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xd=Ad,Od=Rd.concat("length","prototype");ad.f=Object.getOwnPropertyNames||function(e){return xd(e,Od)};var Ld={};Ld.f=Object.getOwnPropertySymbols;var Nd=sc,Md=ad,Ud=Ld,Bd=Yu,Fd=Nl([].concat),Hd=Nd("Reflect","ownKeys")||function(e){var t=Md.f(Bd(e)),i=Ud.f;return i?Fd(t,i(e)):t},jd=Jc,Vd=Hd,Kd=vl,Wd=ju,Gd=function(e,t,i){for(var n=Vd(t),r=Wd.f,o=Kd.f,a=0;a<n.length;a++){var s=n[a];jd(e,s)||i&&jd(i,s)||r(e,s,o(t,s))}},Yd=ml,zd=tc,$d=/#|\.prototype\./,Xd=function(e,t){var i=Zd[qd(e)];return i==Jd||i!=Qd&&(zd(t)?Yd(t):!!t)},qd=Xd.normalize=function(e){return String(e).replace($d,".").toLowerCase()},Zd=Xd.data={},Qd=Xd.NATIVE="N",Jd=Xd.POLYFILL="P",ef=Xd,tf=yl,nf=vl.f,rf=ah,of=od,af=Vc,sf=Gd,lf=ef,cf=function(e,t){var i,n,r,o,a,s=e.target,l=e.global,c=e.stat;if(i=l?tf:c?tf[s]||af(s,{}):(tf[s]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(a=nf(i,n))&&a.value:i[n],!lf(l?n:s+(c?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;sf(o,r)}(e.sham||r&&r.sham)&&rf(o,"sham",!0),of(i,n,o,e)}},uf=Fl,hf=Array.isArray||function(e){return"Array"==uf(e)},df=TypeError,ff=function(e){if(e>9007199254740991)throw df("Maximum allowed index exceeded");return e},pf=ku,gf=ju,yf=Al,vf=function(e,t,i){var n=pf(t);n in e?gf.f(e,n,yf(0,i)):e[n]=i},mf={};mf[pu("toStringTag")]="z";var _f="[object z]"===String(mf),Ef=_f,Tf=tc,bf=Fl,Sf=pu("toStringTag"),Cf=Object,kf="Arguments"==bf(function(){return arguments}()),If=Ef?bf: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=Cf(e),Sf))?i:kf?bf(t):"Object"==(n=bf(t))&&Tf(t.callee)?"Arguments":n},Pf=Nl,Df=ml,wf=tc,Af=If,Rf=Eh,xf=function(){},Of=[],Lf=sc("Reflect","construct"),Nf=/^\s*(?:class|function)\b/,Mf=Pf(Nf.exec),Uf=!Nf.exec(xf),Bf=function(e){if(!wf(e))return!1;try{return Lf(xf,Of,e),!0}catch(t){return!1}},Ff=function(e){if(!wf(e))return!1;switch(Af(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Uf||!!Mf(Nf,Rf(e))}catch(t){return!0}};Ff.sham=!0;var Hf=!Lf||Df((function(){var e;return Bf(Bf.call)||!Bf(Object)||!Bf((function(){e=!0}))||e}))?Ff:Bf,jf=hf,Vf=Hf,Kf=rc,Wf=pu("species"),Gf=Array,Yf=function(e){var t;return jf(e)&&(t=e.constructor,(Vf(t)&&(t===Gf||jf(t.prototype))||Kf(t)&&null===(t=t[Wf]))&&(t=void 0)),void 0===t?Gf:t},zf=function(e,t){return new(Yf(e))(0===t?0:t)},$f=ml,Xf=yc,qf=pu("species"),Zf=function(e){return Xf>=51||!$f((function(){var t=[];return(t.constructor={})[qf]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Qf=cf,Jf=ml,ep=hf,tp=rc,ip=qc,np=_d,rp=ff,op=vf,ap=zf,sp=Zf,lp=yc,cp=pu("isConcatSpreadable"),up=lp>=51||!Jf((function(){var e=[];return e[cp]=!1,e.concat()[0]!==e})),hp=sp("concat"),dp=function(e){if(!tp(e))return!1;var t=e[cp];return void 0!==t?!!t:ep(e)};Qf({target:"Array",proto:!0,arity:1,forced:!up||!hp},{concat:function(e){var t,i,n,r,o,a=ip(this),s=ap(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(dp(o=-1===t?a:arguments[t]))for(r=np(o),rp(l+r),i=0;i<r;i++,l++)i in o&&op(s,l,o[i]);else rp(l+1),op(s,l++,o);return s.length=l,s}});var fp=Fl,pp=Nl,gp=function(e){if("Function"===fp(e))return pp(e)},yp=Rc,vp=El,mp=gp(gp.bind),_p=function(e,t){return yp(e),void 0===t?e:vp?mp(e,t):function(){return e.apply(t,arguments)}},Ep=_p,Tp=Wl,bp=qc,Sp=_d,Cp=zf,kp=Nl([].push),Ip=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=bp(l),g=Tp(p),y=Ep(c,u),v=Sp(g),m=0,_=h||Cp,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:kp(E,d)}else switch(e){case 4:return!1;case 7:kp(E,d)}return o?-1:n||r?r:E}},Pp={forEach:Ip(0),map:Ip(1),filter:Ip(2),some:Ip(3),every:Ip(4),find:Ip(5),findIndex:Ip(6),filterReject:Ip(7)},Dp=Pp.map;cf({target:"Array",proto:!0,forced:!Zf("map")},{map:function(e){return Dp(this,e,arguments.length>1?arguments[1]:void 0)}});var wp=Ad,Ap=Rd,Rp=Object.keys||function(e){return wp(e,Ap)},xp=qc,Op=Rp;cf({target:"Object",stat:!0,forced:ml((function(){Op(1)}))},{keys:function(e){return Op(xp(e))}});var Lp=If,Np=String,Mp=function(e){if("Symbol"===Lp(e))throw TypeError("Cannot convert a Symbol value to a string");return Np(e)},Up=Nl,Bp=ud,Fp=Mp,Hp=$l,jp=Up("".charAt),Vp=Up("".charCodeAt),Kp=Up("".slice),Wp=function(e){return function(t,i){var n,r,o=Fp(Hp(t)),a=Bp(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=Vp(o,a))<55296||n>56319||a+1===s||(r=Vp(o,a+1))<56320||r>57343?e?jp(o,a):n:e?Kp(o,a,a+2):r-56320+(n-55296<<10)+65536}},Gp={codeAt:Wp(!1),charAt:Wp(!0)},Yp=Gp.charAt,zp=$l,$p=ud,Xp=Mp;cf({target:"String",proto:!0,forced:!0},{at:function(e){var t=Xp(zp(this)),i=t.length,n=$p(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:Yp(t,r)}});var qp=If,Zp=_f?{}.toString:function(){return"[object "+qp(this)+"]"};_f||od(Object.prototype,"toString",Zp,{unsafe:!0});var Qp=Yu,Jp=function(){var e=Qp(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},eg=Sl,tg=Jc,ig=lc,ng=Jp,rg=RegExp.prototype,og=function(e){var t=e.flags;return void 0!==t||"flags"in rg||tg(e,"flags")||!ig(rg,e)?t:eg(ng,e)},ag=fh.PROPER,sg=od,lg=Yu,cg=Mp,ug=ml,hg=og,dg="toString",fg=RegExp.prototype[dg],pg=ug((function(){return"/a/b"!=fg.call({source:"a",flags:"b"})})),gg=ag&&fg.name!=dg;(pg||gg)&&sg(RegExp.prototype,dg,(function(){var e=lg(this);return"/"+cg(e.source)+"/"+cg(hg(e))}),{unsafe:!0});var yg=wu("span").classList,vg=yg&&yg.constructor&&yg.constructor.prototype,mg=vg===Object.prototype?void 0:vg,_g=ml,Eg=function(e,t){var i=[][e];return!!i&&_g((function(){i.call(null,t||function(){return 1},1)}))},Tg=Pp.forEach,bg=Eg("forEach")?[].forEach:function(e){return Tg(this,e,arguments.length>1?arguments[1]:void 0)},Sg=yl,Cg={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},kg=mg,Ig=bg,Pg=ah,Dg=function(e){if(e&&e.forEach!==Ig)try{Pg(e,"forEach",Ig)}catch(t){e.forEach=Ig}};for(var wg in Cg)Cg[wg]&&Dg(Sg[wg]&&Sg[wg].prototype);Dg(kg);var Ag=tc,Rg=String,xg=TypeError,Og=Nl,Lg=Yu,Ng=function(e){if("object"==typeof e||Ag(e))return e;throw xg("Can't set "+Rg(e)+" as a prototype")},Mg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Og(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return Lg(i),Ng(n),t?e(i,n):i.__proto__=n,i}}():void 0),Ug=tc,Bg=rc,Fg=Mg,Hg=function(e,t,i){var n,r;return Fg&&Ug(n=t.constructor)&&n!==i&&Bg(r=n.prototype)&&r!==i.prototype&&Fg(e,r),e},jg=Nl(1..valueOf),Vg="\t\n\v\f\r                 \u2028\u2029\ufeff",Kg=$l,Wg=Mp,Gg=Vg,Yg=Nl("".replace),zg="["+Gg+"]",$g=RegExp("^"+zg+zg+"*"),Xg=RegExp(zg+zg+"*$"),qg=function(e){return function(t){var i=Wg(Kg(t));return 1&e&&(i=Yg(i,$g,"")),2&e&&(i=Yg(i,Xg,"")),i}},Zg={start:qg(1),end:qg(2),trim:qg(3)},Qg=_l,Jg=yl,ey=Nl,ty=ef,iy=od,ny=Jc,ry=Hg,oy=lc,ay=kc,sy=bu,ly=ml,cy=ad.f,uy=vl.f,hy=ju.f,dy=jg,fy=Zg.trim,py="Number",gy=Jg[py],yy=gy.prototype,vy=Jg.TypeError,my=ey("".slice),_y=ey("".charCodeAt),Ey=function(e){var t,i,n,r,o,a,s,l,c=sy(e,"number");if(ay(c))throw vy("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=fy(c),43===(t=_y(c,0))||45===t){if(88===(i=_y(c,2))||120===i)return NaN}else if(48===t){switch(_y(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=my(c,2)).length,s=0;s<a;s++)if((l=_y(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c};if(ty(py,!gy(" 0o1")||!gy("0b1")||gy("+0x1"))){for(var Ty,by=function(e){var t=arguments.length<1?0:gy(function(e){var t=sy(e,"number");return"bigint"==typeof t?t:Ey(t)}(e)),i=this;return oy(yy,i)&&ly((function(){dy(i)}))?ry(Object(t),i,by):t},Sy=Qg?cy(gy):"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(","),Cy=0;Sy.length>Cy;Cy++)ny(gy,Ty=Sy[Cy])&&!ny(by,Ty)&&hy(by,Ty,uy(gy,Ty));by.prototype=yy,yy.constructor=by,iy(Jg,py,by,{constructor:!0})}var ky=_l,Iy=fh.EXISTS,Py=Nl,Dy=ju.f,wy=Function.prototype,Ay=Py(wy.toString),Ry=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,xy=Py(Ry.exec);ky&&!Iy&&Dy(wy,"name",{configurable:!0,get:function(){try{return xy(Ry,Ay(this))[1]}catch(e){return""}}});var Oy=cf,Ly=Wl,Ny=Zl,My=Eg,Uy=Nl([].join),By=Ly!=Object,Fy=My("join",",");Oy({target:"Array",proto:!0,forced:By||!Fy},{join:function(e){return Uy(Ny(this),void 0===e?",":e)}});var Hy,jy,Vy,Ky,Wy="process"==Fl(yl.process),Gy=ju.f,Yy=Jc,zy=pu("toStringTag"),$y=function(e,t,i){e&&!i&&(e=e.prototype),e&&!Yy(e,zy)&&Gy(e,zy,{configurable:!0,value:t})},Xy=sc,qy=ju,Zy=_l,Qy=pu("species"),Jy=function(e){var t=Xy(e),i=qy.f;Zy&&t&&!t[Qy]&&i(t,Qy,{configurable:!0,get:function(){return this}})},ev=lc,tv=TypeError,iv=Hf,nv=Pc,rv=TypeError,ov=Yu,av=function(e){if(iv(e))return e;throw rv(nv(e)+" is not a constructor")},sv=Gl,lv=pu("species"),cv=function(e,t){var i,n=ov(e).constructor;return void 0===n||sv(i=ov(n)[lv])?t:av(i)},uv=El,hv=Function.prototype,dv=hv.apply,fv=hv.call,pv="object"==typeof Reflect&&Reflect.apply||(uv?fv.bind(dv):function(){return fv.apply(dv,arguments)}),gv=sc("document","documentElement"),yv=Nl([].slice),vv=TypeError,mv=/(?:ipad|iphone|ipod).*applewebkit/i.test(cc),_v=yl,Ev=pv,Tv=_p,bv=tc,Sv=Jc,Cv=ml,kv=gv,Iv=yv,Pv=wu,Dv=function(e,t){if(e<t)throw vv("Not enough arguments");return e},wv=mv,Av=Wy,Rv=_v.setImmediate,xv=_v.clearImmediate,Ov=_v.process,Lv=_v.Dispatch,Nv=_v.Function,Mv=_v.MessageChannel,Uv=_v.String,Bv=0,Fv={},Hv="onreadystatechange";try{Hy=_v.location}catch(nF){}var jv=function(e){if(Sv(Fv,e)){var t=Fv[e];delete Fv[e],t()}},Vv=function(e){return function(){jv(e)}},Kv=function(e){jv(e.data)},Wv=function(e){_v.postMessage(Uv(e),Hy.protocol+"//"+Hy.host)};Rv&&xv||(Rv=function(e){Dv(arguments.length,1);var t=bv(e)?e:Nv(e),i=Iv(arguments,1);return Fv[++Bv]=function(){Ev(t,void 0,i)},jy(Bv),Bv},xv=function(e){delete Fv[e]},Av?jy=function(e){Ov.nextTick(Vv(e))}:Lv&&Lv.now?jy=function(e){Lv.now(Vv(e))}:Mv&&!wv?(Ky=(Vy=new Mv).port2,Vy.port1.onmessage=Kv,jy=Tv(Ky.postMessage,Ky)):_v.addEventListener&&bv(_v.postMessage)&&!_v.importScripts&&Hy&&"file:"!==Hy.protocol&&!Cv(Wv)?(jy=Wv,_v.addEventListener("message",Kv,!1)):jy=Hv in Pv("script")?function(e){kv.appendChild(Pv("script"))[Hv]=function(){kv.removeChild(this),jv(e)}}:function(e){setTimeout(Vv(e),0)});var Gv,Yv,zv,$v,Xv,qv,Zv,Qv,Jv={set:Rv,clear:xv},em=yl,tm=/ipad|iphone|ipod/i.test(cc)&&void 0!==em.Pebble,im=/web0s(?!.*chrome)/i.test(cc),nm=yl,rm=_p,om=vl.f,am=Jv.set,sm=mv,lm=tm,cm=im,um=Wy,hm=nm.MutationObserver||nm.WebKitMutationObserver,dm=nm.document,fm=nm.process,pm=nm.Promise,gm=om(nm,"queueMicrotask"),ym=gm&&gm.value;ym||(Gv=function(){var e,t;for(um&&(e=fm.domain)&&e.exit();Yv;){t=Yv.fn,Yv=Yv.next;try{t()}catch(nF){throw Yv?$v():zv=void 0,nF}}zv=void 0,e&&e.enter()},sm||um||cm||!hm||!dm?!lm&&pm&&pm.resolve?((Zv=pm.resolve(void 0)).constructor=pm,Qv=rm(Zv.then,Zv),$v=function(){Qv(Gv)}):um?$v=function(){fm.nextTick(Gv)}:(am=rm(am,nm),$v=function(){am(Gv)}):(Xv=!0,qv=dm.createTextNode(""),new hm(Gv).observe(qv,{characterData:!0}),$v=function(){qv.data=Xv=!Xv}));var vm=ym||function(e){var t={fn:e,next:void 0};zv&&(zv.next=t),Yv||(Yv=t,$v()),zv=t},mm=yl,_m=function(e){try{return{error:!1,value:e()}}catch(nF){return{error:!0,value:nF}}},Em=function(){this.head=null,this.tail=null};Em.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 Tm=Em,bm=yl.Promise,Sm="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Cm=!Sm&&!Wy&&"object"==typeof window&&"object"==typeof document,km=yl,Im=bm,Pm=tc,Dm=ef,wm=Eh,Am=pu,Rm=Cm,xm=Sm,Om=yc;Im&&Im.prototype;var Lm=Am("species"),Nm=!1,Mm=Pm(km.PromiseRejectionEvent),Um={CONSTRUCTOR:Dm("Promise",(function(){var e=wm(Im),t=e!==String(Im);if(!t&&66===Om)return!0;if(!Om||Om<51||!/native code/.test(e)){var i=new Im((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[Lm]=n,!(Nm=i.then((function(){}))instanceof n))return!0}return!t&&(Rm||xm)&&!Mm})),REJECTION_EVENT:Mm,SUBCLASSING:Nm},Bm={},Fm=Rc,Hm=TypeError,jm=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw Hm("Bad Promise constructor");t=e,i=n})),this.resolve=Fm(t),this.reject=Fm(i)};Bm.f=function(e){return new jm(e)};var Vm,Km,Wm,Gm=cf,Ym=Wy,zm=yl,$m=Sl,Xm=od,qm=Mg,Zm=$y,Qm=Jy,Jm=Rc,e_=tc,t_=rc,i_=function(e,t){if(ev(t,e))return e;throw tv("Incorrect invocation")},n_=cv,r_=Jv.set,o_=vm,a_=function(e,t){var i=mm.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},s_=_m,l_=Tm,c_=jh,u_=bm,h_=Bm,d_="Promise",f_=Um.CONSTRUCTOR,p_=Um.REJECTION_EVENT,g_=Um.SUBCLASSING,y_=c_.getterFor(d_),v_=c_.set,m_=u_&&u_.prototype,__=u_,E_=m_,T_=zm.TypeError,b_=zm.document,S_=zm.process,C_=h_.f,k_=C_,I_=!!(b_&&b_.createEvent&&zm.dispatchEvent),P_="unhandledrejection",D_=function(e){var t;return!(!t_(e)||!e_(t=e.then))&&t},w_=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&&L_(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(T_("Promise-chain cycle")):(n=D_(i))?$m(n,i,l,c):l(i)):c(o)}catch(nF){u&&!r&&u.exit(),c(nF)}},A_=function(e,t){e.notified||(e.notified=!0,o_((function(){for(var i,n=e.reactions;i=n.get();)w_(i,e);e.notified=!1,t&&!e.rejection&&x_(e)})))},R_=function(e,t,i){var n,r;I_?((n=b_.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),zm.dispatchEvent(n)):n={promise:t,reason:i},!p_&&(r=zm["on"+e])?r(n):e===P_&&a_("Unhandled promise rejection",i)},x_=function(e){$m(r_,zm,(function(){var t,i=e.facade,n=e.value;if(O_(e)&&(t=s_((function(){Ym?S_.emit("unhandledRejection",n,i):R_(P_,i,n)})),e.rejection=Ym||O_(e)?2:1,t.error))throw t.value}))},O_=function(e){return 1!==e.rejection&&!e.parent},L_=function(e){$m(r_,zm,(function(){var t=e.facade;Ym?S_.emit("rejectionHandled",t):R_("rejectionhandled",t,e.value)}))},N_=function(e,t,i){return function(n){e(t,n,i)}},M_=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,A_(e,!0))},U_=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw T_("Promise can't be resolved itself");var n=D_(t);n?o_((function(){var i={done:!1};try{$m(n,t,N_(U_,i,e),N_(M_,i,e))}catch(nF){M_(i,nF,e)}})):(e.value=t,e.state=1,A_(e,!1))}catch(nF){M_({done:!1},nF,e)}}};if(f_&&(E_=(__=function(e){i_(this,E_),Jm(e),$m(Vm,this);var t=y_(this);try{e(N_(U_,t),N_(M_,t))}catch(nF){M_(t,nF)}}).prototype,(Vm=function(e){v_(this,{type:d_,done:!1,notified:!1,parent:!1,reactions:new l_,rejection:!1,state:0,value:void 0})}).prototype=Xm(E_,"then",(function(e,t){var i=y_(this),n=C_(n_(this,__));return i.parent=!0,n.ok=!e_(e)||e,n.fail=e_(t)&&t,n.domain=Ym?S_.domain:void 0,0==i.state?i.reactions.add(n):o_((function(){w_(n,i)})),n.promise})),Km=function(){var e=new Vm,t=y_(e);this.promise=e,this.resolve=N_(U_,t),this.reject=N_(M_,t)},h_.f=C_=function(e){return e===__||undefined===e?new Km(e):k_(e)},e_(u_)&&m_!==Object.prototype)){Wm=m_.then,g_||Xm(m_,"then",(function(e,t){var i=this;return new __((function(e,t){$m(Wm,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete m_.constructor}catch(nF){}qm&&qm(m_,E_)}Gm({global:!0,constructor:!0,wrap:!0,forced:f_},{Promise:__}),Zm(__,d_,!1),Qm(d_);var B_={},F_=B_,H_=pu("iterator"),j_=Array.prototype,V_=If,K_=Lc,W_=Gl,G_=B_,Y_=pu("iterator"),z_=function(e){if(!W_(e))return K_(e,Y_)||K_(e,"@@iterator")||G_[V_(e)]},$_=Sl,X_=Rc,q_=Yu,Z_=Pc,Q_=z_,J_=TypeError,eE=Sl,tE=Yu,iE=Lc,nE=_p,rE=Sl,oE=Yu,aE=Pc,sE=function(e){return void 0!==e&&(F_.Array===e||j_[H_]===e)},lE=_d,cE=lc,uE=function(e,t){var i=arguments.length<2?Q_(e):t;if(X_(i))return q_($_(i,e));throw J_(Z_(e)+" is not iterable")},hE=z_,dE=function(e,t,i){var n,r;tE(e);try{if(!(n=iE(e,"return"))){if("throw"===t)throw i;return i}n=eE(n,e)}catch(nF){r=!0,n=nF}if("throw"===t)throw i;if(r)throw n;return tE(n),i},fE=TypeError,pE=function(e,t){this.stopped=e,this.result=t},gE=pE.prototype,yE=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=nE(t,u),y=function(e){return n&&dE(n,"normal",e),new pE(!0,e)},v=function(e){return h?(oE(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=hE(e)))throw fE(aE(e)+" is not iterable");if(sE(r)){for(o=0,a=lE(e);a>o;o++)if((s=v(e[o]))&&cE(gE,s))return s;return new pE(!1)}n=uE(e,r)}for(l=d?e.next:n.next;!(c=rE(l,n)).done;){try{s=v(c.value)}catch(nF){dE(n,"throw",nF)}if("object"==typeof s&&s&&cE(gE,s))return s}return new pE(!1)},vE=pu("iterator"),mE=!1;try{var _E=0,EE={next:function(){return{done:!!_E++}},return:function(){mE=!0}};EE[vE]=function(){return this},Array.from(EE,(function(){throw 2}))}catch(nF){}var TE=bm,bE=Um.CONSTRUCTOR||!function(e,t){if(!t&&!mE)return!1;var i=!1;try{var n={};n[vE]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(nF){}return i}((function(e){TE.all(e).then(void 0,(function(){}))})),SE=Sl,CE=Rc,kE=Bm,IE=_m,PE=yE;cf({target:"Promise",stat:!0,forced:bE},{all:function(e){var t=this,i=kE.f(t),n=i.resolve,r=i.reject,o=IE((function(){var i=CE(t.resolve),o=[],a=0,s=1;PE(e,(function(e){var l=a++,c=!1;s++,SE(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 DE=cf,wE=Um.CONSTRUCTOR,AE=bm,RE=sc,xE=tc,OE=od,LE=AE&&AE.prototype;if(DE({target:"Promise",proto:!0,forced:wE,real:!0},{catch:function(e){return this.then(void 0,e)}}),xE(AE)){var NE=RE("Promise").prototype.catch;LE.catch!==NE&&OE(LE,"catch",NE,{unsafe:!0})}var ME=Sl,UE=Rc,BE=Bm,FE=_m,HE=yE;cf({target:"Promise",stat:!0,forced:bE},{race:function(e){var t=this,i=BE.f(t),n=i.reject,r=FE((function(){var r=UE(t.resolve);HE(e,(function(e){ME(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var jE=Sl,VE=Bm;cf({target:"Promise",stat:!0,forced:Um.CONSTRUCTOR},{reject:function(e){var t=VE.f(this);return jE(t.reject,void 0,e),t.promise}});var KE=Yu,WE=rc,GE=Bm,YE=function(e,t){if(KE(e),WE(t)&&t.constructor===e)return t;var i=GE.f(e);return(0,i.resolve)(t),i.promise},zE=cf,$E=Um.CONSTRUCTOR,XE=YE;sc("Promise"),zE({target:"Promise",stat:!0,forced:$E},{resolve:function(e){return XE(this,e)}});var qE=cf,ZE=bm,QE=ml,JE=sc,eT=tc,tT=cv,iT=YE,nT=od,rT=ZE&&ZE.prototype;if(qE({target:"Promise",proto:!0,real:!0,forced:!!ZE&&QE((function(){rT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=tT(this,JE("Promise")),i=eT(e);return this.then(i?function(i){return iT(t,e()).then((function(){return i}))}:e,i?function(i){return iT(t,e()).then((function(){throw i}))}:e)}}),eT(ZE)){var oT=JE("Promise").prototype.finally;rT.finally!==oT&&nT(rT,"finally",oT,{unsafe:!0})}var aT=_l,sT=hf,lT=TypeError,cT=Object.getOwnPropertyDescriptor,uT=aT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(nF){return nF instanceof TypeError}}(),hT=Pc,dT=TypeError,fT=cf,pT=qc,gT=pd,yT=ud,vT=_d,mT=uT?function(e,t){if(sT(e)&&!cT(e,"length").writable)throw lT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},_T=ff,ET=zf,TT=vf,bT=function(e,t){if(!delete e[t])throw dT("Cannot delete property "+hT(t)+" of "+hT(e))},ST=Zf("splice"),CT=Math.max,kT=Math.min;fT({target:"Array",proto:!0,forced:!ST},{splice:function(e,t){var i,n,r,o,a,s,l=pT(this),c=vT(l),u=gT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=kT(CT(yT(t),0),c-u)),_T(c+i-n),r=ET(l,n),o=0;o<n;o++)(a=u+o)in l&&TT(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]:bT(l,s);for(o=c;o>c-n+i;o--)bT(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]:bT(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return mT(l,c-n+i),r}});var IT=ud,PT=Mp,DT=$l,wT=RangeError,AT=cf,RT=Nl,xT=ud,OT=jg,LT=function(e){var t=PT(DT(this)),i="",n=IT(e);if(n<0||n==1/0)throw wT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},NT=ml,MT=RangeError,UT=String,BT=Math.floor,FT=RT(LT),HT=RT("".slice),jT=RT(1..toFixed),VT=function(e,t,i){return 0===t?i:t%2==1?VT(e,t-1,i*e):VT(e*e,t/2,i)},KT=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=BT(r/1e7)},WT=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=BT(n/t),n=n%t*1e7},GT=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=UT(e[t]);i=""===i?n:i+FT("0",7-n.length)+n}return i};AT({target:"Number",proto:!0,forced:NT((function(){return"0.000"!==jT(8e-5,3)||"1"!==jT(.9,0)||"1.25"!==jT(1.255,2)||"1000000000000000128"!==jT(0xde0b6b3a7640080,0)}))||!NT((function(){jT({})}))},{toFixed:function(e){var t,i,n,r,o=OT(this),a=xT(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw MT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return UT(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*VT(2,69,1))-69)<0?o*VT(2,-t,1):o/VT(2,t,1),i*=4503599627370496,(t=52-t)>0){for(KT(s,0,i),n=a;n>=7;)KT(s,1e7,0),n-=7;for(KT(s,VT(10,n,1),0),n=t-1;n>=23;)WT(s,1<<23),n-=23;WT(s,1<<n),KT(s,1,1),WT(s,2),c=GT(s)}else KT(s,0,i),KT(s,1<<-t,0),c=GT(s)+FT("0",a);return c=a>0?l+((r=c.length)<=a?"0."+FT("0",a-r)+c:HT(c,0,r-a)+"."+HT(c,r-a)):l+c}}),cf({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var YT=ml,zT=yl.RegExp,$T=YT((function(){var e=zT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),XT=$T||YT((function(){return!zT("a","y").sticky})),qT={BROKEN_CARET:$T||YT((function(){var e=zT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:XT,UNSUPPORTED_Y:$T},ZT={},QT=_l,JT=Vu,eb=ju,tb=Yu,ib=Zl,nb=Rp;ZT.f=QT&&!JT?Object.defineProperties:function(e,t){tb(e);for(var i,n=ib(t),r=nb(t),o=r.length,a=0;o>a;)eb.f(e,i=r[a++],n[i]);return e};var rb,ob=Yu,ab=ZT,sb=Rd,lb=Ph,cb=gv,ub=wu,hb="prototype",db="script",fb=Ih("IE_PROTO"),pb=function(){},gb=function(e){return"<"+db+">"+e+"</"+db+">"},yb=function(e){e.write(gb("")),e.close();var t=e.parentWindow.Object;return e=null,t},vb=function(){try{rb=new ActiveXObject("htmlfile")}catch(nF){}var e,t,i;vb="undefined"!=typeof document?document.domain&&rb?yb(rb):(t=ub("iframe"),i="java"+db+":",t.style.display="none",cb.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(gb("document.F=Object")),e.close(),e.F):yb(rb);for(var n=sb.length;n--;)delete vb[hb][sb[n]];return vb()};lb[fb]=!0;var mb,_b,Eb=Object.create||function(e,t){var i;return null!==e?(pb[hb]=ob(e),i=new pb,pb[hb]=null,i[fb]=e):i=vb(),void 0===t?i:ab.f(i,t)},Tb=ml,bb=yl.RegExp,Sb=Tb((function(){var e=bb(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Cb=ml,kb=yl.RegExp,Ib=Cb((function(){var e=kb("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Pb=Sl,Db=Nl,wb=Mp,Ab=Jp,Rb=qT,xb=Eb,Ob=jh.get,Lb=Sb,Nb=Ib,Mb=zc("native-string-replace",String.prototype.replace),Ub=RegExp.prototype.exec,Bb=Ub,Fb=Db("".charAt),Hb=Db("".indexOf),jb=Db("".replace),Vb=Db("".slice),Kb=(_b=/b*/g,Pb(Ub,mb=/a/,"a"),Pb(Ub,_b,"a"),0!==mb.lastIndex||0!==_b.lastIndex),Wb=Rb.BROKEN_CARET,Gb=void 0!==/()??/.exec("")[1];(Kb||Gb||Wb||Lb||Nb)&&(Bb=function(e){var t,i,n,r,o,a,s,l=this,c=Ob(l),u=wb(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=Pb(Bb,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=Wb&&l.sticky,p=Pb(Ab,l),g=l.source,y=0,v=u;if(f&&(p=jb(p,"y",""),-1===Hb(p,"g")&&(p+="g"),v=Vb(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Fb(u,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),i=new RegExp("^(?:"+g+")",p)),Gb&&(i=new RegExp("^"+g+"$(?!\\s)",p)),Kb&&(n=l.lastIndex),r=Pb(Ub,f?i:l,v),f?r?(r.input=Vb(r.input,y),r[0]=Vb(r[0],y),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:Kb&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),Gb&&r&&r.length>1&&Pb(Mb,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=xb(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var Yb=Bb;cf({target:"RegExp",proto:!0,forced:/./.exec!==Yb},{exec:Yb});var zb=gp,$b=od,Xb=Yb,qb=ml,Zb=pu,Qb=ah,Jb=Zb("species"),eS=RegExp.prototype,tS=function(e,t,i,n){var r=Zb(e),o=!qb((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!qb((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[Jb]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=zb(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=zb(e),l=t.exec;return l===Xb||l===eS.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));$b(String.prototype,e,l[0]),$b(eS,r,l[1])}n&&Qb(eS[r],"sham",!0)},iS=Gp.charAt,nS=function(e,t,i){return t+(i?iS(e,t).length:1)},rS=Nl,oS=qc,aS=Math.floor,sS=rS("".charAt),lS=rS("".replace),cS=rS("".slice),uS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,hS=/\$([$&'`]|\d{1,2})/g,dS=Sl,fS=Yu,pS=tc,gS=Fl,yS=Yb,vS=TypeError,mS=function(e,t){var i=e.exec;if(pS(i)){var n=dS(i,e,t);return null!==n&&fS(n),n}if("RegExp"===gS(e))return dS(yS,e,t);throw vS("RegExp#exec called on incompatible receiver")},_S=pv,ES=Sl,TS=Nl,bS=tS,SS=ml,CS=Yu,kS=tc,IS=Gl,PS=ud,DS=vd,wS=Mp,AS=$l,RS=nS,xS=Lc,OS=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=hS;return void 0!==r&&(r=oS(r),l=uS),lS(o,l,(function(o,l){var c;switch(sS(l,0)){case"$":return"$";case"&":return e;case"`":return cS(t,0,i);case"'":return cS(t,a);case"<":c=r[cS(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=aS(u/10);return 0===h?o:h<=s?void 0===n[h-1]?sS(l,1):n[h-1]+sS(l,1):o}c=n[u-1]}return void 0===c?"":c}))},LS=mS,NS=pu("replace"),MS=Math.max,US=Math.min,BS=TS([].concat),FS=TS([].push),HS=TS("".indexOf),jS=TS("".slice),VS="$0"==="a".replace(/./,"$0"),KS=!!/./[NS]&&""===/./[NS]("a","$0");bS("replace",(function(e,t,i){var n=KS?"$":"$0";return[function(e,i){var n=AS(this),r=IS(e)?void 0:xS(e,NS);return r?ES(r,e,n,i):ES(t,wS(n),e,i)},function(e,r){var o=CS(this),a=wS(e);if("string"==typeof r&&-1===HS(r,n)&&-1===HS(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=kS(r);l||(r=wS(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=LS(o,a);if(null===d)break;if(FS(h,d),!c)break;""===wS(d[0])&&(o.lastIndex=RS(a,DS(o.lastIndex),u))}for(var f,p="",g=0,y=0;y<h.length;y++){for(var v=wS((d=h[y])[0]),m=MS(US(PS(d.index),a.length),0),_=[],E=1;E<d.length;E++)FS(_,void 0===(f=d[E])?f:String(f));var T=d.groups;if(l){var b=BS([v],_,m,a);void 0!==T&&FS(b,T);var S=wS(_S(r,void 0,b))}else S=OS(v,a,m,_,T,r);m>=g&&(p+=jS(a,g,m)+S,g=m+v.length)}return p+jS(a,g)}]}),!!SS((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!VS||KS);var WS=rc,GS=Fl,YS=pu("match"),zS=function(e){var t;return WS(e)&&(void 0!==(t=e[YS])?!!t:"RegExp"==GS(e))},$S=pd,XS=_d,qS=vf,ZS=Array,QS=Math.max,JS=function(e,t,i){for(var n=XS(e),r=$S(t,n),o=$S(void 0===i?n:i,n),a=ZS(QS(o-r,0)),s=0;r<o;r++,s++)qS(a,s,e[r]);return a.length=s,a},eC=pv,tC=Sl,iC=Nl,nC=tS,rC=Yu,oC=Gl,aC=zS,sC=$l,lC=cv,cC=nS,uC=vd,hC=Mp,dC=Lc,fC=JS,pC=mS,gC=Yb,yC=ml,vC=qT.UNSUPPORTED_Y,mC=4294967295,_C=Math.min,EC=[].push,TC=iC(/./.exec),bC=iC(EC),SC=iC("".slice),CC=!yC((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]}));nC("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=hC(sC(this)),r=void 0===i?mC:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!aC(e))return tC(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=tC(gC,h,n))&&!((a=h.lastIndex)>u&&(bC(l,SC(n,u,o.index)),o.length>1&&o.index<n.length&&eC(EC,l,fC(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&TC(h,"")||bC(l,""):bC(l,SC(n,u)),l.length>r?fC(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:tC(t,this,e,i)}:t,[function(t,i){var r=sC(this),o=oC(t)?void 0:dC(t,e);return o?tC(o,t,r,i):tC(n,hC(r),t,i)},function(e,r){var o=rC(this),a=hC(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=lC(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(vC?"g":"y"),h=new l(vC?"^(?:"+o.source+")":o,u),d=void 0===r?mC:r>>>0;if(0===d)return[];if(0===a.length)return null===pC(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=vC?0:p;var y,v=pC(h,vC?SC(a,p):a);if(null===v||(y=_C(uC(h.lastIndex+(vC?p:0)),a.length))===f)p=cC(a,p,c);else{if(bC(g,SC(a,f,p)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(bC(g,v[m]),g.length===d)return g;p=f=y}}return bC(g,SC(a,f)),g}]}),!CC,vC);var kC=fh.PROPER,IC=ml,PC=Vg,DC=Zg.trim;cf({target:"String",proto:!0,forced:function(e){return IC((function(){return!!PC[e]()||"​…᠎"!=="​…᠎"[e]()||kC&&PC[e].name!==e}))}("trim")},{trim:function(){return DC(this)}});var wC=Pp.filter;cf({target:"Array",proto:!0,forced:!Zf("filter")},{filter:function(e){return wC(this,e,arguments.length>1?arguments[1]:void 0)}});var AC=Sl,RC=Yu,xC=Gl,OC=vd,LC=Mp,NC=$l,MC=Lc,UC=nS,BC=mS;tS("match",(function(e,t,i){return[function(t){var i=NC(this),n=xC(t)?void 0:MC(t,e);return n?AC(n,t,i):new RegExp(t)[e](LC(i))},function(e){var n=RC(this),r=LC(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return BC(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=BC(n,r));){var u=LC(s[0]);l[c]=u,""===u&&(n.lastIndex=UC(r,OC(n.lastIndex),a)),c++}return 0===c?null:l}]}));var FC=ju.f,HC=_l,jC=yl,VC=Nl,KC=ef,WC=Hg,GC=ah,YC=ad.f,zC=lc,$C=zS,XC=Mp,qC=og,ZC=qT,QC=function(e,t,i){i in e||FC(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},JC=od,ek=ml,tk=Jc,ik=jh.enforce,nk=Jy,rk=Sb,ok=Ib,ak=pu("match"),sk=jC.RegExp,lk=sk.prototype,ck=jC.SyntaxError,uk=VC(lk.exec),hk=VC("".charAt),dk=VC("".replace),fk=VC("".indexOf),pk=VC("".slice),gk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,yk=/a/g,vk=/a/g,mk=new sk(yk)!==yk,_k=ZC.MISSED_STICKY,Ek=ZC.UNSUPPORTED_Y,Tk=HC&&(!mk||_k||rk||ok||ek((function(){return vk[ak]=!1,sk(yk)!=yk||sk(vk)==vk||"/a/i"!=sk(yk,"i")})));if(KC("RegExp",Tk)){for(var bk=function(e,t){var i,n,r,o,a,s,l=zC(lk,this),c=$C(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===bk)return e;if((c||zC(lk,e))&&(e=e.source,u&&(t=qC(d))),e=void 0===e?"":XC(e),t=void 0===t?"":XC(t),d=e,rk&&"dotAll"in yk&&(n=!!t&&fk(t,"s")>-1)&&(t=dk(t,/s/g,"")),i=t,_k&&"sticky"in yk&&(r=!!t&&fk(t,"y")>-1)&&Ek&&(t=dk(t,/y/g,"")),ok&&(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=hk(e,n)))t+=hk(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:uk(gk,pk(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||tk(a,u))throw new ck("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=WC(sk(e,t),l?this:lk,bk),(n||r||h.length)&&(s=ik(a),n&&(s.dotAll=!0,s.raw=bk(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=hk(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+hk(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{GC(a,"source",""===d?"(?:)":d)}catch(nF){}return a},Sk=YC(sk),Ck=0;Sk.length>Ck;)QC(bk,sk,Sk[Ck++]);lk.constructor=bk,bk.prototype=lk,JC(jC,"RegExp",bk,{constructor:!0})}nk("RegExp");var kk="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function Ik(){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 Pk(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 Dk(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(nF){return t}return t}function wk(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];kk&&(t=console).log.apply(t,["[logger]",e].concat(n))}function Ak(){try{return Math.round(window.performance.now())}catch(nF){return(new Date).getTime()}}function Rk(){return(new Date).getTime()}function xk(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=Ak(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=Dk(s),a.connectTime=Ak()-o,a.status=s.status,a.statusText=s.statusText,r=Ak())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=Ak()-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=Ak()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=Ak()-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(l){n(l)}}))}function Ok(e){return!e||window.location.href.indexOf(e)>-1}function Lk(e){return!!e&&/^blob:/.test(e)}var Nk={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function Mk(e){if(!e)return{};var t={};return Object.keys(Nk).map((function(i){if(e[i]||"string"!=typeof Nk[i]){if(!e[i]&&Nk[i]instanceof Array){var n=Nk[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[Nk[i]]||""})),t}function Uk(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Bk(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(n){var i=e.className&&"object"===ll(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function Fk(e){return"String"===Uk(e)?e.replace("P","p"):e?"Number"===Uk(e)?"".concat(e):void 0:""}function Hk(e){try{return JSON.stringify(e)}catch(t){return""}}var jk=0,Vk=1,Kk=2;function Wk(e,t){return Math.round(t/e*1e3*100)}var Gk=[];"undefined"!=typeof window&&function(){try{new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");Gk.length>30&&Gk.splice(0,Gk.length-30);for(var i=0;i<t.length;i++)Gk.push(t[i])})).observe({entryTypes:["resource"]})}catch(e){console.warn("PerformanceObserver not support",e)}}();var Yk="videoplayer_oneplay",zk="videoplayer_oneopera",$k="videoplayer_oneerror",Xk="videoplayer_oneevent",qk="videoplayer_onetemp",Zk={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},Qk={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},Jk=0,eI=1,tI=2,iI=3,nI=4,rI=0,oI=1,aI=2,sI=3,lI=1,cI=2,uI=3,hI=4,dI=5,fI=6,pI=7,gI="error_retry",yI="oneerror",vI="oneevent",mI="onetemp",_I=0,EI=1,TI=864e5,bI=36e5,SI=["tag","subtag","device_type"],CI={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var kI=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(e){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(t){return!0}}()?window.localStorage:{},II="__xgplayerlogkey",PI={set:function(e){try{var t=this.get();t.push(e),kI.setItem(II,JSON.stringify(t))}catch(nF){}},get:function(){try{var e=kI.getItem(II);return e=e?JSON.parse(e):[]}catch(nF){return[]}},remove:function(){try{kI.removeItem(II)}catch(nF){}},clear:function(){try{kI.clear()}catch(nF){}}},DI={},wI=Fl,AI=Zl,RI=ad.f,xI=JS,OI="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];DI.f=function(e){return OI&&"Window"==wI(e)?function(e){try{return RI(e)}catch(nF){return xI(OI)}}(e):RI(AI(e))};var LI={},NI=pu;LI.f=NI;var MI=yl,UI=Jc,BI=LI,FI=ju.f,HI=Sl,jI=sc,VI=pu,KI=od,WI=cf,GI=yl,YI=Sl,zI=Nl,$I=_l,XI=_c,qI=ml,ZI=Jc,QI=lc,JI=Yu,eP=Zl,tP=ku,iP=Mp,nP=Al,rP=Eb,oP=Rp,aP=ad,sP=DI,lP=Ld,cP=vl,uP=ju,hP=ZT,dP=Cl,fP=od,pP=zc,gP=Ph,yP=ru,vP=pu,mP=LI,_P=function(e){var t=MI.Symbol||(MI.Symbol={});UI(t,e)||FI(t,e,{value:BI.f(e)})},EP=function(){var e=jI("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=VI("toPrimitive");t&&!t[n]&&KI(t,n,(function(e){return HI(i,this)}),{arity:1})},TP=$y,bP=jh,SP=Pp.forEach,CP=Ih("hidden"),kP="Symbol",IP="prototype",PP=bP.set,DP=bP.getterFor(kP),wP=Object[IP],AP=GI.Symbol,RP=AP&&AP[IP],xP=GI.TypeError,OP=GI.QObject,LP=cP.f,NP=uP.f,MP=sP.f,UP=dP.f,BP=zI([].push),FP=pP("symbols"),HP=pP("op-symbols"),jP=pP("wks"),VP=!OP||!OP[IP]||!OP[IP].findChild,KP=$I&&qI((function(){return 7!=rP(NP({},"a",{get:function(){return NP(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=LP(wP,t);n&&delete wP[t],NP(e,t,i),n&&e!==wP&&NP(wP,t,n)}:NP,WP=function(e,t){var i=FP[e]=rP(RP);return PP(i,{type:kP,tag:e,description:t}),$I||(i.description=t),i},GP=function(e,t,i){e===wP&&GP(HP,t,i),JI(e);var n=tP(t);return JI(i),ZI(FP,n)?(i.enumerable?(ZI(e,CP)&&e[CP][n]&&(e[CP][n]=!1),i=rP(i,{enumerable:nP(0,!1)})):(ZI(e,CP)||NP(e,CP,nP(1,{})),e[CP][n]=!0),KP(e,n,i)):NP(e,n,i)},YP=function(e,t){JI(e);var i=eP(t),n=oP(i).concat(qP(i));return SP(n,(function(t){$I&&!YI(zP,i,t)||GP(e,t,i[t])})),e},zP=function(e){var t=tP(e),i=YI(UP,this,t);return!(this===wP&&ZI(FP,t)&&!ZI(HP,t))&&(!(i||!ZI(this,t)||!ZI(FP,t)||ZI(this,CP)&&this[CP][t])||i)},$P=function(e,t){var i=eP(e),n=tP(t);if(i!==wP||!ZI(FP,n)||ZI(HP,n)){var r=LP(i,n);return!r||!ZI(FP,n)||ZI(i,CP)&&i[CP][n]||(r.enumerable=!0),r}},XP=function(e){var t=MP(eP(e)),i=[];return SP(t,(function(e){ZI(FP,e)||ZI(gP,e)||BP(i,e)})),i},qP=function(e){var t=e===wP,i=MP(t?HP:eP(e)),n=[];return SP(i,(function(e){!ZI(FP,e)||t&&!ZI(wP,e)||BP(n,FP[e])})),n};XI||(AP=function(){if(QI(RP,this))throw xP("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?iP(arguments[0]):void 0,t=yP(e),i=function(e){this===wP&&YI(i,HP,e),ZI(this,CP)&&ZI(this[CP],t)&&(this[CP][t]=!1),KP(this,t,nP(1,e))};return $I&&VP&&KP(wP,t,{configurable:!0,set:i}),WP(t,e)},fP(RP=AP[IP],"toString",(function(){return DP(this).tag})),fP(AP,"withoutSetter",(function(e){return WP(yP(e),e)})),dP.f=zP,uP.f=GP,hP.f=YP,cP.f=$P,aP.f=sP.f=XP,lP.f=qP,mP.f=function(e){return WP(vP(e),e)},$I&&(NP(RP,"description",{configurable:!0,get:function(){return DP(this).description}}),fP(wP,"propertyIsEnumerable",zP,{unsafe:!0}))),WI({global:!0,constructor:!0,wrap:!0,forced:!XI,sham:!XI},{Symbol:AP}),SP(oP(jP),(function(e){_P(e)})),WI({target:kP,stat:!0,forced:!XI},{useSetter:function(){VP=!0},useSimple:function(){VP=!1}}),WI({target:"Object",stat:!0,forced:!XI,sham:!$I},{create:function(e,t){return void 0===t?rP(e):YP(rP(e),t)},defineProperty:GP,defineProperties:YP,getOwnPropertyDescriptor:$P}),WI({target:"Object",stat:!0,forced:!XI},{getOwnPropertyNames:XP}),EP(),TP(AP,kP),gP[CP]=!0;var ZP=_c&&!!Symbol.for&&!!Symbol.keyFor,QP=cf,JP=sc,eD=Jc,tD=Mp,iD=zc,nD=ZP,rD=iD("string-to-symbol-registry"),oD=iD("symbol-to-string-registry");QP({target:"Symbol",stat:!0,forced:!nD},{for:function(e){var t=tD(e);if(eD(rD,t))return rD[t];var i=JP("Symbol")(t);return rD[t]=i,oD[i]=t,i}});var aD=cf,sD=Jc,lD=kc,cD=Pc,uD=ZP,hD=zc("symbol-to-string-registry");aD({target:"Symbol",stat:!0,forced:!uD},{keyFor:function(e){if(!lD(e))throw TypeError(cD(e)+" is not a symbol");if(sD(hD,e))return hD[e]}});var dD=cf,fD=sc,pD=pv,gD=Sl,yD=Nl,vD=ml,mD=hf,_D=tc,ED=rc,TD=kc,bD=yv,SD=_c,CD=fD("JSON","stringify"),kD=yD(/./.exec),ID=yD("".charAt),PD=yD("".charCodeAt),DD=yD("".replace),wD=yD(1..toString),AD=/[\uD800-\uDFFF]/g,RD=/^[\uD800-\uDBFF]$/,xD=/^[\uDC00-\uDFFF]$/,OD=!SD||vD((function(){var e=fD("Symbol")();return"[null]"!=CD([e])||"{}"!=CD({a:e})||"{}"!=CD(Object(e))})),LD=vD((function(){return'"\\udf06\\ud834"'!==CD("\udf06\ud834")||'"\\udead"'!==CD("\udead")})),ND=function(e,t){var i=bD(arguments),n=t;if((ED(t)||void 0!==e)&&!TD(e))return mD(t)||(t=function(e,t){if(_D(n)&&(t=gD(n,this,e,t)),!TD(t))return t}),i[1]=t,pD(CD,null,i)},MD=function(e,t,i){var n=ID(i,t-1),r=ID(i,t+1);return kD(RD,e)&&!kD(xD,r)||kD(xD,e)&&!kD(RD,n)?"\\u"+wD(PD(e,0),16):e};CD&&dD({target:"JSON",stat:!0,arity:3,forced:OD||LD},{stringify:function(e,t,i){var n=bD(arguments),r=pD(OD?ND:CD,null,n);return LD&&"string"==typeof r?DD(r,AD,MD):r}});var UD=Ld,BD=qc;cf({target:"Object",stat:!0,forced:!_c||ml((function(){UD.f(1)}))},{getOwnPropertySymbols:function(e){var t=UD.f;return t?t(BD(e)):[]}});var FD=cf,HD=_l,jD=yl,VD=Nl,KD=Jc,WD=tc,GD=lc,YD=Mp,zD=ju.f,$D=Gd,XD=jD.Symbol,qD=XD&&XD.prototype;if(HD&&WD(XD)&&(!("description"in qD)||void 0!==XD().description)){var ZD={},QD=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:YD(arguments[0]),t=GD(qD,this)?new XD(e):void 0===e?XD():XD(e);return""===e&&(ZD[t]=!0),t};$D(QD,XD),QD.prototype=qD,qD.constructor=QD;var JD="Symbol(test)"==String(XD("test")),ew=VD(qD.valueOf),tw=VD(qD.toString),iw=/^Symbol\((.*)\)[^)]+$/,nw=VD("".replace),rw=VD("".slice);zD(qD,"description",{configurable:!0,get:function(){var e=ew(this);if(KD(ZD,e))return"";var t=tw(e),i=JD?rw(t,7,-1):nw(t,iw,"$1");return""===i?void 0:i}}),FD({global:!0,constructor:!0,forced:!0},{Symbol:QD})}var ow=[{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)/}],aw=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}],sw=["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 lw=["Baiduspider","YandexBot"],cw=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];var uw="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?(sw.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=ow;/trident/.test(e)&&(u=aw);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;lw.map((function(t){t===e&&(i=!0)}));for(var n=0;n<cw.length;n++){var r=cw[n];if(-1!==t.indexOf(r)){i=!0;break}}return i}(o.name,e),o}(navigator.userAgent);function hw(){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 dw=[1,1,1,1,1];function fw(){return parseInt(dw.join(""),10)}dw[0]=uw.isSupportMP4?dw[1]+1:dw[1],dw[1]=hw()?dw[1]+1:dw[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(a){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?dw[2]=dw[2]+1:dw[2]=1})).catch((function(){dw[2]=dw[2]-1}));var pw={range:"0-1048576",timer:6e4,timeout:15e3},gw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};cl(this,e),Object.keys(pw).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=pw[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 hl(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=Mk(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)?wk("task>>cant`t trigger url",this.ishangUp,this.intervalId):(wk("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),xk(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){wk("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){wk("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}(),yw="ProgressInfo";var vw=function(){function e(){cl(this,e),this._init()}return hl(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,wk(yw,"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(),wk(yw,"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){wk(yw,"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 mw="0.12.10";var _w=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];wk("xgVodLogger version is ".concat(mw));var Ew,Tw=(Ew="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(Ew,"]")}),bw=1300,Sw="__tea_cache_tokens_".concat(bw),Cw="",kw=null,Iw=function(){function e(t,i){var n=this;if(cl(this,e),dl(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===Uk(e)?e:"";"String"!==Uk(t)&&(t=""),n.urlLog={initial_url:t,initial_host:Pk(t),initial_ip:""}})),dl(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())})),dl(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),dl(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),dl(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),dl(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),dl(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=Ak(),n._endType="switch"})),dl(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),dl(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),wk("onDefinitionChange from:".concat(t,", to:").concat(i))})),dl(this,"onDefiChangeSuccess",(function(){wk("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),dl(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;wk("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:Ak(),operaType:"abr_switch",abrInfo:r})}})),dl(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=Rk(),wk("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=Fk(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})),dl(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),dl(this,"onCanplay",(function(){wk("onCanplay","this.startStep:".concat(n.startStep," ").concat(Rk())),n.setVt()})),dl(this,"onLoadeddata",(function(){wk("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(Rk())),n.setVt(),n.updateVideoSize()})),dl(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=Ok(n.player.currentSrc);n.triggerTask("start"),wk("onLoadStart","this.startStep:".concat(n.startStep," ").concat(Rk()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),dl(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=Rk())}})),dl(this,"onPlayerInited",(function(){wk("player init"),n._playerCreatedTime=Rk(),n.playlogs.rt=Rk()})),dl(this,"onNotAutoPlay",(function(){wk("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),dl(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(wk("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(uw.isSupportMP4," isPC:").concat(uw.isPC)),wk("onPlayerError",e),n.load_state=sI,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),uw.isPC&&!uw.isSupportMP4||uw.isSpider)return t.errc=Qk[5],t.errt=Zk.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&&Zk[e.errorType]?Zk[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&Qk[e.errorCode]?Qk[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&Qk[e.code]?Qk[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(lI),n.onOnePlay(lI),n.onOneTemp(lI),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:pI,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),dl(this,"onPlayInterfaceInfo",(function(e){wk("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=Ak()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),dl(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=Gk||[],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(o){return t}}(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=Dk(a));var c=sl(sl({},l=Mk(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(sl(sl({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:Pk(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:Pk(u)},c,"error"===e.type?0:2)}})),dl(this,"onNext",(function(){if(wk("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(cI))return;n.sendSwitchOpera(cI),n.onOnePlay(cI),n.onOneTemp(cI),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),dl(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=Fk(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),dl(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){wk("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=Ak();wk("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)}}})),dl(this,"onSeeking",(function(){if(!Ok(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;wk("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=Ak(),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)}})),dl(this,"onSeeked",(function(){Ok(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),dl(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=oI;var e=Ak();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),dl(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(wk("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(sl({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:fI,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),dl(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;wk("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(sl({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},Mk(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),dl(this,"onLog",(function(e){wk("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case gI:break;case mI: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=EI);break;case yI: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 vI: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)}})),dl(this,"onPlay",(function(){wk("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),dl(this,"onPause",(function(){wk("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=Ak()})),dl(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(wk("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=Ak(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;wk("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(Ak()-n.inWaitingStart)),n._endType="wait",n.load_state=aI,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,Ak()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),dl(this,"onEnded",(function(){if(n.initial_url){wk("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:Ak(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(uI),n.onOnePlay(uI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(uI),n.sendEventsQueue(),n.playlogs.lc++}})),dl(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(hI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(hI)||(n.sendSwitchOpera(hI),n.onOnePlay(hI,!0)))})),dl(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),dl(this,"onDestroy",(function(){wk("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(dI),n.startStep>0&&n.initial_url&&(n.onOneTemp(dI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:Ak(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(uI),n.sendEventsQueue(),uw.isPC?window.removeEventListener("beforeunload",n.onUnload):(uw.isMobile||uw.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()})),dl(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(wk("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=Rk();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,b=v.pcdnVideoCached,S=n._progressInfo.getFileSize(s.duration),C=n.seekLog,k=C.sc,I=C.sat,P={bc:Wk(d,n.bc),bu_acu_t:Wk(d,n.bu_acu_t),sc:Wk(d,k),sat:Wk(d,I)};n.setExt();var D=n._getCompatibilityInfo();n.setNovv(null,e);var w=sl(sl(sl(sl({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||Rk(),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:S.video,audio_length:S.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:Hk(n.merror),ex:Hk(n.exInfo),perf:Hk(g),bufs:Hk(n.buffers.allBuffer),vds:_,pvds:E,vps:m,vvds:T,pvvds:b,pcdn:Hk(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:Hk(n.encryptedInfo),per100_info:Hk(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=Hk(n.abrInfo);var R=D.is_support_mp4&&D.is_support_mse_mp4;if(D.is_spider||uw.isPC&&!R&&0===n.fvt)wk("is_spider",D.is_spider,"is_support_mp4",D.is_support_mp4);else if(t){var x=!n._options.disableLocalCache;n.reportLog(Yk,w,x?1:0)}else n.reportLog(Yk,w)}})),dl(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;wk("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=sl(sl({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:Ak()-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:Hk(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,b=p.first_frame_interval,S=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(Xk,sl({end_type:"longwait",local_time:m,v:_,cost_time:E,cdn_url:T,first_frame_interval:b,cur_play_pos:S,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>bI&&(p.cost_time=bI);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=Hk(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog(Xk,p,c)})),dl(this,"onOneTemp",(function(){if(wk("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=sl(sl(sl({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>TI?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>TI?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:Hk(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=Rk()),["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 gw),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 vw,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),wk("logger constructor:".concat(this.player.video))}catch(r){console.error(r)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return hl(e,[{key:"resetLoggerParams",value:function(){wk("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:Rk(),vt:0,rt:this.isEnded?Rk():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:Rk()},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=Rk(),this._novv.novv_lpt=Rk()-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:Ak(),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:uw.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=rI,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=_I}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(Sw).web_id||"0"}catch(nF){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(i){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),wk("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 kw("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?bw:1300===bw?323254:bw,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:mw,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:uw.isPad?"pad":uw.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:fw(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};wk("commonParams ",this.commonParams,a);var s=sl({evtParams:this.commonParams,disable_auto_pv:!0},a);!uw.name||uw.isChrome||uw.isSafari||(s.browser=uw.name,uw.appVersion&&(s.browser_version=uw.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=Pk(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),wk("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=PI.get();PI.remove(),t.map((function(t){Object.keys(t).map((function(i){if(wk("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===Yk?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;wk(">>>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(Tw(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=Fk(t),i=Fk(i),l.ldet=Ak(),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:Ik(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=Ak(),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(){uw.isPC?window.addEventListener("beforeunload",this.onUnload):(uw.isMobile||uw.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]:{};wk("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},sl({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>TI?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?CI.FULLSCREEN_TYPE:this.player.isCssfullScreen?CI.CSS:CI.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:Hk(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(zk,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];wk("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=Mk(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||lI);var f=sl(sl(sl({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:Hk(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||lI,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:Hk(this.exInfo),pref:Hk(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=Lk(p)?Lk(t.url)?this.initial_url:t.url:p,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:Lk(p)?1:0};if(n&&"String"===Uk(g)){var v={};xk(g,{range:"0-8",timeout:2e3}).then((function(e){wk("getXhr>>check result ",e);var t=Mk(e.headers||{});f.server_ip=t.x_response_sinfo,v=sl(sl({},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=sl(sl({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=function(e){if(!e||"String"!==Uk(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)?Vk:Kk:jk}catch(o){return jk}}(g);v.isexpired=t,f.net=Hk(v),e.reportLog($k,f,i)}))}else f.net=Hk(y),this.reportLog($k,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<sw.length;i++){var n='video/mp4; codecs="'.concat(sw[i],'"'),r=MediaSource.isTypeSupported(n);t+="".concat(n," is ").concat(r," "),r&&(e=!0)}return{support:e,message:t}}();return{is_spider:uw.isSpider?1:0,is_support_mp4:uw.isSupportMP4?1:0,is_support_hevc:hw()?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"===Uk(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,Tw(c)&&(SI.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=Hk(this._envInfo||{}),i.support=fw(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0;var u=function(){if(1===n){var e={};return e[t]=i,void PI.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;wk("triggerTask>>",e),!Ok(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)}wk("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=Ak(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(wk("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=oI,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=Ak()-i.lastSeekStartTime;wk("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>bI?0:o,n.sc++,n.sat+=o>bI?0:o,o>bI&&(o=bI),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=Rk(),wk("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=Rk(),wk("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>TI?0:e}},{key:"pt",get:function(){return this.playlogs.pt||Rk()}},{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(i){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:Ok(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:Pk(Ok(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?Mk(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 Bk(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return Bk(this.player.root,"xgplayer-ended")||Bk(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return Bk(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return Bk(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&&(wk("lt init",this.playlogs.lt),e=Rk()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?iI:this.isStop?Jk:this.isPause?tI:this.isLoading?nI:eI}},{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:Ik(t.played);return i>=0?i>TI?TI: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=Ak()-this.inWaitingStart;return e>bI?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 sl({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},fl(e,_w))}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];wk("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)}wk("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(Ik(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);wk("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 wk("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return bw},set:function(e){Sw="__tea_cache_tokens_".concat(bw=e)}},{key:"AB_SDK_VERSION",get:function(){return Cw},set:function(e){Cw="Array"===Uk(e)?e.join(","):e}},{key:"Collector",set:function(e){kw=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 Pw=null==(e=Js())?void 0:e.__LOG_TEA_ID__;function Dw(e){let t={};const i=(i,n)=>{const r=(e=>Object.assign({},t,null!=e?e:{}))(n);as.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 ww(){var e;const t=null==(e=pB.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}Iw.TEA_ID=Pw,Iw.Collector=function(e){const t=ww();if(t)return Dw(t);const i=Ns();return i?new i(e):void 0};const Aw="beforePlayerCreate.authtoken.getVideoInfo.getVideos",Rw=`${Aw}.getDramaInfoViaJSB.perfInfo`,xw={prepareCost:`${Rw}.prepareCost`,requestCost:`${Rw}.requestCost`,parseCost:`${Rw}.parseCost`,totalCost:`${Rw}.totalCost`};function Ow(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 Lw=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=Rs(a),i.drm_encrypt_type=nl(a)||"",i.initial_url=Mr.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=pB.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=Ow(s,Aw);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:Ow(e,xw.prepareCost),server_fetch_request_cost:Ow(e,xw.requestCost),server_fetch_parse_cost:Ow(e,xw.parseCost),server_fetch_total_cost:Ow(e,xw.totalCost)}}(s)),i.create_player_total_duration=c,i.prepare_play=c-l,i.is_preload_enabled=2===pB.preloaderStatus,t===Yk||t===$k){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 Iw(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new Iw(this,this.config.vodLogOpts||{})};Lw.pluginName="__xgVodLogger",Lw.playerConfig={},Lw.Collector=Iw.Collector,Lw.setABSdkVersion=e=>{Iw.AB_SDK_VERSION=e};const Nw=Ui((function(e,t,i){ki(e,t,i)}));class Mw{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const Uw={"@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 Bw=(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))(Bw||{});const Fw={[Bw.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${Uw["xgplayer-hls"]}/dist/index.min.js`},[Bw.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${Uw["xgplayer-flv"]}/dist/index.min.js`},[Bw.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${Uw["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[Bw.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Uw["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[Bw.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${Uw["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[Bw.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${Uw["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[Bw.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${Uw["@byted/streamprobe"]}/dist/index.min.js`},[Bw.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${Uw["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[Bw.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${Uw["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[Bw.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${Uw["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[Bw.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${Uw["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[Bw.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${Uw["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[Bw.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${Uw["@byted/xgplayer-vod-preload"]}/dist/index.min.js`},[Bw.HLSjsPro]:{name:"EncryptHlsjsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Uw["@byted/xgplayer-encrypt-hls"]}/dist/hlsjs.min.js`}},Hw={h265:Bw.VeStrategyH265,preload:Bw.VeStrategyPreload,adaptRange:Bw.VeStrategyAdaptRange},jw={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(Bw.VeStrategyPreload))},loadVeStrategy(e){return d(this,null,(function*(){return e.loadPlugins(Bw.VeStrategy)}))},loadStrategy(e,t){return d(this,null,(function*(){return e.loadPlugins(Hw[t])}))},loadPreloader(e){return d(this,null,(function*(){return e.loadPlugins(Bw.Preloader)}))},loadMp4Encrypt(e){return d(this,null,(function*(){return e.loadPlugins(Bw.MP4Encrypt)}))},loadHlsjsPro(e){return d(this,null,(function*(){return e.loadPlugins(Bw.HLSjsPro)}))}};let Vw=!1;class Kw extends Mw{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(Bw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){Vw=!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 Vw&&as.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."),Vw=!1,!1}return!((null==(t=Vr.os)?void 0:t.isIos)&&!Xs())}canAdaptRangeEnable(){var e;return!((null==(e=Vr.os)?void 0:e.isIos)&&!Xs())}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 jw.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=ys(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 Ww=!1;class Gw extends Mw{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(Bw.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 Ww&&as.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."),Ww=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=Vr.os)?void 0:e.isIos)}generatePlaylistFromServer(e){Ww=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===fs.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(Bw.DASH);return(null==(i=null==(t=null==n?void 0:n.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[n]:(as.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=ys(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 Yw=/\s/;var zw=/^\s+/;function $w(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Yw.test(e.charAt(t)););return t}(e)+1).replace(zw,""):e}var Xw=NaN,qw=/^[-+]0x[0-9a-f]+$/i,Zw=/^0b[01]+$/i,Qw=/^0o[0-7]+$/i,Jw=parseInt;function eA(e){if("number"==typeof e)return e;if(Cn(e))return Xw;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=$w(e);var i=Zw.test(e);return i||Qw.test(e)?Jw(e.slice(2),i?2:8):qw.test(e)?Xw:+e}const tA=function(){return _.Date.now()};var iA="Expected a function",nA=Math.max,rA=Math.min;function oA(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(iA);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=tA();if(p(e))return y(e);s=setTimeout(g,function(e){var i=t-(e-l);return h?rA(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=tA(),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=eA(t)||0,A(i)&&(u=!!i.leading,o=(h="maxWait"in i)?nA(eA(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(tA())},v}const aA=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(Bw).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(aA.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete aA.jsLoadMap[t],delete aA.jsLoadPromiseMap[t]}constructor(){this.umdMap=Fw,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=Js(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(aA.registeredModules,e))return this.triggerSuccessCallback(t),i(aA.registeredModules[e]);if(Reflect.get(aA.jsLoadMap,r))return i(aA.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 as.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 aA.jsLoadMap[r]=l,this.triggerSuccessCallback(t),i(l);const c=`${this.pluginPublicPath}/${e+".js"}`;let u=aA.jsLoadPromiseMap[r];as.log(`umdLoader cache hit ${r}=${!!u}`),u||(u=zs((()=>this.loadExtraCdn(c,!0)),2),aA.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;aA.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):(as.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 as.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=>{as.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let sA=aA;sA.jsLoadMap={},sA.jsLoadPromiseMap={},sA.registeredModules={};const lA=new sA;var cA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(cA||{});function uA(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 hA=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(hA||{});class dA{constructor(e){this.strategyKey=cA.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new sA}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[cA.PRELOAD],p="boolean"==typeof f;if(!f||!p&&(null==f?void 0:f.disabled))return this.preloaderStatus=0,!1;const g=null==(i=uA(f))?void 0:i.config,y=null==(a=null==(o=null==(r=null==(n=this._strategyManager.config)?void 0:n.strategies)?void 0:r[cA.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*(){as.log("preloader init");const[e,t]=yield Promise.all([jw.loadPreloader(this.sdkUmdLoader),p||"hls"!==(null==f?void 0:f.format)?jw.loadMp4Encrypt(this.sdkUmdLoader):jw.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void as.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 as.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 as.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 as.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=[],as.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=c(c({},this.preloadCacheConfig),null!=t?t:{}),void as.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 fA{constructor(e){this.strategyKey=cA.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[cA.H265])?void 0:t.enableH265Hardware)}}const pA=new class{constructor(){var e,t;this.teaId=null==(e=Js())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=Js())?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:hA.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new sA}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=Js(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=Js(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 jw.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=u(c({},this.config),{Module:e}))}))}fetchStrategies(){return d(this,null,(function*(){const e={};return jw.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 jw.loadStrategy(this.sdkUmdLoader,i);n&&(e[t]=u(c({},this.config.strategies[t]),{Strategy:n}))}e[t]=uA(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return d(this,null,(function*(){if(!e||!e.appId)return;this.collector=Ns(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(r){}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:as}})),this.status=2,this.preloadWrapper=new dA(this),this.h265Wrapper=new fA(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&&as.warn("[VeStrategy] Ignoring conflicting serviceConfigMode after initialization has started."):((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&jw.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 as.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 as.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[cA.H265])?void 0:t.enableH265Hardware)}};let gA=!1;class yA extends Mw{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(Bw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,n,r;gA=!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 Vr.os.isIos||"safari"===Vr.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 gA&&as.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."),gA=!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=pA.config)?void 0:t.strategies)?void 0:i[cA.PRELOAD]){return[yield e.loadPlugins(Bw.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=Ws(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(Bw.HLSEncrypt)]}{const t=Ws(o,"Subtitle"),i=c&&t,n=($s()||window.WebAssembly)&&u,l=r.enableHlsMSE,d=r.enableMobileHlsPlugin&&(Vr.os.isAndroid&&$s()||Vr.os.isIos&&Xs()),p=f&&Vr.os.isAndroid,g=f&&Qs,y=h&&!document.createElement("video").canPlayType("application/vnd.apple.mpegurl");if(h&&(n||i||l||d||p||y)||!(h||Qs&&!a||g)){return[yield e.loadPlugins(s?Bw.HLSjsPro:Bw.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=ys(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 vA extends Mw{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 mA=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(mA||{}),_A=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(_A||{}),EA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(EA||{}),TA=(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))(TA||{});const bA={setLicenseConfig:e=>d(this,null,(function*(){})),checkLicense:()=>d(this,null,(function*(){return"premium_edition"})),checkModuleList:()=>d(this,null,(function*(){return Object.values(EA)})),checkLicenseStatus:()=>d(this,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>d(this,null,(function*(){return!0})),renderLogo:e=>{}};class SA{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:Xa,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:b=!0,enableHlsJs:S=!0,enableMenu:C=!1,region:k={}.__DEFAULT_REGION__,userRegion:I,debug:P=!1,licensSupportModuleList:D=Object.values(EA),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&&(as.config.debug=3),this.options=Object.assign({},o,A),this.options.poster="string"==typeof this.options.poster?function(e){const t=""+e,i=ol.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"===Vr.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=ur.observe(this.current),this.plugins=[...u],this.isMusic=E,this.unionId=_,this.sdkPlugins=T,this.useHlsPluginForSafari=b,this.enableHlsJs=S,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),ur.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=pi([...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]:as.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 Kw(i);case"dash":return new Gw(i);case"hls":return new yA(i);default:return as.log(`no adapter match ${e}, use others adapter by default`),new vA(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!(Vr.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 as.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const r=this.getUrlList({lineId:i,definition:n});return r.length>0?(this.isHitDefault=!0,r[0]):(as.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;Nw(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=il(""+(i||this.configs.urlExpireTimestamp));n?this.urlCheckData.urlExpireTimestamp=n:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=Xa,as.warn("not provide urlExpireTimestamp, url expire check will not work")),as.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[Qa,Ja],i=e&&Object.entries(e).reduce(((e,[i,n])=>(Ya.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||js(e.url):this.configs.streamType||vs(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||js(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||vs(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(EA.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 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()),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)||Ga;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});as.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=pB.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=Js(this.userRegion,this.region);!function(e){Iw.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(ye(e))return t})),t}updateConfigs(e){Bi(this.configs,pi(e),((e,t)=>{if(ye(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 CA{}CA.isSupported=()=>!1,CA.isSupportedH264=e=>!1;var kA=function(){function e(t){pr(this,e),this.config=t.config,this.parent=t.root,this.root=Mr.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 yr(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(Mr.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&&Mr.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Mr.addClass(t,"selected"),n&&Mr.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(){Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"active")}},{key:"hide",value:function(){Mr.removeClass(this.root,"active"),Mr.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}(),IA="side",PA="middle",DA="default",wA="click",AA="hover";var RA="mobile"===Vr.device,xA=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),vr(Tr(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===wA?n.toggle(!n.isActive):n.toggle(!0)})),vr(Tr(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==IA&&n.isActive&&n.toggle(!1)})),vr(Tr(n),"onListEnter",(function(e){n.enterType=2})),vr(Tr(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 yr(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(),(RA=RA||"touch"===this.domEventType)&&"mobile"===Vr.device&&t.listType===DA&&(t.listType=IA),t.hidePortrait&&Mr.addClass(this.root,"portrait"),this.on([Ao,ko],(function(){e._resizeList()})),this.once(io,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),RA&&this.on(uo,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),RA?(t.toggleMode=wA,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===wA?"click":"mouseenter",t.toggleMode===wA?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",Mr.createDom("span","",{},"icon-text")),Mr.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Mr.addClass(this.root,"show")}},{key:"hide",value:function(){Mr.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||Mr.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===fr(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===IA?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===IA?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||RA||n===IA)&&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===IA?s===va.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:RA?"touch":"mouse"},root:n.listType===IA?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===PA?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new kA(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===PA?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===wA?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:va.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:AA,heightLimit:!0}}}]),i}(ba);const OA={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"},LA=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"}),NA=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"}),OA),LA),MA={SDKEvents:OA,PluginEvents:LA},UA=NA,BA=70,FA=30,HA=50,jA=60,VA=20,KA=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"===Vr.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 Us,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(LA.PLAY_NEXT_START,(()=>{this.definitionSubscribeId&&ur.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&ur.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(LA.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(wo,this.toastInfo.remove),this.player.off(Zr,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(wo,this.toastInfo.remove),this.player.once(Zr,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=ur.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(LA.INNER_DEFINITION_CHANGE,{from:e,to:t,url:n.url}),this.player.emit(LA.PlAY_URL_CHANGE,{url:n.url,from:LA.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=ur.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 WA extends(KA(xA)){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),oA(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:FA,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||Mr.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(!Mr.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 GA(e){const t={};for(const i of["lang","name"]){const n=e[i];void 0!==n&&(t[i]=n)}return t}function YA(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function zA(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(GA(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 $A={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 XA(e){var t;return null!=(t=$A[e.toLowerCase()])?t:e.toUpperCase()}function qA(e,t){var i;const n=null!=(i=e.name)?i:"",r=e.lang?XA(e.lang):"";return[r||n||`Track ${e.id+1}`,!1!==(null==t?void 0:t.showNameSuffix)&&r&&n?`(${n})`:""].filter(Boolean).join(" ")}function ZA(e,t,i){var n;const r=null!=(n=e.label)?n:"",o=e.language?XA(e.language):"";return[o||r||`Track ${t+1}`,!1!==(null==i?void 0:i.showNameSuffix)&&o&&r?`(${r})`:""].filter(Boolean).join(" ")}class QA extends xA{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({},xA.defaultConfig),{position:ba.POSITIONS.CONTROLS_RIGHT,index:BA,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;YA(e,t.to.id)}else{const e=this._getHls();if(!e)return;zA(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=ZA(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 JA(){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:eR,os:tR,device:iR}=Vr,nR=tR.isAndroid,rR=tR.isIos,oR="mobile"===iR;let aR=0,sR=!1;class lR 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((()=>{as.log("wechat autoplay success")})).catch((e=>{as.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):as.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():nR?this.player.once(io,this.wxCanPlayFn):rR&&this.player.once(vo,this.wxCanPlayFn)},this.userClickPlay=()=>{if(sR)return;const e=this.player.play();e&&e.then?e.then((()=>{as.log("user action autoplay success"),sR=!0})).catch((e=>{as.warn("user action autoplay fail:",e)})):(as.warn("no play promise"),sR=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(as.warn("unmute autoplay fail"),this.player.emit(LA.AUTOPLAY_FAILED,{mode:"unmute"}),nR&&eR?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(as.warn("mute autoplay fail"),this.player.emit(LA.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(LA.AUTOPLAY_FAILED,{mode:"noSupport"}),void as.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(LA.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(LA.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(LA.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-aR>200&&(aR=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:JA,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(yo,this.handleAutoplayPrevented),this.player.on(go,this.handleAutoplayStart),this.player.on(ro,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){eR&&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(LA.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((()=>{as.log("degrade mute autoplay success")})).catch((e=>{as.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):as.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=Mr.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(yo,this.handleAutoplayPrevented),this.player.off(go,this.handleAutoplayStart),this.player.off(ro,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=oR?"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 cR=void 0;function uR(){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 hR 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:uR,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=Mr.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const n=Mr.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),t.appendChild(n)}renderPanel(e){this.panelContainer||(this.panelContainer=Mr.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,n;const r=Mr.createDom("div","",{},"panel-icon-bt"),o=Mr.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(Mr.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 dR(){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 fR=(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))(fR||{});const pR={NETWORK:{code:2100,message:"Network error",textKey:fR.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:fR.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:fR.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:fR.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:fR.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:fR.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:fR.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:fR.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:fR.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:fR.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:fR.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:fR.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:fR.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:fR.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:fR.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:fR.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:fR.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:fR.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:fR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:fR.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:fR.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:fR.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:fR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:fR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:fR.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:fR.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:fR.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:fR.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:fR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:fR.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:fR.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:fR.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:fR.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:fR.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:fR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:fR.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:fR.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:fR.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},gR={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:fR.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:fR.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:fR.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:fR.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:fR.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:fR.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:fR.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:fR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}};var yR=(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))(yR||{});const vR={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:fR.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:fR.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:fR.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:fR.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:fR.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:fR.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:fR.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:fR.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:fR.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:fR.DRAMA_FAILED_GET_EPISODE_INFO}};const mR={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},_R=1002305;class ER{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(Vs(t))}catch(t){throw a.push(Vs(null)),t}})),Promise.all([...a]).then((e=>{e.every((e=>!e))&&n(r,i)})).catch((e=>{as.error(e),n(r,e)}))}))}}}const TR="xgplayer-error-analysing",bR="xgplayer-error-retrying",SR="ve_error",CR={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},kR={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},IR="http:",PR="https:";let DR=null;function wR(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(IR)&&i===PR){if(new URL(e).protocol===IR)return AR.getVeErrorInfo(pR.NETWORK_PROTOCOL)}}class AR{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(TR);const i=yield this.transformToVeError(e);this.player.veError=i,as.error("error: ",i),this.player.removeClass(TR),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?as.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit(SR,i)})),this.player=e,this.config={},t&&Object.keys(AR.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=AR.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;CR[m]&&(m=CR[m]);const{code:_,message:E,textKey:T}=e.veError||{},b=o||t.message,S=_||m,C=AR.getErrorType(e),k=E||b,I=T||(e=>{for(const[t,{code:i,textKey:n}]of Object.entries(pR))if(i===e)return n})(S)||function(e){for(const t of Object.values(vR))if(t.code===e)return t.textKey}(S),P=this.player.i18n[I]||k||this.player.i18n[fR.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:b,mediaError:t,originError:a?a.stack:"",host:Mr.getHostFromUrl(p||g),veErrorCode:S,veErrorType:C,veErrorMessage:k,displayMessage:P},w),{videoInfo:c({isMSE:Rs(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:nl(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?yR[e.slice(0,2)]:yR[e.slice(0,1)]}if(null==i?void 0:i.code)return kR[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;DR||(DR=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;as.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(Zr,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(Zr,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(bR))}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 ER,this.eventMiddleware.addMiddleware(Zr,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(Zr)})}defaultErrorMiddleWare(e){return d(this,null,(function*(){var t,i;if(!Mr.isMSE(this.player.media)){const{error:n}=e||{};if(!n)return as.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?as.warn(`max total retry count ${n} reached, stop retrying`):as.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===r)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=tl(rl(this.player));if(t){const i=wR(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 as.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(bR),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(bR),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=Mr.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 As(e,{range:"0-8",timeout:i});as.log("xhr result",t);const{status:o,response:a}=t;if(403===o){if("string"==typeof a){if(a.includes("expire"))return AR.getVeErrorInfo(pR.NETWORK_URL_EXPIRE);if(a.includes("sign"))return AR.getVeErrorInfo(pR.NETWORK_URL_SIGN)}return AR.getVeErrorInfo(pR.NETWORK_FORBIDDEN)}if(416===o)return AR.getVeErrorInfo(pR.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return AR.getVeErrorInfo(pR.NETWORK_NOTFOUND);if(o===ws.TIMEOUT)return AR.getVeErrorInfo(pR.NETWORK_TIMEOUT);if(o===ws.ERROR)return AR.getVeErrorInfo(pR.NETWORK,r);if(200===o||206===o){if(4===n)return r?AR.getVeErrorInfo(pR.MEDIA_ERR_PLAY_ERR,r):AR.getVeErrorInfo(pR.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===n)return AR.getVeErrorInfo(pR.MEDIA_ERR_DECODE,r);if(2===n)return AR.getVeErrorInfo(pR.MEDIA_ERR_NETWORK,r);if(1===n)return AR.getVeErrorInfo(pR.MEDIA_ERR_ABORTED,r);if(-9996===n){return nl(this.player)===or.PRIVATE_ENCRYPT_UPGRADE?AR.getVeErrorInfo(pR.PRIVATE_DRM_GET_KEY_FAILED):AR.getVeErrorInfo(pR.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(o){return as.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."),AR.getVeErrorInfo(pR.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:yR.network,errorCode:t,httpCode:i,errorMessage:r,originError:e};if(i){if(404===i)o.veError=AR.getVeErrorInfo(pR.NETWORK_NOTFOUND);else if(416===i)o.veError=AR.getVeErrorInfo(pR.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=AR.getVeErrorInfo(pR.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=AR.getVeErrorInfo(pR.NETWORK_URL_SIGN):o.veError=AR.getVeErrorInfo(pR.NETWORK_FORBIDDEN),this.createVeError(o)}catch(a){as.warn("get response text error")}return o.veError=AR.getVeErrorInfo(pR.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=tl(rl(this.player));if(e){const t=wR(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:n}){return this.createVeError({errorType:yR.serve,errorCode:t||pR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:AR.getVeErrorInfo(pR.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:n}){try{const r=tl(rl(this.player)),o=yield this.analyseNet(r,e,3e3);return o?this.createVeError({errorType:yR.network,errorCode:t||pR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:o}):this.createVeError({errorCode:t||pR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:AR.getVeErrorInfo(pR.NETWORK_ENCRYPT_HLS_ERR)})}catch(r){return as.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||pR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:AR.getVeErrorInfo(pR.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:n}){const r={errorType:yR.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=AR.getVeErrorInfo(pR.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||pR.OTHER.code,httpCode:t,errorMessage:s,originError:e},e||{}))}))}}const RR=new Set(Object.values(vR).map((e=>e.code)));let xR=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)===pR.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(LA.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(Ia.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(pR).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:dR,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(SR,this.handleError),this.on(io,this.closeError),this.on($r,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(Ia.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(Ia.ENTER),this.state.retryTimes===t&&this.player.emit(LA.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),as.log(`retry times: ${this.state.retryTimes}`,n),this.player.emit(LA.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(LA.PlAY_URL_CHANGE,{url:e,from:LA.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(LA.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:ls().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:n}=this.getErrorInfo(e),r=Mr.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(Mr.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(Mr.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(Mr.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){as.error("copy error info err ",r)}}getActionDom(e){const t=e.errorType,i=Mr.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),n=!(t&&[yR[10],yR[11],yR[12]].includes(t));if(this.config.isNeedRefreshButton&&n){const e=Mr.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=Mr.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=!!pB.ttDramaEnv,d="number"==typeof u&&RR.has(u);if("drama"===(h&&d?"drama":"normal")){if(!this.$errorDom){this.$errorDom=Mr.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=Mr.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=Mr.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=Mr.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=Mr.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=Mr.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(Zr,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};function OR(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 LR(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?OR(Object(i),!0).forEach((function(t){FR(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):OR(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function NR(e){return(NR="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 MR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UR(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,QR(n.key),n)}}function BR(e,t,i){return t&&UR(e.prototype,t),i&&UR(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function FR(e,t,i){return(t=QR(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function HR(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&&VR(e,t)}function jR(e){return(jR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function VR(e,t){return(VR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function KR(){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(e){return!1}}function WR(e,t,i){return(WR=KR()?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&&VR(r,i.prototype),r}).apply(null,arguments)}function GR(e){var t="function"==typeof Map?new Map:void 0;return GR=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 WR(e,arguments,jR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),VR(n,e)},GR(e)}function YR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zR(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 YR(e)}function $R(e){var t=KR();return function(){var i,n=jR(e);if(t){var r=jR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return zR(this,i)}}function XR(){return XR="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=jR(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}},XR.apply(this,arguments)}function qR(e){return function(e){if(Array.isArray(e))return ZR(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 ZR(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 ZR(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 ZR(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 QR(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 JR=["b","i","u","span","c","ruby","rt","v","lang"],ex=["br"];var tx=/^WEBVTT/i,ix=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,nx=/^STYLE+$/,rx=/^\:\:cue/,ox=/^}+$/,ax=/^\[Script Info\].*/,sx=[/[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}/],lx=/^Format:\s/,cx=/^Style:\s/,ux=/^Dialogue:\s/,hx=/^([0-5]?\d)[.,](\d{1,3})$/;function dx(e){var t=hx.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function fx(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+dx(e[2]):2===t?60*Number(e[0])+dx(e[1]):dx(e[0])}function px(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function gx(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yx(e,t){return e>=0&&e<t.length?t[e]:""}function vx(e){return t=function(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}(e),JR.includes(t)||ex.includes(t);var t}var mx=function(){function e(){MR(this,e)}return BR(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(nF){console.error(nF),i({format:n},nF)}}},{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=gx(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]=fx(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(nF){return console.error(nF),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(lx.test(i[r]))s=(s=i[r].replace(lx,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(cx.test(i[r]))a.push(i[r].replace(cx,"").replace(/\s+/g,""));else if(ux.test(i[r])){var c=e.parseASSItem(i[r].replace(ux,""),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(nF){console.error(nF)}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(tx,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=yx(n,t).trim();if(!h||a&&px(h))a=!h;else if(rx.test(h)&&nx.test(yx(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)ox.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<sx.length&&!(i=sx[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(vx(n=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:gx(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:gx(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=fx(r),n=fx(o)}return{start:i,end:n,time:e}}},{key:"isVTT",value:function(e){return tx.test(e)}},{key:"isASS",value:function(e){return ax.test(e)}},{key:"checkFormat",value:function(e){return e?tx.test(e)?"vtt":ax.test(e)?"ass":ix.test(e)?"srt":"":""}}]),e}(),_x=[{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"}],Ex=function(e){HR(i,e);var t=$R(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 MR(this,i),e||(e=_x[r||7].msg),(n=t.call(this,e)).code=r||7,n.message=e,n.type=_x[r||7].msg,n.orgError=o||null,n.data=a||null,n}return BR(i)}(GR(Error));function Tx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={code:_x[e].code,msg:_x[e].msg,message:_x[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var bx=BR((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 MR(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("&"))}}))})),Sx=function(){function e(){var t,i;MR(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 BR(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function Cx(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"===NR(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function kx(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):Cx(e,t)||(e.className&&"object"===NR(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function Ix(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 Px(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 Dx(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function wx(){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 Ax(e){return e&&e instanceof window.HTMLMediaElement}function Rx(e,t,i){if(i||(i=new Sx),"json"===t){var n=mx.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&mx.parse(e,(function(e,t){if(t){var n=Tx(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=Tx(3);i.reject(r)}}));return i}function xx(e,t){t||(t=new Sx);var i=[];"String"===Dx(e.url)?i=[e.url]:"Array"===Dx(e.url)&&(i=qR(e.url));return function n(){var r=i.shift();if(r)new bx({url:r,type:"text"}).then((function(i){Rx(i.res.response,"string").then((function(i){t.resolve(LR(LR({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)n();else{var a=Tx(1,LR({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:r},e));t.reject(a)}}));else{var o=Tx(1,LR({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function Ox(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 Lx(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function Nx(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function Mx(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var Ux=function(){function e(){var t=this;MR(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return BR(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(nF){console.error(nF)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),Bx=null;var Fx="resize",Hx="change",jx="off",Vx="update",Kx="error",Wx=/^[A-Za-z0-9_-]+$/,Gx=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function Yx(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 zx(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&&JR.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(!JR.includes(l)&&!ex.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 Wx.test(e)})).join(" ")),selfClosing:r,tagName:l}}function $x(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 Gx.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 Xx(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;){Yx(n[n.length-1].dom,i.slice(o,a.index));var s=a[0],l=zx(s);if(l)if(l.closing){var c=n.map((function(e){return e.tagName})).lastIndexOf(l.tagName);c>0?n.length=c:Yx(n[n.length-1].dom,s)}else if("br"===l.tagName)n[n.length-1].dom.appendChild(document.createElement("br"));else{var u=$x(l);n[n.length-1].dom.appendChild(u),l.selfClosing||n.push({dom:u,tagName:l.tagName})}else Yx(n[n.length-1].dom,s);o=r.lastIndex,a=r.exec(i)}Yx(n[n.length-1].dom,i.slice(o))}function qx(e){var t=[];if(e&&"String"===Dx(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===Dx(e)){if(0===e.length)return t;"String"===Dx(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 Zx=!1,Qx=function(e){HR(i,e);var t=$R(i);function i(e){var n,r,o,a,s,l,c;return MR(this,i),FR(YR(n=t.call(this)),"_onPause",(function(){n.stopRender()})),FR(YR(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),FR(YR(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)))}})),FR(YR(n),"_onResize",(function(e){var t=YR(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=Ox(a/o*100)}n.__startResize(e)}})),FR(YR(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)}})),FR(YR(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=YR(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))}})),FR(YR(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),Zx=/(?: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"===Dx(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.setSubTitles(e.subTitles,n.config.defaultOpen),n):zR(n)}return BR(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(Lx(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=Lx(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(e){}};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&&kx(this.root,"text-track-hide"),!s&&kx(this.root,"text-track-no-fitvideo"),a&&kx(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,Bx||(Bx=new Ux),Bx.addObserver(i,n))),Ax(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&&(Ax(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,Bx&&Bx.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 Ex("no default subtitle",5);return e.emitError(r),void n(r)}if(e.currentText&&Lx(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(Tx(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var a=0;a<e.textTrack.length;a++)if(Lx(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(Tx(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(Tx(0));else{var a=new Ex("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 Ex("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(Lx(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!Lx(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(Tx(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(Tx(0))}))}},{key:"emitError",value:function(e){this.emit(Kx,{type:Kx,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(Hx,{type:Hx,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(jx,{type:jx,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 Sx,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 Rx(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):(xx(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=LR({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){xx(LR(LR({},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=Ix(e,this.currentText.list,this._gid);if(n>-1&&(i=Px(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(Vx,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=Ix(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=Px(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(Vx,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(Vx,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:Vx,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 Ox(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}}))};Lx(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=Ox(h*e)/100,i=e):(d=t,i=Ox(t/h*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;p=Ox(h>120?(f=a)*d/1080:(f=o)*i/1920);var g=Zx?s:l,y={fontSize:p=p<g?g:p>f?f:p},v=Ox((t-d)/2),m=Ox((e-i)/2),_=Ox(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(Fx,{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=wx("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=wx("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),Xx(l,r),setTimeout((function(){e._renderByWords(s,o,t.start,t.end,r)}),600)}else Xx(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(Nx(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(/^[ ]*$/)||Mx(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,Xx(s=document.createElement("span"),a),s.textContent||"")),c=this._getPlayerCurrentTime(),u=Ox(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)})):Cx(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===NR(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(kx(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=XR(jR(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=XR(jR(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=XR(jR(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=XR(jR(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){XR(jR(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}(Ar);class Jx extends Ar{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)):as.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 eO(){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 tO(){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:iO}=ba,nO="mobile"===Vr.device,rO="text-close";function oO(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 aO 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||(nO?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===rO?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",Vr.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:iO.CONTROLS_RIGHT,index:jA,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=oO(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 Jx(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(uo,this.onPlayerFocus),this.on(ho,this.onPlayerBlur));const{player:s}=this;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new Qx(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&&Mr.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?Mr.addClass(this.root,"isOpen"):Mr.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;!nO&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!nO&&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:eO,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:tO,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(nO)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 kA(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,Mr.removeClass(this.root,"isClose"),Mr.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>as.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,Mr.addClass(this.root,"isClose"),Mr.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null==(e=this.optionList)||e.hide()}renderItemList(){nO?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=oO(o);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?o[a]:null,Mr.removeClass(this.root,"isClose"),Mr.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,Mr.removeClass(this.root,"isOpen"),Mr.addClass(this.root,"isClose"),this.changeTipText(),null==(t=this.optionList)||t.hide()),this.config.list=o,o.length>0?nO||null==(i=this.optionList)||i.hide():(this.switchOffSubtitle(),nO?this.showMobilePanel():null==(n=this.optionList)||n.show(),nO||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=Mr.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":rO,selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,n=Mr.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=nO?"touchend":"click",o=ba.delegate(n,".panel-Item",r,(t=>{e["data-type"]===rO?(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||Mr.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 sO=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=Mr.createDom("div","",void 0,"toast-container"),r=Mr.checkIsObject(e)?e:Mr.createDom("div",e,void 0,"toast-txt");if(n.appendChild(r),t){const e=Mr.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 lO(){return(new Date).getTime()}var cO="loadstart",uO="loadeddata",hO="firstFrame",dO="waitingStart",fO="waitingEnd",pO="seekStart",gO="seekEnd",yO=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Lr.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),vr(Tr(e),"_onAutoplayStart",(function(){Lr.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),vr(Tr(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=lO(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Mr.clearTimeout(Tr(e),e._waitTimer),e._waittTimer&&Mr.clearTimeout(Tr(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),vr(Tr(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=lO(),e.emitLog(pO,{start:lO()}))})),vr(Tr(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),vr(Tr(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=lO(),e.fixedWaitingStart=lO(),e._waitType=1,e.emitLog(dO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),vr(Tr(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=lO(),e._waitTimer=Mr.setTimeout(Tr(e),(function(){e._isWaiting&&(e.waitingStart=lO(),Mr.clearTimeout(Tr(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(dO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),vr(Tr(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),vr(Tr(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return yr(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=lO(),this.loadedCostTime=0,this.startCostTime=0,this.on(lo,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=lO()-e.newPointTime,Lr.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(cO,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=lO(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(oo,(function(){e.vt=lO(),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;Lr.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(uO,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Qr,this._onSeeking),this.on(Jr,this._onSeeked),this.on(_o,(function(){e.endState("destroy")})),this.on(Eo,(function(){e.endState("urlChange"),Lr.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([$r,io],this._onPlaying),this.on(to,this._onWaiting),this.on(Zr,this._onError),this.on(Bo,(function(){Lr.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(go,this._onAutoplayStart),this.off(eo,this._onTimeupdate),this.once(go,this._onAutoplayStart),this.once(eo,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=lO();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Lr.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Lr.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(hO,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Mr.clearTimeout(this,this._waittTimer),this._waittTimer=Mr.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Mr.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=lO(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(gO,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Mr.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Mr.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=lO(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(fO,{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(Mo,dr({t:lO(),host:Mr.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}(ba);function vO(){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 mO=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"registerIcons",value:function(){return{replay:vO}}},{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(Xr,(function(){if(e.playerConfig.loop||Mr.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(zr,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Mr.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}(ba);function _O(){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 EO(){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 TO={};function bO(e){e?window.clearTimeout(e):Object.keys(TO).map((function(e){window.clearTimeout(TO[e].id),delete TO[e]}))}var SO=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),Mr.removeClass(n.root,e),n.show()})),vr(Tr(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";Mr.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return yr(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(fo,(function(){i&&(i.lang&&"en"===i.lang?Mr.addClass(t.root,"lang-is-en"):"jp"===i.lang&&Mr.addClass(t.root,"lang-is-jp"))})),this.on(go,this.onAutoplayStart),this.on(yo,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Mr.removeClass(e.root,t),e.show()})),this.on(zr,(function(){e.toggleTo("play")})),this.on(qr,(function(){e.toggleTo("pause")})),this.on(Bo,(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:_O,class:"xg-icon-play"},startPause:{icon:EO,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(){Mr.addClass(this.root,"hide")}},{key:"show",value:function(e){Mr.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Mr.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Mr.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 TO[e]&&window.clearTimeout(TO[e].id),TO[e]={},i.start&&i.start(),TO[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(TO[e].id),delete TO[e]}),t),TO[e].id}("pauseplay",400,{start:function(){Mr.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Mr.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){Mr.removeClass(this.root,"interact"),bO(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<La.READY)||(this.player.paused||t.state!==La.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<La.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),bO(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}(ba),CO=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=Mr.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}(ba);function kO(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(n){return'<div class="xg-tips hide"></div>'}}var IO=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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:va.CONTROLS_RIGHT,index:10}}}]),i}(ba);function PO(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var DO=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],wO=DO.length;function AO(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===fr(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<wO;t++)e[DO[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<wO;r++){var o=DO[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=PO(t.width);!1!==g&&(i.width=g+(p?0:l+d));var y=PO(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 RO(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var xO="dragStart",OO="dragMove",LO="dragEnded",NO={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},MO=function(e){mr(i,e);var t=Sr(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pr(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 yr(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=RO(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=RO(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=RO(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=AO(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(xO,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(LO)),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(OO,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=AO(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(Ar),UO=function(e){mr(i,e);var t=Sr(i);function i(e){var n;pr(this,i),vr(Tr(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),vr(Tr(n),"onCenterClick",(function(e){var t=Tr(n).player;t.paused?t.play():t.pause()})),vr(Tr(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(Mr.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=Tr(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 yr(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(qr,(function(){e.setAttr("data-state","pause")})),this.on(zr,(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(IO,i,IO.pluginName)}var n=Mr.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new MO(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:_O,class:"xg-icon-play"},pause:{icon:EO,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={},Mr.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(Po,!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;Mr.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(Po,!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=Mr.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(kO(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}(ba),BO={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},FO=["videoClick","videoDbClick"],HO=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=Tr(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),vr(Tr(e),"onMouseEnter",(function(t){var i=Tr(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(So)})),vr(Tr(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)})),vr(Tr(e),"onVideoClick",(function(t){var i=Tr(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--,sa(Tr(e),FO[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),vr(Tr(e),"onVideoDblClick",(function(t){var i=Tr(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(),sa(Tr(e),FO[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 yr(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,FO.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Vr.device&&!Vr.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(BO).map((function(t){n.addEventListener(t,e[BO[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(BO).map((function(t){n.removeEventListener(t,e[BO[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(ca),jO="press",VO="pressend",KO="doubleclick",WO="click",GO="touchmove",YO="touchstart",zO="touchend",$O={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},XO={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function qO(e){return e&&e.length>0?e[e.length-1]:null}var ZO=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};pr(this,e),vr(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(YO,e)})),vr(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),vr(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(VO,e),i.trigger(zO,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),vr(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(VO,e),t.press=!1,t.moving=!0,i.trigger(GO,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?XO:$O,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return yr(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(jO,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(KO,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(WO,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(nF){console.error("trigger>>:".concat(e),nF)}}))}},{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 QO(){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 JO="auto",eL="seeking",tL="playbackrate",iL=["videoClick","videoDbClick"],nL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onTouchStart",(function(e){var t=Tr(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),Mr.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=Mr.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}})),vr(Tr(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=Tr(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}}})),vr(Tr(n),"onTouchEnd",(function(e){var t=Tr(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(),Mr.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(JO)}})),vr(Tr(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),vr(Tr(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 yr(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:QO,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;iL.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(),Mr.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Mr.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new ZO(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(no,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([io,Xr],(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(JO)}))})))}}},{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&&Mr.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:Vr.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(JO)}},{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<La.RUNNING?n.closeVideoClick||(this.sendUseAction(Mr.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(Mr.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=La.RUNNING&&(this.sendUseAction(Mr.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;sa(this,iL[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;sa(this,iL[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(tL))}},{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(JO))}},{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(eL);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Mr.format(this.duration),this.find(".xg-cur").innerHTML=Mr.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Mr.removeClass(this.find(".xg-seek-show"),"xg-back"):Mr.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<La.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}(ba);function rL(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var oL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=Tr(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||rL(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!rL(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),vr(Tr(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),vr(Tr(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=Tr(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)}})),vr(Tr(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return yr(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=Mr.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=Mr.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var n,r=Object.keys(this.keyCodeMap),o=0;o<r.length;o++){var a=this.keyCodeMap[r[o]],s=a.action,l=a.keyCode,c=a.disable,u=a.pressAction,h=a.disablePress;if(l===e){if(!(c||i&&h)){var d=i&&u||s;"function"==typeof d?s(t,this.player,i):"string"==typeof d&&"function"==typeof this[d]&&this[d](t,this.player,i),this.emit(No,dr({key:r[o],target:t.target,isPress:i},this.keyCodeMap[r[o]]))}(n=t).preventDefault(),n.returnValue=!1,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}(ca);function aL(){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 sL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"registerIcons",value:function(){return{loadingIcon:aL}}},{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:va.ROOT}}}]),i}(ba),lL=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],cL=function(){function e(t){pr(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 yr(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"!==Mr.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"!==Mr.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(Mr.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++)Mr.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Mr.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=Mr.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=Mr.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),lL.forEach((function(t){o.appendChild(Mr.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}(),uL={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},hL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=Tr(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){Mr.event(e);var l=Mr.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)})),vr(Tr(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),vr(Tr(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),vr(Tr(n),"_mouseUpHandler",(function(e,t){Tr(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),vr(Tr(n),"_mouseMoveHandler",(function(e,t){var i=Tr(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)})),vr(Tr(n),"onMouseDown",(function(e){var t=Tr(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=Mr.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(),Mr.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Mr.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Mr.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,Mr.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()}})),vr(Tr(n),"onMouseUp",(function(e){var t=Tr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;if(o){e.stopPropagation(),e.preventDefault(),Mr.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Mr.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Mr.event(e),Mr.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)),Mr.setTimeout(Tr(n),(function(){n.resetSeekState()}),1),i.focus()}})),vr(Tr(n),"onMouseMove",(function(e){var t=Tr(n),i=t._state,r=t.pos,o=t.player,a=t.config;Mr.checkTouchSupport()&&e.preventDefault(),Mr.event(e);var s=Mr.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)}})),vr(Tr(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),vr(Tr(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),vr(Tr(n),"onMouseEnter",(function(e){var t=Tr(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),Mr.event(e);var o=Mr.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),vr(Tr(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),vr(Tr(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 yr(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=dr(dr({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new cL(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"===Vr.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(no,(function(){e.onMouseLeave()})),this.on(eo,(function(){e.onTimeupdate()})),this.on(Jr,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(so,(function(){e.onCacheUpdate()})),this.on(Xr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(co,(function(){e.onReset()})),this.on(Ao,(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"===fr(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(nF){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),nF)}}))}},{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(),Mr.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Mr.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:Mr.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=Mr.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=Mr.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:va.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:uL.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return uL}}]),i}(ba),dL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),vr(Tr(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return yr(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}(ba),fL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=Tr(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 yr(i,[{key:"afterCreate",value:function(){Cr(_r(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([zr,qr,Zr,co],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:_O,class:"xg-icon-play"},pause:{icon:EO,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(){Cr(_r(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(kO(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_LEFT,index:0,disable:!1}}}]),i}(dL);function pL(){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 gL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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:pL,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Mr.addClass(this.root,"show")}},{key:"hide",value:function(){Mr.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:va.ROOT_TOP,index:0}}}]),i}(ba);function yL(){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 vL(){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 mL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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 yr(i,[{key:"afterCreate",value:function(){var e=this;Cr(_r(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=Mr.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(ko,(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:gL,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Vr.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:yL,class:"xg-get-fullscreen"},exitFullscreen:{icon:vL,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){Cr(_r(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Vr.device?"touchend":"click",this.handleFullscreen),"mobile"===Vr.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(kO(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(t){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(dL),_L=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).isActiving=!1,n}return yr(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([no,Jr,eo],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(Xr,(function(){e.onTimeUpdate(!0)})),this.on(co,(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=Mr.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Mr.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=Mr.format(n))):(this.timeDom.innerHTML=this.minWidthTime(Mr.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=Mr.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Mr.format(0)),this.centerDurDom.innerHTML=Mr.format(0)):(this.timeDom.innerHTML=this.minWidthTime(Mr.format(0)),this.durationDom.innerHTML=Mr.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Mr.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=Mr.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?(Mr.hide(this.durationDom),Mr.hide(this.timeDom),Mr.hide(this.find(".time-separator")),Mr.show(this.find(".time-live-tag"))):Mr.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Mr.hide(this.durationDom),Mr.hide(this.timeDom),Mr.hide(this.find(".time-separator")),Mr.show(this.find(".time-live-tag"))):(Mr.hide(this.find(".time-live-tag")),Mr.show(this.find(".time-separator")),Mr.show(this.durationDom),Mr.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(Mr.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(Mr.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(Jr,i),t.isSeeking&&t.media.seeking?this.once(Jr,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:va.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(ba),EL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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=Mr.getIndexByTime(i,n),o=Mr.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),vr(Tr(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=Mr.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),vr(Tr(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=Mr.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=Mr.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()}}})),vr(Tr(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=Mr.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),vr(Tr(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 yr(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(no,this._onDurationChange),this.on(oo,this._onLoadedData),this.on(eo,this._onTimeupdate),this.on(Qr,this._onSeeking),this.on(zr,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}(ca);function TL(){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 bL(){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 SL(){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 CL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=Tr(e).player,n=e.find(".xgplayer-bar");Mr.event(t);var r=n.getBoundingClientRect(),o=Mr.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})),vr(Tr(e),"onBarMouseMove",(function(t){var i=Tr(e)._d;if(i.isStart){var n=Tr(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),Mr.event(t);var a=Mr.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),vr(Tr(e),"onBarMouseUp",(function(t){Mr.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=Tr(e)._d;i.isStart=!1,i.isMoving=!1})),vr(Tr(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),vr(Tr(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),vr(Tr(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 yr(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:bL,class:"xg-volume-small"},volumeLarge:{icon:TL,class:"xg-volume"},volumeMuted:{icon:SL,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"!==Vr.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(ro,this.onVolumeChange),this.once(oo,this.onVolumeChange),"Number"!==Mr.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&&(Mr.clearTimeout(this,this._timerId),this._timerId=null),Mr.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&&(Mr.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Mr.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),Mr.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&&(Mr.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"===Vr.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:va.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}(ba);function kL(){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 IL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return yr(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){Cr(_r(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(Ao,(function(){e.rotateDeg&&e.config.innerRotate&&Mr.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(){Cr(_r(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(xo,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:kL}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(kO(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}(dL);function PL(){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 DL(){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 wL="picture-in-picture",AL="inline",RL="fullscreen",xL=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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 yr(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()&&(Cr(_r(i.prototype),"afterCreate",this).call(this),this.pMode=AL,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(vo,(function(){e.config.showIcon&&(Mr.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:PL,class:"xg-get-pip"},pipIconExit:{icon:DL,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;Mr.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(Ro,!1)},this.enterPIPCallback=function(i){t.emit(Ro,!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===RL&&n!==RL&&t.onFullscreenChange(null,!1),e.pMode=n,n===wL?e.enterPIPCallback(i):n===AL&&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=kr(document.styleSheets).map((function(t){try{return kr(t.cssRules).map((function(e){return e.cssText})).join("")}catch(n){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"===Mr.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===wL}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===Mr.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===Mr.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Mr.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){Cr(_r(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(kO(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:va.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}(dL);function OL(){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 LL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"playNext",(function(e){var t=Tr(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(Lo,n.idx+1)):(n.nextHandler(),t.emit(Lo))})),n.idx=-1,n}return yr(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:OL}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Vr.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(kO(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(ba),NL={exports:{}};!function(e,t){e.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}}(NL);const ML=sr(NL.exports);function UL(){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 BL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===Mr.typeOf(t)?i=t:"Array"===Mr.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);ML(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 yr(i,[{key:"afterCreate",value:function(){Cr(_r(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:UL}}},{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(){Cr(_r(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(kO(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(dL),FL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){Cr(_r(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(Ao,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(r){console.error("MouseEvent unsupported",r)}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(Oo,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(){Cr(_r(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Ao,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:va.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(dL),HL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return yr(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;Cr(_r(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||Mr.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=dr(dr({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));Cr(_r(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;Cr(_r(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 dr(dr({},xA.defaultConfig),{},{position:va.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(xA),jL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).curRate=1,n}return yr(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;Cr(_r(i.prototype),"afterCreate",this).call(this),this.on(ao,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&Cr(_r(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){Cr(_r(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}));Cr(_r(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(){Cr(_r(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return dr(dr({},xA.defaultConfig),{},{position:va.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}(xA);function VL(){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 KL(){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 WL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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;Cr(_r(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Io,(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:VL,class:"xg-get-cssfull"},exitCssFullscreen:{icon:KL,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){Cr(_r(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(kO(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:va.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(dL),GL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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(Zr,(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}(ba),YL=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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),Mr.addClass(this.root,"show"),"arrow"===i.mode&&Mr.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(){Mr.removeClass(this.root,"show"),Mr.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Ia.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}(ba),zL={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function $L(e){Object.keys(zL).map((function(t){void 0===e[t]&&(e[t]=zL[t])}))}var XL={_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?Mr.addClass(t,"mini"):Mr.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&&($L(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=Mr.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=Mr.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 qL={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},ZL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),vr(Tr(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(Mr.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||Mr.hasClass(e.target,"xg-spot-content"))&&(Mr.event(e),e.stopPropagation()))})),vr(Tr(n),"onMousedown",(function(e){n.config.disable||(n._state.f||Mr.hasClass(e.target,"xg-spot-content"))&&(Mr.event(e),e.stopPropagation())})),vr(Tr(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))}})),vr(Tr(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()}})),vr(Tr(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&Mr.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 yr(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(Mr.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(XL).map((function(t){e[t]=XL[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return $L(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(no,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Ao,(function(){e.positionDots()}))}(this),this.on(no,(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(qL).map((function(i){e[qL[i]]=e[qL[i]].bind(e),t.addCallBack(i,e[qL[i]])})),"mobile"!==Vr.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&&Mr.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Mr.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||Mr.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&&Mr.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"!==Vr.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){Mr.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&Mr.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=Mr.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Mr.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")),Mr.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Mr.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Mr.addClass(this.root,"no-timepoint"),e&&(Mr.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Mr.addClass(this.root,"product"),this.tipText.textContent=e):(Mr.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){Mr.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Mr.removeClass(this.find(".xg-spot-content"),"show-text"),Mr.removeClass(this.root,"product")}},{key:"hide",value:function(){Mr.addClass(this.root,"hide")}},{key:"show",value:function(e){Mr.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(qL).map((function(i){t.removeCallBack(i,e[qL[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"===Vr.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}(ba),QL=function(e){mr(i,e);var t=Sr(i);function i(e){var n;return pr(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return yr(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([no],(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,Mr.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=Mr.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}(ba);function JL(e){return e?"background:".concat(e,";"):""}var eN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=Tr(e).offsetDuration,n=e.currentTime;n=Mr.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return yr(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(eo,this.onTimeupdate),this.on(co,(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:JL(t.cachedColor),played:JL(t.playedColor),progress:JL(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}(ba),tN="realtime",iN="firstframe",nN="poster";var rN=null,oN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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(eo,e.renderOnTimeupdate),e.on(eo,e.renderOnTimeupdate))})),vr(Tr(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),vr(Tr(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(eo,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),vr(Tr(e),"start",(function(t,i){var n=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(e){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===tN||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Mr.setTimeout(Tr(e),e.start,i):Mr.requestAnimationFrame(e.start))})),vr(Tr(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Mr.clearTimeout(Tr(e),e.frameId):Mr.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return yr(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!==tN&&this.interval>=1e3?"timer":"animation",this.once(vo,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==nN&&(r!==iN&&(this.on(co,(function(){e.stop()})),this.on(zr,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(qr,(function(){e.stop()}))),this.on(oo,this.onLoadedData),this.on(lo,(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(o){Lr.logError("plugin:DynamicBg",o)}}},{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"!==Vr.browser||!Mr.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"===Mr.typeOf(e)?e:"String"===Mr.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!==iN&&e!==nN}},{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(u){Lr.logError("plugin:DynamicBg",u)}}},{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 rN?rN:rN=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Vr.browser||"firefox"===Vr.browser)}}]),i}(ba),aN="info",sN=Vo,lN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(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[aN].push(dr(dr({type:"userAction"},i),{},{payload:n}))})),vr(Tr(e),"_onReset",(function(){e.reset()})),vr(Tr(e),"_recordInfo",(function(t){e.info(t)})),vr(Tr(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 yr(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Uo,this._recordUserActions),this.on(sN.STATS_INFO,this._recordInfo),this.on(sN.STATS_DOWNLOAD,this._downloadStats),this.on(sN.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[aN].push(dr(dr({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=dr({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=(vr(e={},aN,[]),vr(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[aN].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(nF){console.log("err",nF)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[aN].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(ca),cN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Tr(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 yr(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(to,this.onGapJump),this.on(zr,(function(){e.hasPlayed=!0})),this.on(Qr,(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}(ba);cN.BROWSER_GAP_TOLERANCE=.001;var uN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Tr(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),vr(Tr(e),"onJump",(function(){var t=Tr(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 yr(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(to,this.onWaiting),this.on([$r,io],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(zr,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(ba),hN="cdn",dN=["cdn"],fN=function(e){mr(i,e);var t=Sr(i);function i(){var e;pr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return vr(Tr(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hN;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)})),vr(Tr(e),"startTimer",(function(){Mr.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),vr(Tr(e),"initSpeedList",(function(){e.speedListCache={},dN.forEach((function(t){e.speedListCache[t]=[]}))})),vr(Tr(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||hN)})),vr(Tr(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(d){console.error(d)}}}})),vr(Tr(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hN;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=Tr(e).player;r&&(i===hN?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),vr(Tr(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hN,i=e.getSpeed(t),n=Tr(e).player;if(n)if(t===hN)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(To,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(To,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return yr(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&dN.push.apply(dN,kr(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([oo,mo],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([oo,mo],this.startTimer),dN.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}(ba),pN=function(e){mr(i,e);var t=Sr(i);function i(){return pr(this,i),t.apply(this,arguments)}return yr(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(zr,(function(){e._startTick()})),this.on(qr,(function(){e._stopTick()})),this.on(Xr,(function(){e._stopTick()})),this.on(co,(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(Ko,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}(ba);const gN=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(){Mr.addClass(this.root,"hide")}show(){return Mr.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(Xr,(()=>{this.isEndedShow&&Mr.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(eo,(()=>{this.onTimeUpdate()})),this.on(Eo,(()=>{Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"xg-showplay"),this.once(eo,(()=>{this.onTimeUpdate()}))}))):this.on(zr,(()=>{Mr.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?Mr.removeClass(this.root,"xg-showplay"):this.once(eo,(()=>{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>`}};Oa.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 yN{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:n}=t,r=[...n?[]:[EL,hL,eN,ZL,_L],fL,mL,IL,LL,HL,jL,BL,FL,CL,xL],o=[mO,gN,SO,sL,CO,GL,YL,QL,UO];this.plugins=[lN,yO,...r,...o,cN,uN];const a=i?"mobile":Vr.device;switch(a){case"pc":this.plugins.push(oL,HO,WL,fN,pN);break;case"mobile":this.plugins.push(nL);break;default:this.plugins.push(oL,HO,WL)}(Vr.os.isIpad||"pc"===a)&&this.plugins.push(oN),this.ignores=[],this.i18n=[]}}function vN(e,t){return d(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:n,playerData:r},o){const a=[yN,mN()],{openSoftDecoding:s,isMusic:l}=r,c=[],u=[];if(i?a.push(function({isLive:e,playerData:t}){const i=["error","playbackRate"],n=t.configs,r=Ws(n,"EncryptHlsPlugin");(null==r?void 0:r.playAuthToken)||i.push("definition");const o=[hR];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=[QA],r=t.configs,o=Ws(r,"EncryptHlsPlugin");(null==o?void 0:o.playAuthToken)||(i.push("definition"),n.push(WA));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($s()||Xs()||s){const e=yield o.sdkUmdLoader.loadPlugins(Bw.FLV);c.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(Bw.FLV);c.push(e)}})))());Ws(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&c.push(aO);const[h,f]=yield Promise.all([n(),_N({playerData:o.playerData},o),...u]);return{presets:a,softDecodingOption:h,plugins:[...c,...f].filter(Boolean)}}))}function mN(e){const t=[xR,sO,lR];return class{constructor(){this.plugins=t,this.ignores=["error"]}}}function _N(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(ww()||Ns())&&o.push(Lw),e.enableMenu&&o.push(cR),o}))}function EN(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function TN(){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 bN(){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 SN(){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 CN(){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 kN(){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 IN=u(c({startPlay:bN,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:TN,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:SN,volumeMuted:CN,volumeSmall:kN}),PN={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:Gs(),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({},IN),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}},DN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},wN={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 AN=u(c({startPlay:bN,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:TN,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:SN,volumeMuted:CN,volumeSmall:kN}),RN=u(c({width:"100%",height:"100%",lang:Gs(),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({},AN),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}}),xN={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}},ON={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:LN}=ba,NN=e=>{const t="mobile"===Vr.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:n=(t?"inner":"normal"),position:r=LN.CONTROLS_LEFT,icon:o=EN,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=oA(this.handleCallback.bind(this),200);const t="mobile"===Vr.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),s&&(null==(e=this.player)||e.on(ko,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(LA.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),s&&(null==(e=this.player)||e.off(ko,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 MN{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:za.INNER;Object.values(za).includes(s)||(s=za.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(ko,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(za.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:za.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(LA.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["normal","inner","fullscreen"][this.mode]}`;switch(this.root=Mr.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case za.NORMAL:{const e=Mr.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=Mr.createDom("div",qa[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case za.INNER:this.container=this.root;break;case za.FULLSCREEN:{const e=Mr.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&&Mr.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&&Mr.hasClass(this.children,"item-list-panel-content")&&Mr.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!==za.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return Mr.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"active")}hide(){this.isShow=!1,Mr.removeClass(this.root,"active"),Mr.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(ko,this.handleOrientationChange.bind(this))}}function UN(){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:BN}=ba;class FN extends(KA(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:BN.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:UN,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=Mr.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=Mr.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 HN(){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:jN}=ba;class VN 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:jN.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&ur.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:HN,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=Mr.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=Mr.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(LA.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(OA.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 KN(){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:WN}=ba;class GN 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:WN.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:KN,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(ao,(()=>{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=Mr.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=Mr.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 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="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:zN}=ba;class $N 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:zN.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:YN,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=Mr.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=Mr.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=Mr.createDom("div","",{},"audiotrack-panel-content");r.forEach((t=>{const i=Mr.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){zA(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=Mr.createDom("div","",{},"audiotrack-panel-content");for(let a=0;a<i.length;a++){const e=i[a],t=ZA(e,a,n),o=Mr.createDom("div","",{},"panel-Item "+(e.enabled?"select-in":""));o.innerHTML=t,o.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=this._getNativeTrackList();t&&YA(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=$N.textTips[this.player.lang||"en"])?e:$N.textTips.en}}class XN{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){XN.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 qN=18e5,ZN=1e3,QN="media_info",JN="ttdrama_media_info",eM="[mediaInfoCache]";let tM=c({},{enable:!1,expireTime:qN,cacheType:"memory",maxEntries:100});const iM=new Map,nM=new Map;function rM(e,t={}){as.log(`${eM} ${e}`,t)}function oM(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:cM(e)}}function aM(){return c({},tM)}function sM(){const e=iM.size,t=nM.size;iM.clear(),nM.clear();rM("clear success",{memoryCacheCount:e,prefetchedCacheCount:t,localStorageCacheCount:function(){const e=gM();if(!e)return 0;const t=[`${Ss}${QN}_`,`${Ss}${JN}_`],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}()})}function lM(e){return"string"==typeof e?e.trim():""}function cM(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function uM(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function hM(e){const t=dM(e);return t.playAuthTokenHash?uM(JSON.stringify(t)):""}function dM(e){const t=lM(e.playAuthToken);return{playAuthTokenHash:t?uM(t):"",reqParams:fM(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function fM(e){if(!e)return;const t=c({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const pM={getItem:e=>iM.get(e)||null,setItem(e,t){iM.delete(e),iM.set(e,t)},removeItem(e){iM.delete(e)}};function gM(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(e){return}}function yM(e){return e.startsWith(`${Ss}${QN}_`)||e.startsWith(`${Ss}${JN}_`)}function vM(){if("memory"===tM.cacheType)return Array.from(iM.keys()).filter(yM);const e=gM();return e?function(e){const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);n&&yM(n)&&t.push(n)}return t}(e):[]}function mM(){return"memory"===tM.cacheType?pM:gM()}function _M(e){try{return JSON.parse(e)}catch(t){return}}function EM(e){const t=lM(e.moduleName),i=lM(e.cacheKey);return t&&i?`${Ss}${t}_${i}`:""}function TM(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 bM(e,t){const i=Date.now()+t,n=TM(e);return n?Math.min(i,n-ZN):i}function SM(e){const t=lM(e.moduleName),i=lM(e.cacheKey);return t&&i?`${t}:${i}`:""}function CM(e){const t=SM(e),i=t?nM.get(t):void 0;if(i){if(!(Date.now()>=i.expireAt))return i.lastAccessedAt=Date.now(),i.mediaInfo;nM.delete(t)}}function kM(e,t){const i=SM(e);if(!i||!cM(t))return;const n=bM(t,tM.expireTime);n<=Date.now()||(nM.set(i,{mediaInfo:t,expireAt:n,lastAccessedAt:Date.now()}),function(){const e=nM.size-tM.maxEntries;e<=0||[...nM.entries()].sort((([,e],[,t])=>e.lastAccessedAt-t.lastAccessedAt)).slice(0,e).forEach((([e])=>nM.delete(e)))}())}function IM(e){return{moduleName:lM(e.moduleName),cacheKey:lM(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:tM.cacheType}}function PM(e){const t=mM(),i=EM(e),n=IM(e);if(!t)return void rM("get skip no storage",n);if(!i)return void rM("get skip empty storage key",n);const r=t.getItem(i)||"";if(!r)return void rM("get miss empty cache",n);const o=_M(r);if(!o)return void rM("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 rM("get miss expired and removed",u(c({},n),{expireAt:o.expireAt,now:Date.now()}))):(rM("get hit",c(u(c({},n),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),oM(a))),function(e,t,i,n){try{e.setItem(t,JSON.stringify(u(c({},i),{lastAccessedAt:Date.now()})))}catch(nF){rM("touch failed",u(c({},n),{error:nF}))}}(t,i,o,n),a);rM("get miss invalid cache payload",n)}function DM(e,t,i=qN){const n=mM(),r=EM(e),o=IM(e);if(!n)return void rM("set skip no storage",c(c({},o),oM(t)));if(!r)return void rM("set skip empty storage key",c(c({},o),oM(t)));if(!cM(t))return void rM("set skip invalid media info",c(c({},o),oM(t)));const a=bM(t,i);if(a<=Date.now())return void rM("set skip expired media info",c(u(c({},o),{expireTime:i,expireAt:a}),oM(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=vM(),i=tM.maxEntries;if(t.length<=i)return;const n=t.map((t=>{const i=_M(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))),rM("prune success",{removeCount:r,maxEntries:i,cacheType:tM.cacheType})}(n),rM("set success",c(u(c({},o),{cacheKeyInfo:s.cacheKeyInfo,expireTime:i,expireAt:a}),oM(t)))}catch(nF){rM("set failed",c(u(c({},o),{error:nF}),oM(t)))}}function wM(e){if(tM.enable)return function(e){return PM({moduleName:QN,cacheKey:hM(e),cacheKeyInfo:dM(e)})}(e)}function AM(e){return CM({moduleName:QN,cacheKey:hM(e),cacheKeyInfo:dM(e)})||wM(e)}function RM(e,t){tM.enable&&function(e,t,i=qN){DM({moduleName:QN,cacheKey:hM(e),cacheKeyInfo:dM(e)},t,i)}(e,t,tM.expireTime)}const xM=[["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 OM(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LM(e){if(!e)return;const t={};return xM.forEach((([i,n])=>{const r=e[i];"string"==typeof r&&(t[n]=r)})),t}function NM(e){return uM(JSON.stringify(LM(e)||{}))}function MM(e){return!0===(null==e?void 0:e.canIUseGetDramaInfoTranscodeParam)}function UM(e){switch(e){case mR.NOT_SUBMITTED:return"NOT_SUBMITTED";case mR.UNDER_REVIEW:return"UNDER_REVIEW";case mR.FAILED_REVIEW:return"FAILED_REVIEW";case mR.WITHDRAWN:return"WITHDRAWN_REVIEW";case mR.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}}function BM(e,t){return void 0!==t?UM(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 FM(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 HM(e,t=10,i=0){const n=parseInt(`${e}`,t);return Number.isNaN(n)?i:n}function jM(e){var t;return lM(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function VM(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 KM(e){return lM(e.albumId||e.album_id)}function WM(e){return lM(e.episodeId||e.episode_id||e.episodeID)}function GM(e,t){const i={episodeId:WM(e)};return!OM(e,"transcodeParam")||t&&!MM(t)||(i.transcodeParam=e.transcodeParam),i}function YM(e){const t=lM(e.episodeId);return t?OM(e,"transcodeParam")?`${t}_${NM(e.transcodeParam||{})}`:t:""}function zM(e){const t={episodeId:lM(e.episodeId)};return OM(e,"transcodeParam")&&(t.transcodeParamHash=NM(e.transcodeParam||{})),t}function $M(e){const t={moduleName:JN,cacheKey:YM(e),cacheKeyInfo:zM(e)};return CM(t)||function(e){if(tM.enable)return PM(e);rM("get skip disabled",u(c({},IM(e)),{config:aM()}))}(t)}function XM(e,t){!function(e,t){tM.enable?DM(e,t,tM.expireTime):rM("set skip disabled",c(u(c({},IM(e)),{config:aM()}),oM(t)))}({moduleName:JN,cacheKey:YM(e),cacheKeyInfo:zM(e)},t)}function qM(e){return AM(ZM(e))}function ZM(e){const t=e.getVideoByToken||{};return u(c({},t),{defaultDefinition:jM(e),reqParams:c({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function QM(e,t){const i=ZM(e);return u(c({},i),{playDomain:i.playDomain||VM(null==t?void 0:t.channel)})}function JM(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=FM(i,y),a=FM(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:HM(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,Xa),drmType:t(["DrmType","drmType","drm_type"])},e),Ms(e,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}))})).sort(_s);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 eU(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function tU(e,t){var i,n;const r=jM(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=eU(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:HM(o.bitrate||o.Bitrate),duration:HM(o.duration||o.Duration||e.duration),size:HM(o.size||o.Size)}}let iU=!1;const nU=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function rU(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(i){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${a}?${l.join("&")}${n}`}function oU(e,t){return"string"==typeof e?rU(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?rU(e,t):e&&"object"==typeof e&&"string"==typeof e.src?u(c({},e),{src:rU(e.src,t)}):e)):e}function aU(e,t=Date.now()){if(!iU||!e)return e;const i=c({},e);return nU.forEach((e=>{i[e]&&(i[e]=oU(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>oU(e,t)))),i}function sU(e,t=Date.now()){return iU&&e?u(c({},e),{playList:(e.playList||[]).map((e=>aU(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:"ئۇيغۇرچە"}],cU=new Map,uU=new Map;for(const rF of lU)cU.set(rF.id,rF.label),uU.set(rF.tag.toLowerCase(),rF.label);function hU(...e){for(const t of e){if("string"!=typeof t)continue;const e=t.trim();if(e)return e}return null}function dU(e){return{albumId:hU(null==e?void 0:e.album_id,null==e?void 0:e.albumId),episodeId:hU(null==e?void 0:e.episode_id,null==e?void 0:e.episodeId,null==e?void 0:e.episodeID)}}const fU=AR.getVeErrorInfo,pU={playAuthToken:"",needDefinitionList:!0},gU=(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},yU=(e,t="")=>null==e?t:`${e}`;class vU extends XN{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==pB?void 0:pB.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 as.error("get no media info");as.log("getVideo res: ",v);const{type:m,poster:_,vid:E,dashOpts:T,thumbs:b,barrageMaskUrl:S}=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||vs(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&&b.length>0&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(b))):this.getThumbnailConfig(b)),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}}as.error("get no media info")}catch(y){if(as.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=pB.ttDramaEnv,r=e||(null==(t=this.playerData)?void 0:t.configs)||{},{albumId:o,episodeId:a}=dU(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=LM(r.transcodeParam)||{});const i=t=>{var i;as.error("getDramaInfo error:",t);const n={errorType:"drama",errorCode:vR.FAILED_GET_EPISODE_INFO.code,veError:fU({code:vR.FAILED_GET_EPISODE_INFO.code,message:vR.FAILED_GET_EPISODE_INFO.message,textKey:vR.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:vR.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(as.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:o,episodeId:a,vid:s}),!(null==t?void 0:t.is_success)){as.error("getDramaInfoViaJSB invalid response:",t);const i=BM(null==(n=null==t?void 0:t.error)?void 0:n.error_msg,void 0),o=vR[i]||vR.FAILED_GET_EPISODE_INFO,a={errorType:"drama",errorCode:o.code,veError:fU({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)!==mR.SUCCESS){as.error("getDramaInfoViaJSB invalid response:",t);const n=UM(null==i?void 0:i.status),r=vR[n]||vR.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:r.code,veError:fU({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)){as.error("getDramaInfoViaJSB invalid response:",t);const n={errorType:"drama",errorCode:vR.FAILED_TO_QUERY.code,veError:fU({code:vR.FAILED_TO_QUERY.code,message:vR.FAILED_TO_QUERY.message,textKey:vR.FAILED_TO_QUERY.textKey}),errorMessage:vR.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)}as.log("videoInfoRes before transformDramaVideoInfoToRes",i.video_info);const u=this.transformDramaVideoInfoToRes(i.video_info,this.config);as.log("videoInfoRes after transformDramaVideoInfoToRes",u),e(u)}catch(u){i(u)}}),t)}catch(l){i(l)}}));{const e=vR.INVALID_PARAM;null==(i=this.sdk)||i.delayError.push({errorType:yR.network,errorCode:e.code,veError:fU({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return UM(e)}mapDramaErrorCode(e,t){return BM(e,t)}transformDramaVideoInfoToRes(e,t){return JM(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){as.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(as.log("tt drama info: ",this.isMinisDramaMode,null==pB?void 0:pB.ttDramaEnv),this.isMinisDramaMode&&(null==(i=null==pB?void 0:pB.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=$M(GM(t,pB.ttDramaEnv));if(i){const e=sU(i);return this.callOnGetMediaInfo(e,!0),e}const l=e=>{XM(GM(t,pB.ttDramaEnv),e);const i=sU(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")){as.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:fU(pR.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){as.log(o)}null==(i=this._emitter)||i.emit(LA.GET_PLAY_URL_ERR,e);const r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:fU(pR.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 Ts((()=>Es(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=hM(i),r=AM(i);if(r){as.log("[mediaInfoCache] authToken use cached media info",{cacheKey:n,vid:r.vid,playListLength:(null==(e=r.playList)?void 0:e.length)||0});const t=sU(r);return this.callOnGetMediaInfo(t,!0),t}as.log("[mediaInfoCache] authToken request media info",{cacheKey:n,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield Ts((()=>Es(i)),this.retryCount,(e=>502===e.status),h);RM(i,o);const a=sU(o);return as.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(Bw.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Bw.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(Bw.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Bw.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 jw.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield jw.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 as.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 Ys(Vs(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield Ys(Vs(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=ys(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){as.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=gU(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=gU(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),n=gU(e,["StringContent","stringContent","string_content"],"",!0),r=gU(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=cU.get(i);if(e)return e}if(t){const e=uU.get(t.toLowerCase());if(e)return e}}(gU(e,["LanguageId","languageId","language_id"],void 0,!0),gU(e,["Language","language"],"",!0)),a=o||yU(gU(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),s=yU(gU(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),l=yU(gU(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=yU(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 as.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=ps(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",[Za.FAIRPLAY]:{serverProcessSPCPath:bs(Za.FAIRPLAY,f,m,_),serverCertificatePath:h},[Za.WIDEVINE]:{serverProcessSPCPath:bs(Za.WIDEVINE,f,m,_)},[Za.PLAYREADY]:{serverProcessSPCPath:bs(Za.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){as.error("generate drm config error:",d)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=pB.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}=dU(n),a=!(!r||!o),s=!!pB.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||s&&a,this.isPlayByToken&&(this.config=Object.assign({},pU,e),Object.prototype.hasOwnProperty.call(n,"definitionMap")&&(this.config.definitionMap=n.definitionMap),e.playAuthToken)){if(this.tokenInfo=gs(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=ys(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=gs(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(ms(this.tokenInfo)){as.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:OA.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:fU(pR.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(ms(this.keyTokenInfo)){as.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:OA.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:fU(pR.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(ms(this.thirdPartyDrmAuthTokenInfo)){as.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:OA.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:fU(pR.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 mU extends XN{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({},mU.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 _U extends XN{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 EU extends XN{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,n,r;if(pA.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=pA.getStrategyRecommendations(void 0,s),{result:c}=l;as.log("VodLogCommon Final StrategyConfig:",c);const u=null==c?void 0:c[cA.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 TU={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=[vU,mU,_U,EU,...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){as.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){as.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 o of Object.keys(t))if(t[o]&&t[o].beforePlayerCreate)try{const e=()=>Vs(t[o].beforePlayerCreate());(null==i?void 0:i.measureAsync)?n.push(i.measureAsync(`beforePlayerCreate.${o}`,e)):n.push(e())}catch(r){throw n.push(Vs(null)),r}return new Promise(((e,t)=>{Promise.all([...n]).then((()=>{e(null)})).catch((i=>{as.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 n of Object.keys(t))if(t[n]&&t[n].beforePlayerCreate)try{t[n].afterPlayerCreate()}catch(i){throw i}},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}}},bU={[fR.NETWORK]:"Network error",[fR.NETWORK_TIMEOUT]:"Network timeout",[fR.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[fR.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[fR.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[fR.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[fR.NETWORK_URL_EXPIRE]:"The video URL has expired",[fR.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[fR.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[fR.MEDIA_ERR]:"Media error",[fR.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[fR.MEDIA_ERR_NETWORK]:"Network error",[fR.MEDIA_ERR_DECODE]:"Decoding error",[fR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[fR.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[fR.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[fR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[fR.MEDIA_ERR_PLAY_ERR]:"Video playback error",[fR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[fR.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[fR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[fR.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[fR.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[fR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[fR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[fR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[fR.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[fR.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[fR.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[fR.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[fR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[fR.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[fR.OTHER]:"Other error",[fR.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[fR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[fR.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[fR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[fR.GET_PLAY_INFO_ERR]:"Failed to get media information",[fR.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[fR.LICENSE_VALIDATE_FAIL]:"License validation failed",[fR.DEFINITION_AUTO]:"Auto",[fR.LICENSE_STATUS_INVALID]:"License validation is invalid",[fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[fR.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[fR.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[fR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[fR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[fR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[fR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[fR.DRAMA_INVALID_PARAM]:"Invalid parameter",[fR.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[fR.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[fR.DRAMA_UNDER_REVIEW]:"Episode is under review",[fR.DRAMA_FAILED_REVIEW]:"Episode failed review",[fR.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[fR.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[fR.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[fR.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[fR.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},SU={[fR.NETWORK]:"网络错误",[fR.NETWORK_TIMEOUT]:"网络超时",[fR.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[fR.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[fR.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[fR.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[fR.NETWORK_URL_EXPIRE]:"视频地址已过期",[fR.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[fR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[fR.MEDIA_ERR]:"播放错误",[fR.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[fR.MEDIA_ERR_NETWORK]:"网络错误",[fR.MEDIA_ERR_DECODE]:"解码错误",[fR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[fR.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[fR.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[fR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[fR.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[fR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[fR.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[fR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[fR.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[fR.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[fR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[fR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[fR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[fR.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[fR.BUSINESS_DRM_KEY_ERROR]:"解密错误",[fR.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[fR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[fR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[fR.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[fR.OTHER]:"其他错误",[fR.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[fR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[fR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[fR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[fR.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[fR.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[fR.LICENSE_VALIDATE_FAIL]:"license 校验失败",[fR.DEFINITION_AUTO]:"自动",[fR.LICENSE_STATUS_INVALID]:"license 校验无效",[fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[fR.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[fR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[fR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[fR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[fR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[fR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[fR.DRAMA_INVALID_PARAM]:"参数错误",[fR.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[fR.DRAMA_NOT_SUBMITTED]:"剧集未送审",[fR.DRAMA_UNDER_REVIEW]:"剧集审核中",[fR.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[fR.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[fR.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[fR.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[fR.DRAMA_NOT_ON_SHELF]:"视频未上架",[fR.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},CU={[fR.NETWORK]:"ネットワークエラー",[fR.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[fR.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[fR.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[fR.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[fR.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[fR.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[fR.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[fR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[fR.MEDIA_ERR]:"再生エラー",[fR.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[fR.MEDIA_ERR_NETWORK]:"ネットワークエラー",[fR.MEDIA_ERR_DECODE]:"デコードエラー",[fR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[fR.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[fR.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[fR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[fR.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[fR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[fR.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[fR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[fR.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[fR.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[fR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[fR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[fR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[fR.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[fR.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[fR.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[fR.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[fR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[fR.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[fR.OTHER]:"その他のエラー",[fR.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[fR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[fR.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[fR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[fR.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[fR.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[fR.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[fR.DEFINITION_AUTO]:"自動",[fR.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[fR.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[fR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[fR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[fR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[fR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[fR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[fR.DRAMA_INVALID_PARAM]:"パラメータが無効です",[fR.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[fR.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[fR.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[fR.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[fR.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[fR.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[fR.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[fR.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[fR.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},kU=[{LANG:"en",TEXT:bU},{LANG:"zh",TEXT:SU},{LANG:"zh-hk",TEXT:{[fR.NETWORK]:"網路錯誤",[fR.NETWORK_TIMEOUT]:"網路逾時",[fR.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[fR.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[fR.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[fR.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[fR.NETWORK_URL_EXPIRE]:"視頻地址已過期",[fR.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[fR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[fR.MEDIA_ERR]:"播放錯誤",[fR.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[fR.MEDIA_ERR_NETWORK]:"網路錯誤",[fR.MEDIA_ERR_DECODE]:"解碼錯誤",[fR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[fR.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[fR.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[fR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[fR.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[fR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[fR.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[fR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[fR.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[fR.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[fR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[fR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[fR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[fR.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[fR.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[fR.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[fR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[fR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[fR.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[fR.OTHER]:"其他錯誤",[fR.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[fR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[fR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[fR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[fR.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[fR.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[fR.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[fR.DEFINITION_AUTO]:"自動",[fR.LICENSE_STATUS_INVALID]:"license 校驗無效",[fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[fR.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[fR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[fR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[fR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[fR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[fR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[fR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[fR.DRAMA_INVALID_PARAM]:"參數錯誤",[fR.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[fR.DRAMA_NOT_SUBMITTED]:"劇集未送審",[fR.DRAMA_UNDER_REVIEW]:"劇集審核中",[fR.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[fR.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[fR.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[fR.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[fR.DRAMA_NOT_ON_SHELF]:"影片未上架",[fR.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"}},{LANG:"jp",TEXT:CU}],IU="ignoreServicePreloadConfigEnable";class PU extends Error{constructor(e,t){super(t),this.code=e}}const DU=new Map;function wU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function AU(e){return!!(e&&KM(e)&&WM(e))}function RU(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function xU(e,t){return e instanceof PU?e:new PU(t.code,t.message)}function OU(e,t,i){const n=`${t.cacheOptions.moduleName}:${t.cacheOptions.cacheKey}`,r=DU.get(n);if(r)return r;const o="ttDrama"===t.kind?function(e,t){const i=KM(t),n=WM(t);if(!(null==e?void 0:e.getDramaInfo)||!i||!n){const e=vR.INVALID_PARAM;return Promise.reject(new PU(e.code,e.message))}const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return MM(e)&&wU(t,"transcodeParam")&&(r.transcodeParam=LM(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=BM(null==(o=null==r?void 0:r.error)?void 0:o.error_msg,void 0),t=vR[e];return void n(new PU(t.code,t.message))}if((null==(a=r.data)?void 0:a.status)!==mR.SUCCESS){const e=UM(null==(s=r.data)?void 0:s.status),t=vR[e];return void n(new PU(t.code,t.message))}if(!(null==(l=r.data)?void 0:l.video_info)){const e=vR.FAILED_TO_QUERY;return void n(new PU(e.code,e.message))}const c=JM(r.data.video_info,QM(t,e));if(!cM(c)){const e=vR.FAILED_TO_QUERY;return void n(new PU(e.code,e.message))}i(c)}catch(nF){n(xU(nF,vR.FAILED_GET_EPISODE_INFO))}}),r)}catch(nF){n(xU(nF,vR.FAILED_GET_EPISODE_INFO))}}))}(i,e):function(e,t){return d(this,null,(function*(){const i=QM(e,t);try{const e=gs(i.playAuthToken);if(ms(e)){const e=pR.PLAY_AUTH_TOKEN_EXPIRED;throw new PU(e.code,e.message)}const t=yield Es(i);if(!cM(t))throw new PU(pR.GET_PLAY_INFO_ERR.code,pR.GET_PLAY_INFO_ERR.message);return t}catch(nF){throw xU(nF,pR.GET_PLAY_INFO_ERR)}}))}(e,i);DU.set(n,o);const a=()=>{DU.get(n)===o&&DU.delete(n)};return o.then(a,a),o}function LU(e,t){return d(this,null,(function*(){try{const i=function(e,t){if(AU(e)&&!0===(null==t?void 0:t.canIUseGetDramaInfo)){const i=GM(e,t);return{kind:"ttDrama",cacheOptions:{moduleName:JN,cacheKey:YM(i),cacheKeyInfo:zM(i)}}}if(RU(e)){const t=ZM(e);return{kind:"playAuthToken",cacheOptions:{moduleName:QN,cacheKey:hM(t),cacheKeyInfo:dM(t)}}}if(AU(e)){const e=vR.INVALID_PARAM;throw new PU(e.code,e.message)}throw new PU(8e3,"Unsupported media info source")}(e,t),n=function(e,t,i){const n=CM(t.cacheOptions);return n||("ttDrama"===t.kind?$M(GM(e,i)):qM(e))}(e,i,t);if(n)return{status:"fulfilled",source:e,data:n,fromCache:!0};const r=yield OU(e,i,t);return kM(i.cacheOptions,r),{status:"fulfilled",source:e,data:r,fromCache:!1}}catch(nF){const i=xU(nF,pR.OTHER);return{status:"rejected",source:e,error:{code:i.code,message:i.message}}}}))}function NU(e,t){const i=QM(e,t);return i.playAuthToken?Es(i).catch((()=>{})):Promise.resolve(void 0)}function MU(e,t){return d(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return UU(e,t);const i=function(e,t){const i=$M(GM(e,t));return i?tU(i,e):void 0}(e,t);if(i)return aU(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return UU(e,t);const n=yield function(e,t){const i=KM(t),n=WM(t);if(!i||!n)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return NU(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return MM(e)&&wU(t,"transcodeParam")&&(r.transcodeParam=LM(t.transcodeParam)||{}),new Promise((i=>{try{e.getDramaInfo((n=>{try{if(!(null==n?void 0:n.is_success))return as.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const{data:r}=n;if((null==r?void 0:r.status)!==mR.SUCCESS||!(null==r?void 0:r.video_info))return as.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const o=JM(r.video_info,QM(t,e));i(o)}catch(r){as.error("[ttdrama] getDramaInfo invalid response",n),i(void 0)}}),r)}catch(n){as.error("[ttdrama] getDramaInfo call failed",n),i(void 0)}}))}(t,e);return n?(XM(GM(e,t),n),aU(tU(n,e))):void 0}))}function UU(e,t){return d(this,null,(function*(){const i=function(e){const t=qM(e);return t?tU(t,e):void 0}(e);if(i)return aU(i);const n=yield NU(e,t);var r;return n?(r=n,RM(ZM(e),r),aU(tU(n,e))):void 0}))}function BU(e,t){return d(this,null,(function*(){if(eU(e.url))return e;if(AU(e)){const i=yield MU(e,t);return i||t||RU(e)?i:e}return RU(e)?UU(e,t):e}))}function FU(e,t){return d(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(Vr.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const n of e)i.push(yield BU(n,t))}else i=yield Promise.all(e.map((e=>BU(e,t))));return i.filter(Boolean)}))}const HU=["live","rtm","music","danmu","ad"],jU=["configs","options","defaultConfig","current"],VU=["url","src","playUrl","playURL"],KU=["plugins","sdkPlugins","strategiesPlugins","presets"];class WU 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,WU.prototype)}}class GU extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,GU.prototype)}}function YU(e){return"object"==typeof e&&null!==e||"function"==typeof e}function zU(e,t){if(YU(e))try{return e[t]}catch(i){return}}function $U(e){try{return Array.isArray(e)}catch(t){return!1}}function XU(e){if(!$U(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 qU(e){return null!=e&&!1!==e}function ZU(e){return"string"==typeof e?e.toLowerCase():""}function QU(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function JU(e){return VU.some((t=>function(e){const t=[e],i=new WeakSet;for(let n=0;n<t.length;n+=1){const e=t[n];if(QU(e))return!0;if(YU(e)&&!i.has(e))if(i.add(e),$U(e))for(const i of XU(e))t.push(i);else for(const i of VU)t.push(zU(e,i))}return!1}(zU(e,t))))}function eB(e){if("string"==typeof e)return[e];if(!YU(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 tB(e,t){return KU.some((i=>XU(zU(e,i)).some((e=>function(e){const t=eB(e);return t.push(...eB(zU(e,"plugin"))),t.push(...eB(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 iB(e,t){switch(t){case"live":return!0===zU(e,"isLive")||"live"===ZU(zU(e,"type"))||qU(zU(e,"TimeShiftPlugin"))||qU(zU(e,"LiveInfoPanel"))||qU(zU(e,"LiveSubtitlesPlugin"))||qU(zU(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===ZU(zU(e,"streamType"))||qU(zU(e,"rtm"))||JU(e);case"music":return!0===zU(e,"isMusic")||qU(zU(e,"music"));case"danmu":{const t=zU(e,"getVideoByToken");return qU(zU(e,"DanmuPlugin"))||!0===zU(e,"needBarrageMask")||!0===zU(t,"needBarrageMask")}case"ad":return qU(zU(e,"AdsPlugin"))||qU(zU(e,"AdPlugin"))}}function nB(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(YU(e)&&!n.has(e)){n.add(e),t.push(e);for(const t of jU)i.push(zU(e,t));for(const t of XU(zU(e,"playList")))i.push(t)}}return t}(e);for(const i of HU)if(t.some((e=>iB(e,i)||tB(e,i))))throw new WU(i)}const rB=()=>Mr.generateSessionId(),oB=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0?e:0,aB=e=>c({},e),sB=(e,t)=>t.lastEnteredPlayingAt-e.lastEnteredPlayingAt||t.sequence-e.sequence,lB=(e,t)=>t.lastPlaybackAt-e.lastPlaybackAt||t.sequence-e.sequence,cB=(e,t)=>t.createdAt-e.createdAt||t.sequence-e.sequence,uB=(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 hB=new class{constructor(e=Date.now,t=rB){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:uB(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,aB(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||lB(n,this.historical)<0)&&(this.historical=n)}query(e){const t=[];for(const a of this.sessions.values()){if((a.pendingIdentity||a.pendingPlaybackSessionId||a.useStableSnapshot)&&a.lastStableSnapshot){t.push(this.rank(a,aB(a.lastStableSnapshot)));continue}const i=e.find((e=>e===a.core&&e.sdk===a.vePlayer));try{const e=this.snapshotSession(a,null!=i?i:null);a.lastStableSnapshot=aB(e.snapshot),t.push(e)}catch(o){a.lastStableSnapshot&&t.push(this.rank(a,aB(a.lastStableSnapshot)))}}const i=t.filter((e=>"playing"===e.state||"buffering"===e.state)).sort(sB)[0];if(i)return aB(i.snapshot);const n=t.filter((e=>e.hasEverPlayed)).concat(this.historical?[this.historical]:[]).sort(lB)[0];if(n)return aB(n.snapshot);const r=t.sort(cB)[0];return r?aB(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,uB(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:oB(t.duration),currentTime:oB(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 dB=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;hB.beginCoreCreate(this,e);try{const i=yield this._createPlayer(e,t);return this._isStaleLifecycleGeneration(t)?void this._discardStalePlayer(i):i}catch(nF){throw hB.failCoreCreate(this,e),nF}})),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 Os,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();nB(this.playerData);const{options:p,plugins:g,isMobile:y,openSoftDecoding:v,configs:m,strategiesPlugins:_,strategiesPluginConfigs:E}=this.playerData,T=!1,b=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),S=this.playerData.getCurrentStreamType()||vs(null==m?void 0:m.getVideoByToken);Ws(m,"EncryptHlsPlugin")||b&&S||this.playerData.isOpenABR()||(as.warn(`url is empty or streamType is empty (url:${b}, streamType: ${S})`),this.renderPoster());const C=()=>d(this,null,(function*(){const e=tl(b);return yield this.getSoftDecodingOption(v,e,S)})),k=yield f.measureAsync("createSDKPreset",(()=>d(this,null,(function*(){return yield vN({isLive:T,isMobile:y,streamType:S,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({},RN),i=c({},e?xN:ON);return c(c({},t),i)}(T):function(e=!1){const t=c({},PN),i=c({},e?DN:wN);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=Mr.deepMerge(w,p),U=u(c(u(c(c(c({},{errorKey:SR}),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,GN,FN,$N]}}),E),{playerData:this.playerData});this.playerData.getLineList().length>1&&U.MoreButtonPlugin.iconPlugins.push(VN),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=dB.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(OA.READY_CREATE_PLAYER);let V,K={};if(dB.shouldCheckLicense()){const e=yield dB.checkLicenseStatus();e!==TA.LICENSE_STATUS_OK&&e!==TA.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:b,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,hB.attachCore(this,V,e);const W=f.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=W,this.emit(OA.CREATE_PLAYER_PERF,W),as.log("createPlayer perf: ",W),this._emitter.emit(OA.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),V})),this._onMp4PreloadInfo=e=>{this.emit(LA.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(UA.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:n,mediaError:r}=e||{};if(Mr.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=tl(this.playerData.getCurrentUrl());t&&As(t,{range:"0-8",timeout:2e3}).then((t=>{as.log("xhr result",t);const{status:i,response:n}=t;403===i&&"string"==typeof n&&n.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{as.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(OA.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(OA.AUDIO_TRACK_CHANGE,{id:n,audioTrack:t});break}}},function(e){if(!e)throw new GU}(Boolean(dB.ttDramaEnv)),this.assertLiteConfig(e),hB.register(this,dU(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)&&hB.has(e.sdk))))?i:[];return hB.query(n)}static registerModules(e){sA.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){!function(e=!0){iU=!!e}(e)}static getAppendVideoUrlTimestamp(){return iU}static setTTDramaEnv(e){var t;as.log("TTDramaEnv: ",e);dB.ttDramaEnv=u(c({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){!function(e){e?("boolean"==typeof e.enable&&(tM.enable=e.enable),e.cacheType&&(tM.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?tM.expireTime=e.expireTime:void 0!==e.expireTime&&rM("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:tM.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?tM.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&rM("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:tM.maxEntries}),rM("config updated",aM())):rM("config skip empty config",{currentConfig:aM()})}(e)}static getMediaInfoCacheConfig(){return aM()}static clearMediaInfoCache(){sM()}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(Vr.os.isAndroid&&!0===(null==t?void 0:t.canIUseGetDramaInfo)&&!t.canAndroidBatchGetDramaInfo){const i=[];for(const n of e)i.push(yield LU(n,t));return i}return Promise.all(e.map((e=>LU(e,t))))}))}(e,dB.ttDramaEnv)}static setDebug(e){!function(e){as.config.debug=e?3:1}(e)}static setCollector(e){Ls=e}static shouldCheckLicense(){return!1}static prepare(e){return d(this,null,(function*(){let t=e;const i=Boolean(dB.ttDramaEnv);!(null==t?void 0:t.appId)&&i&&(t=u(c({},t),{appId:_R}));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&&as.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),{[IU]:!0,config:u(c({},null!=(i=null==o?void 0:o.config)?i:{}),{[IU]:!0})})})})}(u(c({},t),{serviceConfigMode:r}));if(dB.shouldCheckLicense())try{dB.hasInitVeStrategy=!0;const e=yield dB.checkLicenseStatus(),t=yield dB.checkLicense();if(e===TA.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===mA.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(nF){return void as.error(nF.message)}else dB.hasInitVeStrategy=!0;yield pA.init(o)}))}static setPreloadScene(e,t){return pA.setPreloadScene(e,t)}static get preloader(){return pA.preloader}static get preloaderStatus(){return pA.preloaderStatus}static addPreloadList(e){return FU(e,dB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||as.warn("[addPreloadList] resolved preloadList is empty"),pA.addPreloadList(e))))}static setPreloadList(e){return FU(e,dB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||as.warn("[setPreloadList] resolved preloadList is empty"),as.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),pA.setPreloadList(e))))}static setLicenseConfig(e){return bA.setLicenseConfig(e)}static checkLicense(){return bA.checkLicense()}static checkModuleList(){return bA.checkModuleList()}static checkLicenseStatus(){return bA.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return bA.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return d(this,null,(function*(){try{const i={hls:Bw.HLSEncrypt,mp4:Bw.MP4Encrypt,dash:Bw.DASH};if(!t||!i[t])return void as.warn("param of streamType is invalid");const n=(new Date).getTime().toString(),r="mp4"===t?yield jw.loadMp4Encrypt(lA):yield lA.loadPlugins(i[t]);return null==r?void 0:r.generateEncryptInfo(e,n)}catch(i){as.error("generate encrypt info error: ",i)}}))}assertLiteConfig(e){nB(e)}_init(e,t){return d(this,null,(function*(){var i;if(dB.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new Ar,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const n=dB.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield dB.checkModuleList():Object.values(EA);this.playerData=ur.observe(new SA(u(c({},e),{licensSupportModuleList:n}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(OA.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 as.error("createPlayer error:",e),void this.emit(UA.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(){TU.init(this);[...this.sdkPlugins].map((e=>TU.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new Us,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(LA.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new sA,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=Ws(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=dB.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==n?void 0:n.line_app_id)){const e={errorType:"log",errorCode:pR.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(OA.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=Xa,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,as.warn("media is expired, ",n),this.emit(UA.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,as.warn("media is expired, ",n),this.emit(UA.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()||vs(null==n?void 0:n.getVideoByToken))&&i&&!!(null==(e=Ws(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 dB.checkLicense(),y=yield dB.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:y,licenseType:g},y===TA.LICENSE_STATUS_EXPIRED)bA.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(OA.LICENSE_STATUS_WARNING,gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(n=null==(i=this.playerData.configs)?void 0:i.adaptRange)?void 0:n.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===dB.hasInitVeStrategy&&this.emit(OA.LICENSE_STATUS_WARNING,gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(y!==TA.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:yR.license},y===TA.LICENSE_STATUS_INVALID?{errorCode:pR.LICENSE_STATUS_INVALID.code,errorMessage:pR.LICENSE_STATUS_INVALID.message}:{errorCode:pR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:pR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else g===mA.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(d=null==(h=this._originConfigs)?void 0:h.autoBitrateOpts)?void 0:d.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,gR.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(p=null==(f=this.playerData.configs)?void 0:f.adaptRange)?void 0:p.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===dB.hasInitVeStrategy&&this.emit(OA.LICENSE_STATUS_WARNING,gR.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()||vs(null==s?void 0:s.getVideoByToken),g=Ws(s,"EncryptHlsPlugin"),y=Ws(e,"EncryptHlsPlugin"),v=Ws(s,"Mp4EncryptPlayer"),m=Ws(e,"Mp4EncryptPlayer"),_=Ws(s,"DASHPlugin"),E=Ws(e,"DASHPlugin"),T=Ws(s,"vodLogOpts"),b=(null==(t=dB.ttDramaEnv)?void 0:t.clientKey)?{appVersion:dB.ttDramaEnv.appVersion,clientKey:dB.ttDramaEnv.clientKey,line_app_id:_R,line_user_id:Ps(dB.ttDramaEnv.clientKey)}:{},S=!!(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||!Qs||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||b.clientKey){as.log("codec",this.playerData.codec);const t=Js(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:S?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}),b),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(Bw.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(i){as.warn("detect codec error: ",i)}}))}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()||vs(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=NN(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 TU.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>d(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([TU.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){as.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 pA.prepare()){const{plugins:e,pluginConfiguration:t}=pA.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(pA.isReady()){const e=pA.getStrategyRecommendations(),{result:t}=e;if(as.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[cA.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[cA.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})),as.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;dB.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),TU.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=dB.ttDramaEnv)?void 0:e.clientKey};this.veErrorIns=new AR(this.player,i)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(UA.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()||vs(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),r=Mr.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 MN({config:null!=(t=i.panel)?t:{mode:n?za.INNER:za.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_onPlayerRebuild(){if(!this._publicPlayNextOperation&&!hB.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(OA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.once(UA.READY,this._emitDelayError.bind(this)),this.player.once(UA.READY,this._emitDelayEvent.bind(this)),this.player.on(UA.ERROR,this._onError),this.player.on(SR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(LA.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=Vs(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&&Vr.isWeixin&&Vr.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=Vs(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(Wo).filter((e=>e!==Zr)),t=[...Object.values(LA),...Object.values(OA),...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(OA.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(OA.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(GA(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 YA(e,a)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(OA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.off(UA.ERROR,this._onError),this.player.off(SR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(LA.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=Mr.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?Mr.show(r,"block"):Mr.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&&hB.commitIdentitySwitch(this,i)})).catch((e=>{throw i&&hB.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((()=>{})))):(as.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))):(as.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(Ia.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)};_(UA.ERROR,(e=>r(e))),_(UA.CANPLAY,(()=>{l&&i.pause(),n(!0)})),v(UA.EMPTIED,(()=>{!f&&t&&(f=hB.armIdentitySwitch(this,t,i))}));try{if(i.plugins.dashplugin){const e=c(c({},Ws(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(nF){m((()=>r(nF)))}}))}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(UA.CANPLAY,(()=>{this.player.pause()})),e()};Vr.os.isAndroid?this.once(UA.TIME_UPDATE,(()=>{n()})):this.once(UA.CANPLAY,(()=>{n()})),this.player.play()}))}next(e,t=!0){try{this.assertLiteConfig(e)}catch(i){return Promise.reject(i)}return this._publicPlayNextOperation||hB.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=vs(null==e?void 0:e.getVideoByToken)||nr.MP4);const l=hB.beginIdentitySwitch(this,dU(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(hB.rollbackIdentitySwitch(this,l),this._isDestroyedPlaybackSwitchError(e))throw e;if(as.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||hB.hasActiveIdentitySwitch(this))return Promise.reject(this._createPlayNextInProgressError());const i={};this._publicPlayNextOperation=i;const n=this.player;try{n.emit(LA.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=hB.beginIdentitySwitch(this,dU(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&&hB.rollbackIdentitySwitch(this,o),r=Promise.reject(s)}const a=r.catch((e=>{throw o&&hB.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(LA.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(nF){a((()=>i(nF)))}}))}_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=Ws(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({},Ws(this.playerData.options,"Subtitle")||{}),Ws(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===UA.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(UA.ERROR,(e=>{d((()=>t(e)))})),u(UA.CANPLAY,(()=>{d((()=>{6===o&&h?r.pause():6!==o&&r.config.autoplay&&r.play(),e(void 0)}))}));const f=()=>{n||(n=!i||hB.armIdentitySwitch(this,i,r))};c.push([UA.EMPTIED,f]),r.once(UA.EMPTIED,f);try{r.playNext(s)}catch(p){d((()=>t(p)))}}))}if(dB.ttDramaEnv){if(null==(n=e.getVideoByToken)?void 0:n.playAuthToken){if((this.playerData.getCurrentStreamType()||vs(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||vs(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()||vs(null==(o=this.playerData.configs)?void 0:o.getVideoByToken))!==(e.streamType||vs(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=vR.INVALID_PARAM;return{errorType:yR.network,errorCode:e.code,veError:AR.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){return dU(e).albumId||""}_getDramaEpisodeIdFromConfig(e){return dU(e).episodeId||""}switchDramaEpisode(e,t=!0,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken"),o=hB.beginIdentitySwitch(this,dU(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((()=>{hB.commitIdentitySwitch(this,o)})).catch((e=>{throw hB.rollbackIdentitySwitch(this,o),e})):(hB.rollbackIdentitySwitch(this,o),as.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=gs(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||Ws(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(a===tr.H265||c||(null==(n=null==s?void 0:s.autoBitrateOpts)?void 0:n.enable)));if(dB.shouldCheckLicense()&&(null==(r=this._originConfigs)?void 0:r.useSoftDecoding)&&!l)try{const e=yield dB.checkLicenseStatus();if(!(yield dB.checkLicenseModuleAuth(_A.SDK_VOD_PLAY,EA.H265)))throw this.emit(OA.LICENSE_STATUS_WARNING,e===TA.LICENSE_STATUS_EXPIRED?gR.EXPIRED_LICENSE_NOT_SUPPORT_265:gR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(nF){return void as.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(Bw.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 jw.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(OA.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),as.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(dB.shouldCheckLicense()&&!l)try{const e=yield dB.checkLicenseStatus();if(!(yield dB.checkLicenseModuleAuth(_A.SDK_VOD_PLAY,EA.H265)))throw this.emit(OA.LICENSE_STATUS_WARNING,e===TA.LICENSE_STATUS_EXPIRED?gR.EXPIRED_LICENSE_NOT_SUPPORT_265:gR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(nF){return void as.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(Bw.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 jw.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(OA.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),as.error("soft decode is not support by current browser")}}else{this.emit(OA.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),as.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()&&Vr.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 zA(r,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&YA(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=>{Oa.use(e)})),Oa.extend(kU),i&&Oa.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(),hB.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,TU.destroy(this)}))}destroy(){return d(this,null,(function*(){yield this._teardown(!1)}))}};let fB=dB;fB.isMSESupported=$s,fB.veStrategy=pA,fB.sdkVersion="1.18.0",fB.ttDramaEnv=null,fB.isMMSSupported=Xs,fB.isRTMSupported=CA.isSupported,fB.hasInitVeStrategy=!1;const pB=fB;const gB="function"==typeof Buffer,yB=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),vB=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),mB=(e=>{let t={};return e.forEach(((e,i)=>t[e]=i)),t})(vB),_B=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,EB=String.fromCharCode.bind(String),TB=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),bB=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),SB=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+=vB[t>>18&63]+vB[t>>12&63]+vB[t>>6&63]+vB[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},CB="function"==typeof btoa?e=>btoa(e):gB?e=>Buffer.from(e,"binary").toString("base64"):SB,kB=gB?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;i<n;i+=4096)t.push(EB.apply(null,e.subarray(i,i+4096)));return CB(t.join(""))},IB=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?EB(192|t>>>6)+EB(128|63&t):EB(224|t>>>12&15)+EB(128|t>>>6&63)+EB(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return EB(240|t>>>18&7)+EB(128|t>>>12&63)+EB(128|t>>>6&63)+EB(128|63&t)},PB=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,DB=e=>e.replace(PB,IB),wB=gB?e=>Buffer.from(e,"utf8").toString("base64"):yB?e=>kB(yB.encode(e)):e=>CB(DB(e)),AB=(e,t=!1)=>t?TB(wB(e)):wB(e),RB=e=>{if(e=e.replace(/\s+/g,""),!_B.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=mB[e.charAt(o++)]<<18|mB[e.charAt(o++)]<<12|(i=mB[e.charAt(o++)])<<6|(n=mB[e.charAt(o++)]),r+=64===i?EB(t>>16&255):64===n?EB(t>>16&255,t>>8&255):EB(t>>16&255,t>>8&255,255&t);return r},xB=AB;var OB={};!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)},b=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function S(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?b(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=S(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)?"�":b(e)},d:C,yup:function(e){return(e=S(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}(OB);const LB="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",NB={SLOW:.5,MODERATE:1,FAST:2},MB={SLOW:5,MODERATE:3.5,FAST:2},UB={style:{node:LB,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function BB(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 FB{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=OB.inHTMLData(i),document.body.appendChild(r);const o=BB("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.offsetWidth+2,height:r.offsetHeight}),a=BB("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=OB.inHTMLData(i),document.body.removeChild(r),o.appendChild(a),"data:image/svg+xml;base64, "+xB((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=NB[this.config.tickerSpeed]||NB.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=MB[this.config.tickerSpeed]||MB.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=MB[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")!=UB.class[i]&&e.setAttribute("class",UB.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=UB.style[i]&&e.setAttribute("style",UB.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",LB);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 HB="xg-dynamic-watermark";function jB(){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 VB(){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:KB}=ba,WB="getMirror",GB="exitMirror";class YB extends ba{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=Mr.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=Mr.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:sO}}afterCreate(){this.once(Jr,this.showToast),this.on(eo,(()=>{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)):as.warn("the time got is invalid",t),e()})).catch((t=>{as.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(Xr,this.saveTime.bind(this)),this.on(Zr,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=Mr.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){Cs(e,YB.pluginName,t+"")}getTimeByStorage(e){return ks(e,YB.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function zB(){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 $B{constructor(e){this.config=e.config,this.parent=e.root,this.root=Mr.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===Vr.device?"touchend":"click";this.modal=Mr.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?Mr.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=Mr.createDom("li",r,e,i),a=Mr.findDom(o,".bg"),s=null==zB?void 0:zB();!e.poster&&s&&a.appendChild(s),this.root.appendChild(o)}));const n=e.findIndex((e=>e.selected));if(n>=0){const t=Mr.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&&Mr.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Mr.addClass(t,"selected"),n&&Mr.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(){Mr.removeClass(this.modal,"hide"),Mr.addClass(this.modal,"active"),Mr.removeClass(this.root,"hide"),Mr.addClass(this.root,"active")}hide(){Mr.removeClass(this.modal,"active"),Mr.addClass(this.modal,"hide"),Mr.removeClass(this.root,"active"),Mr.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 XB(){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 qB(){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 ZB="playListNext",QB="playListToggle",JB="mobile"===Vr.device;function eF(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 tF(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}SA.prototype.setVodPlayListConfig=function(e){if(!(e.plugins||[]).find((e=>e.pluginName===iF.pluginName)))return;const t=Ws(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=eF(i),o=tF(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 iF 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:VA,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=eF(t),this.timer=setTimeout((()=>{this.emit(LA.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=tF(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(eo,this._onTimeUpdate),this.on(Xr,this._onEnded),this.on([Ao,ko],(()=>{this._resizeList()})),this.once(io,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),JB&&this.on(uo,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),JB?(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{[ZB]:{icon:XB,class:"xg-play-next-btn"},[QB]:{icon:qB,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[ZB]),this.appendChild(".xg-play-list-btn",e[QB])}show(){!this.list||this.list.length<1||Mr.addClass(this.root,"show")}hide(){Mr.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=eF(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(LA.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(LA.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 $B(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>`}}return Object.assign(pB,{Events:UA,Event:MA,DefinitionDemotePlugin:class 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(to,this._waiting),this.on(qr,this._clearTime),this.on(zr,this._clearTime),this.on(Do,this._clearTime),this.on(LA.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(LA.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&&(as.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(LA.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void as.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&&(as.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(LA.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&as.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===La.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(LA.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){const e=t.url;as.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==n&&this.showToast(t)}else as.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((()=>{as.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(LA.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=Mr.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=Mr.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,as.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}},MirrorPlugin:class extends ba{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:KB.CONTROLS_RIGHT,index:HA,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{[WB]:{icon:jB,class:"xg-get-mirror"},[GB]:{icon:VB,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[WB]),t.appendChild(e[GB])}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(LA.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?GB:WB)}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[WB]}</div>\n </xg-icon>`}},MemoryPlay:YB,Subtitle:aO,DynamicWatermarkPlugin:class 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(eo,(()=>{this.start()})),this.on(Ao,(()=>{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 FB(u(c({},this.config),{root:this.root,rootClassName:HB}))}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=${HB} />\n `}},PlayListPlugin:iF,getI18N:function(){return Oa},BasePlugin:ca,Plugin:ba,Sniffer:Vr,Util:Mr,STATE_CLASS:Ia,I18N:Oa,STATES:La})}));