xgplayer 3.0.0-alpha.151 → 3.0.0-alpha.152
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/browser/index.min.js +1 -1
- package/dist/index.min.js +1 -1
- package/es/player.js +6 -2
- package/es/version.js +1 -1
- package/lib/player.js +6 -2
- package/lib/version.js +1 -1
- package/package.json +1 -2
package/browser/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!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).Player=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),i={exports:{}},r=n,o=Object.defineProperty,s=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t},a=s,c="__core-js_shared__",u=n[c]||a(c,{}),l=u;(i.exports=function(e,t){return l[e]||(l[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var f,h,d=function(e){try{return!!e()}catch(e){return!0}},p=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),v=p,g=Function.prototype,y=g.call,m=v&&g.bind.bind(y,y),k=v?m:function(e){return function(){return y.apply(e,arguments)}},b=function(e){return null==e},w=b,C=TypeError,_=function(e){if(w(e))throw C("Can't call method on "+e);return e},x=_,S=Object,T=function(e){return S(x(e))},P=T,E=k({}.hasOwnProperty),R=Object.hasOwn||function(e,t){return E(P(e),t)},O=k,I=0,L=Math.random(),A=O(1..toString),D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+A(++I+L,36)},M="undefined"!=typeof navigator&&String(navigator.userAgent)||"",N=n,F=M,B=N.process,j=N.Deno,H=B&&B.versions||j&&j.version,U=H&&H.v8;U&&(h=(f=U.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!h&&F&&(!(f=F.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=F.match(/Chrome\/(\d+)/))&&(h=+f[1]);var V=h,G=V,W=d,z=n.String,K=!!Object.getOwnPropertySymbols&&!W((function(){var e=Symbol();return!z(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&G&&G<41})),Y=K&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,X=n,q=i.exports,$=R,J=D,Z=K,Q=Y,ee=X.Symbol,te=q("wks"),ne=Q?ee.for||ee:ee&&ee.withoutSetter||J,ie=function(e){return $(te,e)||(te[e]=Z&&$(ee,e)?ee[e]:ne("Symbol."+e)),te[e]},re={};re[ie("toStringTag")]="z";var oe="[object z]"===String(re),se="object"==typeof document&&document.all,ae={all:se,IS_HTMLDDA:void 0===se&&void 0!==se},ce=ae.all,ue=ae.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},le={},fe=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),he=ue,de=ae.all,pe=ae.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:he(e)||e===de}:function(e){return"object"==typeof e?null!==e:he(e)},ve=pe,ge=n.document,ye=ve(ge)&&ve(ge.createElement),me=function(e){return ye?ge.createElement(e):{}},ke=me,be=!fe&&!d((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),we=fe&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=pe,_e=String,xe=TypeError,Se=function(e){if(Ce(e))return e;throw xe(_e(e)+" is not an object")},Te=p,Pe=Function.prototype.call,Ee=Te?Pe.bind(Pe):function(){return Pe.apply(Pe,arguments)},Re=n,Oe=ue,Ie=function(e,t){return arguments.length<2?(n=Re[e],Oe(n)?n:void 0):Re[e]&&Re[e][t];var n},Le=k({}.isPrototypeOf),Ae=Ie,De=ue,Me=Le,Ne=Object,Fe=Y?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return De(t)&&Me(t.prototype,Ne(e))},Be=String,je=function(e){try{return Be(e)}catch(e){return"Object"}},He=ue,Ue=je,Ve=TypeError,Ge=function(e){if(He(e))return e;throw Ve(Ue(e)+" is not a function")},We=Ge,ze=b,Ke=function(e,t){var n=e[t];return ze(n)?void 0:We(n)},Ye=Ee,Xe=ue,qe=pe,$e=TypeError,Je=Ee,Ze=pe,Qe=Fe,et=Ke,tt=function(e,t){var n,i;if("string"===t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;if(Xe(n=e.valueOf)&&!qe(i=Ye(n,e)))return i;if("string"!==t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;throw $e("Can't convert object to primitive value")},nt=TypeError,it=ie("toPrimitive"),rt=function(e,t){if(!Ze(e)||Qe(e))return e;var n,i=et(e,it);if(i){if(void 0===t&&(t="default"),n=Je(i,e,t),!Ze(n)||Qe(n))return n;throw nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},ot=rt,st=Fe,at=function(e){var t=ot(e,"string");return st(t)?t:t+""},ct=fe,ut=be,lt=we,ft=Se,ht=at,dt=TypeError,pt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,gt="enumerable",yt="configurable",mt="writable";le.f=ct?lt?function(e,t,n){if(ft(e),t=ht(t),ft(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n[mt]){var i=vt(e,t);i&&i[mt]&&(e[t]=n.value,n={configurable:yt in n?n[yt]:i[yt],enumerable:gt in n?n[gt]:i[gt],writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(ft(e),t=ht(t),ft(n),ut)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var kt={exports:{}},bt=fe,wt=R,Ct=Function.prototype,_t=bt&&Object.getOwnPropertyDescriptor,xt=wt(Ct,"name"),St={EXISTS:xt,PROPER:xt&&"something"===function(){}.name,CONFIGURABLE:xt&&(!bt||bt&&_t(Ct,"name").configurable)},Tt=ue,Pt=u,Et=k(Function.toString);Tt(Pt.inspectSource)||(Pt.inspectSource=function(e){return Et(e)});var Rt,Ot,It,Lt=Pt.inspectSource,At=ue,Dt=n.WeakMap,Mt=At(Dt)&&/native code/.test(String(Dt)),Nt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ft=le,Bt=Nt,jt=fe?function(e,t,n){return Ft.f(e,t,Bt(1,n))}:function(e,t,n){return e[t]=n,e},Ht=i.exports,Ut=D,Vt=Ht("keys"),Gt=function(e){return Vt[e]||(Vt[e]=Ut(e))},Wt={},zt=Mt,Kt=n,Yt=pe,Xt=jt,qt=R,$t=u,Jt=Gt,Zt=Wt,Qt="Object already initialized",en=Kt.TypeError,tn=Kt.WeakMap;if(zt||$t.state){var nn=$t.state||($t.state=new tn);nn.get=nn.get,nn.has=nn.has,nn.set=nn.set,Rt=function(e,t){if(nn.has(e))throw en(Qt);return t.facade=e,nn.set(e,t),t},Ot=function(e){return nn.get(e)||{}},It=function(e){return nn.has(e)}}else{var rn=Jt("state");Zt[rn]=!0,Rt=function(e,t){if(qt(e,rn))throw en(Qt);return t.facade=e,Xt(e,rn,t),t},Ot=function(e){return qt(e,rn)?e[rn]:{}},It=function(e){return qt(e,rn)}}var on={set:Rt,get:Ot,has:It,enforce:function(e){return It(e)?Ot(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!Yt(t)||(n=Ot(t)).type!==e)throw en("Incompatible receiver, "+e+" required");return n}}},sn=k,an=d,cn=ue,un=R,ln=fe,fn=St.CONFIGURABLE,hn=Lt,dn=on.enforce,pn=on.get,vn=String,gn=Object.defineProperty,yn=sn("".slice),mn=sn("".replace),kn=sn([].join),bn=ln&&!an((function(){return 8!==gn((function(){}),"length",{value:8}).length})),wn=String(String).split("String"),Cn=kt.exports=function(e,t,n){"Symbol("===yn(vn(t),0,7)&&(t="["+mn(vn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!un(e,"name")||fn&&e.name!==t)&&(ln?gn(e,"name",{value:t,configurable:!0}):e.name=t),bn&&n&&un(n,"arity")&&e.length!==n.arity&&gn(e,"length",{value:n.arity});try{n&&un(n,"constructor")&&n.constructor?ln&&gn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=dn(e);return un(i,"source")||(i.source=kn(wn,"string"==typeof t?t:"")),e};Function.prototype.toString=Cn((function(){return cn(this)&&pn(this).source||hn(this)}),"toString");var _n=ue,xn=le,Sn=kt.exports,Tn=s,Pn=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(_n(n)&&Sn(n,o,i),i.global)r?e[t]=n:Tn(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=n:xn.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},En=k,Rn=En({}.toString),On=En("".slice),In=function(e){return On(Rn(e),8,-1)},Ln=oe,An=ue,Dn=In,Mn=ie("toStringTag"),Nn=Object,Fn="Arguments"==Dn(function(){return arguments}()),Bn=Ln?Dn:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Nn(e),Mn))?n:Fn?Dn(t):"Object"==(i=Dn(t))&&An(t.callee)?"Arguments":i},jn=Bn,Hn=oe?{}.toString:function(){return"[object "+jn(this)+"]"};oe||Pn(Object.prototype,"toString",Hn,{unsafe:!0});var Un={},Vn={},Gn={}.propertyIsEnumerable,Wn=Object.getOwnPropertyDescriptor,zn=Wn&&!Gn.call({1:2},1);Vn.f=zn?function(e){var t=Wn(this,e);return!!t&&t.enumerable}:Gn;var Kn=d,Yn=In,Xn=Object,qn=k("".split),$n=Kn((function(){return!Xn("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yn(e)?qn(e,""):Xn(e)}:Xn,Jn=$n,Zn=_,Qn=function(e){return Jn(Zn(e))},ei=fe,ti=Ee,ni=Vn,ii=Nt,ri=Qn,oi=at,si=R,ai=be,ci=Object.getOwnPropertyDescriptor;Un.f=ei?ci:function(e,t){if(e=ri(e),t=oi(t),ai)try{return ci(e,t)}catch(e){}if(si(e,t))return ii(!ti(ni.f,e,t),e[t])};var ui={},li=Math.ceil,fi=Math.floor,hi=Math.trunc||function(e){var t=+e;return(t>0?fi:li)(t)},di=function(e){var t=+e;return t!=t||0===t?0:hi(t)},pi=di,vi=Math.max,gi=Math.min,yi=function(e,t){var n=pi(e);return n<0?vi(n+t,0):gi(n,t)},mi=di,ki=Math.min,bi=function(e){return e>0?ki(mi(e),9007199254740991):0},wi=bi,Ci=function(e){return wi(e.length)},_i=Qn,xi=yi,Si=Ci,Ti=function(e){return function(t,n,i){var r,o=_i(t),s=Si(o),a=xi(i,s);if(e&&n!=n){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},Pi={includes:Ti(!0),indexOf:Ti(!1)},Ei=R,Ri=Qn,Oi=Pi.indexOf,Ii=Wt,Li=k([].push),Ai=function(e,t){var n,i=Ri(e),r=0,o=[];for(n in i)!Ei(Ii,n)&&Ei(i,n)&&Li(o,n);for(;t.length>r;)Ei(i,n=t[r++])&&(~Oi(o,n)||Li(o,n));return o},Di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mi=Ai,Ni=Di.concat("length","prototype");ui.f=Object.getOwnPropertyNames||function(e){return Mi(e,Ni)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var Bi=Ie,ji=ui,Hi=Fi,Ui=Se,Vi=k([].concat),Gi=Bi("Reflect","ownKeys")||function(e){var t=ji.f(Ui(e)),n=Hi.f;return n?Vi(t,n(e)):t},Wi=R,zi=Gi,Ki=Un,Yi=le,Xi=d,qi=ue,$i=/#|\.prototype\./,Ji=function(e,t){var n=Qi[Zi(e)];return n==tr||n!=er&&(qi(t)?Xi(t):!!t)},Zi=Ji.normalize=function(e){return String(e).replace($i,".").toLowerCase()},Qi=Ji.data={},er=Ji.NATIVE="N",tr=Ji.POLYFILL="P",nr=Ji,ir=n,rr=Un.f,or=jt,sr=Pn,ar=s,cr=function(e,t,n){for(var i=zi(t),r=Yi.f,o=Ki.f,s=0;s<i.length;s++){var a=i[s];Wi(e,a)||n&&Wi(n,a)||r(e,a,o(t,a))}},ur=nr,lr=function(e,t){var n,i,r,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?ir:u?ir[a]||ar(a,{}):(ir[a]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(s=rr(n,i))&&s.value:n[i],!ur(c?i:a+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;cr(o,r)}(e.sham||r&&r.sham)&&or(o,"sham",!0),sr(n,i,o,e)}},fr=p,hr=Function.prototype,dr=hr.apply,pr=hr.call,vr="object"==typeof Reflect&&Reflect.apply||(fr?pr.bind(dr):function(){return pr.apply(dr,arguments)}),gr=k([].slice),yr=k,mr=Ge,kr=pe,br=R,wr=gr,Cr=p,_r=Function,xr=yr([].concat),Sr=yr([].join),Tr={},Pr=Cr?_r.bind:function(e){var t=mr(this),n=t.prototype,i=wr(arguments,1),r=function(){var n=xr(i,wr(arguments));return this instanceof r?function(e,t,n){if(!br(Tr,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Tr[t]=_r("C,a","return new C("+Sr(i,",")+")")}return Tr[t](e,n)}(t,n.length,n):t.apply(e,n)};return kr(n)&&(r.prototype=n),r},Er=k,Rr=d,Or=ue,Ir=Bn,Lr=Lt,Ar=function(){},Dr=[],Mr=Ie("Reflect","construct"),Nr=/^\s*(?:class|function)\b/,Fr=Er(Nr.exec),Br=!Nr.exec(Ar),jr=function(e){if(!Or(e))return!1;try{return Mr(Ar,Dr,e),!0}catch(e){return!1}},Hr=function(e){if(!Or(e))return!1;switch(Ir(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Br||!!Fr(Nr,Lr(e))}catch(e){return!0}};Hr.sham=!0;var Ur=!Mr||Rr((function(){var e;return jr(jr.call)||!jr(Object)||!jr((function(){e=!0}))||e}))?Hr:jr,Vr=Ur,Gr=je,Wr=TypeError,zr=function(e){if(Vr(e))return e;throw Wr(Gr(e)+" is not a constructor")},Kr={},Yr=Ai,Xr=Di,qr=Object.keys||function(e){return Yr(e,Xr)},$r=fe,Jr=we,Zr=le,Qr=Se,eo=Qn,to=qr;Kr.f=$r&&!Jr?Object.defineProperties:function(e,t){Qr(e);for(var n,i=eo(t),r=to(t),o=r.length,s=0;o>s;)Zr.f(e,n=r[s++],i[n]);return e};var no,io=Ie("document","documentElement"),ro=Se,oo=Kr,so=Di,ao=Wt,co=io,uo=me,lo="prototype",fo="script",ho=Gt("IE_PROTO"),po=function(){},vo=function(e){return"<"+fo+">"+e+"</"+fo+">"},go=function(e){e.write(vo("")),e.close();var t=e.parentWindow.Object;return e=null,t},yo=function(){try{no=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;yo="undefined"!=typeof document?document.domain&&no?go(no):(t=uo("iframe"),n="java"+fo+":",t.style.display="none",co.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(vo("document.F=Object")),e.close(),e.F):go(no);for(var i=so.length;i--;)delete yo[lo][so[i]];return yo()};ao[ho]=!0;var mo=Object.create||function(e,t){var n;return null!==e?(po[lo]=ro(e),n=new po,po[lo]=null,n[ho]=e):n=yo(),void 0===t?n:oo.f(n,t)},ko=lr,bo=vr,wo=Pr,Co=zr,_o=Se,xo=pe,So=mo,To=d,Po=Ie("Reflect","construct"),Eo=Object.prototype,Ro=[].push,Oo=To((function(){function e(){}return!(Po((function(){}),[],e)instanceof e)})),Io=!To((function(){Po((function(){}))})),Lo=Oo||Io;function Ao(e){return Ao="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},Ao(e)}function Do(e){var t=function(e,t){if("object"!==Ao(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Ao(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ao(t)?t:String(t)}function Mo(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Do(i.key),i)}}function No(e,t,n){return t&&Mo(e.prototype,t),n&&Mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){return Bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bo(e,t)}function jo(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&&Bo(e,t)}function Ho(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uo(e,t){if(t&&("object"===Ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ho(e)}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vo(e)}function Go(e,t,n){return(t=Do(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ko({target:"Reflect",stat:!0,forced:Lo,sham:Lo},{construct:function(e,t){Co(e),_o(t);var n=arguments.length<3?e:Co(arguments[2]);if(Io&&!Oo)return Po(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return bo(Ro,i,t),new(bo(wo,e,i))}var r=n.prototype,o=So(xo(r)?r:Eo),s=bo(e,o,t);return xo(s)?s:o}});var Wo=Bn,zo=String,Ko=function(e){if("Symbol"===Wo(e))throw TypeError("Cannot convert a Symbol value to a string");return zo(e)},Yo={},Xo=at,qo=le,$o=Nt,Jo=function(e,t,n){var i=Xo(t);i in e?qo.f(e,i,$o(0,n)):e[i]=n},Zo=yi,Qo=Ci,es=Jo,ts=Array,ns=Math.max,is=function(e,t,n){for(var i=Qo(e),r=Zo(t,i),o=Zo(void 0===n?i:n,i),s=ts(ns(o-r,0)),a=0;r<o;r++,a++)es(s,a,e[r]);return s.length=a,s},rs=In,os=Qn,ss=ui.f,as=is,cs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yo.f=function(e){return cs&&"Window"==rs(e)?function(e){try{return ss(e)}catch(e){return as(cs)}}(e):ss(os(e))};var us=kt.exports,ls=le,fs=function(e,t,n){return n.get&&us(n.get,t,{getter:!0}),n.set&&us(n.set,t,{setter:!0}),ls.f(e,t,n)},hs={},ds=ie;hs.f=ds;var ps=n,vs=ps,gs=R,ys=hs,ms=le.f,ks=Ee,bs=Ie,ws=ie,Cs=Pn,_s=le.f,xs=R,Ss=ie("toStringTag"),Ts=function(e,t,n){e&&!n&&(e=e.prototype),e&&!xs(e,Ss)&&_s(e,Ss,{configurable:!0,value:t})},Ps=In,Es=k,Rs=function(e){if("Function"===Ps(e))return Es(e)},Os=Ge,Is=p,Ls=Rs(Rs.bind),As=function(e,t){return Os(e),void 0===t?e:Is?Ls(e,t):function(){return e.apply(t,arguments)}},Ds=In,Ms=Array.isArray||function(e){return"Array"==Ds(e)},Ns=Ms,Fs=Ur,Bs=pe,js=ie("species"),Hs=Array,Us=function(e){var t;return Ns(e)&&(t=e.constructor,(Fs(t)&&(t===Hs||Ns(t.prototype))||Bs(t)&&null===(t=t[js]))&&(t=void 0)),void 0===t?Hs:t},Vs=function(e,t){return new(Us(e))(0===t?0:t)},Gs=As,Ws=$n,zs=T,Ks=Ci,Ys=Vs,Xs=k([].push),qs=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,u,l,f){for(var h,d,p=zs(c),v=Ws(p),g=Gs(u,l),y=Ks(v),m=0,k=f||Ys,b=t?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in v)&&(d=g(h=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:Xs(b,h)}else switch(e){case 4:return!1;case 7:Xs(b,h)}return o?-1:i||r?r:b}},$s={forEach:qs(0),map:qs(1),filter:qs(2),some:qs(3),every:qs(4),find:qs(5),findIndex:qs(6),filterReject:qs(7)},Js=lr,Zs=n,Qs=Ee,ea=k,ta=fe,na=K,ia=d,ra=R,oa=Le,sa=Se,aa=Qn,ca=at,ua=Ko,la=Nt,fa=mo,ha=qr,da=ui,pa=Yo,va=Fi,ga=Un,ya=le,ma=Kr,ka=Vn,ba=Pn,wa=fs,Ca=i.exports,_a=Wt,xa=D,Sa=ie,Ta=hs,Pa=function(e){var t=vs.Symbol||(vs.Symbol={});gs(t,e)||ms(t,e,{value:ys.f(e)})},Ea=function(){var e=bs("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=ws("toPrimitive");t&&!t[i]&&Cs(t,i,(function(e){return ks(n,this)}),{arity:1})},Ra=Ts,Oa=on,Ia=$s.forEach,La=Gt("hidden"),Aa="Symbol",Da="prototype",Ma=Oa.set,Na=Oa.getterFor(Aa),Fa=Object[Da],Ba=Zs.Symbol,ja=Ba&&Ba[Da],Ha=Zs.TypeError,Ua=Zs.QObject,Va=ga.f,Ga=ya.f,Wa=pa.f,za=ka.f,Ka=ea([].push),Ya=Ca("symbols"),Xa=Ca("op-symbols"),qa=Ca("wks"),$a=!Ua||!Ua[Da]||!Ua[Da].findChild,Ja=ta&&ia((function(){return 7!=fa(Ga({},"a",{get:function(){return Ga(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Va(Fa,t);i&&delete Fa[t],Ga(e,t,n),i&&e!==Fa&&Ga(Fa,t,i)}:Ga,Za=function(e,t){var n=Ya[e]=fa(ja);return Ma(n,{type:Aa,tag:e,description:t}),ta||(n.description=t),n},Qa=function(e,t,n){e===Fa&&Qa(Xa,t,n),sa(e);var i=ca(t);return sa(n),ra(Ya,i)?(n.enumerable?(ra(e,La)&&e[La][i]&&(e[La][i]=!1),n=fa(n,{enumerable:la(0,!1)})):(ra(e,La)||Ga(e,La,la(1,{})),e[La][i]=!0),Ja(e,i,n)):Ga(e,i,n)},ec=function(e,t){sa(e);var n=aa(t),i=ha(n).concat(rc(n));return Ia(i,(function(t){ta&&!Qs(tc,n,t)||Qa(e,t,n[t])})),e},tc=function(e){var t=ca(e),n=Qs(za,this,t);return!(this===Fa&&ra(Ya,t)&&!ra(Xa,t))&&(!(n||!ra(this,t)||!ra(Ya,t)||ra(this,La)&&this[La][t])||n)},nc=function(e,t){var n=aa(e),i=ca(t);if(n!==Fa||!ra(Ya,i)||ra(Xa,i)){var r=Va(n,i);return!r||!ra(Ya,i)||ra(n,La)&&n[La][i]||(r.enumerable=!0),r}},ic=function(e){var t=Wa(aa(e)),n=[];return Ia(t,(function(e){ra(Ya,e)||ra(_a,e)||Ka(n,e)})),n},rc=function(e){var t=e===Fa,n=Wa(t?Xa:aa(e)),i=[];return Ia(n,(function(e){!ra(Ya,e)||t&&!ra(Fa,e)||Ka(i,Ya[e])})),i};na||(Ba=function(){if(oa(ja,this))throw Ha("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ua(arguments[0]):void 0,t=xa(e),n=function(e){this===Fa&&Qs(n,Xa,e),ra(this,La)&&ra(this[La],t)&&(this[La][t]=!1),Ja(this,t,la(1,e))};return ta&&$a&&Ja(Fa,t,{configurable:!0,set:n}),Za(t,e)},ba(ja=Ba[Da],"toString",(function(){return Na(this).tag})),ba(Ba,"withoutSetter",(function(e){return Za(xa(e),e)})),ka.f=tc,ya.f=Qa,ma.f=ec,ga.f=nc,da.f=pa.f=ic,va.f=rc,Ta.f=function(e){return Za(Sa(e),e)},ta&&(wa(ja,"description",{configurable:!0,get:function(){return Na(this).description}}),ba(Fa,"propertyIsEnumerable",tc,{unsafe:!0}))),Js({global:!0,constructor:!0,wrap:!0,forced:!na,sham:!na},{Symbol:Ba}),Ia(ha(qa),(function(e){Pa(e)})),Js({target:Aa,stat:!0,forced:!na},{useSetter:function(){$a=!0},useSimple:function(){$a=!1}}),Js({target:"Object",stat:!0,forced:!na,sham:!ta},{create:function(e,t){return void 0===t?fa(e):ec(fa(e),t)},defineProperty:Qa,defineProperties:ec,getOwnPropertyDescriptor:nc}),Js({target:"Object",stat:!0,forced:!na},{getOwnPropertyNames:ic}),Ea(),Ra(Ba,Aa),_a[La]=!0;var oc=K&&!!Symbol.for&&!!Symbol.keyFor,sc=lr,ac=Ie,cc=R,uc=Ko,lc=i.exports,fc=oc,hc=lc("string-to-symbol-registry"),dc=lc("symbol-to-string-registry");sc({target:"Symbol",stat:!0,forced:!fc},{for:function(e){var t=uc(e);if(cc(hc,t))return hc[t];var n=ac("Symbol")(t);return hc[t]=n,dc[n]=t,n}});var pc=lr,vc=R,gc=Fe,yc=je,mc=oc,kc=(0,i.exports)("symbol-to-string-registry");pc({target:"Symbol",stat:!0,forced:!mc},{keyFor:function(e){if(!gc(e))throw TypeError(yc(e)+" is not a symbol");if(vc(kc,e))return kc[e]}});var bc=Ms,wc=ue,Cc=In,_c=Ko,xc=k([].push),Sc=lr,Tc=Ie,Pc=vr,Ec=Ee,Rc=k,Oc=d,Ic=ue,Lc=Fe,Ac=gr,Dc=function(e){if(wc(e))return e;if(bc(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?xc(n,r):"number"!=typeof r&&"Number"!=Cc(r)&&"String"!=Cc(r)||xc(n,_c(r))}var o=n.length,s=!0;return function(e,t){if(s)return s=!1,t;if(bc(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},Mc=K,Nc=String,Fc=Tc("JSON","stringify"),Bc=Rc(/./.exec),jc=Rc("".charAt),Hc=Rc("".charCodeAt),Uc=Rc("".replace),Vc=Rc(1..toString),Gc=/[\uD800-\uDFFF]/g,Wc=/^[\uD800-\uDBFF]$/,zc=/^[\uDC00-\uDFFF]$/,Kc=!Mc||Oc((function(){var e=Tc("Symbol")();return"[null]"!=Fc([e])||"{}"!=Fc({a:e})||"{}"!=Fc(Object(e))})),Yc=Oc((function(){return'"\\udf06\\ud834"'!==Fc("\udf06\ud834")||'"\\udead"'!==Fc("\udead")})),Xc=function(e,t){var n=Ac(arguments),i=Dc(t);if(Ic(i)||void 0!==e&&!Lc(e))return n[1]=function(e,t){if(Ic(i)&&(t=Ec(i,this,Nc(e),t)),!Lc(t))return t},Pc(Fc,null,n)},qc=function(e,t,n){var i=jc(n,t-1),r=jc(n,t+1);return Bc(Wc,e)&&!Bc(zc,r)||Bc(zc,e)&&!Bc(Wc,i)?"\\u"+Vc(Hc(e,0),16):e};Fc&&Sc({target:"JSON",stat:!0,arity:3,forced:Kc||Yc},{stringify:function(e,t,n){var i=Ac(arguments),r=Pc(Kc?Xc:Fc,null,i);return Yc&&"string"==typeof r?Uc(r,Gc,qc):r}});var $c=Fi,Jc=T;lr({target:"Object",stat:!0,forced:!K||d((function(){$c.f(1)}))},{getOwnPropertySymbols:function(e){var t=$c.f;return t?t(Jc(e)):[]}});var Zc=lr,Qc=d,eu=Qn,tu=Un.f,nu=fe;Zc({target:"Object",stat:!0,forced:!nu||Qc((function(){tu(1)})),sham:!nu},{getOwnPropertyDescriptor:function(e,t){return tu(eu(e),t)}});var iu=Gi,ru=Qn,ou=Un,su=Jo;function au(){return au="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vo(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},au.apply(this,arguments)}lr({target:"Object",stat:!0,sham:!fe},{getOwnPropertyDescriptors:function(e){for(var t,n,i=ru(e),r=ou.f,o=iu(i),s={},a=0;o.length>a;)void 0!==(n=r(i,t=o[a++]))&&su(s,t,n);return s}});var cu=TypeError,uu=function(e){if(e>9007199254740991)throw cu("Maximum allowed index exceeded");return e},lu=d,fu=V,hu=ie("species"),du=function(e){return fu>=51||!lu((function(){var t=[];return(t.constructor={})[hu]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},pu=lr,vu=d,gu=Ms,yu=pe,mu=T,ku=Ci,bu=uu,wu=Jo,Cu=Vs,_u=du,xu=V,Su=ie("isConcatSpreadable"),Tu=xu>=51||!vu((function(){var e=[];return e[Su]=!1,e.concat()[0]!==e})),Pu=function(e){if(!yu(e))return!1;var t=e[Su];return void 0!==t?!!t:gu(e)};pu({target:"Array",proto:!0,arity:1,forced:!Tu||!_u("concat")},{concat:function(e){var t,n,i,r,o,s=mu(this),a=Cu(s,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Pu(o=-1===t?s:arguments[t]))for(r=ku(o),bu(c+r),n=0;n<r;n++,c++)n in o&&wu(a,c,o[n]);else bu(c+1),wu(a,c++,o);return a.length=c,a}});var Eu=$s.map;lr({target:"Array",proto:!0,forced:!du("map")},{map:function(e){return Eu(this,e,arguments.length>1?arguments[1]:void 0)}});var Ru=T,Ou=qr;lr({target:"Object",stat:!0,forced:d((function(){Ou(1)}))},{keys:function(e){return Ou(Ru(e))}});var Iu=lr,Lu=Ms,Au=Ur,Du=pe,Mu=yi,Nu=Ci,Fu=Qn,Bu=Jo,ju=ie,Hu=gr,Uu=du("slice"),Vu=ju("species"),Gu=Array,Wu=Math.max;Iu({target:"Array",proto:!0,forced:!Uu},{slice:function(e,t){var n,i,r,o=Fu(this),s=Nu(o),a=Mu(e,s),c=Mu(void 0===t?s:t,s);if(Lu(o)&&(n=o.constructor,(Au(n)&&(n===Gu||Lu(n.prototype))||Du(n)&&null===(n=n[Vu]))&&(n=void 0),n===Gu||void 0===n))return Hu(o,a,c);for(i=new(void 0===n?Gu:n)(Wu(c-a,0)),r=0;a<c;a++,r++)a in o&&Bu(i,r,o[a]);return i.length=r,i}});var zu={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},Ku=me("span").classList,Yu=Ku&&Ku.constructor&&Ku.constructor.prototype,Xu=Yu===Object.prototype?void 0:Yu,qu=d,$u=function(e,t){var n=[][e];return!!n&&qu((function(){n.call(null,t||function(){return 1},1)}))},Ju=$s.forEach,Zu=$u("forEach")?[].forEach:function(e){return Ju(this,e,arguments.length>1?arguments[1]:void 0)},Qu=n,el=zu,tl=Xu,nl=Zu,il=jt,rl=function(e){if(e&&e.forEach!==nl)try{il(e,"forEach",nl)}catch(t){e.forEach=nl}};for(var ol in el)el[ol]&&rl(Qu[ol]&&Qu[ol].prototype);rl(tl);var sl=lr,al=$n,cl=Qn,ul=$u,ll=k([].join);sl({target:"Array",proto:!0,forced:al!=Object||!ul("join",",")},{join:function(e){return ll(cl(this),void 0===e?",":e)}});var fl=fe,hl=Ms,dl=TypeError,pl=Object.getOwnPropertyDescriptor,vl=fl&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),gl=je,yl=TypeError,ml=function(e,t){if(!delete e[t])throw yl("Cannot delete property "+gl(t)+" of "+gl(e))},kl=lr,bl=T,wl=yi,Cl=di,_l=Ci,xl=vl?function(e,t){if(hl(e)&&!pl(e,"length").writable)throw dl("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Sl=uu,Tl=Vs,Pl=Jo,El=ml,Rl=du("splice"),Ol=Math.max,Il=Math.min;kl({target:"Array",proto:!0,forced:!Rl},{splice:function(e,t){var n,i,r,o,s,a,c=bl(this),u=_l(c),l=wl(e,u),f=arguments.length;for(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=Il(Ol(Cl(t),0),u-l)),Sl(u+n-i),r=Tl(c,i),o=0;o<i;o++)(s=l+o)in c&&Pl(r,o,c[s]);if(r.length=i,n<i){for(o=l;o<u-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:El(c,a);for(o=u;o>u-i+n;o--)El(c,o-1)}else if(n>i)for(o=u-i;o>l;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:El(c,a);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return xl(c,u-i+n),r}});var Ll,Al,Dl,Ml,Nl="undefined"!=typeof process&&"process"==In(process),Fl=k,Bl=Ge,jl=ue,Hl=String,Ul=TypeError,Vl=function(e,t,n){try{return Fl(Bl(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},Gl=Se,Wl=function(e){if("object"==typeof e||jl(e))return e;throw Ul("Can't set "+Hl(e)+" as a prototype")},zl=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Vl(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return Gl(n),Wl(i),t?e(n,i):n.__proto__=i,n}}():void 0),Kl=Ie,Yl=fs,Xl=fe,ql=ie("species"),$l=function(e){var t=Kl(e);Xl&&t&&!t[ql]&&Yl(t,ql,{configurable:!0,get:function(){return this}})},Jl=Le,Zl=TypeError,Ql=function(e,t){if(Jl(t,e))return e;throw Zl("Incorrect invocation")},ef=Se,tf=zr,nf=b,rf=ie("species"),of=function(e,t){var n,i=ef(e).constructor;return void 0===i||nf(n=ef(i)[rf])?t:tf(n)},sf=TypeError,af=function(e,t){if(e<t)throw sf("Not enough arguments");return e},cf=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),uf=n,lf=vr,ff=As,hf=ue,df=R,pf=d,vf=io,gf=gr,yf=me,mf=af,kf=cf,bf=Nl,wf=uf.setImmediate,Cf=uf.clearImmediate,_f=uf.process,xf=uf.Dispatch,Sf=uf.Function,Tf=uf.MessageChannel,Pf=uf.String,Ef=0,Rf={},Of="onreadystatechange";pf((function(){Ll=uf.location}));var If=function(e){if(df(Rf,e)){var t=Rf[e];delete Rf[e],t()}},Lf=function(e){return function(){If(e)}},Af=function(e){If(e.data)},Df=function(e){uf.postMessage(Pf(e),Ll.protocol+"//"+Ll.host)};wf&&Cf||(wf=function(e){mf(arguments.length,1);var t=hf(e)?e:Sf(e),n=gf(arguments,1);return Rf[++Ef]=function(){lf(t,void 0,n)},Al(Ef),Ef},Cf=function(e){delete Rf[e]},bf?Al=function(e){_f.nextTick(Lf(e))}:xf&&xf.now?Al=function(e){xf.now(Lf(e))}:Tf&&!kf?(Ml=(Dl=new Tf).port2,Dl.port1.onmessage=Af,Al=ff(Ml.postMessage,Ml)):uf.addEventListener&&hf(uf.postMessage)&&!uf.importScripts&&Ll&&"file:"!==Ll.protocol&&!pf(Df)?(Al=Df,uf.addEventListener("message",Af,!1)):Al=Of in yf("script")?function(e){vf.appendChild(yf("script"))[Of]=function(){vf.removeChild(this),If(e)}}:function(e){setTimeout(Lf(e),0)});var Mf={set:wf,clear:Cf},Nf=function(){this.head=null,this.tail=null};Nf.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Ff,Bf,jf,Hf,Uf,Vf=Nf,Gf=/ipad|iphone|ipod/i.test(M)&&"undefined"!=typeof Pebble,Wf=/web0s(?!.*chrome)/i.test(M),zf=n,Kf=As,Yf=Un.f,Xf=Mf.set,qf=Vf,$f=cf,Jf=Gf,Zf=Wf,Qf=Nl,eh=zf.MutationObserver||zf.WebKitMutationObserver,th=zf.document,nh=zf.process,ih=zf.Promise,rh=Yf(zf,"queueMicrotask"),oh=rh&&rh.value;if(!oh){var sh=new qf,ah=function(){var e,t;for(Qf&&(e=nh.domain)&&e.exit();t=sh.get();)try{t()}catch(e){throw sh.head&&Ff(),e}e&&e.enter()};$f||Qf||Zf||!eh||!th?!Jf&&ih&&ih.resolve?((Hf=ih.resolve(void 0)).constructor=ih,Uf=Kf(Hf.then,Hf),Ff=function(){Uf(ah)}):Qf?Ff=function(){nh.nextTick(ah)}:(Xf=Kf(Xf,zf),Ff=function(){Xf(ah)}):(Bf=!0,jf=th.createTextNode(""),new eh(ah).observe(jf,{characterData:!0}),Ff=function(){jf.data=Bf=!Bf}),oh=function(e){sh.head||Ff(),sh.add(e)}}var ch=oh,uh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},lh=n.Promise,fh="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,hh=!fh&&!Nl&&"object"==typeof window&&"object"==typeof document,dh=n,ph=lh,vh=ue,gh=nr,yh=Lt,mh=ie,kh=hh,bh=fh,wh=V;ph&&ph.prototype;var Ch=mh("species"),_h=!1,xh=vh(dh.PromiseRejectionEvent),Sh=gh("Promise",(function(){var e=yh(ph),t=e!==String(ph);if(!t&&66===wh)return!0;if(!wh||wh<51||!/native code/.test(e)){var n=new ph((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[Ch]=i,!(_h=n.then((function(){}))instanceof i))return!0}return!t&&(kh||bh)&&!xh})),Th={CONSTRUCTOR:Sh,REJECTION_EVENT:xh,SUBCLASSING:_h},Ph={},Eh=Ge,Rh=TypeError,Oh=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw Rh("Bad Promise constructor");t=e,n=i})),this.resolve=Eh(t),this.reject=Eh(n)};Ph.f=function(e){return new Oh(e)};var Ih,Lh,Ah,Dh=lr,Mh=Nl,Nh=n,Fh=Ee,Bh=Pn,jh=zl,Hh=Ts,Uh=$l,Vh=Ge,Gh=ue,Wh=pe,zh=Ql,Kh=of,Yh=Mf.set,Xh=ch,qh=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},$h=uh,Jh=Vf,Zh=on,Qh=lh,ed=Ph,td="Promise",nd=Th.CONSTRUCTOR,id=Th.REJECTION_EVENT,rd=Th.SUBCLASSING,od=Zh.getterFor(td),sd=Zh.set,ad=Qh&&Qh.prototype,cd=Qh,ud=ad,ld=Nh.TypeError,fd=Nh.document,hd=Nh.process,dd=ed.f,pd=dd,vd=!!(fd&&fd.createEvent&&Nh.dispatchEvent),gd="unhandledrejection",yd=function(e){var t;return!(!Wh(e)||!Gh(t=e.then))&&t},md=function(e,t){var n,i,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&_d(t),t.rejection=1),!0===a?n=o:(l&&l.enter(),n=a(o),l&&(l.exit(),r=!0)),n===e.promise?u(ld("Promise-chain cycle")):(i=yd(n))?Fh(i,n,c,u):c(n)):u(o)}catch(e){l&&!r&&l.exit(),u(e)}},kd=function(e,t){e.notified||(e.notified=!0,Xh((function(){for(var n,i=e.reactions;n=i.get();)md(n,e);e.notified=!1,t&&!e.rejection&&wd(e)})))},bd=function(e,t,n){var i,r;vd?((i=fd.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),Nh.dispatchEvent(i)):i={promise:t,reason:n},!id&&(r=Nh["on"+e])?r(i):e===gd&&qh("Unhandled promise rejection",n)},wd=function(e){Fh(Yh,Nh,(function(){var t,n=e.facade,i=e.value;if(Cd(e)&&(t=$h((function(){Mh?hd.emit("unhandledRejection",i,n):bd(gd,n,i)})),e.rejection=Mh||Cd(e)?2:1,t.error))throw t.value}))},Cd=function(e){return 1!==e.rejection&&!e.parent},_d=function(e){Fh(Yh,Nh,(function(){var t=e.facade;Mh?hd.emit("rejectionHandled",t):bd("rejectionhandled",t,e.value)}))},xd=function(e,t,n){return function(i){e(t,i,n)}},Sd=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,kd(e,!0))},Td=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw ld("Promise can't be resolved itself");var i=yd(t);i?Xh((function(){var n={done:!1};try{Fh(i,t,xd(Td,n,e),xd(Sd,n,e))}catch(t){Sd(n,t,e)}})):(e.value=t,e.state=1,kd(e,!1))}catch(t){Sd({done:!1},t,e)}}};if(nd&&(ud=(cd=function(e){zh(this,ud),Vh(e),Fh(Ih,this);var t=od(this);try{e(xd(Td,t),xd(Sd,t))}catch(e){Sd(t,e)}}).prototype,(Ih=function(e){sd(this,{type:td,done:!1,notified:!1,parent:!1,reactions:new Jh,rejection:!1,state:0,value:void 0})}).prototype=Bh(ud,"then",(function(e,t){var n=od(this),i=dd(Kh(this,cd));return n.parent=!0,i.ok=!Gh(e)||e,i.fail=Gh(t)&&t,i.domain=Mh?hd.domain:void 0,0==n.state?n.reactions.add(i):Xh((function(){md(i,n)})),i.promise})),Lh=function(){var e=new Ih,t=od(e);this.promise=e,this.resolve=xd(Td,t),this.reject=xd(Sd,t)},ed.f=dd=function(e){return e===cd||undefined===e?new Lh(e):pd(e)},Gh(Qh)&&ad!==Object.prototype)){Ah=ad.then,rd||Bh(ad,"then",(function(e,t){var n=this;return new cd((function(e,t){Fh(Ah,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete ad.constructor}catch(e){}jh&&jh(ad,ud)}Dh({global:!0,constructor:!0,wrap:!0,forced:nd},{Promise:cd}),Hh(cd,td,!1),Uh(td);var Pd={},Ed=Pd,Rd=ie("iterator"),Od=Array.prototype,Id=function(e){return void 0!==e&&(Ed.Array===e||Od[Rd]===e)},Ld=Bn,Ad=Ke,Dd=b,Md=Pd,Nd=ie("iterator"),Fd=function(e){if(!Dd(e))return Ad(e,Nd)||Ad(e,"@@iterator")||Md[Ld(e)]},Bd=Ee,jd=Ge,Hd=Se,Ud=je,Vd=Fd,Gd=TypeError,Wd=function(e,t){var n=arguments.length<2?Vd(e):t;if(jd(n))return Hd(Bd(n,e));throw Gd(Ud(e)+" is not iterable")},zd=Ee,Kd=Se,Yd=Ke,Xd=function(e,t,n){var i,r;Kd(e);try{if(!(i=Yd(e,"return"))){if("throw"===t)throw n;return n}i=zd(i,e)}catch(e){r=!0,i=e}if("throw"===t)throw n;if(r)throw i;return Kd(i),n},qd=As,$d=Ee,Jd=Se,Zd=je,Qd=Id,ep=Ci,tp=Le,np=Wd,ip=Fd,rp=Xd,op=TypeError,sp=function(e,t){this.stopped=e,this.result=t},ap=sp.prototype,cp=function(e,t,n){var i,r,o,s,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=qd(t,l),g=function(e){return i&&rp(i,"normal",e),new sp(!0,e)},y=function(e){return f?(Jd(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(h)i=e.iterator;else if(d)i=e;else{if(!(r=ip(e)))throw op(Zd(e)+" is not iterable");if(Qd(r)){for(o=0,s=ep(e);s>o;o++)if((a=y(e[o]))&&tp(ap,a))return a;return new sp(!1)}i=np(e,r)}for(c=h?e.next:i.next;!(u=$d(c,i)).done;){try{a=y(u.value)}catch(e){rp(i,"throw",e)}if("object"==typeof a&&a&&tp(ap,a))return a}return new sp(!1)},up=ie("iterator"),lp=!1;try{var fp=0,hp={next:function(){return{done:!!fp++}},return:function(){lp=!0}};hp[up]=function(){return this},Array.from(hp,(function(){throw 2}))}catch(e){}var dp=lh,pp=function(e,t){if(!t&&!lp)return!1;var n=!1;try{var i={};i[up]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},vp=Th.CONSTRUCTOR||!pp((function(e){dp.all(e).then(void 0,(function(){}))})),gp=Ee,yp=Ge,mp=Ph,kp=uh,bp=cp;lr({target:"Promise",stat:!0,forced:vp},{all:function(e){var t=this,n=mp.f(t),i=n.resolve,r=n.reject,o=kp((function(){var n=yp(t.resolve),o=[],s=0,a=1;bp(e,(function(e){var c=s++,u=!1;a++,gp(n,t,e).then((function(e){u||(u=!0,o[c]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise}});var wp=lr,Cp=Th.CONSTRUCTOR,_p=lh,xp=Ie,Sp=ue,Tp=Pn,Pp=_p&&_p.prototype;if(wp({target:"Promise",proto:!0,forced:Cp,real:!0},{catch:function(e){return this.then(void 0,e)}}),Sp(_p)){var Ep=xp("Promise").prototype.catch;Pp.catch!==Ep&&Tp(Pp,"catch",Ep,{unsafe:!0})}var Rp=Ee,Op=Ge,Ip=Ph,Lp=uh,Ap=cp;lr({target:"Promise",stat:!0,forced:vp},{race:function(e){var t=this,n=Ip.f(t),i=n.reject,r=Lp((function(){var r=Op(t.resolve);Ap(e,(function(e){Rp(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Dp=Ee,Mp=Ph;lr({target:"Promise",stat:!0,forced:Th.CONSTRUCTOR},{reject:function(e){var t=Mp.f(this);return Dp(t.reject,void 0,e),t.promise}});var Np=Se,Fp=pe,Bp=Ph,jp=lr,Hp=Th.CONSTRUCTOR,Up=function(e,t){if(Np(e),Fp(t)&&t.constructor===e)return t;var n=Bp.f(e);return(0,n.resolve)(t),n.promise};Ie("Promise"),jp({target:"Promise",stat:!0,forced:Hp},{resolve:function(e){return Up(this,e)}});var Vp=fe,Gp=St.EXISTS,Wp=k,zp=fs,Kp=Function.prototype,Yp=Wp(Kp.toString),Xp=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,qp=Wp(Xp.exec);Vp&&!Gp&&zp(Kp,"name",{configurable:!0,get:function(){try{return qp(Xp,Yp(this))[1]}catch(e){return""}}}),lr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var $p=ue,Jp=pe,Zp=zl,Qp=function(e,t,n){var i,r;return Zp&&$p(i=t.constructor)&&i!==n&&Jp(r=i.prototype)&&r!==n.prototype&&Zp(e,r),e},ev=k(1..valueOf),tv="\t\n\v\f\r \u2028\u2029\ufeff",nv=_,iv=Ko,rv=tv,ov=k("".replace),sv=RegExp("^["+rv+"]+"),av=RegExp("(^|[^"+rv+"])["+rv+"]+$"),cv=function(e){return function(t){var n=iv(nv(t));return 1&e&&(n=ov(n,sv,"")),2&e&&(n=ov(n,av,"$1")),n}},uv={start:cv(1),end:cv(2),trim:cv(3)},lv=lr,fv=fe,hv=n,dv=ps,pv=k,vv=nr,gv=R,yv=Qp,mv=Le,kv=Fe,bv=rt,wv=d,Cv=ui.f,_v=Un.f,xv=le.f,Sv=ev,Tv=uv.trim,Pv="Number",Ev=hv[Pv];dv[Pv];var Rv=Ev.prototype,Ov=hv.TypeError,Iv=pv("".slice),Lv=pv("".charCodeAt),Av=function(e){var t,n,i,r,o,s,a,c,u=bv(e,"number");if(kv(u))throw Ov("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=Tv(u),43===(t=Lv(u,0))||45===t){if(88===(n=Lv(u,2))||120===n)return NaN}else if(48===t){switch(Lv(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(s=(o=Iv(u,2)).length,a=0;a<s;a++)if((c=Lv(o,a))<48||c>r)return NaN;return parseInt(o,i)}return+u},Dv=vv(Pv,!Ev(" 0o1")||!Ev("0b1")||Ev("+0x1")),Mv=function(e){var t,n=arguments.length<1?0:Ev(function(e){var t=bv(e,"number");return"bigint"==typeof t?t:Av(t)}(e));return mv(Rv,t=this)&&wv((function(){Sv(t)}))?yv(Object(n),this,Mv):n};Mv.prototype=Rv,Dv&&(Rv.constructor=Mv),lv({global:!0,constructor:!0,wrap:!0,forced:Dv},{Number:Mv});Dv&&function(e,t){for(var n,i=fv?Cv(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)gv(t,n=i[r])&&!gv(e,n)&&xv(e,n,_v(t,n))}(dv[Pv],Ev);var Nv=ie,Fv=mo,Bv=le.f,jv=Nv("unscopables"),Hv=Array.prototype;null==Hv[jv]&&Bv(Hv,jv,{configurable:!0,value:Fv(null)});var Uv,Vv,Gv,Wv=function(e){Hv[jv][e]=!0},zv=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Kv=R,Yv=ue,Xv=T,qv=zv,$v=Gt("IE_PROTO"),Jv=Object,Zv=Jv.prototype,Qv=qv?Jv.getPrototypeOf:function(e){var t=Xv(e);if(Kv(t,$v))return t[$v];var n=t.constructor;return Yv(n)&&t instanceof n?n.prototype:t instanceof Jv?Zv:null},eg=d,tg=ue,ng=pe,ig=Qv,rg=Pn,og=ie("iterator"),sg=!1;[].keys&&("next"in(Gv=[].keys())?(Vv=ig(ig(Gv)))!==Object.prototype&&(Uv=Vv):sg=!0);var ag=!ng(Uv)||eg((function(){var e={};return Uv[og].call(e)!==e}));ag&&(Uv={}),tg(Uv[og])||rg(Uv,og,(function(){return this}));var cg={IteratorPrototype:Uv,BUGGY_SAFARI_ITERATORS:sg},ug=cg.IteratorPrototype,lg=mo,fg=Nt,hg=Ts,dg=Pd,pg=function(){return this},vg=function(e,t,n,i){var r=t+" Iterator";return e.prototype=lg(ug,{next:fg(+!i,n)}),hg(e,r,!1),dg[r]=pg,e},gg=lr,yg=Ee,mg=ue,kg=vg,bg=Qv,wg=zl,Cg=Ts,_g=jt,xg=Pn,Sg=Pd,Tg=St.PROPER,Pg=St.CONFIGURABLE,Eg=cg.IteratorPrototype,Rg=cg.BUGGY_SAFARI_ITERATORS,Og=ie("iterator"),Ig="keys",Lg="values",Ag="entries",Dg=function(){return this},Mg=function(e,t,n,i,r,o,s){kg(n,t,i);var a,c,u,l=function(e){if(e===r&&v)return v;if(!Rg&&e in d)return d[e];switch(e){case Ig:case Lg:case Ag:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[Og]||d["@@iterator"]||r&&d[r],v=!Rg&&p||l(r),g="Array"==t&&d.entries||p;if(g&&(a=bg(g.call(new e)))!==Object.prototype&&a.next&&(bg(a)!==Eg&&(wg?wg(a,Eg):mg(a[Og])||xg(a,Og,Dg)),Cg(a,f,!0)),Tg&&r==Lg&&p&&p.name!==Lg&&(Pg?_g(d,"name",Lg):(h=!0,v=function(){return yg(p,this)})),r)if(c={values:l(Lg),keys:o?v:l(Ig),entries:l(Ag)},s)for(u in c)(Rg||h||!(u in d))&&xg(d,u,c[u]);else gg({target:t,proto:!0,forced:Rg||h},c);return d[Og]!==v&&xg(d,Og,v,{name:r}),Sg[t]=v,c},Ng=function(e,t){return{value:e,done:t}},Fg=Qn,Bg=Wv,jg=Pd,Hg=on,Ug=le.f,Vg=Mg,Gg=Ng,Wg=fe,zg="Array Iterator",Kg=Hg.set,Yg=Hg.getterFor(zg),Xg=Vg(Array,"Array",(function(e,t){Kg(this,{type:zg,target:Fg(e),index:0,kind:t})}),(function(){var e=Yg(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,Gg(void 0,!0)):Gg("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),qg=jg.Arguments=jg.Array;if(Bg("keys"),Bg("values"),Bg("entries"),Wg&&"values"!==qg.name)try{Ug(qg,"name",{value:"values"})}catch(e){}var $g=n,Jg=zu,Zg=Xu,Qg=Xg,ey=jt,ty=ie,ny=ty("iterator"),iy=ty("toStringTag"),ry=Qg.values,oy=function(e,t){if(e){if(e[ny]!==ry)try{ey(e,ny,ry)}catch(t){e[ny]=ry}if(e[iy]||ey(e,iy,t),Jg[t])for(var n in Qg)if(e[n]!==Qg[n])try{ey(e,n,Qg[n])}catch(t){e[n]=Qg[n]}}};for(var sy in Jg)oy($g[sy]&&$g[sy].prototype,sy);oy(Zg,"DOMTokenList");var ay=$s.filter;lr({target:"Array",proto:!0,forced:!du("filter")},{filter:function(e){return ay(this,e,arguments.length>1?arguments[1]:void 0)}});var cy=fe,uy=k,ly=Ee,fy=d,hy=qr,dy=Fi,py=Vn,vy=T,gy=$n,yy=Object.assign,my=Object.defineProperty,ky=uy([].concat),by=!yy||fy((function(){if(cy&&1!==yy({b:1},yy(my({},"a",{enumerable:!0,get:function(){my(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=yy({},e)[n]||hy(yy({},t)).join("")!=i}))?function(e,t){for(var n=vy(e),i=arguments.length,r=1,o=dy.f,s=py.f;i>r;)for(var a,c=gy(arguments[r++]),u=o?ky(hy(c),o(c)):hy(c),l=u.length,f=0;l>f;)a=u[f++],cy&&!ly(s,c,a)||(n[a]=c[a]);return n}:yy,wy=by;lr({target:"Object",stat:!0,arity:2,forced:Object.assign!==wy},{assign:wy});var Cy={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},a.prototype.emit=function(e,t,i,r,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||i&&a.context!==i||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||r&&!a[c].once||i&&a[c].context!==i)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(Cy);var _y=Cy.exports,xy=JSON.parse('"3.0.0-alpha.151"');function Sy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Ty(e){return function(e){if(Array.isArray(e))return Sy(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){if("string"==typeof e)return Sy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sy(e,t):void 0}}(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.")}()}var Py=Se,Ey=function(){var e=Py(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},Ry=d,Oy=n.RegExp,Iy=Ry((function(){var e=Oy("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Ly=Iy||Ry((function(){return!Oy("a","y").sticky})),Ay={BROKEN_CARET:Iy||Ry((function(){var e=Oy("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Ly,UNSUPPORTED_Y:Iy},Dy=d,My=n.RegExp,Ny=Dy((function(){var e=My(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Fy=d,By=n.RegExp,jy=Fy((function(){var e=By("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Hy=Ee,Uy=k,Vy=Ko,Gy=Ey,Wy=Ay,zy=i.exports,Ky=mo,Yy=on.get,Xy=Ny,qy=jy,$y=zy("native-string-replace",String.prototype.replace),Jy=RegExp.prototype.exec,Zy=Jy,Qy=Uy("".charAt),em=Uy("".indexOf),tm=Uy("".replace),nm=Uy("".slice),im=function(){var e=/a/,t=/b*/g;return Hy(Jy,e,"a"),Hy(Jy,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),rm=Wy.BROKEN_CARET,om=void 0!==/()??/.exec("")[1];(im||om||rm||Xy||qy)&&(Zy=function(e){var t,n,i,r,o,s,a,c=this,u=Yy(c),l=Vy(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=Hy(Zy,f,l),c.lastIndex=f.lastIndex,t;var h=u.groups,d=rm&&c.sticky,p=Hy(Gy,c),v=c.source,g=0,y=l;if(d&&(p=tm(p,"y",""),-1===em(p,"g")&&(p+="g"),y=nm(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Qy(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),om&&(n=new RegExp("^"+v+"$(?!\\s)",p)),im&&(i=c.lastIndex),r=Hy(Jy,d?n:c,y),d?r?(r.input=nm(r.input,g),r[0]=nm(r[0],g),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:im&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),om&&r&&r.length>1&&Hy($y,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&h)for(r.groups=s=Ky(null),o=0;o<h.length;o++)s[(a=h[o])[0]]=r[a[1]];return r});var sm=Zy;lr({target:"RegExp",proto:!0,forced:/./.exec!==sm},{exec:sm});var am=Rs,cm=Pn,um=sm,lm=d,fm=ie,hm=jt,dm=fm("species"),pm=RegExp.prototype,vm=function(e,t,n,i){var r=fm(e),o=!lm((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!lm((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[dm]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!s||n){var a=am(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var s=am(e),c=t.exec;return c===um||c===pm.exec?o&&!r?{done:!0,value:a(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));cm(String.prototype,e,c[0]),cm(pm,r,c[1])}i&&hm(pm[r],"sham",!0)},gm=k,ym=di,mm=Ko,km=_,bm=gm("".charAt),wm=gm("".charCodeAt),Cm=gm("".slice),_m=function(e){return function(t,n){var i,r,o=mm(km(t)),s=ym(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=wm(o,s))<55296||i>56319||s+1===a||(r=wm(o,s+1))<56320||r>57343?e?bm(o,s):i:e?Cm(o,s,s+2):r-56320+(i-55296<<10)+65536}},xm={codeAt:_m(!1),charAt:_m(!0)},Sm=xm.charAt,Tm=function(e,t,n){return t+(n?Sm(e,t).length:1)},Pm=Ee,Em=Se,Rm=ue,Om=In,Im=sm,Lm=TypeError,Am=function(e,t){var n=e.exec;if(Rm(n)){var i=Pm(n,e,t);return null!==i&&Em(i),i}if("RegExp"===Om(e))return Pm(Im,e,t);throw Lm("RegExp#exec called on incompatible receiver")},Dm=Ee,Mm=Se,Nm=b,Fm=bi,Bm=Ko,jm=_,Hm=Ke,Um=Tm,Vm=Am;vm("match",(function(e,t,n){return[function(t){var n=jm(this),i=Nm(t)?void 0:Hm(t,e);return i?Dm(i,t,n):new RegExp(t)[e](Bm(n))},function(e){var i=Mm(this),r=Bm(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return Vm(i,r);var s=i.unicode;i.lastIndex=0;for(var a,c=[],u=0;null!==(a=Vm(i,r));){var l=Bm(a[0]);c[u]=l,""===l&&(i.lastIndex=Um(r,Fm(i.lastIndex),s)),u++}return 0===u?null:c}]}));var Gm=pe,Wm=In,zm=ie("match"),Km=function(e){var t;return Gm(e)&&(void 0!==(t=e[zm])?!!t:"RegExp"==Wm(e))},Ym=Ee,Xm=R,qm=Le,$m=Ey,Jm=RegExp.prototype,Zm=function(e){var t=e.flags;return void 0!==t||"flags"in Jm||Xm(e,"flags")||!qm(Jm,e)?t:Ym($m,e)},Qm=le.f,ek=fe,tk=n,nk=k,ik=nr,rk=Qp,ok=jt,sk=ui.f,ak=Le,ck=Km,uk=Ko,lk=Zm,fk=Ay,hk=function(e,t,n){n in e||Qm(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},dk=Pn,pk=d,vk=R,gk=on.enforce,yk=$l,mk=Ny,kk=jy,bk=ie("match"),wk=tk.RegExp,Ck=wk.prototype,_k=tk.SyntaxError,xk=nk(Ck.exec),Sk=nk("".charAt),Tk=nk("".replace),Pk=nk("".indexOf),Ek=nk("".slice),Rk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Ok=/a/g,Ik=/a/g,Lk=new wk(Ok)!==Ok,Ak=fk.MISSED_STICKY,Dk=fk.UNSUPPORTED_Y,Mk=ek&&(!Lk||Ak||mk||kk||pk((function(){return Ik[bk]=!1,wk(Ok)!=Ok||wk(Ik)==Ik||"/a/i"!=wk(Ok,"i")})));if(ik("RegExp",Mk)){for(var Nk=function(e,t){var n,i,r,o,s,a,c=ak(Ck,this),u=ck(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===Nk)return e;if((u||ak(Ck,e))&&(e=e.source,l&&(t=lk(h))),e=void 0===e?"":uk(e),t=void 0===t?"":uk(t),h=e,mk&&"dotAll"in Ok&&(i=!!t&&Pk(t,"s")>-1)&&(t=Tk(t,/s/g,"")),n=t,Ak&&"sticky"in Ok&&(r=!!t&&Pk(t,"y")>-1)&&Dk&&(t=Tk(t,/y/g,"")),kk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],s={},a=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=Sk(e,i)))t+=Sk(e,++i);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:xk(Rk,Ek(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||vk(s,l))throw new _k("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e),e=o[0],f=o[1]),s=rk(wk(e,t),c?this:Ck,Nk),(i||r||f.length)&&(a=gk(s),i&&(a.dotAll=!0,a.raw=Nk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=Sk(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+Sk(e,++i);return r}(e),n)),r&&(a.sticky=!0),f.length&&(a.groups=f)),e!==h)try{ok(s,"source",""===h?"(?:)":h)}catch(e){}return s},Fk=sk(wk),Bk=0;Fk.length>Bk;)hk(Nk,wk,Fk[Bk++]);Ck.constructor=Nk,Nk.prototype=Ck,dk(tk,"RegExp",Nk,{constructor:!0})}yk("RegExp");var jk=St.PROPER,Hk=Pn,Uk=Se,Vk=Ko,Gk=d,Wk=Zm,zk="toString",Kk=RegExp.prototype[zk],Yk=Gk((function(){return"/a/b"!=Kk.call({source:"a",flags:"b"})})),Xk=jk&&Kk.name!=zk;(Yk||Xk)&&Hk(RegExp.prototype,zk,(function(){var e=Uk(this);return"/"+Vk(e.source)+"/"+Vk(Wk(e))}),{unsafe:!0});var qk=vr,$k=Ee,Jk=k,Zk=vm,Qk=Se,eb=b,tb=Km,nb=_,ib=of,rb=Tm,ob=bi,sb=Ko,ab=Ke,cb=is,ub=Am,lb=sm,fb=d,hb=Ay.UNSUPPORTED_Y,db=4294967295,pb=Math.min,vb=[].push,gb=Jk(/./.exec),yb=Jk(vb),mb=Jk("".slice),kb=!fb((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));Zk("split",(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=sb(nb(this)),r=void 0===n?db:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!tb(e))return $k(t,i,e,r);for(var o,s,a,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=$k(lb,f,i))&&!((s=f.lastIndex)>l&&(yb(c,mb(i,l,o.index)),o.length>1&&o.index<i.length&&qk(vb,c,cb(o,1)),a=o[0].length,l=s,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!a&&gb(f,"")||yb(c,""):yb(c,mb(i,l)),c.length>r?cb(c,0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:$k(t,this,e,n)}:t,[function(t,n){var r=nb(this),o=eb(t)?void 0:ab(t,e);return o?$k(o,t,r,n):$k(i,sb(r),t,n)},function(e,r){var o=Qk(this),s=sb(e),a=n(i,o,s,r,i!==t);if(a.done)return a.value;var c=ib(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(hb?"g":"y"),f=new c(hb?"^(?:"+o.source+")":o,l),h=void 0===r?db:r>>>0;if(0===h)return[];if(0===s.length)return null===ub(f,s)?[s]:[];for(var d=0,p=0,v=[];p<s.length;){f.lastIndex=hb?0:p;var g,y=ub(f,hb?mb(s,p):s);if(null===y||(g=pb(ob(f.lastIndex+(hb?p:0)),s.length))===d)p=rb(s,p,u);else{if(yb(v,mb(s,d,p)),v.length===h)return v;for(var m=1;m<=y.length-1;m++)if(yb(v,y[m]),v.length===h)return v;p=d=g}}return yb(v,mb(s,d)),v}]}),!kb,hb);var bb=k,wb=T,Cb=Math.floor,_b=bb("".charAt),xb=bb("".replace),Sb=bb("".slice),Tb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Pb=/\$([$&'`]|\d{1,2})/g,Eb=vr,Rb=Ee,Ob=k,Ib=vm,Lb=d,Ab=Se,Db=ue,Mb=b,Nb=di,Fb=bi,Bb=Ko,jb=_,Hb=Tm,Ub=Ke,Vb=function(e,t,n,i,r,o){var s=n+e.length,a=i.length,c=Pb;return void 0!==r&&(r=wb(r),c=Tb),xb(o,c,(function(o,c){var u;switch(_b(c,0)){case"$":return"$";case"&":return e;case"`":return Sb(t,0,n);case"'":return Sb(t,s);case"<":u=r[Sb(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var f=Cb(l/10);return 0===f?o:f<=a?void 0===i[f-1]?_b(c,1):i[f-1]+_b(c,1):o}u=i[l-1]}return void 0===u?"":u}))},Gb=Am,Wb=ie("replace"),zb=Math.max,Kb=Math.min,Yb=Ob([].concat),Xb=Ob([].push),qb=Ob("".indexOf),$b=Ob("".slice),Jb="$0"==="a".replace(/./,"$0"),Zb=!!/./[Wb]&&""===/./[Wb]("a","$0");Ib("replace",(function(e,t,n){var i=Zb?"$":"$0";return[function(e,n){var i=jb(this),r=Mb(e)?void 0:Ub(e,Wb);return r?Rb(r,e,i,n):Rb(t,Bb(i),e,n)},function(e,r){var o=Ab(this),s=Bb(e);if("string"==typeof r&&-1===qb(r,i)&&-1===qb(r,"$<")){var a=n(t,o,s,r);if(a.done)return a.value}var c=Db(r);c||(r=Bb(r));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=Gb(o,s);if(null===h)break;if(Xb(f,h),!u)break;""===Bb(h[0])&&(o.lastIndex=Hb(s,Fb(o.lastIndex),l))}for(var d,p="",v=0,g=0;g<f.length;g++){for(var y=Bb((h=f[g])[0]),m=zb(Kb(Nb(h.index),s.length),0),k=[],b=1;b<h.length;b++)Xb(k,void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var C=Yb([y],k,m,s);void 0!==w&&Xb(C,w);var _=Bb(Eb(r,void 0,C))}else _=Vb(y,s,m,k,w,r);m>=v&&(p+=$b(s,v,m)+_,v=m+y.length)}return p+$b(s,v)}]}),!!Lb((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Jb||Zb);var Qb=St.PROPER,ew=d,tw=tv,nw=uv.trim;lr({target:"String",proto:!0,forced:function(e){return ew((function(){return!!tw[e]()||"
"!=="
"[e]()||Qb&&tw[e].name!==e}))}("trim")},{trim:function(){return nw(this)}});var iw=is,rw=Math.floor,ow=function(e,t){var n=e.length,i=rw(n/2);return n<8?sw(e,t):aw(e,ow(iw(e,0,i),t),ow(iw(e,i),t),t)},sw=function(e,t){for(var n,i,r=e.length,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}return e},aw=function(e,t,n,i){for(var r=t.length,o=n.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?i(t[s],n[a])<=0?t[s++]:n[a++]:s<r?t[s++]:n[a++];return e},cw=ow,uw=M.match(/firefox\/(\d+)/i),lw=!!uw&&+uw[1],fw=/MSIE|Trident/.test(M),hw=M.match(/AppleWebKit\/(\d+)\./),dw=!!hw&&+hw[1],pw=lr,vw=k,gw=Ge,yw=T,mw=Ci,kw=ml,bw=Ko,ww=d,Cw=cw,_w=$u,xw=lw,Sw=fw,Tw=V,Pw=dw,Ew=[],Rw=vw(Ew.sort),Ow=vw(Ew.push),Iw=ww((function(){Ew.sort(void 0)})),Lw=ww((function(){Ew.sort(null)})),Aw=_w("sort"),Dw=!ww((function(){if(Tw)return Tw<70;if(!(xw&&xw>3)){if(Sw)return!0;if(Pw)return Pw<603;var e,t,n,i,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)Ew.push({k:t+i,v:n})}for(Ew.sort((function(e,t){return t.v-e.v})),i=0;i<Ew.length;i++)t=Ew[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));pw({target:"Array",proto:!0,forced:Iw||!Lw||!Aw||!Dw},{sort:function(e){void 0!==e&&gw(e);var t=yw(this);if(Dw)return void 0===e?Rw(t):Rw(t,e);var n,i,r=[],o=mw(t);for(i=0;i<o;i++)i in t&&Ow(r,t[i]);for(Cw(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:bw(t)>bw(n)?1:-1}}(e)),n=mw(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)kw(t,i++);return t}});var Mw="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Nw={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Fw="%c[xgplayer]",Bw={config:{debug:Mw?3:1},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Fw,Nw.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Fw,Nw.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[Fw,Nw.error,e].concat(r))}}};var jw=function(){function e(t){Fo(this,e),this.bufferedList=t}return No(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}(),Hw={};function Uw(e){var t=Ao(e);return null!==e&&("object"===t||"function"===t)}function Vw(e,t,n){var i,r,o,s,a,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,s=e.apply(o,n)}function v(e,t){return d?(window.cancelAnimationFrame(a),window.requestAnimationFrame(e)):setTimeout(e,t)}function g(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function y(){var e=Date.now();if(g(e))return m(e);a=v(y,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function m(e){return a=void 0,h&&i?p(e):(i=r=void 0,s)}function k(){for(var e=Date.now(),n=g(e),o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i=h,r=this,c=e,n){if(void 0===a)return function(e){return u=e,a=v(y,t),l?p(e):s}(c);if(f)return a=v(y,t),p(c)}return void 0===a&&(a=v(y,t)),s}return t=+t||0,Uw(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==a&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,i=c=r=a=void 0},k.flush=function(){return void 0===a?s:m(Date.now())},k.pending=function(){return void 0!==a},k}Hw.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},Hw.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&Hw.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Bw.logError("util.createDomFromHtml",e),null}},Hw.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===Ao(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Hw.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(n){Hw.hasClass(e,t)||(e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Hw.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(n){Hw.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},Hw.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Hw.hasClass(e,t)?Hw.removeClass(e,t):Hw.addClass(e,t)}))},Hw.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===Hw.typeOf(e[n])?t.push(e[n]):"Object"===Hw.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},Hw.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(i){Bw.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},Hw.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Hw.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),s=[],a=String(e);o--;)s.push(i);return s.join("").substring(0,r-a.length)+a},Hw.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Hw.padStart(Math.floor(e/3600),2,0),n=Hw.padStart(Math.floor((e-3600*t)/60),2,0),i=Hw.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},Hw.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},Hw.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Hw.deepCopy=function(e,t){if("Object"===Hw.typeOf(t)&&"Object"===Hw.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==Hw.typeOf(t[n])||t[n]instanceof Node?"Array"===Hw.typeOf(t[n])?e[n]="Array"===Hw.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:Hw.deepCopy(e[n],t[n])})),e},Hw.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===Hw.typeOf(t[n])&&"Array"===Hw.typeOf(e[n])?"Array"===Hw.typeOf(e[n])&&(i=e[n]).push.apply(i,Ty(t[n])):Hw.typeOf(e[n])!==Hw.typeOf(t[n])||null===e[n]||"Object"!==Hw.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):Hw.deepMerge(e[n],t[n])})),e},Hw.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},Hw.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""},Hw.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},Hw.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Hw.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),Hw.clearTimeout(e,i)}),n);return e._timers.push(i),i},Hw.clearTimeout=function(e,t){var n=e._timers;if("Array"===Hw.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},Hw.clearAllTimers=function(e){var t=e._timers;"Array"===Hw.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Hw.createImgBtn=function(e,t,n,i){var r,o,s,a=Hw.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(a.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),s=e,!1)})),a.style.width="".concat(r).concat(s),a.style.height="".concat(o).concat(s),a.style.backgroundSize="".concat(r).concat(s," ").concat(o).concat(s),a.style.margin="start"===e?"-".concat(o/2).concat(s," auto auto -").concat(r/2).concat(s):"auto 5px auto 5px");return a},Hw.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Hw.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Hw.checkIsFunction=function(e){return e&&"function"==typeof e},Hw.checkIsObject=function(e){return null!==e&&"object"===Ao(e)},Hw.hide=function(e){e.style.display="none"},Hw.show=function(e,t){e.style.display=t||"block"},Hw.isUndefined=function(e){if(null==e)return!0},Hw.setStyleFromCsstext=function(e,t){t&&("String"===Hw.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},Hw.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(!function(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Hw.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},Hw.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},Hw.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},Hw.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Hw.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Hw.checkTouchSupport=function(){return"ontouchstart"in window},Hw.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var s=r.length;if(s){var a=r[s-1].end;n[o].start-a<t?n[o].end>a&&(r[s-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new jw(r)},Hw.getBufferByCurrentTime=function(e,t){var n={start:0,end:0,include:0,diff:0,cur:t};if(!e||e.length<1)return n;for(var i=-1,r=-1,o=parseInt(1e3*t,10),s=e.length-1;s>-1;s--){var a=parseInt(1e3*e.start(s),10),c=parseInt(1e3*e.end(s),10);if(o>=a&&o<=c){n.include=1,n.start=a/1e3,n.end=c/1e3,n.diff=(c-o)/1e3;break}o<a&&(i<0||a-o<i)?(i=(a-o)/1e3,r=s):o>c&&(i<0||o-c<i)&&(i=(o-c)/1e3,r=s)}return 1!==n.include&&(r<0&&(r=e.length-1),n.start=parseInt(1e3*e.start(r),10)/1e3,n.end=parseInt(1e3*e.end(r),10)/1e3,n.diff=(parseInt(1e3*n.end,10)-o)/1e3),n},Hw.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}},Hw.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Hw.getHostFromUrl=function(e){if("String"!==Hw.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},Hw.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Hw.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Hw.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Hw.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){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 n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Hw.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},Hw.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]:"",n={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(n).forEach((function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(n[e],")");i.test(t)?(i.lastIndex=-1,t=t.replace(i,r)):t+="".concat(r," ")})),t},Hw.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360};var Gw={1:"network",2:"network",3:"decoder",4:"format"},Ww=No((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};Fo(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(null!=t&&t.video){var r=n.mediaError?n.mediaError:t.video.error||{},o=t.duration,s=t.currentTime,a=t.ended,c=t.src,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:xy,domain:document.domain,currentTime:s,duration:o,ended:a,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:Hw.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:xy,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)p[v[g]]=arguments[g];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}})),zw="play",Kw="playing",Yw="ended",Xw="pause",qw="error",$w="seeking",Jw="seeked",Zw="timeupdate",Qw="waiting",eC="canplay",tC="durationchange",nC="volumechange",iC="loadeddata",rC="ratechange",oC="progress",sC="loadstart",aC="emptied",cC="focus",uC="blur",lC="ready",fC="urlNull",hC="autoplay_started",dC="autoplay_was_prevented",pC="complete",vC="replay",gC="destroy",yC="urlchange",mC="download_speed_change",kC="buffer_control",bC="AbortError",wC="fullscreen_change",CC="cssFullscreen_change",_C="mini_state_change",xC="definition_change",SC="after_definition_change",TC="video_resize",PC="pip_change",EC="rotate",RC="screenShot",OC="playnext",IC="shortcut",LC="xglog",AC="user_action",DC="reset",MC="source_error",NC="source_success",FC=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],BC={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},jC="fps_stuck",HC=Object.freeze({__proto__:null,PLAY:zw,PLAYING:Kw,ENDED:Yw,PAUSE:Xw,ERROR:qw,SEEKING:$w,SEEKED:Jw,TIME_UPDATE:Zw,WAITING:Qw,CANPLAY:eC,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:tC,VOLUME_CHANGE:nC,LOADED_DATA:iC,LOADED_METADATA:"loadedmetadata",RATE_CHANGE:rC,PROGRESS:oC,LOAD_START:sC,EMPTIED:aC,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:cC,PLAYER_BLUR:uC,READY:lC,URL_NULL:fC,AUTOPLAY_STARTED:hC,AUTOPLAY_PREVENTED:dC,COMPLETE:pC,REPLAY:vC,DESTROY:gC,URL_CHANGE:yC,DOWNLOAD_SPEED_CHANGE:mC,BUFFER_CONTROLS:kC,PLAY_ABORTED:bC,FULLSCREEN_CHANGE:wC,CSS_FULLSCREEN_CHANGE:CC,MINI_STATE_CHANGE:_C,DEFINITION_CHANGE:xC,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:SC,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:TC,PIP_CHANGE:PC,ROTATE:EC,SCREEN_SHOT:RC,PLAYNEXT:OC,SHORTCUT:IC,XGLOG:LC,USER_ACTION:AC,RESET:DC,SOURCE_ERROR:MC,SOURCE_SUCCESS:NC,SWITCH_SUBTITLE:"switch_subtitle",VIDEO_EVENTS:FC,STATS_EVENTS:BC,FPS_STUCK:jC,DEGRADE:"degrade"}),UC=/(Android)\s([\d.]+)/,VC=/(Version)\/([\d.]+)/,GC=["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"],WC={get device(){return WC.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!o,a=!(s||i||n||o),c=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:s,isIpad:c,isIos:s||c,isAndroid:i,isPc:a,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?VC:UC)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&GC.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}},isHdrSupported:function(){if("function"==typeof matchMedia){var e=matchMedia("(dynamic-range: high)"),t=matchMedia("not supported query");return e.media!==t.media&&!0===e.matches}return!1}},zC=WC;function KC(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function YC(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var XC=function(e){jo(n,e);var t=KC(n);function n(e){var i;Fo(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i.bizType="number"==typeof e.bizType&&e.bizType>=0?e.bizType:0,i._rate=-1,i.videoConfig=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 zC.isWeixin&&zC.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),e.loop&&(i.videoConfig.loop="loop"),i.video=Hw.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===Hw.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.video.muted=!0,i._lastMuted=!0),e.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return No(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.videoEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.videoEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(e){var t=this;this.evHandlers||(this._evHandlers=FC.map((function(e){return Go({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:Hw.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var s=i.video?i.video.playbackRate:0;if(s&&i._rate===s)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var a=YC.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,a)}catch(e){throw YC.call(i,r,o),e}}else YC.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0];e.addEventListener(n,t[n],!1)}))}},{key:"detachVideoEvents",value:function(e){e||(e=this.video),this._evHandlers.map((function(t){var n=Object.keys(t)[0];e.removeEventListener(Object.keys(t)[0],t[n],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(Hw.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit(NC,{src:e.target.currentSrc,host:Hw.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){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=Gw[4];n.emit(MC,new Ww(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var s=0;s<i.length;s++)i[s].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?Gw[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new Ww(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.video&&this.video.autoplay},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?Hw.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var t=this.video.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){if(!this.video||!this.video.error)return null;return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){this.video&&this.video.muted!==e&&(this._lastMuted=this.video.muted,this.video.muted=e)}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video.src=e}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){e!==1/0&&this.video&&(this.video.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){au(Vo(n.prototype),"removeAllListeners",this).call(this)}}]),n}(_y),qC=XC,$C=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"}};Fo(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return No(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),JC=$C,ZC=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],QC=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],e_=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],t_="data-xgplayerid",n_={BUFFER_CONTROLS:"buffer_control"},i_={PLAYING:"playing",WAITING:"waiting"},r_=lr,o_=$s.find,s_=Wv,a_="find",c_=!0;function u_(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var s=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(s&&s.then?s.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function l_(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var s,a=(s=this.__hooks[e]).call.apply(s,[this,this].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&u_.apply(void 0,[r,t,n.next].concat(Ty(i)))})).catch((function(e){throw e})):u_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&u_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else u_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function f_(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function h_(e,t){var n=this.__hooks;if(!n||!Array.isArray(n[e]))return-1;for(var i=n[e],r=0;r<i.length;r++)if(i[r]===t)return r;return-1}function d_(e,t){var n=this.__hooks;if(n)if(Array.isArray(n[e])){var i=n[e],r=h_.call(this,e,t);-1!==r&&i.splice(r,1)}else n[e]&&(n[e]=null)}function p_(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function v_(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function g_(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 y_(e){e.__hooks=null}function m_(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var s,a=(s=e.__hooks[t]).call.apply(s,[e,e].concat(r));if(a&&a.then)a.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==a)return n.call.apply(n,[e,e].concat(r))}function k_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k_(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w_(e,t){Bw.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}a_ in[]&&Array(1)[a_]((function(){c_=!1})),r_({target:"Array",proto:!0,forced:c_},{find:function(e){return o_(this,e,arguments.length>1?arguments[1]:void 0)}}),s_(a_);var C_=function(){function e(t){Fo(this,e),Hw.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),g_(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return No(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,t=Hw.checkTouchSupport()?"touch":"mouse";return["compatible","touch","mouse"].indexOf(null===(e=this.playerConfig)||void 0===e?void 0:e.domEventType)>-1&&(t=this.playerConfig.domEventType),t}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):w_(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):w_(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):w_(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=b_(b_({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return f_.call.apply(f_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return d_.call.apply(d_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),Hw.clearAllTimers(this),Hw.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),y_(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var __=Element.prototype;__.matches=__.matchesSelector||__.mozMatchesSelector||__.msMatchesSelector||__.oMatchesSelector||__.webkitMatchesSelector}var x_=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function S_(e,t,n,i,r){var o=T_.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function T_(e,t,n,i){return function(n){n.delegateTarget=x_(n.target,t),n.delegateTarget&&i.call(e,n)}}var P_=function(e,t,n,i,r){return"function"==typeof e.addEventListener?S_.apply(null,arguments):"function"==typeof n?S_.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return S_(e,t,n,i,r)})))};function E_(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var R_={CONTROLS:"controls",ROOT:"root"},O_={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"},I_="xg-icon-disable";function L_(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function A_(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Hw.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(L_(e)||L_(e.url))return i.src=L_(e)?e:e.url||"",o=Hw.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Hw.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Bw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Bw.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?Hw.createDomFromHtml(e,i,n):(Bw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function D_(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",s=r&&r.attr?r.attr:{},a=null;n&&n[i]&&(o=function(e,t){return"object"===Ao(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),s=function(e,t){return"object"===Ao(e)&&e.attr&&"object"===Ao(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],s),a=A_(n[i],i,o,s,t.pluginName)),!a&&r&&(a=A_(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[i]=a}))}var M_=function(e){jo(n,e);var t=E_(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fo(this,n),(e=t.call(this,i)).__delegates=[],e}return No(n,[{key:"__init",value:function(e){if(au(Vo(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,D_(this.registerIcons()||{},this),this.langText={};var r,o,s=this.registerLanguageTexts()||{};r=s,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var a="";try{a=this.render()}catch(e){throw Bw.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(a)(i=n.insert(a,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=Hw.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var c=this.config.attr||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Ao(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,s=t[o],a={root:e.root};"function"==typeof s?(i=e.config[o]||{},r=s):"object"===Ao(s)&&"function"==typeof s.plugin&&(i=s.options?Hw.deepCopy(e.config[o]||{},s.options):e.config[o]||{},r=s.plugin),a.config=i,void 0!==i.index&&(a.index=i.index),i.root&&(a.root=i.root),e.registerPlugin(r,a,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,Hw.addClass(this.find(".xgplayer-icon"),I_)}},{key:"enable",value:function(){this.config.disable=!1,Hw.removeClass(this.find(".xgplayer-icon"),I_)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=au(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===Hw.typeOf(e)?this.root.style[e]=t:void("Object"===Hw.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===Hw.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Hw.typeOf(e)&&Object.keys(e).map((function(t){n.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"unbindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,n)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return Bw.logError("Plugin:appendChild",e),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)),au(Vo(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var s=0,a=null,c="";s<i;s++){a=t.children[s];var u=Number(a.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<r&&(c="afterend")}return o?"afterend"===c?t.appendChild(e):t.insertBefore(e,a):a.insertAdjacentHTML(c,e),"afterend"===c?t.children[t.children.length-1]:t.children[s]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var s=P_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}));else{var s=P_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return R_}},{key:"POSITIONS",get:function(){return O_}}]),n}(C_),N_=xm.charAt,F_=Ko,B_=on,j_=Mg,H_=Ng,U_="String Iterator",V_=B_.set,G_=B_.getterFor(U_);j_(String,"String",(function(e){V_(this,{type:U_,string:F_(e),index:0})}),(function(){var e,t=G_(this),n=t.string,i=t.index;return i>=n.length?H_(void 0,!0):(e=N_(n,i),t.index+=e.length,H_(e,!1))}));var W_=function(){function e(){var t=this;if(Fo(this,e),Go(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Uw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Vw(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return No(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(t_),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(e){console.error(e)}return!0}return!1}}]),e}(),z_=null;var K_={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},z_||(z_=new W_),z_.addObserver(t,n)),this.pluginGroup[i]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===Hw.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=e;var s=n.pluginName||t.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var a=Object.keys(o),c=0;c<a.length;c++)if(s.toLowerCase()===a[c].toLowerCase()){var u=o[a[c]];"Object"===Hw.typeOf(u)&&(n.config=Object.assign({},n.config,o[a[c]]));break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var l=new t(n);return r[s.toLowerCase()]=l,r[s.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(s,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,s=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();s.push(n(t))}catch(e){throw s.push(n(null)),e}})),Promise.all([].concat(s)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,z_.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,s=Object.keys(r);o<s.length;o++){var a=s[o];this.unRegister(t,a)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Y_=K_,X_={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-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function q_(){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}function $_(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var J_=function(e){jo(n,e);var t=$_(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Ho(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Go(Ho(e),"onMouseLeave",(function(){Ho(e).player.focus()})),e}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==zC.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(X_.FLEX_CONTROLS),o&&this.player.addClass(X_.AUTOHIDE);var s={height:"".concat(i,"px")};Object.keys(s).map((function(t){e.root.style[t]=s[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(_C,(function(t){t?Hw.addClass(e.root,"mini-controls"):Hw.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==zC.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Hw.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){Hw.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case O_.CONTROLS_LEFT:t.root=this.left;break;case O_.CONTROLS_RIGHT:t.root=this.right;break;case O_.CONTROLS_CENTER:t.root=this.center;break;case O_.CONTROLS:t.root=this.root;break;default:t.root=this.left}return au(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==zC.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=Hw.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(M_),Z_=J_,Q_={lang:{},langKeys:[],textKeys:[]};function ex(e,t){return Object.keys(t).forEach((function(n){var i,r=Hw.typeOf(t[n]),o=Hw.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,Ty(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),ex(e[n],t[n])):e[n]=t[n]})),e}function tx(){Object.keys(Q_.lang.en).map((function(e){Q_.textKeys[e]=e}))}function nx(e,t){var n=e.LANG;if(t||(t=Q_),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?ex(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),tx()}}nx({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 ix={get textKeys(){return Q_.textKeys},get langKeys(){return Q_.langKeys},get lang(){var e={};return Q_.langKeys.map((function(t){e[t]=Q_.lang[t]})),Q_.lang["zh-cn"]&&(e.zh=Q_.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=Q_),t.lang){n="Array"!==Hw.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?ex(i[e.LANG]||{},e.TEXT||{}):nx(e,t)})),tx()}},use:nx,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return ex(n.lang,Q_.lang),(t=n.langKeys).push.apply(t,Ty(Q_.langKeys)),ex(n.textKeys,Q_.textKeys),n}},rx=ix;function ox(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var sx={},ax=null,cx=function(e){jo(n,e);var t=ox(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"add",value:function(e){e&&(sx[e.playerId]=e,1===Object.keys(sx).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete sx[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in sx)if(Object.prototype.hasOwnProperty.call(sx,n)){var i=sx[n];if(t){if(e(i))break}else e(i)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(n){var i=e(n);return i&&(t=n),i}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(n){e(n)&&t.push(n)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(sx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):sx[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(sx),t=0;t<e.length;t++){var n=sx[e[t]];if(n&&n.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(sx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):sx[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return ax||(ax=new n),ax}}]),n}(Cy.exports.EventEmitter);function ux(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function lx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ux(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ux(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var hx=["play","pause","replay","retry","playnext"],dx=0,px=0,vx=null,gx=function(e){jo(n,e);var t=fx(n);function n(e){var i;Fo(this,n);var r,o=Hw.deepMerge(q_(),e);Go(Ho(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Bw.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(eC,i.canPlayFunc),i.removeClass(X_.ENTER)}})),Go(Ho(i),"onFullscreenChange",(function(e,t){var n=function(){Hw.setTimeout(Ho(i),(function(){i.getVideoSize()}),100)},r=Hw.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(AC,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,t_);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.emit(wC,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var s=Ho(i),a=s._fullScreenOffset;s.config.needFullscreenScroll?(window.scrollTo(a.left,a.top),Hw.setTimeout(Ho(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(X_.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,X_.FULLSCREEN),i._fullscreenEl=null,i.emit(wC,!1)}})),Go(Ho(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Go(Ho(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),g_(Ho(i),hx),i.config=o,i._pluginInfoId=Hw.generateSessionId(),(r=Ho(i)).logInfo=Bw.logInfo.bind(r),r.logWarn=Bw.logWarn.bind(r),r.logError=Bw.logError.bind(r);var s=i.constructor.defaultPreset;if(i.config.presets.length){var a=i.config.presets.indexOf("default");a>=0&&s&&(i.config.presets[a]=s)}else s&&i.config.presets.push(s);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isBufferControlPaused=!1,i.isCssfullScreen=!1,i.fullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},i.sizeInfo={width:0,height:0,left:0,top:0},i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=rx.init(),zC.os.isAndroid&&zC.osVersion>0&&zC.osVersion<6&&(i.config.autoplay=!1),i.database=new JC,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,i.innerStates={isActiveLocked:!1},i.instManager=vx,i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),Y_.onPluginsReady(Ho(i)),Hw.setTimeout(Ho(i),(function(){i.emit(lC),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Uo(i))}return No(n,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(!n||1!==n.nodeType)return this.emit(qw,new Ww("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=n}var i=function(e){for(var t=Object.keys(sx),n=0;n<t.length;n++){var i=sx[t[n]];if(i.root===e)return i}return null}(this.root);i&&(Bw.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),i.destroy()),this.root.setAttribute(t_,this.playerId),null===(e=vx)||void 0===e||e.add(this),Y_.init(this),this._initBaseDoms();var r=this.constructor.XgVideoProxy;if(r&&this.videoConfig.mediaType===r.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.video);var s=new r(o,this.config,this.videoConfig);this.attachVideoEvents(s),this.video=s}if(this.video.setAttribute(t_,this.playerId),this.config.controls){var a=Y_.register(this,Z_);this.controls=a}var c="mobile"===this.config.isMobileSimulateMode?"mobile":zC.device;if(this.addClass("".concat(X_.DEFAULT," ").concat(X_.ACTIVE," xgplayer-").concat(c," ").concat(this.config.controls?"":X_.NO_CONTROLS)),this.config.autoplay?this.addClass(X_.ENTER):this.addClass(X_.NO_START),this.config.fluid){var u={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(u).map((function(e){t.root.style[e]=u[e]}))}else["width","height"].map((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 l=this.root.getBoundingClientRect(),f=l.width,h=l.height,d=l.left,p=l.top;return this.sizeInfo.width=f,this.sizeInfo.height=h,this.sizeInfo.left=d,this.sizeInfo.top=p,!0}},{key:"_initBaseDoms",value:function(){this.topBar=Hw.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=Hw.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=Hw.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=Hw.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),ZC.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),zC.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on(kC,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),ZC.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==Hw.typeOf(e)||0!==e.length)||(e="",this.emit(fC),Bw.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===Hw.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===Hw.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild);var i=this.video.readyState;Bw.logInfo("_startInit readyState",i),this.config.autoplay&&(!Hw.isMSE(this.video)&&this.load(),(zC.os.isIpad||zC.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(eC,this.canPlayFunc),Hw.setTimeout(this,(function(){t.emit(pC)}),1),this.hasStart||Y_.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&rx.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),s=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),a=e.config[r]||e.config[i];if("Boolean"===Hw.typeOf(a)&&!a||o.indexOf(r)>-1)return;if(!t&&s[r])return;if(n.lazy&&n.loader){var c=Y_.lazyRegister(e,n);return void(n.forceBeforeInit&&(c.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})).catch((function(t){Bw.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})),e._loadingPlugins.push(c)))}return e.registerPlugin(n)}catch(e){Bw.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,s=void 0===o?[]:o,a=r.ignores,c=void 0===a?[]:a,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,Ty(s)),(i=e.config.ignores).push.apply(i,Ty(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,Ty(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case O_.ROOT_RIGHT:t=this.rightBar;break;case O_.ROOT_LEFT:t=this.leftBar;break;case O_.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=Y_.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!Y_.checkPluginIfExits(i.pluginName,o)&&o.push(i);var s=Y_.getRootByConfig(i.pluginName,this.config);s.root&&(r.root=s.root),s.position&&(r.position=s.position);var a=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof a&&a.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(a)),Y_.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?Y_.unRegister(this,e):e instanceof C_&&Y_.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 C_&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return Y_.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Y_.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Hw.hasClass(this.root,e)||Hw.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Hw.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Hw.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.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),Y_.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url)}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Bw.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===Hw.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};zC.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(X_.NO_START),!this.isCanplay&&this.addClass(X_.ENTER));var t=au(Vo(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(X_.NOT_ALLOW_AUTOPLAY),e.addClass(X_.PLAYING),e.isPlaying||(Bw.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(hC))})).catch((function(t){if(Bw.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(X_.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Hw.setTimeout(e,(function(){e._errorTimer=null,e.emit(dC),e.addClass(X_.NOT_ALLOW_AUTOPLAY),e.removeClass(X_.ENTER),e.pause()}),0)),"AbortError"===t.name&&(e._errorTimer=Hw.setTimeout(e,(function(){e._errorTimer=null,e.emit(bC)}),0))})):(Bw.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(X_.NOT_ALLOW_AUTOPLAY),this.removeClass(X_.NO_START),this.removeClass(X_.ENTER),this.addClass(X_.PLAYING),this.emit(hC))),t}this.removeClass(X_.NO_START),this.addClass(X_.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){au(Vo(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(X_.PAUSED),m_(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(e){var t=this;m_(this,"pause",(function(){e===n_.BUFFER_CONTROLS?t.isBufferControlPaused||(t.isBufferControlPaused=!0,t.emit(kC,{type:i_.WAITING})):t.isBufferControlPaused&&(t.isBufferControlPaused=!1,t.emit(kC,{type:i_.PLAYING})),au(Vo(n.prototype),"pause",t).call(t)}),e)}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,s=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(Jw,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(X_.ENTER),n.isSeeking=!1,s){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(Jw,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(X_.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(n.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(xC,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url);r&&r.then?r.then((function(){n.emit(SC,{from:t,to:e})})):this.emit(SC,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[X_.NOT_ALLOW_AUTOPLAY,X_.PLAYING,X_.NO_START,X_.PAUSED,X_.REPLAY,X_.ENTER,X_.ENDED,X_.ERROR,X_.LOADING];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(X_.ENTER),this.emit(DC)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=q_();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e,t=this,i=this.innerContainer,r=this.root,o=this.video;if(r&&o){if(r.removeAttribute(t_),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),Hw.clearAllTimers(this),this.emit(gC),null===(e=vx)||void 0===e||e.remove(this),Y_.destroy(this),y_(this),au(Vo(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(i)for(var s=i.children,a=0;a<s.length;a++)i.removeChild(s[a]);!i&&o instanceof window.Node&&r.contains(o)&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var c=r.className.split(" ");c.length>0?r.className=c.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(X_.ENDED),this.currentTime=0,this.isSeeking=!1,m_(this,"replay",(function(){e.once(Jw,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(vC),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(X_.ERROR),this.addClass(X_.LOADING),m_(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(eC,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=X_.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Hw.filterStyleFromText(e)),Hw.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Hw.filterStyleFromText(t),Hw.addClass(t,i),t.setAttribute(t_,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=X_.PARENT_FULLSCREEN),this._orgCss&&(Hw.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Hw.removeClass(e,n),t&&t!==e&&this._orgPCss&&(Hw.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Hw.removeClass(t,i),t.removeAttribute(t_))}},{key:"getFullscreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,n=this.root,i=this.video;if(t||(t=n),this._fullScreenOffset={top:Hw.scrollTop(),left:Hw.scrollLeft()},this._fullscreenEl=t,this._fullActionFrom="get",Hw.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=0;r<QC.length;r++){var o=QC[r];if(t[o]){var s="webkitRequestFullscreen"===o?t.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):t[o]();return s&&s.then?(s.then((function(){"get"===e._fullActionFrom&&e.changeFullStyle(e.root,t,X_.FULLSCREEN)})),s):(this.changeFullStyle(this.root,t,X_.FULLSCREEN),Promise.resolve())}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(e)}}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||Hw.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<e_.length;n++){var i=e_[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?X_.INNER_FULLSCREEN:X_.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(CC,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?X_.INNER_FULLSCREEN:X_.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(CC,!1)}},{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(cC,lx({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(uC,lx({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},n=this.innerStates;if(this.isActive=!0,this.removeClass(X_.ACTIVE),this.userTimer&&(Hw.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this.userTimer&&(Hw.clearTimeout(this,this.userTimer),this.userTimer=null);else{var i=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Hw.setTimeout(this,(function(){e.userTimer=null,e.blur()}),i)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive&&!this.innerStates.isActiveLocked){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(X_.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(X_.ENTER),!this.isBufferControlPaused&&this.removeClass(X_.LOADING),this.isCanplay=!0,this.waitTimer&&Hw.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(X_.PAUSED),this.ended&&this.removeClass(X_.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(X_.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(Hw.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(X_.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(X_.NOT_ALLOW_AUTOPLAY),this.removeClass(X_.NO_START),this.removeClass(X_.ENTER),this.removeClass(X_.LOADING),this.addClass(X_.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(X_.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Hw.clearTimeout(this,this.waitTimer),this.removeClass(X_.LOADING),this.removeClass(X_.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Hw.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Hw.setTimeout(this,(function(){e.addClass(X_.LOADING),Hw.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[X_.NO_START,X_.PAUSED,X_.ENDED,X_.ERROR,X_.REPLAY,X_.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(X_.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(X_.LOADING),Hw.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(hC)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Hw.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&("waiting"===e.type?(this.isBufferControlPaused=!0,this.addClass(X_.LOADING),this.removeClass(X_.PAUSED)):"playing"===e.type&&(this.isBufferControlPaused=!1,this.removeClass(X_.LOADING),this.paused&&this.addClass(X_.PAUSED)))}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===Hw.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===Hw.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(AC,lx({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>n)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,n=e.vy,i=e.vx,r=e.h,o=e.w;if(!(t<0&&r<0&&o<0)){var s=this.videoPos._pi;if(!s&&this.video.videoHeight&&(s=this.video.videoWidth/this.video.videoHeight*100),s){this.videoPos.pi=s;var a={},c=0,u=0,l=1,f=t<0?0:Math.abs(t/90),h=this.root,d=this.innerContainer,p=h.offsetWidth,v=d?d.offsetHeight:h.offsetHeight,g=v,y=p,m={width:p,height:v};if(f%2==0)l=r>0?100/r:o>0?100/o:1,a.scale=l,c=n>0?(100-r)/2-n:0,a.y=2===f?0-c:c,u=i>0?(100-o)/2-i:0,a.x=2===f?0-u:u,m.width=y,m.height=g;else if(f%2==1){g=p;var k=v-p;u=-k/2/(y=v)*100,a.x=3===f?u+n/2:u-n/2,c=k/2/g*100,a.y=3===f?c+i/2:c-i/2,a.scale=l,m.width=y,m.height=g}var b=this.video;t>=0&&["width","height"].forEach((function(e){b.style[e]="".concat(m[e],"px")})),a.rotate=t<0?0:t;var w=Hw.getTransformStyle(a,this.video.style.transform||this.video.style.webkitTransform);b.style.transform=w,b.style.webkitTransform=w}}}},{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.video&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===Hw.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),this.vtype="MP4",m_(this,"playnext",(function(){t.start(),t.emit(OC,e)}))}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.video,i=n.videoWidth,r=n.videoHeight,o=this.config,s=o.fitVideoSize,a=o.videoFillMode;if("fill"!==a&&"cover"!==a&&"contain"!==a||this.setAttribute("data-xgfill",a),r&&i){this._videoHeight=r,this._videoWidth=i;var c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,l=t.height-c,f=parseInt(i/r*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,v={};"auto"===s&&h>f||"fixWidth"===s?(p=u/f*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+c,"px")):("auto"===s&&h<f||"fixHeight"===s)&&(d=f*l/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||Object.keys(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===a&&h<f||"fillWidth"===a&&h>f)&&this.setAttribute("data-xgfill","cover");var g={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.resizePosition(),this.emit(TC,g)}}}},{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.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"preProcessUrl",value:function(e,t){var n=this.config,i=n.preProcessUrl,r=n.preProcessUrlOptions,o=Object.assign({},r,t);return Hw.isBlob(e)||"function"!=typeof i?{url:e}:i(e,o)}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(yC,e),this.emit(Qw),this._currentTime=0,this._duration=0,Hw.isMSE(this.video)?this.onWaiting():(e=this.preProcessUrl(e).url,this._detachSourceEvents(this.video),"Array"===Hw.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()))}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,r=null;e.map((function(e){t.curDefinition===e.definition&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.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!==rx.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,Y_.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(rx.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 xy}},{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(){var e=au(Vo(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=au(Vo(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=au(Vo(n.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=Hw.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return px},set:function(e){px=e}},{key:"realTimeSpeed",get:function(){return dx},set:function(e){dx=e}},{key:"hook",value:function(e,t){return l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return f_.call.apply(f_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return d_.call.apply(d_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return p_.call.apply(p_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return v_.call.apply(v_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var n;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),null===(n=vx)||void 0===n||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Bw.config.debug},set:function(e){Bw.config.debug=e}},{key:"instManager",get:function(){return vx},set:function(e){vx=e}},{key:"pluginsManager",get:function(){return Y_}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=vx)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var n;null===(n=vx)||void 0===n||n.setActive(e,t)}},{key:"isHevcSupported",value:function(){return zC.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return zC.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(qC);function yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function mx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yx(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function bx(){return(new Date).getTime()}Go(gx,"defaultPreset",null),Go(gx,"XgVideoProxy",null),gx.instManager=cx.getInstance();var wx="loadstart",Cx="loadeddata",_x="firstFrame",xx="waitingStart",Sx="waitingEnd",Tx="seekStart",Px="seekEnd",Ex="waitingEndExt",Rx="seekEndEndExt",Ox="[xgLogger]",Ix=function(e){jo(n,e);var t=kx(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_onLoadStart",(function(){var t=Ho(e)._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=bx()-e.newPointTime,Bw.logInfo(Ox,"LOAD_START","autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(wx,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=bx(),e.vt=0,e.fvt=0,e._initOnceEvents())})),Go(Ho(e),"_onLoadedData",(function(){e.vt=bx(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime,e._updateBuffer();var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Bw.logInfo(Ox,"LOADED_DATA","fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(Cx,{})})),Go(Ho(e),"_onTimeupdate",(function(){var t=Ho(e)._state;t.isTimeUpdate=!0,t.time=e.player.currentTime,e._state.autoplayStart&&!t.isFFSend&&e._sendFF("onTimeupdate")})),Go(Ho(e),"_onPlay",(function(){var t=e.player.buffered,n=Ho(e).levelInfo;Bw.logInfo(Ox,"_onPlay playPos:".concat(n.startBuffer)),n.startBuffer<0&&(n.startBuffer=t.length>0?parseInt(1e3*t.end(0),10):0,n.startType="onplay")})),Go(Ho(e),"_onAutoplayStart",(function(){Bw.logInfo(Ox,"_onAutoplayStart"),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Go(Ho(e),"_onReset",(function(){e._state={time:0,autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=bx(),e.loadedCostTime=0,e.startCostTime=0,e.seekingStart=0,e.seekData={startTime:0,lastTime:0,timeBefore:0,timeAfter:0,inBuffer:0,diffStart:0,interval:-1},e.waitData={startTime:0,lastTime:0,interval:-1,diffStart:0},e.waitingStart=0,e.fixedWaitingStart=0,e.ffsendTime=0,e.levelInfo={diff:0,buffer:-1,startBuffer:-1,startType:""},e._isWaiting=!1,e._waitTimer&&Hw.clearTimeout(Ho(e),e._waitTimer),e._waittTimer&&Hw.clearTimeout(Ho(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Go(Ho(e),"_onSeeking",(function(){var t=Ho(e),n=t.seekData,i=t._state;if(!n.startTime){var r=e.player,o=r.buffered,s=r.currentTime;n.startTime=bx(),n.timeBefore=i.time,n.timeAfter=s;var a=Hw.getBufferByCurrentTime(o,s);Bw.logInfo(Ox,"onSeeking",s,a),n.inBuffer=a.include,n.diffStart=1e3*a.diff,n.lastTime>0?n.interval=n.startTime-n.lastTime:n.interval=-1,Bw.logInfo(Ox,"onSeeking",n),e.suspendWaitingStatus("seek");var c=e._getSeekInfo();e.emitLog(Tx,mx({start:bx()},c))}})),Go(Ho(e),"_onSeeked",(function(){Bw.logInfo(Ox,"onSeeked"),e.suspendSeekingStatus("seeked")})),Go(Ho(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=bx(),e.fixedWaitingStart=bx(),e._waitType=1,e.emitLog(xx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Go(Ho(e),"_onWaiting",(function(){if(!e._isWaiting&&e.vt){e._isWaiting=!0;var t=Ho(e),n=t.waitData,i=t.seekData;t._state.isTimeUpdate||0!==i.startTime?i.startTime?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=bx(),Bw.logInfo(Ox,"_onWaiting"),n.lastTime>0?n.interval=e.fixedWaitingStart-n.lastTime:n.interval=-1;var r=e.player,o=r.buffered,s=r.currentTime,a=Hw.getBufferByCurrentTime(o,s);n.diffStart=1e3*a.diff,e._waitTimer=Hw.setTimeout(Ho(e),(function(){Bw.logInfo(Ox,"_onWaiting real");var t=Ho(e).waitData;e._isWaiting?(e.waitingStart=bx(),Hw.clearTimeout(Ho(e),e._waitTimer),t.lastTime=e.fixedWaitingStart,e._waitTimer=null,e._startWaitTimeout(),e.emitLog(xx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing",diffStart:t.diffStart,interval:t.interval})):(t.interval=-1,t.diffStart=0)}),200)}})),Go(Ho(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Go(Ho(e),"_onWaitingTimeout",(function(t){e.suspendWaitingStatus(t||"timeout"),Hw.clearTimeout(Ho(e),e._waittTimer),e._waittTimer=null})),Go(Ho(e),"_onProgress",(function(){Bw.logInfo(Ox,"_onProgress")})),Go(Ho(e),"_onPlaying",(function(){Bw.logInfo(Ox,"_onPlaying"),e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType=-1,this._initOnceEvents(),this.newPointTime=bx(),this.loadedCostTime=0,this.startCostTime=0,this.ffsendTime=0,this.on(sC,this._onLoadStart),this.on(iC,this._onLoadedData),this.on($w,this._onSeeking),this.on(Jw,this._onSeeked),this.on(gC,(function(){e.endState("destroy")})),this.on(Yw,(function(){e.endState("ended")})),this.on(Xw,(function(){e.endState("pause")})),this.on(zw,this._onPlay),this.on(yC,(function(){e.endState("urlChange"),Bw.logInfo(Ox,"URL_CHANGE"),e._state.isFFSend&&e._onReset()})),this.on([Kw,eC],this._onPlaying),this.on(Qw,this._onWaiting),this.on(qw,this._onError),this.on(DC,(function(){Bw.logInfo(Ox,"RESET"),e.endState("reset"),e._initOnceEvents(),e._onReset();var t=e.levelInfo;e.playerConfig.autoplay&&(t.startType="onreset",t.startBuffer=0)}))}},{key:"_initOnceEvents",value:function(){this.off(hC,this._onAutoplayStart),this.off(Zw,this._onTimeupdate),this.once(hC,this._onAutoplayStart),this.on(Zw,this._onTimeupdate)}},{key:"_sendFF",value:function(e){var t=this._state,n=t.isFFLoading,i=t.isFFSend;if(Bw.logInfo(Ox,"_sendFF","".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i){var r;this.ffsendTime=bx();var o=this.levelInfo,s=o.buffer,a=o.startBuffer,c=o.startType;Bw.logInfo(Ox,"emitLog_firstFrame",e,"startBuffer:".concat(a," startType:").concat(c," buffer:").concat(s," ")),this._state.isFFLoading=!1,this._state.isFFSend=!0;var u=this.fvt+((null===(r=this.player)||void 0===r?void 0:r.beforeLoadStartCostTime)||0);this.emitLog(_x,{fvt:this.fvt,costTime:u,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime,buffer:s,startBuffer:a,endType:e})}}},{key:"_updateBuffer",value:function(){var e=this.player,t=e.buffered,n=e.currentTime,i=Hw.getBufferByCurrentTime(t,n);Bw.logInfo(Ox,"_updateBuffer",i);var r=this.levelInfo;r.buffer=1e3*i.end,r.diff=1e3*i.diff}},{key:"_getSeekInfo",value:function(){var e=this.seekData;return{interval:e.interval,timeBefore:e.timeBefore,timeAfter:e.timeAfter,inBuffer:e.inBuffer,diffStart:e.diffStart}}},{key:"_startWaitTimeout",value:function(){this._waittTimer&&Hw.clearTimeout(this,this._waittTimer),this._waittTimer=Hw.setTimeout(this,this._onWaitingTimeout,this.config.waitTimeout)}},{key:"endState",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=i-n,o=!(i>0&&n>0&&r<1);Bw.logInfo(Ox,"endState:".concat(e," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(e,o),this.suspendSeekingStatus(e,o)}},{key:"suspendSeekingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.seekData;if(n.startTime){var i=bx(),r=i-n.startTime,o=this.player,s=o.buffered,a=o.currentTime,c=Hw.getBufferByCurrentTime(s,a);Bw.logInfo(Ox,"suspendSeekingStatus",a,r),n.lastTime=n.startTime,n.startTime=0;var u=t?Px:Rx,l=this._getSeekInfo();this.emitLog(u,mx(mx({end:i,costTime:r,endType:e},l),{},{diffEnd:1e3*c.diff}))}}},{key:"suspendWaitingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._waitTimer&&(Hw.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Hw.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var n=this.waitData,i=bx(),r=i-this.waitingStart,o=i-this.fixedWaitingStart,s=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var a=this.player,c=a.buffered,u=a.currentTime,l=Hw.getBufferByCurrentTime(c,u),f=t?Sx:Ex;this.emitLog(f,{fixedCostTime:o>s?s:o,costTime:r>s?s:r,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e,diffStart:n.diffStart,diffEnd:1e3*l.diff,interval:n.interval})}}},{key:"emitLog",value:function(e,t){var n=this.player,i=n.video,r=i.readyState,o=i.networkState;this.emit(LC,mx({t:bx(),host:Hw.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:n.currentTime,readyState:r,networkState:o},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(M_);function Lx(){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}function Ax(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Dx=function(e){jo(n,e);var t=Ax(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{replay:Lx}}},{key:"afterCreate",value:function(){var e=this;M_.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Yw,(function(){if(e.playerConfig.loop||Hw.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(zw,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Hw.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n}(M_),Mx=Dx;function Nx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Fx=function(e){jo(n,e);var t=Nx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){Hw.addClass(this.root,"hide")}},{key:"show",value:function(){Hw.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(Yw,(function(){e.isEndedShow&&Hw.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(Zw,(function(){e.onTimeUpdate()})),this.on(yC,(function(){Hw.removeClass(e.root,"hide"),Hw.addClass(e.root,"xg-showplay"),e.once(Zw,(function(){e.onTimeUpdate()}))}))):this.on(zw,(function(){Hw.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?Hw.removeClass(this.root,"xg-showplay"):this.once(Zw,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(M_),Bx=Fx;function jx(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Hx(){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}function Ux(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Vx={};var Gx=function(e){jo(n,e);var t=Ux(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),Hw.removeClass(i.root,e),i.show()})),Go(Ho(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";Hw.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i._lastState="",i}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(lC,(function(){n&&(n.lang&&"en"===n.lang?Hw.addClass(t.root,"lang-is-en"):"jp"===n.lang&&Hw.addClass(t.root,"lang-is-jp"))})),this.on(hC,this.onAutoplayStart),n.autoplay||this.show(),this.on(dC,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Hw.removeClass(e.root,t),e.show()})),this.on(zw,(function(){e.onPlayPause("play")})),this.on(Xw,(function(){e.onPlayPause("pause")})),this.on(kC,(function(){e.onPlayPause(t.paused?"pause":"play")})),this.on(DC,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:jx,class:"xg-icon-play"},startPause:{icon:Hx,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(){Hw.addClass(this.root,"hide")}},{key:"show",value:function(){Hw.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Hw.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Hw.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;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};Vx[e]&&window.clearTimeout(Vx[e].id),Vx[e]={},n.start&&n.start(),Vx[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Vx[e].id),delete Vx[e]}),t)}("pauseplay",400,{start:function(){Hw.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Hw.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart&&("pause"!==e||this._lastState!==e&&!n.isBufferControlPaused)){if(this._lastState=e,"show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(Vx).map((function(e){window.clearTimeout(Vx[e].id),delete Vx[e]}))}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(M_),Wx=Gx;function zx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Kx=function(e){jo(n,e);var t=zx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=Hw.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(M_),Yx=Kx;function Xx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var qx=function(e){jo(n,e);var t=Xx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:10}}}]),n}(M_),$x=qx;function Jx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function Zx(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var Qx=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],eS=Qx.length;function tS(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Ao(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<eS;t++)e[Qx[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<eS;r++){var o=Qx[r],s=t[o],a=parseFloat(s);n[o]=Number.isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,v=Zx(t.width);!1!==v&&(n.width=v+(p?0:c+h));var g=Zx(t.height);return!1!==g&&(n.height=g+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function nS(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var iS="dragStart",rS="dragMove",oS="dragEnded",sS={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},aS=function(e){jo(n,e);var t=Jx(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fo(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):Uo(i)}return No(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),sS[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=sS[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=nS(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=nS(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=nS(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=tS(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(iS,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(oS)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),s=o.x,a=o.y;s=this.checkContain("x",s,i),a=this.checkContain("y",a,r),this.position.x=i+s,this.position.y=r+a,this.dragPoint.x=s,this.dragPoint.y=a,this.emit(rS,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=tS(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(_y);function cS(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var uS=function(e){jo(n,e);var t=cS(n);function n(e){var i;Fo(this,n),Go(Ho(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Go(Ho(i),"onCenterClick",(function(e){var t=Ho(i).player;t.paused?t.play():t.pause()})),Go(Ho(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(Hw.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=Ho(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Xw,(function(){e.setAttr("data-state","pause")})),this.on(zw,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin($x,n,$x.pluginName)}var i=Hw.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new aS(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:jx,class:"xg-icon-play"},pause:{icon:Hx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},Hw.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(_C,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;Hw.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(_C,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Hw.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 <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(M_);function lS(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var fS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},hS=["videoClick","videoDbClick"],dS=function(e){jo(n,e);var t=lS(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Ho(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Go(Ho(e),"onMouseEnter",(function(t){var n=Ho(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Go(Ho(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Go(Ho(e),"onVideoClick",(function(t){var n=Ho(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.video&&t.target!==i.innerContainer&&t.target!==i.video.__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--,m_(Ho(e),hS[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Go(Ho(e),"onVideoDblClick",(function(t){var n=Ho(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),m_(Ho(e),hS[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,hS.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===zC.device&&!zC.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(fS).map((function(t){i.addEventListener(t,e[fS[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(fS).map((function(t){i.removeEventListener(t,e[fS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(C_),pS=di,vS=Ko,gS=_,yS=RangeError,mS=function(e){var t=vS(gS(this)),n="",i=pS(e);if(i<0||i==1/0)throw yS("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},kS=lr,bS=k,wS=di,CS=ev,_S=mS,xS=d,SS=RangeError,TS=String,PS=Math.floor,ES=bS(_S),RS=bS("".slice),OS=bS(1..toFixed),IS=function(e,t,n){return 0===t?n:t%2==1?IS(e,t-1,n*e):IS(e*e,t/2,n)},LS=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=PS(r/1e7)},AS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=PS(i/t),i=i%t*1e7},DS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=TS(e[t]);n=""===n?i:n+ES("0",7-i.length)+i}return n};kS({target:"Number",proto:!0,forced:xS((function(){return"0.000"!==OS(8e-5,3)||"1"!==OS(.9,0)||"1.25"!==OS(1.255,2)||"1000000000000000128"!==OS(0xde0b6b3a7640080,0)}))||!xS((function(){OS({})}))},{toFixed:function(e){var t,n,i,r,o=CS(this),s=wS(e),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw SS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return TS(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*IS(2,69,1))-69)<0?o*IS(2,-t,1):o/IS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(LS(a,0,n),i=s;i>=7;)LS(a,1e7,0),i-=7;for(LS(a,IS(10,i,1),0),i=t-1;i>=23;)AS(a,1<<23),i-=23;AS(a,1<<i),LS(a,1,1),AS(a,2),u=DS(a)}else LS(a,0,n),LS(a,1<<-t,0),u=DS(a)+ES("0",s);return u=s>0?c+((r=u.length)<=s?"0."+ES("0",s-r)+u:RS(u,0,r-s)+"."+RS(u,r-s)):c+u}});var MS="press",NS="pressend",FS="doubleclick",BS="click",jS="touchmove",HS="touchstart",US="touchend",VS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},GS={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function WS(e){return e&&e.length>0?e[e.length-1]:null}function zS(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var KS=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Fo(this,e),Go(this,"onTouchStart",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&zS(e);var r=WS(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,n.__setPress(e),i.addEventListener(n.events.end,n.onTouchEnd),i.addEventListener(n.events.cancel,n.onTouchCancel),i.addEventListener(n.events.move,n.onTouchMove),n.trigger(HS,e)})),Go(this,"onTouchCancel",(function(e){n.onTouchEnd(e)})),Go(this,"onTouchEnd",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&zS(e),n.__clearPress(),i.removeEventListener(n.events.cancel,n.onTouchCancel),i.removeEventListener(n.events.end,n.onTouchEnd),i.removeEventListener(n.events.move,n.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&n.trigger(NS,e),n.trigger(US,e),!t.press&&!t.moving&&n.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Go(this,"onTouchMove",(function(e){var t=n._pos,i=n.config,r=WS(e.touches),o=r?parseInt(r.pageX,10):e.pageX,s=r?parseInt(r.pageY,10):e.pageX,a=o-t.x,c=s-t.y;Math.abs(c)<i.miniStep&&Math.abs(a)<i.miniStep||(n.__clearPress(),t.press&&n.trigger(NS,e),t.press=!1,t.moving=!0,n.trigger(jS,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?GS:VS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return No(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(MS,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(FS,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(BS,e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}(),YS=KS;function XS(){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}function qS(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var $S="auto",JS="seeking",ZS="playbackrate",QS=["videoClick","videoDbClick"],eT=function(e){jo(n,e);var t=qS(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onTouchStart",(function(e){var t=Ho(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=i.getTouche(e);if(a&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,Hw.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=Hw.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height);var u=parseInt(a.pageX-o.left,10),l=parseInt(a.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,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}})),Go(Ho(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Ho(i),r=n.pos,o=n.config,s=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var a=o.miniMoveStep,c=o.hideControlsActive,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===s.rotateDeg?l:u,h=90===s.rotateDeg?u:l;if(Math.abs(f-r.x)>a||Math.abs(h-r.y)>a){var d=f-r.x,p=h-r.y,v=r.scope;if(-1===v&&(0===(v=i.checkScope(f,h,d,p,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,v,r.width,r.height),r.x=f,r.y=h}}})),Go(Ho(i),"onTouchEnd",(function(e){var t=Ho(i),n=t.player,r=t.pos,o=t.playerConfig;r.isStart&&(r.scope>-1&&e.cancelable&&e.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),Hw.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction($S))})),Go(Ho(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Go(Ho(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.recoverAutoHide()}})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return No(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:XS,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;QS.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),Hw.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Hw.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new YS(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(tC,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([eC,Yw],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).forEach((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var s=i.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),s.addCallBack("dragend",(function(){e.changeAction($S)})),s.addCallBack("click",(function(){e.changeAction($S)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&Hw.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,r){var o=r.width,s=-1;if(e<0||e>o)return s;var a=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&a>=1.73&&e>r.scopeM1&&e<r.scopeM2?s=0:(0===Math.abs(n)||a<=.57)&&(s=e<r.scopeL?1:e>r.scopeR?2:3),s}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:zC.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction($S)}},{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:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;m_(this,QS[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;m_(this,QS[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(ZS))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction($S))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),n.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(JS);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Hw.format(this.duration),this.find(".xg-cur").innerHTML=Hw.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Hw.removeClass(this.find(".xg-seek-show"),"xg-back"):Hw.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.hasStart)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(M_),tT=eT;function nT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function iT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function oT(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}lr({target:"String",proto:!0},{repeat:mS});var sT=function(e){jo(n,e);var t=rT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n=t||window.event,i=n.keyCode,r=Ho(e),o=r._keyState,s=r.player,a=e.config,c=a.disable,u=a.disableBodyTrigger,l=a.isIgnoreUserActive;c||u||!s.isUserActive&&!l||oT(n.target)||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((n.target===document.body||e.config.isGlobalTrigger&&!oT(n.target))&&e.checkCode(i,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(n))}})),Go(Ho(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Go(Ho(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=Ho(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Go(Ho(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return No(n,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,s={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:s}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.fullscreen,i=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]];if(o){var s=o.action,a=o.keyCode,c=o.disable,u=o.pressAction,l=o.disablePress;if(a===e){if(!(c||n&&l)){var f=n&&u||s;"function"==typeof f?s(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(IC,iT({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(C_),aT=sT;function cT(){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}function uT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var lT=function(e){jo(n,e);var t=uT(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{loadingIcon:cT}}},{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:O_.ROOT}}}]),n}(M_),fT=lT,hT=lr,dT=$s.findIndex,pT=Wv,vT="findIndex",gT=!0;vT in[]&&Array(1)[vT]((function(){gT=!1})),hT({target:"Array",proto:!0,forced:gT},{findIndex:function(e){return dT(this,e,arguments.length>1?arguments[1]:void 0)}}),pT(vT);var yT=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],mT=function(){function e(t){Fo(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 No(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,s=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var a=i[r],c=0===s?0:(s-a.start)/a.duration;n[r][e].style.width=c<0?0:"".concat(100*c,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==Hw.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Hw.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Hw.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++)Hw.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Hw.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=Hw.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=Hw.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),yT.forEach((function(t){o.appendChild(Hw.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}();function kT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var CT={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},_T=function(e){jo(n,e);var t=wT(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Ho(i),r=n.pos,o=n.config,s=n.player,a=t;if(e){Hw.event(e);var c=Hw.getEventPos(e,s.zoom),u=90===s.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,a=i.computeTime(e,u)}i.triggerCallbacks("dragmove",a,e),i._updateInnerFocus(a)})),Go(Ho(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Go(Ho(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Go(Ho(i),"_mouseUpHandler",(function(e,t){Ho(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Go(Ho(i),"_mouseMoveHandler",(function(e,t){var n=Ho(i),r=n._state,o=n.pos,s=n.config,a=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,s.isPauseMoving&&a.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Go(Ho(i),"onMouseDown",(function(e){var t=Ho(i),n=t._state,r=t.player,o=t.pos,s=t.config,a=t.playerConfig,c=Hw.getEventPos(e,r.zoom),u=90===r.rotateDeg?c.clientY:c.clientX;if(!(r.isMini||s.closeMoveSeek||!a.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),Hw.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),Hw.checkIsFunction(s.onMoveStart)&&s.onMoveStart(),Hw.event(e),o.x=u,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,Hw.addClass(i.progressBtn,"active");var l=i.computeTime(e,u);return l.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,l),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp),i.root.addEventListener("touchcancel",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Go(Ho(i),"onMouseUp",(function(e){var t=Ho(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;e.stopPropagation(),e.preventDefault(),Hw.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),Hw.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Hw.event(e),Hw.removeClass(i.progressBtn,"active");var c=i.computeTime(e,o.x);c.prePlayTime=a.prePlayTime,o.moving?(i.triggerCallbacks("dragend",c,e),i.emitUserAction("drag","dragend",c)):(i.triggerCallbacks("click",c,e),i.emitUserAction("click","click",c)),i._mouseUpHandlerHook(e,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.prePlayTime=0,a.time=0;var u=e.type;"touchend"===u||"touchcancel"===u?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.root.removeEventListener("touchcancel",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),Hw.setTimeout(Ho(i),(function(){i.resetSeekState()}),10),n.focus()})),Go(Ho(i),"onMouseMove",(function(e){var t=Ho(i),n=t._state,r=t.pos,o=t.player,s=t.config;Hw.checkTouchSupport()&&e.preventDefault(),Hw.event(e);var a=Hw.getEventPos(e,o.zoom),c=90===o.rotateDeg?a.clientY:a.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<s.miniMoveStep||!r.moving&&u<s.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Go(Ho(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Go(Ho(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Go(Ho(i),"onMouseEnter",(function(e){var t=Ho(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),Hw.event(e);var o=Hw.getEventPos(e,n.zoom),s=90===n.rotateDeg?o.clientY:o.clientX,a=i.computeTime(e,s);i.triggerCallbacks("mouseenter",a,e),i.focus()}})),Go(Ho(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),Go(Ho(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return No(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=bT(bT({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new mT(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===zC.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(tC,(function(){e.onMouseLeave()})),this.on(Zw,(function(){e.onTimeupdate()})),this.on(Jw,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(oC,(function(){e.onCacheUpdate()})),this.on(Yw,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(aC,(function(){e.onReset()})),this.on(TC,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Ao(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),e)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",Hw.stopPropagation),t.center&&t.center.addEventListener("touchend",Hw.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Hw.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Hw.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=a,i=c):(n=s,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!(t.isSeeking&&t.video.seeking||this.isProgressMoving)&&t.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=Hw.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var s=this.player.plugins.miniprogress;s&&s.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=Hw.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",Hw.stopPropagation),t.center&&t.center.removeEventListener("touchend",Hw.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!1))}},{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:O_.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:CT.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return CT}}]),n}(M_),xT=_T;function ST(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var TT=function(e){jo(n,e);var t=ST(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Ho(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return No(n,[{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)}}]),n}(M_);function PT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var ET=function(e){jo(n,e);var t=PT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){var n=Ho(e),i=n.player;if(!n.config.disable)return t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this);var t=this.player;this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([Xw,aC,zw],(function(){e.animate(t.paused)})),this.on(kC,(function(){e.animate(t.paused)})),this.animate(this.player.paused)}},{key:"registerIcons",value:function(){return{play:{icon:jx,class:"xg-icon-play"},pause:{icon:Hx,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){var t=this.i18nKeys,n=this.player;e&&n.isBufferControlPaused||(e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS)))}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(TT),RT=ET;function OT(){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}function IT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var LT=function(e){jo(n,e);var t=IT(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:OT,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Hw.addClass(this.root,"show")}},{key:"hide",value:function(){Hw.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:O_.ROOT_TOP,index:0}}}]),n}(M_);function AT(){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 DT(){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}function MT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var NT=function(e){jo(n,e);var t=MT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Hw.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.config.disable||e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(wC,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:LT,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===zC.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:AT,class:"xg-get-fullscreen"},exitFullscreen:{icon:DT,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===zC.device?"touchend":"click",this.handleFullscreen),"mobile"===zC.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:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?X_.INNER_FULLSCREEN:X_.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,X_.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(wC,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?X_.INNER_FULLSCREEN:X_.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,X_.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(wC,!1)}},{key:"changeFullScreen",value:function(e){var t=this.player,n=this.config;if(!n.disable){e&&(e.preventDefault(),e.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(wC,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(wC,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(){}))}}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){au(Vo(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){au(Vo(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(TT);function FT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var BT=function(e){jo(n,e);var t=FT(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).isActiving=!1,i}return No(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on([tC,Jw,Zw],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(Yw,(function(){e.onTimeUpdate(!0)})),this.on(aC,(function(){e.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&au(Vo(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(!n.disable&&!this.isActiving&&t.hasStart){var r=t.currentTime+this.timeOffset;r=Hw.adjustTimeByDuration(r,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=Hw.format(r),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=Hw.format(i))):(this.timeDom.innerHTML=Hw.format(r),i!==1/0&&i>0&&(this.durationDom.innerHTML=Hw.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=Hw.format(0),this.centerDurDom.innerHTML=Hw.format(0)):(this.timeDom.innerHTML=Hw.format(0),this.durationDom.innerHTML=Hw.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Hw.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=Hw.createDom("xg-icon","00:00",{},"xgplayer-time right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Hw.hide(this.durationDom),Hw.hide(this.timeDom),Hw.hide(this.find(".time-separator")),Hw.show(this.find(".time-live-tag"))):Hw.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Hw.hide(this.durationDom),Hw.hide(this.timeDom),Hw.hide(this.find(".time-separator")),Hw.show(this.find(".time-live-tag"))):(Hw.hide(this.find(".time-live-tag")),Hw.show(this.find(".time-separator")),Hw.show(this.durationDom),Hw.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=Hw.format(e):this.centerCurDom.innerHTML=Hw.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(Jw,n),t.isSeeking&&t.video.seeking?this.once(Jw,n):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(M_);function jT(){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 HT(){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 UT(){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}function VT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var GT=function(e){jo(n,e);var t=VT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Ho(e).player,i=e.find(".xgplayer-bar");Hw.event(t);var r=i.getBoundingClientRect(),o=Hw.getEventPos(t,n.zoom),s=r.height-(o.clientY-r.top);if(o.h=s,o.barH=r.height,e.pos=o,!(s<-2))return e.updateVolumePos(s,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Go(Ho(e),"onBarMouseMove",(function(t){var n=Ho(e)._d;if(n.isStart){var i=Ho(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),Hw.event(t);var s=Hw.getEventPos(t,o.zoom);n.isMoving=!0;var a=r.h-s.clientY+r.clientY;a>r.barH||e.updateVolumePos(a,t)}})),Go(Ho(e),"onBarMouseUp",(function(t){Hw.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Ho(e)._d;n.isStart=!1,n.isMoving=!1})),Go(Ho(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Ho(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Go(Ho(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return No(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:HT,class:"xg-volume-small"},volumeLarge:{icon:jT,class:"xg-volume"},volumeMuted:{icon:UT,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==zC.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(nC,this.onVolumeChange),this.once(iC,this.onVolumeChange),"Number"!==Hw.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=Math.max(Math.min(e/r.getBoundingClientRect().height,1),0),s=parseInt(1e3*o,10),a=s/1e3,c={volume:{from:n.volume,to:a}};i.style.height="".concat(100*o,"%"),n.muted&&(c.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:c}),n.volume=Math.max(Math.min(s/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.round(100*r)}},{key:"focus",value:function(){var e=this.player;this.config.disable||(e.focus({autoHide:!1}),this._timerId&&(Hw.clearTimeout(this,this._timerId),this._timerId=null),Hw.addClass(this.root,"slide-show"))}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Hw.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Hw.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),Hw.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){if(!this.config.disable){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&&(Hw.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"===zC.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){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:O_.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(M_),WT=GT;function zT(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}function KT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var YT=function(e){jo(n,e);var t=KT(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onBtnClick",(function(e){i.config.disable||(e.preventDefault(),e.stopPropagation(),i.emitUserAction(e,"rotate"),i.rotate(i.config.clockwise,i.config.innerRotate,1))})),i.rotateDeg=i.config.rotateDeg||0,i}return No(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){au(Vo(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(TC,(function(){e.rotateDeg&&e.config.innerRotate&&Hw.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(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"updateRotateDeg",value:function(e,t){e||(e=0);var n=this.player,i=this.rootWidth,r=this.rootHeight;if(t)n.videoRotateDeg=e;else{var o=this.player,s=o.root,a=o.innerContainer,c=o.video,u=s.offsetWidth,l=a&&t?a.offsetHeight:s.offsetHeight,f=i,h=r,d=0,p=0;.75!==e&&.25!==e||(f="".concat(l,"px"),h="".concat(u,"px"),d=-(l-u)/2,p=-(u-l)/2);var v="translate(".concat(d,"px,").concat(p,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:v,webKitTransform:v,height:h,width:f},y=t?c:s,m=t?n.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],m&&m.root&&(m.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(EC,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:zT}}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(TT);function XT(){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 qT(){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}function $T(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var JT="picture-in-picture",ZT="inline",QT="fullscreen",eP=function(e){jo(n,e);var t=$T(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable()||e.config.disable)return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(au(Vo(n.prototype),"afterCreate",this).call(this),this.pMode=ZT,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(pC,(function(){e.config.showIcon&&(Hw.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:XT,class:"xg-get-pip"},pipIconExit:{icon:qT,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var n=t.paused;Hw.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(PC,!1)},this.enterPIPCallback=function(n){t.emit(PC,!0),null!=n&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===QT&&i!==QT&&t.onFullscreenChange(null,!1),e.pMode=i,i===JT?e.enterPIPCallback(n):i===ZT&&e.leavePIPCallback(n)},t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=Ty(document.styleSheets).map((function(t){try{return Ty(t.cssRules).map((function(e){return e.cssText})).join("")}catch(i){var n=document.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media,n.href=t.href,e.document.head.appendChild(n)}return""})).filter(Boolean).join("\n"),n=document.createElement("style");n.textContent=t,e.document.head.appendChild(n)}},{key:"requestPIP",value:function(){var e=this,t=this.player,i=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=i.poster;if(o&&(t.video.poster="String"===Hw.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var s={};if(r.width&&r.height)s.width=r.width,s.height=r.height;else{var a=t.root.getBoundingClientRect();s.width=a.width,s.height=a.height}documentPictureInPicture.requestWindow(s).then((function(n){var i=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var s=i||t.root,a=s.parentElement,c=s.previousSibling,u=s.nextSibling;e.copyStyleIntoPiPWindow(n);var l=document.createElement("style");if(l.append("body{padding:0; margin:0;}"),o){var f="";"string"==typeof o?f=o:"function"==typeof o&&(f=o.call(r)),f&&l.append(f)}else s===t.root&&l.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");n.document.head.append(l),n.document.body.append(s),n.addEventListener("pagehide",(function(t){a&&(u?a.insertBefore(s,u):c?a.insertBefore(s,c.nextSibling):a.appendChild(s)),e.leavePIPCallback()}),{once:!0})}))}else n.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("picture-in-picture"):t.video.requestPictureInPicture();return!0}catch(e){return console.error("requestPiP",e),!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():n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(e){return console.error("exitPIP",e),!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.video||t.video.webkitPresentationMode===JT}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==Hw.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===Hw.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Hw.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this);var e=this.player;e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:O_.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}}]),n}(TT),tP=eP;function nP(){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}function iP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var rP=function(e){jo(n,e);var t=iP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"playNext",(function(e){var t=Ho(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(OC,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(OC))})),i.idx=-1,i}return No(n,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:nP}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===zC.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.autoplay=!0,t.src=e)}},{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 <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(M_),oP={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=s.Blob||s.MozBlob||s.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var g=0,y=new Uint8Array(u.length),m=y.length;g<m;++g)y[g]=u.charCodeAt(g);u=new d([y],{type:c})}function k(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,s=new Uint8Array(r);o<r;++o)s[o]=i.charCodeAt(o);return new d([s],{type:n})}function b(e,t){if("download"in f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){s.URL.revokeObjectURL(f.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=u instanceof d?u:new d([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(s.URL)b(s.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===h)try{return b("data:"+c+";base64,"+s.btoa(r))}catch(e){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}}(oP);var sP=oP.exports;function aP(){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}function cP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var uP=function(e){jo(n,e);var t=cP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"download",(function(e){if(!i.isLock&&!i.config.disable){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);sP(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return No(n,[{key:"afterCreate",value:function(){au(Vo(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:aP}}},{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(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(TT);function lP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var fP=function(e){jo(n,e);var t=lP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){au(Vo(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(TC,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvans",value:function(e,t){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(RC,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,s=i.quality||r.quality,a=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvans(e,t),n.canvasCtx.drawImage(o.video,0,0,e||r.width,t||r.height);var u=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(TC,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:O_.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(TT),hP=function(){function e(t){Fo(this,e),this.config=t.config,this.parent=t.root,this.root=Hw.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touche"===this.config.domEventType?"touchend":"click";this._delegates=M_.delegate.call(this,this.root,"li",n,this.onItemClick)}return No(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(Hw.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Hw.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");Hw.addClass(t,"selected"),i&&Hw.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){Hw.removeClass(this.root,"hide"),Hw.addClass(this.root,"active")}},{key:"hide",value:function(){Hw.removeClass(this.root,"active"),Hw.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function dP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var pP="mobile"===zC.device,vP=function(e){jo(n,e);var t=dP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!0)})),Go(Ho(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return No(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),pP=pP||"touch"===this.domEventType,"mobile"===zC.device&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&Hw.addClass(this.root,"portrait"),this.once(eC,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),pP&&this.on(cC,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=pP?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",Hw.createDom("span","",{},"icon-text")),Hw.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||Hw.addClass(this.root,"show")}},{key:"hide",value:function(){Hw.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||Hw.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Ao(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?t.focus():t.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,r=n.list;(pP||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var s={config:{data:e||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(e,t){n.onItemClick(e,t)},domEventType:pP?"touche":"mouse"},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new hP(s),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),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:O_.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(M_);function gP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var yP=function(e){jo(n,e);var t=gP(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return No(n,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(xC,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,s=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!Hw.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));au(Vo(n.prototype),"renderItemList",this).call(this,s,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;au(Vo(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(vP);function mP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var kP=function(e){jo(n,e);var t=mP(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curRate=1,i}return No(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this),this.on(rC,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&au(Vo(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){au(Vo(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=0,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));au(Vo(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(vP);function bP(){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 wP(){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}function CP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var _P=function(e){jo(n,e);var t=CP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(CC,(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){if(!this.config.disable){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;this.changeLangTextKey(this.find(".xg-tips"),e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:bP,class:"xg-get-cssfull"},exitCssFullscreen:{icon:wP,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(TT);function xP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var SP=function(e){jo(n,e);var t=xP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(eC,(function(){e.handleCanPlay()})),this.on(qw,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){Hw.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),n}(M_);function TP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var PP=function(e){jo(n,e);var t=TP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),n.style&&this.setStyle(n.style),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),"arrow"===n.mode&&Hw.addClass(this.root,"arrow"),n.preventScreenOverflow){var o=this.root.getBoundingClientRect(),s=o.left,a=o.right,c=document.documentElement.clientWidth||document.body.clientWidth;if(s<0){var u=Number((Math.abs(s)/c*100).toFixed(2));if(n.style.left){var l=parseInt(n.style.left);this.setStyle({left:"".concat(l+u+.5,"%")})}}if(a>=c){var f=Number(((Math.abs(a)-c)/c*100).toFixed(2));if(n.style.left){var h=parseInt(n.style.left);this.setStyle({left:"".concat(h-f-.5,"%")})}}}if(Hw.addClass(this.root,"show"),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var d=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),d)}}}},{key:"hide",value:function(){Hw.removeClass(this.root,"show"),Hw.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(X_.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,preventScreenOverflow:!1,detail:{text:"",highlight:""},onClick:function(){}}}}]),n}(M_),EP=PP,RP={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function OP(e){Object.keys(RP).map((function(t){void 0===e[t]&&(e[t]=RP[t])}))}var IP={initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this._ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player.plugins.progress;if(n&&(t&&(OP(e),this._ispots.push(e)),this._ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),r=e.style||{},o=e.stylePreferred;r.left=o&&void 0!==r.left?r.left:"".concat(i.left,"%"),r.width=o&&void 0!==r.width?r.width:"".concat(i.width,"%");var s="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(s+=" mini");var a=Hw.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},s);Object.keys(r).map((function(e){a.style[e]=r[e]})),n.outer&&n.outer.appendChild(a)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this._ispotsInit){var r=n.find('xg-spot[data-id="'.concat(e.id,'"]'));if(r){var o=this.calcuPosition(e.time,e.duration),s=e.style||{};s.left="".concat(o.left,"%"),s.width="".concat(o.width,"%"),r.setAttribute("data-text",e.text),r.setAttribute("data-time",e.time),o.isMini?Hw.addClass(r,"mini"):Hw.removeClass(r,"mini"),Object.keys(s).map((function(e){r.style[e]=s[e]})),t&&this.showDot(e.id)}}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this._ispotsInit){var s=n.find('xg-spot[data-id="'.concat(e,'"]'));s&&s.parentElement.removeChild(s)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this._ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this._ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.map((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},updateAllDotsStyles:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.player.plugins.progress;if(null!=n&&n.root)for(var i,r=n.root.getElementsByTagName("xg-spot"),o=function(n){var o=(n=r[s]).getAttribute("data-id"),a=e.findDot(o);if(a&&a.activeStyle&&a.style&&a.stylePreferred){var c=t?null==a?void 0:a.activeStyle:null==a?void 0:a.style;c&&Object.keys(c).map((function(e){n.style[e]=c[e]}))}i=n},s=0;s<r.length;s++)o(i)},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};function LP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var AP={dragmove:"onProgressDragMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseEnter",mouseleave:"onProgressMouseLeave"},DP=function(e){jo(n,e);var t=LP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(Hw.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||Hw.hasClass(e.target,"xg-spot-content"))&&(Hw.event(e),e.stopPropagation()))})),Go(Ho(i),"onMousedown",(function(e){i.config.disable||(i._state.f||Hw.hasClass(e.target,"xg-spot-content"))&&(Hw.event(e),e.stopPropagation())})),Go(Ho(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Go(Ho(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Go(Ho(i),"onProgressMouseLeave",(function(e,t){i.updateAllDotsStyles(!1)})),Go(Ho(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&Hw.hasClass(t.target,"xgplayer-spot")&&!i._curDot){i._curDot=t.target,i.focusDot(t.target),i._curDot.children.length>0&&i.hide();var n=i.player.plugins.progress;n&&n.disableBlur(),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave)}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i._state={now:0,f:!1},i}return No(n,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(IP).map((function(t){e[t]=IP[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return OP(e),e})),e._ispotsInit=!1,n.once(tC,(function(){e.initDots()}))}(this),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(AP).map((function(n){e[AP[n]]=e[AP[n]].bind(e),t.addCallBack(n,e[AP[n]])})),"mobile"!==zC.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMouseEnter",value:function(e,t){this.onProgressMove(e,t),this.updateAllDotsStyles(!0)}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.onProgressMove(e,t)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Hw.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Hw.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&Hw.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n=this.root,i=this.previewLine,r=this.timePoint,o=this.player,s=this.config,a="flex"===o.controls.mode,c=n.getBoundingClientRect().width;if(c||!this._hasThumnail){var u,l,f=r.getBoundingClientRect().width,h=e-(c=this._hasThumnail&&c<s.width?s.width:c)/2;h<0&&!a?(h=0,u=e-c/2,!this.thumbnail&&(l=e-c/2-f/2)):h>t-c&&!a?(u=h-(t-c),!this.thumbnail&&(l=h-(t-c)-f/2),h=t-c):(u=0,!this.thumbnail&&(l=-f/2)),void 0!==u&&(i.style.transform="translateX(".concat(u.toFixed(2),"px)")),void 0!==l&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,s=this._state;if(r){this.updateLinePos(e,t),s.now=n;var a=Hw.format(n);i&&i.target&&Hw.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,a),this.focusDot(i.target),s.f=!0,o.isFocusDots&&s.f&&(s.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(s.f=!1,this.showTips(o.defaultText,!0,a)):(s.f=!1,this.hideTips("")),this.updateTimeText(a),this.updateThumbnails(s.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==zC.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){Hw.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&Hw.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=Hw.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Hw.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player,r=n.root.getBoundingClientRect().width,o=i.duration/r*6;return e+t>i.duration&&(t=i.duration-e),i.duration,i.duration,{left:e/i.duration*100,width:t/i.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Hw.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Hw.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Hw.addClass(this.root,"no-timepoint"),e&&(Hw.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Hw.addClass(this.root,"product"),this.tipText.textContent=e):(Hw.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){Hw.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Hw.removeClass(this.find(".xg-spot-content"),"show-text"),Hw.removeClass(this.root,"product")}},{key:"hide",value:function(){Hw.addClass(this.root,"hide")}},{key:"show",value:function(){Hw.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(AP).map((function(n){t.removeCallBack(n,e[AP[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===zC.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n}(M_);function MP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var NP=function(e){jo(n,e);var t=MP(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return No(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([tC],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,Hw.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,s=i.col,a=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*s?0:Math.ceil(u/(o*s))-1,f=u-l*(s*o),h=f>0?Math.ceil(f/s)-1:0,d=f>0?f-h*s-1:0,p=0,v=0;t&&n?t/n<a/c?p=(v=n)*(a/c):v=(p=t)/(a/c):n?t||(p=(v=n||c)*(a/c)):v=(p=t||a)/(a/c);var g=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:g,height:v,width:p,style:{backgroundImage:"url(".concat(g,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*v,"px"),width:"".concat(p,"px"),height:"".concat(v,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,s=o.pic_num,a=o.urls;if(!(s<=0)&&a&&0!==a.length){var c=this.getPosition(t,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(t){e.style[t]=c.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=Hw.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(M_);function FP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var BP=function(e){jo(n,e);var t=FP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(M_),jP=BP;function HP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var UP="realtime",VP="firstframe",GP="poster";var WP=null,zP=function(e){jo(n,e);var t=HP(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(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(Zw,e.renderOnTimeupdate),e.on(Zw,e.renderOnTimeupdate))})),Go(Ho(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Go(Ho(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(Zw,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,n)}})),Go(Ho(e),"start",(function(t,n){var i=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),o=e.checkVideoIsSupport(i);o&&e.canvasCtx&&(n||(n=e.interval),e.stop(),i.videoWidth&&i.videoHeight&&(e.videoPI=i.videoHeight>0?parseInt(i.videoWidth/i.videoHeight*100,10):0,(e.config.mode===UP||r-e.preTime>=n)&&(i&&i.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Hw.setTimeout(Ho(e),e.start,n):Hw.requestAnimationFrame(e.start))})),Go(Ho(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Hw.clearTimeout(Ho(e),e.frameId):Hw.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;if(!i){this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==UP&&this.interval>=1e3?"timer":"animation";var s=function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())};this.player.hasStart?s():this.once(pC,s),r!==GP&&(r!==VP&&(this.on(aC,(function(){e.stop()})),this.on(zw,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Xw,(function(){e.stop()}))),this.on(iC,this.onLoadedData),this.on(sC,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange))}}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(n){"root"===n&&e[n]!==t.config[n]?t.reRender(e[n]):"frameRate"===n?t.interval=parseInt(1e3/e[n],10):"disable"===n&&e[n]&&t.stop(),t.config[n]=e[n]}))}},{key:"init",value:function(e){var t=this.player,i=this.config;this.canvasFilter=n.supportCanvasFilter();try{var r=e||i.root;r||(r=i.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(i.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=i.filter,this.canvas.style.webkitFilter=i.filter),this.mask=this.find("xgmask"),i.addMask&&(this.mask.style.background=i.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){Bw.logError("plugin:DynamicBg",e)}}},{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 n=this.config.startInterval;this._checkIfCanStart()&&this.start(0,n)}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"!==zC.browser||!Hw.isMSE(t)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Hw.typeOf(e)?e:"String"===Hw.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!==VP&&e!==GP}},{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 n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,s=r.height;if(o!==n.width||s!==n.height||n.pi!==t){var a=parseInt(o/s*100,10);n.pi=t,n.width!==o&&(n.width=this.canvas.width=o),n.height!==s&&(n.height=this.canvas.height=s);var c=s,u=o;a<t?u=parseInt(s*t/100,10):a>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(s-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Bw.logError("plugin:DynamicBg",e)}}},{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 WP?WP:WP=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===zC.browser||"firefox"===zC.browser)}}]),n}(M_),KP=zP,YP=d,XP=fe,qP=ie("iterator"),$P=!YP((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.size&&!XP||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[qP]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),JP=Se,ZP=Xd,QP=As,eE=Ee,tE=T,nE=function(e,t,n,i){try{return i?t(JP(n)[0],n[1]):t(n)}catch(t){ZP(e,"throw",t)}},iE=Id,rE=Ur,oE=Ci,sE=Jo,aE=Wd,cE=Fd,uE=Array,lE=k,fE=2147483647,hE=/[^\0-\u007E]/,dE=/[.\u3002\uFF0E\uFF61]/g,pE="Overflow: input needs wider integers to process",vE=RangeError,gE=lE(dE.exec),yE=Math.floor,mE=String.fromCharCode,kE=lE("".charCodeAt),bE=lE([].join),wE=lE([].push),CE=lE("".replace),_E=lE("".split),xE=lE("".toLowerCase),SE=function(e){return e+22+75*(e<26)},TE=function(e,t,n){var i=0;for(e=n?yE(e/700):e>>1,e+=yE(e/t);e>455;)e=yE(e/35),i+=36;return yE(i+36*e/(e+38))},PE=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=kE(e,n++);if(r>=55296&&r<=56319&&n<i){var o=kE(e,n++);56320==(64512&o)?wE(t,((1023&r)<<10)+(1023&o)+65536):(wE(t,r),n--)}else wE(t,r)}return t}(e);var n,i,r=e.length,o=128,s=0,a=72;for(n=0;n<e.length;n++)(i=e[n])<128&&wE(t,mE(i));var c=t.length,u=c;for(c&&wE(t,"-");u<r;){var l=fE;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<l&&(l=i);var f=u+1;if(l-o>yE((fE-s)/f))throw vE(pE);for(s+=(l-o)*f,o=l,n=0;n<e.length;n++){if((i=e[n])<o&&++s>fE)throw vE(pE);if(i==o){for(var h=s,d=36;;){var p=d<=a?1:d>=a+26?26:d-a;if(h<p)break;var v=h-p,g=36-p;wE(t,mE(SE(p+v%g))),h=yE(v/g),d+=36}wE(t,mE(SE(h))),a=TE(s,f,u==c),s=0,u++}}s++,o++}return bE(t,"")},EE=Pn,RE=lr,OE=n,IE=Ee,LE=k,AE=fe,DE=$P,ME=Pn,NE=fs,FE=function(e,t,n){for(var i in t)EE(e,i,t[i],n);return e},BE=Ts,jE=vg,HE=on,UE=Ql,VE=ue,GE=R,WE=As,zE=Bn,KE=Se,YE=pe,XE=Ko,qE=mo,$E=Nt,JE=Wd,ZE=Fd,QE=af,eR=cw,tR=ie("iterator"),nR="URLSearchParams",iR=nR+"Iterator",rR=HE.set,oR=HE.getterFor(nR),sR=HE.getterFor(iR),aR=Object.getOwnPropertyDescriptor,cR=function(e){if(!AE)return OE[e];var t=aR(OE,e);return t&&t.value},uR=cR("fetch"),lR=cR("Request"),fR=cR("Headers"),hR=lR&&lR.prototype,dR=fR&&fR.prototype,pR=OE.RegExp,vR=OE.TypeError,gR=OE.decodeURIComponent,yR=OE.encodeURIComponent,mR=LE("".charAt),kR=LE([].join),bR=LE([].push),wR=LE("".replace),CR=LE([].shift),_R=LE([].splice),xR=LE("".split),SR=LE("".slice),TR=/\+/g,PR=Array(4),ER=function(e){return PR[e-1]||(PR[e-1]=pR("((?:%[\\da-f]{2}){"+e+"})","gi"))},RR=function(e){try{return gR(e)}catch(t){return e}},OR=function(e){var t=wR(e,TR," "),n=4;try{return gR(t)}catch(e){for(;n;)t=wR(t,ER(n--),RR);return t}},IR=/[!'()~]|%20/g,LR={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},AR=function(e){return LR[e]},DR=function(e){return wR(yR(e),IR,AR)},MR=jE((function(e,t){rR(this,{type:iR,iterator:JE(oR(e).entries),kind:t})}),"Iterator",(function(){var e=sR(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),NR=function(e){this.entries=[],this.url=null,void 0!==e&&(YE(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===mR(e,0)?SR(e,1):e:XE(e)))};NR.prototype={type:nR,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,s,a,c=ZE(e);if(c)for(n=(t=JE(e,c)).next;!(i=IE(n,t)).done;){if(o=(r=JE(KE(i.value))).next,(s=IE(o,r)).done||(a=IE(o,r)).done||!IE(o,r).done)throw vR("Expected sequence with length 2");bR(this.entries,{key:XE(s.value),value:XE(a.value)})}else for(var u in e)GE(e,u)&&bR(this.entries,{key:u,value:XE(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=xR(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=xR(t,"="),bR(this.entries,{key:OR(CR(n)),value:OR(kR(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],bR(n,DR(e.key)+"="+DR(e.value));return kR(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var FR=function(){UE(this,BR);var e=rR(this,new NR(arguments.length>0?arguments[0]:void 0));AE||(this.length=e.entries.length)},BR=FR.prototype;if(FE(BR,{append:function(e,t){QE(arguments.length,2);var n=oR(this);bR(n.entries,{key:XE(e),value:XE(t)}),AE||this.length++,n.updateURL()},delete:function(e){QE(arguments.length,1);for(var t=oR(this),n=t.entries,i=XE(e),r=0;r<n.length;)n[r].key===i?_R(n,r,1):r++;AE||(this.length=n.length),t.updateURL()},get:function(e){QE(arguments.length,1);for(var t=oR(this).entries,n=XE(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){QE(arguments.length,1);for(var t=oR(this).entries,n=XE(e),i=[],r=0;r<t.length;r++)t[r].key===n&&bR(i,t[r].value);return i},has:function(e){QE(arguments.length,1);for(var t=oR(this).entries,n=XE(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){QE(arguments.length,1);for(var n,i=oR(this),r=i.entries,o=!1,s=XE(e),a=XE(t),c=0;c<r.length;c++)(n=r[c]).key===s&&(o?_R(r,c--,1):(o=!0,n.value=a));o||bR(r,{key:s,value:a}),AE||(this.length=r.length),i.updateURL()},sort:function(){var e=oR(this);eR(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=oR(this).entries,i=WE(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new MR(this,"keys")},values:function(){return new MR(this,"values")},entries:function(){return new MR(this,"entries")}},{enumerable:!0}),ME(BR,tR,BR.entries,{name:"entries"}),ME(BR,"toString",(function(){return oR(this).serialize()}),{enumerable:!0}),AE&&NE(BR,"size",{get:function(){return oR(this).entries.length},configurable:!0,enumerable:!0}),BE(FR,nR),RE({global:!0,constructor:!0,forced:!DE},{URLSearchParams:FR}),!DE&&VE(fR)){var jR=LE(dR.has),HR=LE(dR.set),UR=function(e){if(YE(e)){var t,n=e.body;if(zE(n)===nR)return t=e.headers?new fR(e.headers):new fR,jR(t,"content-type")||HR(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),qE(e,{body:$E(0,XE(n)),headers:$E(0,t)})}return e};if(VE(uR)&&RE({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return uR(e,arguments.length>1?UR(arguments[1]):{})}}),VE(lR)){var VR=function(e){return UE(this,hR),new lR(e,arguments.length>1?UR(arguments[1]):{})};hR.constructor=VR,VR.prototype=hR,RE({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:VR})}}var GR,WR=lr,zR=fe,KR=$P,YR=n,XR=As,qR=k,$R=Pn,JR=fs,ZR=Ql,QR=R,eO=by,tO=function(e){var t=tE(e),n=rE(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=QP(r,i>2?arguments[2]:void 0));var s,a,c,u,l,f,h=cE(t),d=0;if(!h||this===uE&&iE(h))for(s=oE(t),a=n?new this(s):uE(s);s>d;d++)f=o?r(t[d],d):t[d],sE(a,d,f);else for(l=(u=aE(t,h)).next,a=n?new this:[];!(c=eE(l,u)).done;d++)f=o?nE(u,r,[c.value,d],!0):c.value,sE(a,d,f);return a.length=d,a},nO=is,iO=xm.codeAt,rO=function(e){var t,n,i=[],r=_E(CE(xE(e),dE,"."),".");for(t=0;t<r.length;t++)n=r[t],wE(i,gE(hE,n)?"xn--"+PE(n):n);return bE(i,".")},oO=Ko,sO=Ts,aO=af,cO={URLSearchParams:FR,getState:oR},uO=on,lO=uO.set,fO=uO.getterFor("URL"),hO=cO.URLSearchParams,dO=cO.getState,pO=YR.URL,vO=YR.TypeError,gO=YR.parseInt,yO=Math.floor,mO=Math.pow,kO=qR("".charAt),bO=qR(/./.exec),wO=qR([].join),CO=qR(1..toString),_O=qR([].pop),xO=qR([].push),SO=qR("".replace),TO=qR([].shift),PO=qR("".split),EO=qR("".slice),RO=qR("".toLowerCase),OO=qR([].unshift),IO="Invalid scheme",LO="Invalid host",AO="Invalid port",DO=/[a-z]/i,MO=/[\d+-.a-z]/i,NO=/\d/,FO=/^0x/i,BO=/^[0-7]+$/,jO=/^\d+$/,HO=/^[\da-f]+$/i,UO=/[\0\t\n\r #%/:<>?@[\\\]^|]/,VO=/[\0\t\n\r #/:<>?@[\\\]^|]/,GO=/^[\u0000-\u0020]+/,WO=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,zO=/[\t\n\r]/g,KO=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)OO(t,e%256),e=yO(e/256);return wO(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=CO(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},YO={},XO=eO({},YO,{" ":1,'"':1,"<":1,">":1,"`":1}),qO=eO({},XO,{"#":1,"?":1,"{":1,"}":1}),$O=eO({},qO,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),JO=function(e,t){var n=iO(e,0);return n>32&&n<127&&!QR(t,e)?e:encodeURIComponent(e)},ZO={ftp:21,file:null,http:80,https:443,ws:80,wss:443},QO=function(e,t){var n;return 2==e.length&&bO(DO,kO(e,0))&&(":"==(n=kO(e,1))||!t&&"|"==n)},eI=function(e){var t;return e.length>1&&QO(EO(e,0,2))&&(2==e.length||"/"===(t=kO(e,2))||"\\"===t||"?"===t||"#"===t)},tI=function(e){return"."===e||"%2e"===RO(e)},nI={},iI={},rI={},oI={},sI={},aI={},cI={},uI={},lI={},fI={},hI={},dI={},pI={},vI={},gI={},yI={},mI={},kI={},bI={},wI={},CI={},_I=function(e,t,n){var i,r,o,s=oO(e);if(t){if(r=this.parse(s))throw vO(r);this.searchParams=null}else{if(void 0!==n&&(i=new _I(n,!0)),r=this.parse(s,null,i))throw vO(r);(o=dO(new hO)).bindURL(this),this.searchParams=o}};_I.prototype={type:"URL",parse:function(e,t,n){var i,r,o,s,a,c=this,u=t||nI,l=0,f="",h=!1,d=!1,p=!1;for(e=oO(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=SO(e,GO,""),e=SO(e,WO,"$1")),e=SO(e,zO,""),i=tO(e);l<=i.length;){switch(r=i[l],u){case nI:if(!r||!bO(DO,r)){if(t)return IO;u=rI;continue}f+=RO(r),u=iI;break;case iI:if(r&&(bO(MO,r)||"+"==r||"-"==r||"."==r))f+=RO(r);else{if(":"!=r){if(t)return IO;f="",u=rI,l=0;continue}if(t&&(c.isSpecial()!=QR(ZO,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&ZO[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?u=vI:c.isSpecial()&&n&&n.scheme==c.scheme?u=oI:c.isSpecial()?u=uI:"/"==i[l+1]?(u=sI,l++):(c.cannotBeABaseURL=!0,xO(c.path,""),u=bI)}break;case rI:if(!n||n.cannotBeABaseURL&&"#"!=r)return IO;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=nO(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=CI;break}u="file"==n.scheme?vI:aI;continue;case oI:if("/"!=r||"/"!=i[l+1]){u=aI;continue}u=lI,l++;break;case sI:if("/"==r){u=fI;break}u=kI;continue;case aI:if(c.scheme=n.scheme,r==GR)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=cI;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.query="",u=wI;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.path.length--,u=kI;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.query=n.query,c.fragment="",u=CI}break;case cI:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=kI;continue}u=fI}else u=lI;break;case uI:if(u=lI,"/"!=r||"/"!=kO(f,l+1))continue;l++;break;case lI:if("/"!=r&&"\\"!=r){u=fI;continue}break;case fI:if("@"==r){h&&(f="%40"+f),h=!0,o=tO(f);for(var v=0;v<o.length;v++){var g=o[v];if(":"!=g||p){var y=JO(g,$O);p?c.password+=y:c.username+=y}else p=!0}f=""}else if(r==GR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==f)return"Invalid authority";l-=tO(f).length+1,f="",u=hI}else f+=r;break;case hI:case dI:if(t&&"file"==c.scheme){u=yI;continue}if(":"!=r||d){if(r==GR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==f)return LO;if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",u=mI,t)return;continue}"["==r?d=!0:"]"==r&&(d=!1),f+=r}else{if(""==f)return LO;if(s=c.parseHost(f))return s;if(f="",u=pI,t==dI)return}break;case pI:if(!bO(NO,r)){if(r==GR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=f){var m=gO(f,10);if(m>65535)return AO;c.port=c.isSpecial()&&m===ZO[c.scheme]?null:m,f=""}if(t)return;u=mI;continue}return AO}f+=r;break;case vI:if(c.scheme="file","/"==r||"\\"==r)u=gI;else{if(!n||"file"!=n.scheme){u=kI;continue}if(r==GR)c.host=n.host,c.path=nO(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=nO(n.path),c.query="",u=wI;else{if("#"!=r){eI(wO(nO(i,l),""))||(c.host=n.host,c.path=nO(n.path),c.shortenPath()),u=kI;continue}c.host=n.host,c.path=nO(n.path),c.query=n.query,c.fragment="",u=CI}}break;case gI:if("/"==r||"\\"==r){u=yI;break}n&&"file"==n.scheme&&!eI(wO(nO(i,l),""))&&(QO(n.path[0],!0)?xO(c.path,n.path[0]):c.host=n.host),u=kI;continue;case yI:if(r==GR||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&QO(f))u=kI;else if(""==f){if(c.host="",t)return;u=mI}else{if(s=c.parseHost(f))return s;if("localhost"==c.host&&(c.host=""),t)return;f="",u=mI}continue}f+=r;break;case mI:if(c.isSpecial()){if(u=kI,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=GR&&(u=kI,"/"!=r))continue}else c.fragment="",u=CI;else c.query="",u=wI;break;case kI:if(r==GR||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(a=RO(a=f))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||xO(c.path,"")):tI(f)?"/"==r||"\\"==r&&c.isSpecial()||xO(c.path,""):("file"==c.scheme&&!c.path.length&&QO(f)&&(c.host&&(c.host=""),f=kO(f,0)+":"),xO(c.path,f)),f="","file"==c.scheme&&(r==GR||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)TO(c.path);"?"==r?(c.query="",u=wI):"#"==r&&(c.fragment="",u=CI)}else f+=JO(r,qO);break;case bI:"?"==r?(c.query="",u=wI):"#"==r?(c.fragment="",u=CI):r!=GR&&(c.path[0]+=JO(r,YO));break;case wI:t||"#"!=r?r!=GR&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":JO(r,YO)):(c.fragment="",u=CI);break;case CI:r!=GR&&(c.fragment+=JO(r,XO))}l++}},parseHost:function(e){var t,n,i;if("["==kO(e,0)){if("]"!=kO(e,e.length-1))return LO;if(t=function(e){var t,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return kO(e,f)};if(":"==h()){if(":"!=kO(e,1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&bO(HO,h());)t=16*t+gO(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!bO(NO,h()))return;for(;bO(NO,h());){if(o=gO(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(s=u-l,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[l+s-1],c[l+--s]=a;else if(8!=u)return;return c}(EO(e,1,-1)),!t)return LO;this.host=t}else if(this.isSpecial()){if(e=rO(e),bO(UO,e))return LO;if(t=function(e){var t,n,i,r,o,s,a,c=PO(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(o=10,r.length>1&&"0"==kO(r,0)&&(o=bO(FO,r)?16:8,r=EO(r,8==o?1:2)),""===r)s=0;else{if(!bO(10==o?jO:8==o?BO:HO,r))return e;s=gO(r,o)}xO(n,s)}for(i=0;i<t;i++)if(s=n[i],i==t-1){if(s>=mO(256,5-t))return null}else if(s>255)return null;for(a=_O(n),i=0;i<n.length;i++)a+=n[i]*mO(256,3-i);return a}(e),null===t)return LO;this.host=t}else{if(bO(VO,e))return LO;for(t="",n=tO(e),i=0;i<n.length;i++)t+=JO(n[i],YO);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return QR(ZO,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&QO(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=KO(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+wO(s,"/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw vO(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new xI(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+KO(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(oO(e)+":",nI)},getUsername:function(){return this.username},setUsername:function(e){var t=tO(oO(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=JO(t[n],$O)}},getPassword:function(){return this.password},setPassword:function(e){var t=tO(oO(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=JO(t[n],$O)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?KO(e):KO(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,hI)},getHostname:function(){var e=this.host;return null===e?"":KO(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,dI)},getPort:function(){var e=this.port;return null===e?"":oO(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=oO(e))?this.port=null:this.parse(e,pI))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+wO(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,mI))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=oO(e))?this.query=null:("?"==kO(e,0)&&(e=EO(e,1)),this.query="",this.parse(e,wI)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=oO(e))?("#"==kO(e,0)&&(e=EO(e,1)),this.fragment="",this.parse(e,CI)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var xI=function(e){var t=ZR(this,SI),n=aO(arguments.length,1)>1?arguments[1]:void 0,i=lO(t,new _I(e,!1,n));zR||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},SI=xI.prototype,TI=function(e,t){return{get:function(){return fO(this)[e]()},set:t&&function(e){return fO(this)[t](e)},configurable:!0,enumerable:!0}};if(zR&&(JR(SI,"href",TI("serialize","setHref")),JR(SI,"origin",TI("getOrigin")),JR(SI,"protocol",TI("getProtocol","setProtocol")),JR(SI,"username",TI("getUsername","setUsername")),JR(SI,"password",TI("getPassword","setPassword")),JR(SI,"host",TI("getHost","setHost")),JR(SI,"hostname",TI("getHostname","setHostname")),JR(SI,"port",TI("getPort","setPort")),JR(SI,"pathname",TI("getPathname","setPathname")),JR(SI,"search",TI("getSearch","setSearch")),JR(SI,"searchParams",TI("getSearchParams")),JR(SI,"hash",TI("getHash","setHash"))),$R(SI,"toJSON",(function(){return fO(this).serialize()}),{enumerable:!0}),$R(SI,"toString",(function(){return fO(this).serialize()}),{enumerable:!0}),pO){var PI=pO.createObjectURL,EI=pO.revokeObjectURL;PI&&$R(xI,"createObjectURL",XR(PI,pO)),EI&&$R(xI,"revokeObjectURL",XR(EI,pO))}function RI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function OI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RI(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function II(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}sO(xI,"URL"),WR({global:!0,constructor:!0,forced:!KR,sham:!zR},{URL:xI});var LI="info",AI=BC,DI=function(e){jo(n,e);var t=II(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats[LI].push(OI(OI({type:"userAction"},n),{},{payload:i}))})),Go(Ho(e),"_onReset",(function(){e.reset()})),Go(Ho(e),"_recordInfo",(function(t){e.info(t)})),Go(Ho(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return No(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(AC,this._recordUserActions),this.on(AI.STATS_INFO,this._recordInfo),this.on(AI.STATS_DOWNLOAD,this._downloadStats),this.on(AI.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[LI].push(OI(OI({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=OI({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=(Go(e={},LI,[]),Go(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.video,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[LI].map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}));return e}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[LI].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(C_);function MI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var NI=function(e){jo(n,e);var t=MI(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Ho(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,s=r.smallGapLimit||.5,a=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,a);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=s;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(Qw,this.onGapJump),this.on(zw,(function(){e.hasPlayed=!0})),this.on($w,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(M_);function FI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}NI.BROWSER_GAP_TOLERANCE=.001;var BI=function(e){jo(n,e);var t=FI(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Ho(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Go(Ho(e),"onJump",(function(){var t=Ho(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(e.jumpCnt++,n.currentTime=r)}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(Qw,this.onWaiting),this.on([Kw,eC],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(zw,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(M_);function jI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var HI="cdn",UI=["cdn"],VI=function(e){jo(n,e);var t=jI(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"startTimer",(function(){Hw.isMSE(e.player.video)||(e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Go(Ho(e),"initSpeedList",(function(){UI.forEach((function(e){!n.speedListCache[e]&&(n.speedListCache[e]=[])}))})),Go(Ho(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.len,t.time,t.type||HI)})),Go(Ho(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,s=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var a=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",s);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=c-a,i=Math.round(1e3*t/n);e.appendList(i,t,n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Go(Ho(e),"appendList",(function(t,i,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:HI;if(n.speedListCache&&n.speedListCache[o]){var s=e.config.saveSpeedMax;n.speedListCache[o].length>=s&&n.speedListCache[o].shift(),n.speedListCache[o].push({speed:t,bytes:i,time:r});var a=Ho(e).player;a&&(o===HI?a.realTimeSpeed=t:a[e.getSpeedName("realTime",o)]=t),e.updateSpeed(o)}})),Go(Ho(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HI,i=n.getAvgSpeedKbs(t),r=Ho(e).player;if(r)if(t===HI)r.avgSpeed&&i===r.avgSpeed||(r.avgSpeed=i,r.emit(mC,{speed:i,realTimeSpeed:r.realTimeSpeed}));else{var o=e.getSpeedName("avg",t);r[o]&&i===r[o]||(r[o]=i,r.emit(mC,{speed:i,realTimeSpeed:r.realTimeSpeed}))}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList,i=e.testCnt;(null==n?void 0:n.length)>0&&UI.push.apply(UI,Ty(n)),this.initSpeedList(),t&&(this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i>0&&this.on([iC,vC],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(){this.off("real_time_speed",this._onRealSpeedChange),this.off([iC,vC],this.startTimer),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:"speedSampleList",get:function(){return n.speedListCache}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:20,addSpeedTypeList:[]}}},{key:"getAvgSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HI;if(!n.speedListCache||!n.speedListCache[e])return-1;if(n.speedListCache[e].length<=0)return-1;var t=0;return n.speedListCache[e].map((function(e){t+=e.speed})),Math.floor(t/n.speedListCache[e].length)}},{key:"getWeightedSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HI,t=-1;if(!n.speedListCache||!n.speedListCache[e])return t;if(n.speedListCache[e].length<=0)return t;var i=[];n.speedListCache[e].forEach((function(e){i.push(e)})),i.sort((function(e,t){return e.speed-t.speed}));for(var r=i.length,o=0,s=0;s<r;s++)o+=i[s].bytes;o/=2;for(var a=0;a<r;a++)(o-=i[a].bytes)<=0&&(t=i[a].speed);return t<0?-1:t}}]),n}(M_);function GI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}Go(VI,"speedListCache",{});var WI=function(e){jo(n,e);var t=GI(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config,i=t.media||t.video;!n.disabled&&i.getVideoPlaybackQuality&&(this.timer=null,this._resetData(),this.on(sC,(function(){e._resetData(),e._stopTick()})),this.on(zw,(function(){e._startTick()})),this.on(Xw,(function(){e._stopTick()})),this.on(Yw,(function(){e._stopTick()})),this.on(aC,(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 n=!1,i=[],r=0;r<t.length;r++){var o=t.start(r),s=t.end(r);if(i.push({start:o,end:s}),o<=e&&e<=s-1){n=!0;break}}return{enoughBuffer:n,buffers:i}}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.media||this.player.video,o=document.hidden,s=r.paused,a=r.readyState,c=r.currentTime,u=r.buffered;if(!(o||s||a<4)){var l=this._checkBuffer(c,u),f=l.enoughBuffer,h=l.buffers;f&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:c,buffers:h,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(jC,this._payload),this._resetCheck())):this._resetCheck())}}},{key:"_resetCheck",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_resetData",value:function(){this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[]}},{key:"_checkDecodeFPS",value:function(){var e,t,n=(null===(e=this.player)||void 0===e?void 0:e.media)||(null===(t=this.player)||void 0===t?void 0:t.video);if(n){var i=n.getVideoPlaybackQuality(),r=i.totalVideoFrames,o=i.droppedVideoFrames,s=performance.now();if(r&&this._lastCheckPoint){var a=r-this._lastDecodedFrames,c=s-this._lastCheckPoint;this._checkStuck(a,r,o,c)}this._lastDecodedFrames=r,this._lastCheckPoint=s}else this._stopTick()}},{key:"destroy",value:function(){this._stopTick(),this._resetData()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(M_);rx.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var zI=No((function e(t,n){var i,r,o;Fo(this,e);var s=n&&"mobile"===n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[xT,jP,DP,BT],[RT,NT,YT,rP,yP,kP,uP,fP,WT,tP]),u=[Mx,Bx,Wx,fT,Yx,SP,EP,NP,uS];this.plugins=[Ix,DI,BI,NI].concat(Ty(c),u);var l=s?"mobile":zC.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[aT,dS,_P,VI,WI]);break;case"mobile":(r=this.plugins).push.apply(r,[tT]);break;default:(o=this.plugins).push.apply(o,[aT,dS,_P])}(zC.os.isIpad||"pc"===l)&&this.plugins.push(KP),zC.os.isIpad&&this.plugins.push(dS),this.ignores=[],this.i18n=[]}));function KI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var YI=function(e){jo(n,e);var t=KI(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n)}(gx);return Go(YI,"defaultPreset",zI),Go(YI,"Util",Hw),Go(YI,"Sniffer",zC),Go(YI,"Errors",Ww),Go(YI,"Events",HC),Go(YI,"Plugin",M_),Go(YI,"BasePlugin",C_),Go(YI,"I18N",rx),Go(YI,"STATE_CLASS",X_),Go(YI,"PAUSE_TYPES",n_),Go(YI,"BUFFER_CONTROL_TYPES",i_),Go(YI,"InstManager",cx),Go(YI,"TestSpeed",VI),YI}));
|
|
1
|
+
!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).Player=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),i={exports:{}},r=n,o=Object.defineProperty,s=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t},a=s,c="__core-js_shared__",u=n[c]||a(c,{}),l=u;(i.exports=function(e,t){return l[e]||(l[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var f,h,d=function(e){try{return!!e()}catch(e){return!0}},p=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),v=p,g=Function.prototype,y=g.call,m=v&&g.bind.bind(y,y),k=v?m:function(e){return function(){return y.apply(e,arguments)}},b=function(e){return null==e},w=b,C=TypeError,_=function(e){if(w(e))throw C("Can't call method on "+e);return e},x=_,S=Object,T=function(e){return S(x(e))},P=T,E=k({}.hasOwnProperty),R=Object.hasOwn||function(e,t){return E(P(e),t)},O=k,I=0,L=Math.random(),A=O(1..toString),D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+A(++I+L,36)},M="undefined"!=typeof navigator&&String(navigator.userAgent)||"",N=n,F=M,B=N.process,j=N.Deno,H=B&&B.versions||j&&j.version,U=H&&H.v8;U&&(h=(f=U.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!h&&F&&(!(f=F.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=F.match(/Chrome\/(\d+)/))&&(h=+f[1]);var V=h,G=V,W=d,z=n.String,K=!!Object.getOwnPropertySymbols&&!W((function(){var e=Symbol();return!z(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&G&&G<41})),Y=K&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,X=n,q=i.exports,$=R,J=D,Z=K,Q=Y,ee=X.Symbol,te=q("wks"),ne=Q?ee.for||ee:ee&&ee.withoutSetter||J,ie=function(e){return $(te,e)||(te[e]=Z&&$(ee,e)?ee[e]:ne("Symbol."+e)),te[e]},re={};re[ie("toStringTag")]="z";var oe="[object z]"===String(re),se="object"==typeof document&&document.all,ae={all:se,IS_HTMLDDA:void 0===se&&void 0!==se},ce=ae.all,ue=ae.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},le={},fe=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),he=ue,de=ae.all,pe=ae.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:he(e)||e===de}:function(e){return"object"==typeof e?null!==e:he(e)},ve=pe,ge=n.document,ye=ve(ge)&&ve(ge.createElement),me=function(e){return ye?ge.createElement(e):{}},ke=me,be=!fe&&!d((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),we=fe&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=pe,_e=String,xe=TypeError,Se=function(e){if(Ce(e))return e;throw xe(_e(e)+" is not an object")},Te=p,Pe=Function.prototype.call,Ee=Te?Pe.bind(Pe):function(){return Pe.apply(Pe,arguments)},Re=n,Oe=ue,Ie=function(e,t){return arguments.length<2?(n=Re[e],Oe(n)?n:void 0):Re[e]&&Re[e][t];var n},Le=k({}.isPrototypeOf),Ae=Ie,De=ue,Me=Le,Ne=Object,Fe=Y?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return De(t)&&Me(t.prototype,Ne(e))},Be=String,je=function(e){try{return Be(e)}catch(e){return"Object"}},He=ue,Ue=je,Ve=TypeError,Ge=function(e){if(He(e))return e;throw Ve(Ue(e)+" is not a function")},We=Ge,ze=b,Ke=function(e,t){var n=e[t];return ze(n)?void 0:We(n)},Ye=Ee,Xe=ue,qe=pe,$e=TypeError,Je=Ee,Ze=pe,Qe=Fe,et=Ke,tt=function(e,t){var n,i;if("string"===t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;if(Xe(n=e.valueOf)&&!qe(i=Ye(n,e)))return i;if("string"!==t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;throw $e("Can't convert object to primitive value")},nt=TypeError,it=ie("toPrimitive"),rt=function(e,t){if(!Ze(e)||Qe(e))return e;var n,i=et(e,it);if(i){if(void 0===t&&(t="default"),n=Je(i,e,t),!Ze(n)||Qe(n))return n;throw nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},ot=rt,st=Fe,at=function(e){var t=ot(e,"string");return st(t)?t:t+""},ct=fe,ut=be,lt=we,ft=Se,ht=at,dt=TypeError,pt=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,gt="enumerable",yt="configurable",mt="writable";le.f=ct?lt?function(e,t,n){if(ft(e),t=ht(t),ft(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n[mt]){var i=vt(e,t);i&&i[mt]&&(e[t]=n.value,n={configurable:yt in n?n[yt]:i[yt],enumerable:gt in n?n[gt]:i[gt],writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(ft(e),t=ht(t),ft(n),ut)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var kt={exports:{}},bt=fe,wt=R,Ct=Function.prototype,_t=bt&&Object.getOwnPropertyDescriptor,xt=wt(Ct,"name"),St={EXISTS:xt,PROPER:xt&&"something"===function(){}.name,CONFIGURABLE:xt&&(!bt||bt&&_t(Ct,"name").configurable)},Tt=ue,Pt=u,Et=k(Function.toString);Tt(Pt.inspectSource)||(Pt.inspectSource=function(e){return Et(e)});var Rt,Ot,It,Lt=Pt.inspectSource,At=ue,Dt=n.WeakMap,Mt=At(Dt)&&/native code/.test(String(Dt)),Nt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ft=le,Bt=Nt,jt=fe?function(e,t,n){return Ft.f(e,t,Bt(1,n))}:function(e,t,n){return e[t]=n,e},Ht=i.exports,Ut=D,Vt=Ht("keys"),Gt=function(e){return Vt[e]||(Vt[e]=Ut(e))},Wt={},zt=Mt,Kt=n,Yt=pe,Xt=jt,qt=R,$t=u,Jt=Gt,Zt=Wt,Qt="Object already initialized",en=Kt.TypeError,tn=Kt.WeakMap;if(zt||$t.state){var nn=$t.state||($t.state=new tn);nn.get=nn.get,nn.has=nn.has,nn.set=nn.set,Rt=function(e,t){if(nn.has(e))throw en(Qt);return t.facade=e,nn.set(e,t),t},Ot=function(e){return nn.get(e)||{}},It=function(e){return nn.has(e)}}else{var rn=Jt("state");Zt[rn]=!0,Rt=function(e,t){if(qt(e,rn))throw en(Qt);return t.facade=e,Xt(e,rn,t),t},Ot=function(e){return qt(e,rn)?e[rn]:{}},It=function(e){return qt(e,rn)}}var on={set:Rt,get:Ot,has:It,enforce:function(e){return It(e)?Ot(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!Yt(t)||(n=Ot(t)).type!==e)throw en("Incompatible receiver, "+e+" required");return n}}},sn=k,an=d,cn=ue,un=R,ln=fe,fn=St.CONFIGURABLE,hn=Lt,dn=on.enforce,pn=on.get,vn=String,gn=Object.defineProperty,yn=sn("".slice),mn=sn("".replace),kn=sn([].join),bn=ln&&!an((function(){return 8!==gn((function(){}),"length",{value:8}).length})),wn=String(String).split("String"),Cn=kt.exports=function(e,t,n){"Symbol("===yn(vn(t),0,7)&&(t="["+mn(vn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!un(e,"name")||fn&&e.name!==t)&&(ln?gn(e,"name",{value:t,configurable:!0}):e.name=t),bn&&n&&un(n,"arity")&&e.length!==n.arity&&gn(e,"length",{value:n.arity});try{n&&un(n,"constructor")&&n.constructor?ln&&gn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=dn(e);return un(i,"source")||(i.source=kn(wn,"string"==typeof t?t:"")),e};Function.prototype.toString=Cn((function(){return cn(this)&&pn(this).source||hn(this)}),"toString");var _n=ue,xn=le,Sn=kt.exports,Tn=s,Pn=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(_n(n)&&Sn(n,o,i),i.global)r?e[t]=n:Tn(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=n:xn.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},En=k,Rn=En({}.toString),On=En("".slice),In=function(e){return On(Rn(e),8,-1)},Ln=oe,An=ue,Dn=In,Mn=ie("toStringTag"),Nn=Object,Fn="Arguments"==Dn(function(){return arguments}()),Bn=Ln?Dn:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Nn(e),Mn))?n:Fn?Dn(t):"Object"==(i=Dn(t))&&An(t.callee)?"Arguments":i},jn=Bn,Hn=oe?{}.toString:function(){return"[object "+jn(this)+"]"};oe||Pn(Object.prototype,"toString",Hn,{unsafe:!0});var Un={},Vn={},Gn={}.propertyIsEnumerable,Wn=Object.getOwnPropertyDescriptor,zn=Wn&&!Gn.call({1:2},1);Vn.f=zn?function(e){var t=Wn(this,e);return!!t&&t.enumerable}:Gn;var Kn=d,Yn=In,Xn=Object,qn=k("".split),$n=Kn((function(){return!Xn("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yn(e)?qn(e,""):Xn(e)}:Xn,Jn=$n,Zn=_,Qn=function(e){return Jn(Zn(e))},ei=fe,ti=Ee,ni=Vn,ii=Nt,ri=Qn,oi=at,si=R,ai=be,ci=Object.getOwnPropertyDescriptor;Un.f=ei?ci:function(e,t){if(e=ri(e),t=oi(t),ai)try{return ci(e,t)}catch(e){}if(si(e,t))return ii(!ti(ni.f,e,t),e[t])};var ui={},li=Math.ceil,fi=Math.floor,hi=Math.trunc||function(e){var t=+e;return(t>0?fi:li)(t)},di=function(e){var t=+e;return t!=t||0===t?0:hi(t)},pi=di,vi=Math.max,gi=Math.min,yi=function(e,t){var n=pi(e);return n<0?vi(n+t,0):gi(n,t)},mi=di,ki=Math.min,bi=function(e){return e>0?ki(mi(e),9007199254740991):0},wi=bi,Ci=function(e){return wi(e.length)},_i=Qn,xi=yi,Si=Ci,Ti=function(e){return function(t,n,i){var r,o=_i(t),s=Si(o),a=xi(i,s);if(e&&n!=n){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},Pi={includes:Ti(!0),indexOf:Ti(!1)},Ei=R,Ri=Qn,Oi=Pi.indexOf,Ii=Wt,Li=k([].push),Ai=function(e,t){var n,i=Ri(e),r=0,o=[];for(n in i)!Ei(Ii,n)&&Ei(i,n)&&Li(o,n);for(;t.length>r;)Ei(i,n=t[r++])&&(~Oi(o,n)||Li(o,n));return o},Di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mi=Ai,Ni=Di.concat("length","prototype");ui.f=Object.getOwnPropertyNames||function(e){return Mi(e,Ni)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var Bi=Ie,ji=ui,Hi=Fi,Ui=Se,Vi=k([].concat),Gi=Bi("Reflect","ownKeys")||function(e){var t=ji.f(Ui(e)),n=Hi.f;return n?Vi(t,n(e)):t},Wi=R,zi=Gi,Ki=Un,Yi=le,Xi=d,qi=ue,$i=/#|\.prototype\./,Ji=function(e,t){var n=Qi[Zi(e)];return n==tr||n!=er&&(qi(t)?Xi(t):!!t)},Zi=Ji.normalize=function(e){return String(e).replace($i,".").toLowerCase()},Qi=Ji.data={},er=Ji.NATIVE="N",tr=Ji.POLYFILL="P",nr=Ji,ir=n,rr=Un.f,or=jt,sr=Pn,ar=s,cr=function(e,t,n){for(var i=zi(t),r=Yi.f,o=Ki.f,s=0;s<i.length;s++){var a=i[s];Wi(e,a)||n&&Wi(n,a)||r(e,a,o(t,a))}},ur=nr,lr=function(e,t){var n,i,r,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?ir:u?ir[a]||ar(a,{}):(ir[a]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(s=rr(n,i))&&s.value:n[i],!ur(c?i:a+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;cr(o,r)}(e.sham||r&&r.sham)&&or(o,"sham",!0),sr(n,i,o,e)}},fr=p,hr=Function.prototype,dr=hr.apply,pr=hr.call,vr="object"==typeof Reflect&&Reflect.apply||(fr?pr.bind(dr):function(){return pr.apply(dr,arguments)}),gr=k([].slice),yr=k,mr=Ge,kr=pe,br=R,wr=gr,Cr=p,_r=Function,xr=yr([].concat),Sr=yr([].join),Tr={},Pr=Cr?_r.bind:function(e){var t=mr(this),n=t.prototype,i=wr(arguments,1),r=function(){var n=xr(i,wr(arguments));return this instanceof r?function(e,t,n){if(!br(Tr,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Tr[t]=_r("C,a","return new C("+Sr(i,",")+")")}return Tr[t](e,n)}(t,n.length,n):t.apply(e,n)};return kr(n)&&(r.prototype=n),r},Er=k,Rr=d,Or=ue,Ir=Bn,Lr=Lt,Ar=function(){},Dr=[],Mr=Ie("Reflect","construct"),Nr=/^\s*(?:class|function)\b/,Fr=Er(Nr.exec),Br=!Nr.exec(Ar),jr=function(e){if(!Or(e))return!1;try{return Mr(Ar,Dr,e),!0}catch(e){return!1}},Hr=function(e){if(!Or(e))return!1;switch(Ir(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Br||!!Fr(Nr,Lr(e))}catch(e){return!0}};Hr.sham=!0;var Ur=!Mr||Rr((function(){var e;return jr(jr.call)||!jr(Object)||!jr((function(){e=!0}))||e}))?Hr:jr,Vr=Ur,Gr=je,Wr=TypeError,zr=function(e){if(Vr(e))return e;throw Wr(Gr(e)+" is not a constructor")},Kr={},Yr=Ai,Xr=Di,qr=Object.keys||function(e){return Yr(e,Xr)},$r=fe,Jr=we,Zr=le,Qr=Se,eo=Qn,to=qr;Kr.f=$r&&!Jr?Object.defineProperties:function(e,t){Qr(e);for(var n,i=eo(t),r=to(t),o=r.length,s=0;o>s;)Zr.f(e,n=r[s++],i[n]);return e};var no,io=Ie("document","documentElement"),ro=Se,oo=Kr,so=Di,ao=Wt,co=io,uo=me,lo="prototype",fo="script",ho=Gt("IE_PROTO"),po=function(){},vo=function(e){return"<"+fo+">"+e+"</"+fo+">"},go=function(e){e.write(vo("")),e.close();var t=e.parentWindow.Object;return e=null,t},yo=function(){try{no=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;yo="undefined"!=typeof document?document.domain&&no?go(no):(t=uo("iframe"),n="java"+fo+":",t.style.display="none",co.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(vo("document.F=Object")),e.close(),e.F):go(no);for(var i=so.length;i--;)delete yo[lo][so[i]];return yo()};ao[ho]=!0;var mo=Object.create||function(e,t){var n;return null!==e?(po[lo]=ro(e),n=new po,po[lo]=null,n[ho]=e):n=yo(),void 0===t?n:oo.f(n,t)},ko=lr,bo=vr,wo=Pr,Co=zr,_o=Se,xo=pe,So=mo,To=d,Po=Ie("Reflect","construct"),Eo=Object.prototype,Ro=[].push,Oo=To((function(){function e(){}return!(Po((function(){}),[],e)instanceof e)})),Io=!To((function(){Po((function(){}))})),Lo=Oo||Io;function Ao(e){return Ao="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},Ao(e)}function Do(e){var t=function(e,t){if("object"!==Ao(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Ao(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ao(t)?t:String(t)}function Mo(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Do(i.key),i)}}function No(e,t,n){return t&&Mo(e.prototype,t),n&&Mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){return Bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bo(e,t)}function jo(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&&Bo(e,t)}function Ho(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uo(e,t){if(t&&("object"===Ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ho(e)}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vo(e)}function Go(e,t,n){return(t=Do(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ko({target:"Reflect",stat:!0,forced:Lo,sham:Lo},{construct:function(e,t){Co(e),_o(t);var n=arguments.length<3?e:Co(arguments[2]);if(Io&&!Oo)return Po(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return bo(Ro,i,t),new(bo(wo,e,i))}var r=n.prototype,o=So(xo(r)?r:Eo),s=bo(e,o,t);return xo(s)?s:o}});var Wo=Bn,zo=String,Ko=function(e){if("Symbol"===Wo(e))throw TypeError("Cannot convert a Symbol value to a string");return zo(e)},Yo={},Xo=at,qo=le,$o=Nt,Jo=function(e,t,n){var i=Xo(t);i in e?qo.f(e,i,$o(0,n)):e[i]=n},Zo=yi,Qo=Ci,es=Jo,ts=Array,ns=Math.max,is=function(e,t,n){for(var i=Qo(e),r=Zo(t,i),o=Zo(void 0===n?i:n,i),s=ts(ns(o-r,0)),a=0;r<o;r++,a++)es(s,a,e[r]);return s.length=a,s},rs=In,os=Qn,ss=ui.f,as=is,cs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yo.f=function(e){return cs&&"Window"==rs(e)?function(e){try{return ss(e)}catch(e){return as(cs)}}(e):ss(os(e))};var us=kt.exports,ls=le,fs=function(e,t,n){return n.get&&us(n.get,t,{getter:!0}),n.set&&us(n.set,t,{setter:!0}),ls.f(e,t,n)},hs={},ds=ie;hs.f=ds;var ps=n,vs=ps,gs=R,ys=hs,ms=le.f,ks=Ee,bs=Ie,ws=ie,Cs=Pn,_s=le.f,xs=R,Ss=ie("toStringTag"),Ts=function(e,t,n){e&&!n&&(e=e.prototype),e&&!xs(e,Ss)&&_s(e,Ss,{configurable:!0,value:t})},Ps=In,Es=k,Rs=function(e){if("Function"===Ps(e))return Es(e)},Os=Ge,Is=p,Ls=Rs(Rs.bind),As=function(e,t){return Os(e),void 0===t?e:Is?Ls(e,t):function(){return e.apply(t,arguments)}},Ds=In,Ms=Array.isArray||function(e){return"Array"==Ds(e)},Ns=Ms,Fs=Ur,Bs=pe,js=ie("species"),Hs=Array,Us=function(e){var t;return Ns(e)&&(t=e.constructor,(Fs(t)&&(t===Hs||Ns(t.prototype))||Bs(t)&&null===(t=t[js]))&&(t=void 0)),void 0===t?Hs:t},Vs=function(e,t){return new(Us(e))(0===t?0:t)},Gs=As,Ws=$n,zs=T,Ks=Ci,Ys=Vs,Xs=k([].push),qs=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,u,l,f){for(var h,d,p=zs(c),v=Ws(p),g=Gs(u,l),y=Ks(v),m=0,k=f||Ys,b=t?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in v)&&(d=g(h=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:Xs(b,h)}else switch(e){case 4:return!1;case 7:Xs(b,h)}return o?-1:i||r?r:b}},$s={forEach:qs(0),map:qs(1),filter:qs(2),some:qs(3),every:qs(4),find:qs(5),findIndex:qs(6),filterReject:qs(7)},Js=lr,Zs=n,Qs=Ee,ea=k,ta=fe,na=K,ia=d,ra=R,oa=Le,sa=Se,aa=Qn,ca=at,ua=Ko,la=Nt,fa=mo,ha=qr,da=ui,pa=Yo,va=Fi,ga=Un,ya=le,ma=Kr,ka=Vn,ba=Pn,wa=fs,Ca=i.exports,_a=Wt,xa=D,Sa=ie,Ta=hs,Pa=function(e){var t=vs.Symbol||(vs.Symbol={});gs(t,e)||ms(t,e,{value:ys.f(e)})},Ea=function(){var e=bs("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=ws("toPrimitive");t&&!t[i]&&Cs(t,i,(function(e){return ks(n,this)}),{arity:1})},Ra=Ts,Oa=on,Ia=$s.forEach,La=Gt("hidden"),Aa="Symbol",Da="prototype",Ma=Oa.set,Na=Oa.getterFor(Aa),Fa=Object[Da],Ba=Zs.Symbol,ja=Ba&&Ba[Da],Ha=Zs.TypeError,Ua=Zs.QObject,Va=ga.f,Ga=ya.f,Wa=pa.f,za=ka.f,Ka=ea([].push),Ya=Ca("symbols"),Xa=Ca("op-symbols"),qa=Ca("wks"),$a=!Ua||!Ua[Da]||!Ua[Da].findChild,Ja=ta&&ia((function(){return 7!=fa(Ga({},"a",{get:function(){return Ga(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Va(Fa,t);i&&delete Fa[t],Ga(e,t,n),i&&e!==Fa&&Ga(Fa,t,i)}:Ga,Za=function(e,t){var n=Ya[e]=fa(ja);return Ma(n,{type:Aa,tag:e,description:t}),ta||(n.description=t),n},Qa=function(e,t,n){e===Fa&&Qa(Xa,t,n),sa(e);var i=ca(t);return sa(n),ra(Ya,i)?(n.enumerable?(ra(e,La)&&e[La][i]&&(e[La][i]=!1),n=fa(n,{enumerable:la(0,!1)})):(ra(e,La)||Ga(e,La,la(1,{})),e[La][i]=!0),Ja(e,i,n)):Ga(e,i,n)},ec=function(e,t){sa(e);var n=aa(t),i=ha(n).concat(rc(n));return Ia(i,(function(t){ta&&!Qs(tc,n,t)||Qa(e,t,n[t])})),e},tc=function(e){var t=ca(e),n=Qs(za,this,t);return!(this===Fa&&ra(Ya,t)&&!ra(Xa,t))&&(!(n||!ra(this,t)||!ra(Ya,t)||ra(this,La)&&this[La][t])||n)},nc=function(e,t){var n=aa(e),i=ca(t);if(n!==Fa||!ra(Ya,i)||ra(Xa,i)){var r=Va(n,i);return!r||!ra(Ya,i)||ra(n,La)&&n[La][i]||(r.enumerable=!0),r}},ic=function(e){var t=Wa(aa(e)),n=[];return Ia(t,(function(e){ra(Ya,e)||ra(_a,e)||Ka(n,e)})),n},rc=function(e){var t=e===Fa,n=Wa(t?Xa:aa(e)),i=[];return Ia(n,(function(e){!ra(Ya,e)||t&&!ra(Fa,e)||Ka(i,Ya[e])})),i};na||(Ba=function(){if(oa(ja,this))throw Ha("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ua(arguments[0]):void 0,t=xa(e),n=function(e){this===Fa&&Qs(n,Xa,e),ra(this,La)&&ra(this[La],t)&&(this[La][t]=!1),Ja(this,t,la(1,e))};return ta&&$a&&Ja(Fa,t,{configurable:!0,set:n}),Za(t,e)},ba(ja=Ba[Da],"toString",(function(){return Na(this).tag})),ba(Ba,"withoutSetter",(function(e){return Za(xa(e),e)})),ka.f=tc,ya.f=Qa,ma.f=ec,ga.f=nc,da.f=pa.f=ic,va.f=rc,Ta.f=function(e){return Za(Sa(e),e)},ta&&(wa(ja,"description",{configurable:!0,get:function(){return Na(this).description}}),ba(Fa,"propertyIsEnumerable",tc,{unsafe:!0}))),Js({global:!0,constructor:!0,wrap:!0,forced:!na,sham:!na},{Symbol:Ba}),Ia(ha(qa),(function(e){Pa(e)})),Js({target:Aa,stat:!0,forced:!na},{useSetter:function(){$a=!0},useSimple:function(){$a=!1}}),Js({target:"Object",stat:!0,forced:!na,sham:!ta},{create:function(e,t){return void 0===t?fa(e):ec(fa(e),t)},defineProperty:Qa,defineProperties:ec,getOwnPropertyDescriptor:nc}),Js({target:"Object",stat:!0,forced:!na},{getOwnPropertyNames:ic}),Ea(),Ra(Ba,Aa),_a[La]=!0;var oc=K&&!!Symbol.for&&!!Symbol.keyFor,sc=lr,ac=Ie,cc=R,uc=Ko,lc=i.exports,fc=oc,hc=lc("string-to-symbol-registry"),dc=lc("symbol-to-string-registry");sc({target:"Symbol",stat:!0,forced:!fc},{for:function(e){var t=uc(e);if(cc(hc,t))return hc[t];var n=ac("Symbol")(t);return hc[t]=n,dc[n]=t,n}});var pc=lr,vc=R,gc=Fe,yc=je,mc=oc,kc=(0,i.exports)("symbol-to-string-registry");pc({target:"Symbol",stat:!0,forced:!mc},{keyFor:function(e){if(!gc(e))throw TypeError(yc(e)+" is not a symbol");if(vc(kc,e))return kc[e]}});var bc=Ms,wc=ue,Cc=In,_c=Ko,xc=k([].push),Sc=lr,Tc=Ie,Pc=vr,Ec=Ee,Rc=k,Oc=d,Ic=ue,Lc=Fe,Ac=gr,Dc=function(e){if(wc(e))return e;if(bc(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?xc(n,r):"number"!=typeof r&&"Number"!=Cc(r)&&"String"!=Cc(r)||xc(n,_c(r))}var o=n.length,s=!0;return function(e,t){if(s)return s=!1,t;if(bc(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},Mc=K,Nc=String,Fc=Tc("JSON","stringify"),Bc=Rc(/./.exec),jc=Rc("".charAt),Hc=Rc("".charCodeAt),Uc=Rc("".replace),Vc=Rc(1..toString),Gc=/[\uD800-\uDFFF]/g,Wc=/^[\uD800-\uDBFF]$/,zc=/^[\uDC00-\uDFFF]$/,Kc=!Mc||Oc((function(){var e=Tc("Symbol")();return"[null]"!=Fc([e])||"{}"!=Fc({a:e})||"{}"!=Fc(Object(e))})),Yc=Oc((function(){return'"\\udf06\\ud834"'!==Fc("\udf06\ud834")||'"\\udead"'!==Fc("\udead")})),Xc=function(e,t){var n=Ac(arguments),i=Dc(t);if(Ic(i)||void 0!==e&&!Lc(e))return n[1]=function(e,t){if(Ic(i)&&(t=Ec(i,this,Nc(e),t)),!Lc(t))return t},Pc(Fc,null,n)},qc=function(e,t,n){var i=jc(n,t-1),r=jc(n,t+1);return Bc(Wc,e)&&!Bc(zc,r)||Bc(zc,e)&&!Bc(Wc,i)?"\\u"+Vc(Hc(e,0),16):e};Fc&&Sc({target:"JSON",stat:!0,arity:3,forced:Kc||Yc},{stringify:function(e,t,n){var i=Ac(arguments),r=Pc(Kc?Xc:Fc,null,i);return Yc&&"string"==typeof r?Uc(r,Gc,qc):r}});var $c=Fi,Jc=T;lr({target:"Object",stat:!0,forced:!K||d((function(){$c.f(1)}))},{getOwnPropertySymbols:function(e){var t=$c.f;return t?t(Jc(e)):[]}});var Zc=lr,Qc=d,eu=Qn,tu=Un.f,nu=fe;Zc({target:"Object",stat:!0,forced:!nu||Qc((function(){tu(1)})),sham:!nu},{getOwnPropertyDescriptor:function(e,t){return tu(eu(e),t)}});var iu=Gi,ru=Qn,ou=Un,su=Jo;function au(){return au="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vo(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},au.apply(this,arguments)}lr({target:"Object",stat:!0,sham:!fe},{getOwnPropertyDescriptors:function(e){for(var t,n,i=ru(e),r=ou.f,o=iu(i),s={},a=0;o.length>a;)void 0!==(n=r(i,t=o[a++]))&&su(s,t,n);return s}});var cu=TypeError,uu=function(e){if(e>9007199254740991)throw cu("Maximum allowed index exceeded");return e},lu=d,fu=V,hu=ie("species"),du=function(e){return fu>=51||!lu((function(){var t=[];return(t.constructor={})[hu]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},pu=lr,vu=d,gu=Ms,yu=pe,mu=T,ku=Ci,bu=uu,wu=Jo,Cu=Vs,_u=du,xu=V,Su=ie("isConcatSpreadable"),Tu=xu>=51||!vu((function(){var e=[];return e[Su]=!1,e.concat()[0]!==e})),Pu=function(e){if(!yu(e))return!1;var t=e[Su];return void 0!==t?!!t:gu(e)};pu({target:"Array",proto:!0,arity:1,forced:!Tu||!_u("concat")},{concat:function(e){var t,n,i,r,o,s=mu(this),a=Cu(s,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Pu(o=-1===t?s:arguments[t]))for(r=ku(o),bu(c+r),n=0;n<r;n++,c++)n in o&&wu(a,c,o[n]);else bu(c+1),wu(a,c++,o);return a.length=c,a}});var Eu=$s.map;lr({target:"Array",proto:!0,forced:!du("map")},{map:function(e){return Eu(this,e,arguments.length>1?arguments[1]:void 0)}});var Ru=T,Ou=qr;lr({target:"Object",stat:!0,forced:d((function(){Ou(1)}))},{keys:function(e){return Ou(Ru(e))}});var Iu=lr,Lu=Ms,Au=Ur,Du=pe,Mu=yi,Nu=Ci,Fu=Qn,Bu=Jo,ju=ie,Hu=gr,Uu=du("slice"),Vu=ju("species"),Gu=Array,Wu=Math.max;Iu({target:"Array",proto:!0,forced:!Uu},{slice:function(e,t){var n,i,r,o=Fu(this),s=Nu(o),a=Mu(e,s),c=Mu(void 0===t?s:t,s);if(Lu(o)&&(n=o.constructor,(Au(n)&&(n===Gu||Lu(n.prototype))||Du(n)&&null===(n=n[Vu]))&&(n=void 0),n===Gu||void 0===n))return Hu(o,a,c);for(i=new(void 0===n?Gu:n)(Wu(c-a,0)),r=0;a<c;a++,r++)a in o&&Bu(i,r,o[a]);return i.length=r,i}});var zu={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},Ku=me("span").classList,Yu=Ku&&Ku.constructor&&Ku.constructor.prototype,Xu=Yu===Object.prototype?void 0:Yu,qu=d,$u=function(e,t){var n=[][e];return!!n&&qu((function(){n.call(null,t||function(){return 1},1)}))},Ju=$s.forEach,Zu=$u("forEach")?[].forEach:function(e){return Ju(this,e,arguments.length>1?arguments[1]:void 0)},Qu=n,el=zu,tl=Xu,nl=Zu,il=jt,rl=function(e){if(e&&e.forEach!==nl)try{il(e,"forEach",nl)}catch(t){e.forEach=nl}};for(var ol in el)el[ol]&&rl(Qu[ol]&&Qu[ol].prototype);rl(tl);var sl=lr,al=$n,cl=Qn,ul=$u,ll=k([].join);sl({target:"Array",proto:!0,forced:al!=Object||!ul("join",",")},{join:function(e){return ll(cl(this),void 0===e?",":e)}});var fl=fe,hl=Ms,dl=TypeError,pl=Object.getOwnPropertyDescriptor,vl=fl&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),gl=je,yl=TypeError,ml=function(e,t){if(!delete e[t])throw yl("Cannot delete property "+gl(t)+" of "+gl(e))},kl=lr,bl=T,wl=yi,Cl=di,_l=Ci,xl=vl?function(e,t){if(hl(e)&&!pl(e,"length").writable)throw dl("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Sl=uu,Tl=Vs,Pl=Jo,El=ml,Rl=du("splice"),Ol=Math.max,Il=Math.min;kl({target:"Array",proto:!0,forced:!Rl},{splice:function(e,t){var n,i,r,o,s,a,c=bl(this),u=_l(c),l=wl(e,u),f=arguments.length;for(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=Il(Ol(Cl(t),0),u-l)),Sl(u+n-i),r=Tl(c,i),o=0;o<i;o++)(s=l+o)in c&&Pl(r,o,c[s]);if(r.length=i,n<i){for(o=l;o<u-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:El(c,a);for(o=u;o>u-i+n;o--)El(c,o-1)}else if(n>i)for(o=u-i;o>l;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:El(c,a);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return xl(c,u-i+n),r}});var Ll,Al,Dl,Ml,Nl="undefined"!=typeof process&&"process"==In(process),Fl=k,Bl=Ge,jl=ue,Hl=String,Ul=TypeError,Vl=function(e,t,n){try{return Fl(Bl(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},Gl=Se,Wl=function(e){if("object"==typeof e||jl(e))return e;throw Ul("Can't set "+Hl(e)+" as a prototype")},zl=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Vl(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return Gl(n),Wl(i),t?e(n,i):n.__proto__=i,n}}():void 0),Kl=Ie,Yl=fs,Xl=fe,ql=ie("species"),$l=function(e){var t=Kl(e);Xl&&t&&!t[ql]&&Yl(t,ql,{configurable:!0,get:function(){return this}})},Jl=Le,Zl=TypeError,Ql=function(e,t){if(Jl(t,e))return e;throw Zl("Incorrect invocation")},ef=Se,tf=zr,nf=b,rf=ie("species"),of=function(e,t){var n,i=ef(e).constructor;return void 0===i||nf(n=ef(i)[rf])?t:tf(n)},sf=TypeError,af=function(e,t){if(e<t)throw sf("Not enough arguments");return e},cf=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),uf=n,lf=vr,ff=As,hf=ue,df=R,pf=d,vf=io,gf=gr,yf=me,mf=af,kf=cf,bf=Nl,wf=uf.setImmediate,Cf=uf.clearImmediate,_f=uf.process,xf=uf.Dispatch,Sf=uf.Function,Tf=uf.MessageChannel,Pf=uf.String,Ef=0,Rf={},Of="onreadystatechange";pf((function(){Ll=uf.location}));var If=function(e){if(df(Rf,e)){var t=Rf[e];delete Rf[e],t()}},Lf=function(e){return function(){If(e)}},Af=function(e){If(e.data)},Df=function(e){uf.postMessage(Pf(e),Ll.protocol+"//"+Ll.host)};wf&&Cf||(wf=function(e){mf(arguments.length,1);var t=hf(e)?e:Sf(e),n=gf(arguments,1);return Rf[++Ef]=function(){lf(t,void 0,n)},Al(Ef),Ef},Cf=function(e){delete Rf[e]},bf?Al=function(e){_f.nextTick(Lf(e))}:xf&&xf.now?Al=function(e){xf.now(Lf(e))}:Tf&&!kf?(Ml=(Dl=new Tf).port2,Dl.port1.onmessage=Af,Al=ff(Ml.postMessage,Ml)):uf.addEventListener&&hf(uf.postMessage)&&!uf.importScripts&&Ll&&"file:"!==Ll.protocol&&!pf(Df)?(Al=Df,uf.addEventListener("message",Af,!1)):Al=Of in yf("script")?function(e){vf.appendChild(yf("script"))[Of]=function(){vf.removeChild(this),If(e)}}:function(e){setTimeout(Lf(e),0)});var Mf={set:wf,clear:Cf},Nf=function(){this.head=null,this.tail=null};Nf.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Ff,Bf,jf,Hf,Uf,Vf=Nf,Gf=/ipad|iphone|ipod/i.test(M)&&"undefined"!=typeof Pebble,Wf=/web0s(?!.*chrome)/i.test(M),zf=n,Kf=As,Yf=Un.f,Xf=Mf.set,qf=Vf,$f=cf,Jf=Gf,Zf=Wf,Qf=Nl,eh=zf.MutationObserver||zf.WebKitMutationObserver,th=zf.document,nh=zf.process,ih=zf.Promise,rh=Yf(zf,"queueMicrotask"),oh=rh&&rh.value;if(!oh){var sh=new qf,ah=function(){var e,t;for(Qf&&(e=nh.domain)&&e.exit();t=sh.get();)try{t()}catch(e){throw sh.head&&Ff(),e}e&&e.enter()};$f||Qf||Zf||!eh||!th?!Jf&&ih&&ih.resolve?((Hf=ih.resolve(void 0)).constructor=ih,Uf=Kf(Hf.then,Hf),Ff=function(){Uf(ah)}):Qf?Ff=function(){nh.nextTick(ah)}:(Xf=Kf(Xf,zf),Ff=function(){Xf(ah)}):(Bf=!0,jf=th.createTextNode(""),new eh(ah).observe(jf,{characterData:!0}),Ff=function(){jf.data=Bf=!Bf}),oh=function(e){sh.head||Ff(),sh.add(e)}}var ch=oh,uh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},lh=n.Promise,fh="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,hh=!fh&&!Nl&&"object"==typeof window&&"object"==typeof document,dh=n,ph=lh,vh=ue,gh=nr,yh=Lt,mh=ie,kh=hh,bh=fh,wh=V;ph&&ph.prototype;var Ch=mh("species"),_h=!1,xh=vh(dh.PromiseRejectionEvent),Sh=gh("Promise",(function(){var e=yh(ph),t=e!==String(ph);if(!t&&66===wh)return!0;if(!wh||wh<51||!/native code/.test(e)){var n=new ph((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[Ch]=i,!(_h=n.then((function(){}))instanceof i))return!0}return!t&&(kh||bh)&&!xh})),Th={CONSTRUCTOR:Sh,REJECTION_EVENT:xh,SUBCLASSING:_h},Ph={},Eh=Ge,Rh=TypeError,Oh=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw Rh("Bad Promise constructor");t=e,n=i})),this.resolve=Eh(t),this.reject=Eh(n)};Ph.f=function(e){return new Oh(e)};var Ih,Lh,Ah,Dh=lr,Mh=Nl,Nh=n,Fh=Ee,Bh=Pn,jh=zl,Hh=Ts,Uh=$l,Vh=Ge,Gh=ue,Wh=pe,zh=Ql,Kh=of,Yh=Mf.set,Xh=ch,qh=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},$h=uh,Jh=Vf,Zh=on,Qh=lh,ed=Ph,td="Promise",nd=Th.CONSTRUCTOR,id=Th.REJECTION_EVENT,rd=Th.SUBCLASSING,od=Zh.getterFor(td),sd=Zh.set,ad=Qh&&Qh.prototype,cd=Qh,ud=ad,ld=Nh.TypeError,fd=Nh.document,hd=Nh.process,dd=ed.f,pd=dd,vd=!!(fd&&fd.createEvent&&Nh.dispatchEvent),gd="unhandledrejection",yd=function(e){var t;return!(!Wh(e)||!Gh(t=e.then))&&t},md=function(e,t){var n,i,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&_d(t),t.rejection=1),!0===a?n=o:(l&&l.enter(),n=a(o),l&&(l.exit(),r=!0)),n===e.promise?u(ld("Promise-chain cycle")):(i=yd(n))?Fh(i,n,c,u):c(n)):u(o)}catch(e){l&&!r&&l.exit(),u(e)}},kd=function(e,t){e.notified||(e.notified=!0,Xh((function(){for(var n,i=e.reactions;n=i.get();)md(n,e);e.notified=!1,t&&!e.rejection&&wd(e)})))},bd=function(e,t,n){var i,r;vd?((i=fd.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),Nh.dispatchEvent(i)):i={promise:t,reason:n},!id&&(r=Nh["on"+e])?r(i):e===gd&&qh("Unhandled promise rejection",n)},wd=function(e){Fh(Yh,Nh,(function(){var t,n=e.facade,i=e.value;if(Cd(e)&&(t=$h((function(){Mh?hd.emit("unhandledRejection",i,n):bd(gd,n,i)})),e.rejection=Mh||Cd(e)?2:1,t.error))throw t.value}))},Cd=function(e){return 1!==e.rejection&&!e.parent},_d=function(e){Fh(Yh,Nh,(function(){var t=e.facade;Mh?hd.emit("rejectionHandled",t):bd("rejectionhandled",t,e.value)}))},xd=function(e,t,n){return function(i){e(t,i,n)}},Sd=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,kd(e,!0))},Td=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw ld("Promise can't be resolved itself");var i=yd(t);i?Xh((function(){var n={done:!1};try{Fh(i,t,xd(Td,n,e),xd(Sd,n,e))}catch(t){Sd(n,t,e)}})):(e.value=t,e.state=1,kd(e,!1))}catch(t){Sd({done:!1},t,e)}}};if(nd&&(ud=(cd=function(e){zh(this,ud),Vh(e),Fh(Ih,this);var t=od(this);try{e(xd(Td,t),xd(Sd,t))}catch(e){Sd(t,e)}}).prototype,(Ih=function(e){sd(this,{type:td,done:!1,notified:!1,parent:!1,reactions:new Jh,rejection:!1,state:0,value:void 0})}).prototype=Bh(ud,"then",(function(e,t){var n=od(this),i=dd(Kh(this,cd));return n.parent=!0,i.ok=!Gh(e)||e,i.fail=Gh(t)&&t,i.domain=Mh?hd.domain:void 0,0==n.state?n.reactions.add(i):Xh((function(){md(i,n)})),i.promise})),Lh=function(){var e=new Ih,t=od(e);this.promise=e,this.resolve=xd(Td,t),this.reject=xd(Sd,t)},ed.f=dd=function(e){return e===cd||undefined===e?new Lh(e):pd(e)},Gh(Qh)&&ad!==Object.prototype)){Ah=ad.then,rd||Bh(ad,"then",(function(e,t){var n=this;return new cd((function(e,t){Fh(Ah,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete ad.constructor}catch(e){}jh&&jh(ad,ud)}Dh({global:!0,constructor:!0,wrap:!0,forced:nd},{Promise:cd}),Hh(cd,td,!1),Uh(td);var Pd={},Ed=Pd,Rd=ie("iterator"),Od=Array.prototype,Id=function(e){return void 0!==e&&(Ed.Array===e||Od[Rd]===e)},Ld=Bn,Ad=Ke,Dd=b,Md=Pd,Nd=ie("iterator"),Fd=function(e){if(!Dd(e))return Ad(e,Nd)||Ad(e,"@@iterator")||Md[Ld(e)]},Bd=Ee,jd=Ge,Hd=Se,Ud=je,Vd=Fd,Gd=TypeError,Wd=function(e,t){var n=arguments.length<2?Vd(e):t;if(jd(n))return Hd(Bd(n,e));throw Gd(Ud(e)+" is not iterable")},zd=Ee,Kd=Se,Yd=Ke,Xd=function(e,t,n){var i,r;Kd(e);try{if(!(i=Yd(e,"return"))){if("throw"===t)throw n;return n}i=zd(i,e)}catch(e){r=!0,i=e}if("throw"===t)throw n;if(r)throw i;return Kd(i),n},qd=As,$d=Ee,Jd=Se,Zd=je,Qd=Id,ep=Ci,tp=Le,np=Wd,ip=Fd,rp=Xd,op=TypeError,sp=function(e,t){this.stopped=e,this.result=t},ap=sp.prototype,cp=function(e,t,n){var i,r,o,s,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=qd(t,l),g=function(e){return i&&rp(i,"normal",e),new sp(!0,e)},y=function(e){return f?(Jd(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(h)i=e.iterator;else if(d)i=e;else{if(!(r=ip(e)))throw op(Zd(e)+" is not iterable");if(Qd(r)){for(o=0,s=ep(e);s>o;o++)if((a=y(e[o]))&&tp(ap,a))return a;return new sp(!1)}i=np(e,r)}for(c=h?e.next:i.next;!(u=$d(c,i)).done;){try{a=y(u.value)}catch(e){rp(i,"throw",e)}if("object"==typeof a&&a&&tp(ap,a))return a}return new sp(!1)},up=ie("iterator"),lp=!1;try{var fp=0,hp={next:function(){return{done:!!fp++}},return:function(){lp=!0}};hp[up]=function(){return this},Array.from(hp,(function(){throw 2}))}catch(e){}var dp=lh,pp=function(e,t){if(!t&&!lp)return!1;var n=!1;try{var i={};i[up]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},vp=Th.CONSTRUCTOR||!pp((function(e){dp.all(e).then(void 0,(function(){}))})),gp=Ee,yp=Ge,mp=Ph,kp=uh,bp=cp;lr({target:"Promise",stat:!0,forced:vp},{all:function(e){var t=this,n=mp.f(t),i=n.resolve,r=n.reject,o=kp((function(){var n=yp(t.resolve),o=[],s=0,a=1;bp(e,(function(e){var c=s++,u=!1;a++,gp(n,t,e).then((function(e){u||(u=!0,o[c]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise}});var wp=lr,Cp=Th.CONSTRUCTOR,_p=lh,xp=Ie,Sp=ue,Tp=Pn,Pp=_p&&_p.prototype;if(wp({target:"Promise",proto:!0,forced:Cp,real:!0},{catch:function(e){return this.then(void 0,e)}}),Sp(_p)){var Ep=xp("Promise").prototype.catch;Pp.catch!==Ep&&Tp(Pp,"catch",Ep,{unsafe:!0})}var Rp=Ee,Op=Ge,Ip=Ph,Lp=uh,Ap=cp;lr({target:"Promise",stat:!0,forced:vp},{race:function(e){var t=this,n=Ip.f(t),i=n.reject,r=Lp((function(){var r=Op(t.resolve);Ap(e,(function(e){Rp(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Dp=Ee,Mp=Ph;lr({target:"Promise",stat:!0,forced:Th.CONSTRUCTOR},{reject:function(e){var t=Mp.f(this);return Dp(t.reject,void 0,e),t.promise}});var Np=Se,Fp=pe,Bp=Ph,jp=lr,Hp=Th.CONSTRUCTOR,Up=function(e,t){if(Np(e),Fp(t)&&t.constructor===e)return t;var n=Bp.f(e);return(0,n.resolve)(t),n.promise};Ie("Promise"),jp({target:"Promise",stat:!0,forced:Hp},{resolve:function(e){return Up(this,e)}});var Vp=fe,Gp=St.EXISTS,Wp=k,zp=fs,Kp=Function.prototype,Yp=Wp(Kp.toString),Xp=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,qp=Wp(Xp.exec);Vp&&!Gp&&zp(Kp,"name",{configurable:!0,get:function(){try{return qp(Xp,Yp(this))[1]}catch(e){return""}}}),lr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var $p=ue,Jp=pe,Zp=zl,Qp=function(e,t,n){var i,r;return Zp&&$p(i=t.constructor)&&i!==n&&Jp(r=i.prototype)&&r!==n.prototype&&Zp(e,r),e},ev=k(1..valueOf),tv="\t\n\v\f\r \u2028\u2029\ufeff",nv=_,iv=Ko,rv=tv,ov=k("".replace),sv=RegExp("^["+rv+"]+"),av=RegExp("(^|[^"+rv+"])["+rv+"]+$"),cv=function(e){return function(t){var n=iv(nv(t));return 1&e&&(n=ov(n,sv,"")),2&e&&(n=ov(n,av,"$1")),n}},uv={start:cv(1),end:cv(2),trim:cv(3)},lv=lr,fv=fe,hv=n,dv=ps,pv=k,vv=nr,gv=R,yv=Qp,mv=Le,kv=Fe,bv=rt,wv=d,Cv=ui.f,_v=Un.f,xv=le.f,Sv=ev,Tv=uv.trim,Pv="Number",Ev=hv[Pv];dv[Pv];var Rv=Ev.prototype,Ov=hv.TypeError,Iv=pv("".slice),Lv=pv("".charCodeAt),Av=function(e){var t,n,i,r,o,s,a,c,u=bv(e,"number");if(kv(u))throw Ov("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=Tv(u),43===(t=Lv(u,0))||45===t){if(88===(n=Lv(u,2))||120===n)return NaN}else if(48===t){switch(Lv(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(s=(o=Iv(u,2)).length,a=0;a<s;a++)if((c=Lv(o,a))<48||c>r)return NaN;return parseInt(o,i)}return+u},Dv=vv(Pv,!Ev(" 0o1")||!Ev("0b1")||Ev("+0x1")),Mv=function(e){var t,n=arguments.length<1?0:Ev(function(e){var t=bv(e,"number");return"bigint"==typeof t?t:Av(t)}(e));return mv(Rv,t=this)&&wv((function(){Sv(t)}))?yv(Object(n),this,Mv):n};Mv.prototype=Rv,Dv&&(Rv.constructor=Mv),lv({global:!0,constructor:!0,wrap:!0,forced:Dv},{Number:Mv});Dv&&function(e,t){for(var n,i=fv?Cv(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)gv(t,n=i[r])&&!gv(e,n)&&xv(e,n,_v(t,n))}(dv[Pv],Ev);var Nv=ie,Fv=mo,Bv=le.f,jv=Nv("unscopables"),Hv=Array.prototype;null==Hv[jv]&&Bv(Hv,jv,{configurable:!0,value:Fv(null)});var Uv,Vv,Gv,Wv=function(e){Hv[jv][e]=!0},zv=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Kv=R,Yv=ue,Xv=T,qv=zv,$v=Gt("IE_PROTO"),Jv=Object,Zv=Jv.prototype,Qv=qv?Jv.getPrototypeOf:function(e){var t=Xv(e);if(Kv(t,$v))return t[$v];var n=t.constructor;return Yv(n)&&t instanceof n?n.prototype:t instanceof Jv?Zv:null},eg=d,tg=ue,ng=pe,ig=Qv,rg=Pn,og=ie("iterator"),sg=!1;[].keys&&("next"in(Gv=[].keys())?(Vv=ig(ig(Gv)))!==Object.prototype&&(Uv=Vv):sg=!0);var ag=!ng(Uv)||eg((function(){var e={};return Uv[og].call(e)!==e}));ag&&(Uv={}),tg(Uv[og])||rg(Uv,og,(function(){return this}));var cg={IteratorPrototype:Uv,BUGGY_SAFARI_ITERATORS:sg},ug=cg.IteratorPrototype,lg=mo,fg=Nt,hg=Ts,dg=Pd,pg=function(){return this},vg=function(e,t,n,i){var r=t+" Iterator";return e.prototype=lg(ug,{next:fg(+!i,n)}),hg(e,r,!1),dg[r]=pg,e},gg=lr,yg=Ee,mg=ue,kg=vg,bg=Qv,wg=zl,Cg=Ts,_g=jt,xg=Pn,Sg=Pd,Tg=St.PROPER,Pg=St.CONFIGURABLE,Eg=cg.IteratorPrototype,Rg=cg.BUGGY_SAFARI_ITERATORS,Og=ie("iterator"),Ig="keys",Lg="values",Ag="entries",Dg=function(){return this},Mg=function(e,t,n,i,r,o,s){kg(n,t,i);var a,c,u,l=function(e){if(e===r&&v)return v;if(!Rg&&e in d)return d[e];switch(e){case Ig:case Lg:case Ag:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[Og]||d["@@iterator"]||r&&d[r],v=!Rg&&p||l(r),g="Array"==t&&d.entries||p;if(g&&(a=bg(g.call(new e)))!==Object.prototype&&a.next&&(bg(a)!==Eg&&(wg?wg(a,Eg):mg(a[Og])||xg(a,Og,Dg)),Cg(a,f,!0)),Tg&&r==Lg&&p&&p.name!==Lg&&(Pg?_g(d,"name",Lg):(h=!0,v=function(){return yg(p,this)})),r)if(c={values:l(Lg),keys:o?v:l(Ig),entries:l(Ag)},s)for(u in c)(Rg||h||!(u in d))&&xg(d,u,c[u]);else gg({target:t,proto:!0,forced:Rg||h},c);return d[Og]!==v&&xg(d,Og,v,{name:r}),Sg[t]=v,c},Ng=function(e,t){return{value:e,done:t}},Fg=Qn,Bg=Wv,jg=Pd,Hg=on,Ug=le.f,Vg=Mg,Gg=Ng,Wg=fe,zg="Array Iterator",Kg=Hg.set,Yg=Hg.getterFor(zg),Xg=Vg(Array,"Array",(function(e,t){Kg(this,{type:zg,target:Fg(e),index:0,kind:t})}),(function(){var e=Yg(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,Gg(void 0,!0)):Gg("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),qg=jg.Arguments=jg.Array;if(Bg("keys"),Bg("values"),Bg("entries"),Wg&&"values"!==qg.name)try{Ug(qg,"name",{value:"values"})}catch(e){}var $g=n,Jg=zu,Zg=Xu,Qg=Xg,ey=jt,ty=ie,ny=ty("iterator"),iy=ty("toStringTag"),ry=Qg.values,oy=function(e,t){if(e){if(e[ny]!==ry)try{ey(e,ny,ry)}catch(t){e[ny]=ry}if(e[iy]||ey(e,iy,t),Jg[t])for(var n in Qg)if(e[n]!==Qg[n])try{ey(e,n,Qg[n])}catch(t){e[n]=Qg[n]}}};for(var sy in Jg)oy($g[sy]&&$g[sy].prototype,sy);oy(Zg,"DOMTokenList");var ay=$s.filter;lr({target:"Array",proto:!0,forced:!du("filter")},{filter:function(e){return ay(this,e,arguments.length>1?arguments[1]:void 0)}});var cy=fe,uy=k,ly=Ee,fy=d,hy=qr,dy=Fi,py=Vn,vy=T,gy=$n,yy=Object.assign,my=Object.defineProperty,ky=uy([].concat),by=!yy||fy((function(){if(cy&&1!==yy({b:1},yy(my({},"a",{enumerable:!0,get:function(){my(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=yy({},e)[n]||hy(yy({},t)).join("")!=i}))?function(e,t){for(var n=vy(e),i=arguments.length,r=1,o=dy.f,s=py.f;i>r;)for(var a,c=gy(arguments[r++]),u=o?ky(hy(c),o(c)):hy(c),l=u.length,f=0;l>f;)a=u[f++],cy&&!ly(s,c,a)||(n[a]=c[a]);return n}:yy,wy=by;lr({target:"Object",stat:!0,arity:2,forced:Object.assign!==wy},{assign:wy});var Cy={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},a.prototype.emit=function(e,t,i,r,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||i&&a.context!==i||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||r&&!a[c].once||i&&a[c].context!==i)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(Cy);var _y=Cy.exports,xy=JSON.parse('"3.0.0-alpha.152"');function Sy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Ty(e){return function(e){if(Array.isArray(e))return Sy(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){if("string"==typeof e)return Sy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sy(e,t):void 0}}(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.")}()}var Py=Se,Ey=function(){var e=Py(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},Ry=d,Oy=n.RegExp,Iy=Ry((function(){var e=Oy("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Ly=Iy||Ry((function(){return!Oy("a","y").sticky})),Ay={BROKEN_CARET:Iy||Ry((function(){var e=Oy("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Ly,UNSUPPORTED_Y:Iy},Dy=d,My=n.RegExp,Ny=Dy((function(){var e=My(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Fy=d,By=n.RegExp,jy=Fy((function(){var e=By("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Hy=Ee,Uy=k,Vy=Ko,Gy=Ey,Wy=Ay,zy=i.exports,Ky=mo,Yy=on.get,Xy=Ny,qy=jy,$y=zy("native-string-replace",String.prototype.replace),Jy=RegExp.prototype.exec,Zy=Jy,Qy=Uy("".charAt),em=Uy("".indexOf),tm=Uy("".replace),nm=Uy("".slice),im=function(){var e=/a/,t=/b*/g;return Hy(Jy,e,"a"),Hy(Jy,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),rm=Wy.BROKEN_CARET,om=void 0!==/()??/.exec("")[1];(im||om||rm||Xy||qy)&&(Zy=function(e){var t,n,i,r,o,s,a,c=this,u=Yy(c),l=Vy(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=Hy(Zy,f,l),c.lastIndex=f.lastIndex,t;var h=u.groups,d=rm&&c.sticky,p=Hy(Gy,c),v=c.source,g=0,y=l;if(d&&(p=tm(p,"y",""),-1===em(p,"g")&&(p+="g"),y=nm(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Qy(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),om&&(n=new RegExp("^"+v+"$(?!\\s)",p)),im&&(i=c.lastIndex),r=Hy(Jy,d?n:c,y),d?r?(r.input=nm(r.input,g),r[0]=nm(r[0],g),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:im&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),om&&r&&r.length>1&&Hy($y,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&h)for(r.groups=s=Ky(null),o=0;o<h.length;o++)s[(a=h[o])[0]]=r[a[1]];return r});var sm=Zy;lr({target:"RegExp",proto:!0,forced:/./.exec!==sm},{exec:sm});var am=Rs,cm=Pn,um=sm,lm=d,fm=ie,hm=jt,dm=fm("species"),pm=RegExp.prototype,vm=function(e,t,n,i){var r=fm(e),o=!lm((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!lm((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[dm]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!s||n){var a=am(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var s=am(e),c=t.exec;return c===um||c===pm.exec?o&&!r?{done:!0,value:a(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));cm(String.prototype,e,c[0]),cm(pm,r,c[1])}i&&hm(pm[r],"sham",!0)},gm=k,ym=di,mm=Ko,km=_,bm=gm("".charAt),wm=gm("".charCodeAt),Cm=gm("".slice),_m=function(e){return function(t,n){var i,r,o=mm(km(t)),s=ym(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=wm(o,s))<55296||i>56319||s+1===a||(r=wm(o,s+1))<56320||r>57343?e?bm(o,s):i:e?Cm(o,s,s+2):r-56320+(i-55296<<10)+65536}},xm={codeAt:_m(!1),charAt:_m(!0)},Sm=xm.charAt,Tm=function(e,t,n){return t+(n?Sm(e,t).length:1)},Pm=Ee,Em=Se,Rm=ue,Om=In,Im=sm,Lm=TypeError,Am=function(e,t){var n=e.exec;if(Rm(n)){var i=Pm(n,e,t);return null!==i&&Em(i),i}if("RegExp"===Om(e))return Pm(Im,e,t);throw Lm("RegExp#exec called on incompatible receiver")},Dm=Ee,Mm=Se,Nm=b,Fm=bi,Bm=Ko,jm=_,Hm=Ke,Um=Tm,Vm=Am;vm("match",(function(e,t,n){return[function(t){var n=jm(this),i=Nm(t)?void 0:Hm(t,e);return i?Dm(i,t,n):new RegExp(t)[e](Bm(n))},function(e){var i=Mm(this),r=Bm(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return Vm(i,r);var s=i.unicode;i.lastIndex=0;for(var a,c=[],u=0;null!==(a=Vm(i,r));){var l=Bm(a[0]);c[u]=l,""===l&&(i.lastIndex=Um(r,Fm(i.lastIndex),s)),u++}return 0===u?null:c}]}));var Gm=pe,Wm=In,zm=ie("match"),Km=function(e){var t;return Gm(e)&&(void 0!==(t=e[zm])?!!t:"RegExp"==Wm(e))},Ym=Ee,Xm=R,qm=Le,$m=Ey,Jm=RegExp.prototype,Zm=function(e){var t=e.flags;return void 0!==t||"flags"in Jm||Xm(e,"flags")||!qm(Jm,e)?t:Ym($m,e)},Qm=le.f,ek=fe,tk=n,nk=k,ik=nr,rk=Qp,ok=jt,sk=ui.f,ak=Le,ck=Km,uk=Ko,lk=Zm,fk=Ay,hk=function(e,t,n){n in e||Qm(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},dk=Pn,pk=d,vk=R,gk=on.enforce,yk=$l,mk=Ny,kk=jy,bk=ie("match"),wk=tk.RegExp,Ck=wk.prototype,_k=tk.SyntaxError,xk=nk(Ck.exec),Sk=nk("".charAt),Tk=nk("".replace),Pk=nk("".indexOf),Ek=nk("".slice),Rk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Ok=/a/g,Ik=/a/g,Lk=new wk(Ok)!==Ok,Ak=fk.MISSED_STICKY,Dk=fk.UNSUPPORTED_Y,Mk=ek&&(!Lk||Ak||mk||kk||pk((function(){return Ik[bk]=!1,wk(Ok)!=Ok||wk(Ik)==Ik||"/a/i"!=wk(Ok,"i")})));if(ik("RegExp",Mk)){for(var Nk=function(e,t){var n,i,r,o,s,a,c=ak(Ck,this),u=ck(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===Nk)return e;if((u||ak(Ck,e))&&(e=e.source,l&&(t=lk(h))),e=void 0===e?"":uk(e),t=void 0===t?"":uk(t),h=e,mk&&"dotAll"in Ok&&(i=!!t&&Pk(t,"s")>-1)&&(t=Tk(t,/s/g,"")),n=t,Ak&&"sticky"in Ok&&(r=!!t&&Pk(t,"y")>-1)&&Dk&&(t=Tk(t,/y/g,"")),kk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],s={},a=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=Sk(e,i)))t+=Sk(e,++i);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:xk(Rk,Ek(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||vk(s,l))throw new _k("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e),e=o[0],f=o[1]),s=rk(wk(e,t),c?this:Ck,Nk),(i||r||f.length)&&(a=gk(s),i&&(a.dotAll=!0,a.raw=Nk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=Sk(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+Sk(e,++i);return r}(e),n)),r&&(a.sticky=!0),f.length&&(a.groups=f)),e!==h)try{ok(s,"source",""===h?"(?:)":h)}catch(e){}return s},Fk=sk(wk),Bk=0;Fk.length>Bk;)hk(Nk,wk,Fk[Bk++]);Ck.constructor=Nk,Nk.prototype=Ck,dk(tk,"RegExp",Nk,{constructor:!0})}yk("RegExp");var jk=St.PROPER,Hk=Pn,Uk=Se,Vk=Ko,Gk=d,Wk=Zm,zk="toString",Kk=RegExp.prototype[zk],Yk=Gk((function(){return"/a/b"!=Kk.call({source:"a",flags:"b"})})),Xk=jk&&Kk.name!=zk;(Yk||Xk)&&Hk(RegExp.prototype,zk,(function(){var e=Uk(this);return"/"+Vk(e.source)+"/"+Vk(Wk(e))}),{unsafe:!0});var qk=vr,$k=Ee,Jk=k,Zk=vm,Qk=Se,eb=b,tb=Km,nb=_,ib=of,rb=Tm,ob=bi,sb=Ko,ab=Ke,cb=is,ub=Am,lb=sm,fb=d,hb=Ay.UNSUPPORTED_Y,db=4294967295,pb=Math.min,vb=[].push,gb=Jk(/./.exec),yb=Jk(vb),mb=Jk("".slice),kb=!fb((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));Zk("split",(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=sb(nb(this)),r=void 0===n?db:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!tb(e))return $k(t,i,e,r);for(var o,s,a,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=$k(lb,f,i))&&!((s=f.lastIndex)>l&&(yb(c,mb(i,l,o.index)),o.length>1&&o.index<i.length&&qk(vb,c,cb(o,1)),a=o[0].length,l=s,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!a&&gb(f,"")||yb(c,""):yb(c,mb(i,l)),c.length>r?cb(c,0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:$k(t,this,e,n)}:t,[function(t,n){var r=nb(this),o=eb(t)?void 0:ab(t,e);return o?$k(o,t,r,n):$k(i,sb(r),t,n)},function(e,r){var o=Qk(this),s=sb(e),a=n(i,o,s,r,i!==t);if(a.done)return a.value;var c=ib(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(hb?"g":"y"),f=new c(hb?"^(?:"+o.source+")":o,l),h=void 0===r?db:r>>>0;if(0===h)return[];if(0===s.length)return null===ub(f,s)?[s]:[];for(var d=0,p=0,v=[];p<s.length;){f.lastIndex=hb?0:p;var g,y=ub(f,hb?mb(s,p):s);if(null===y||(g=pb(ob(f.lastIndex+(hb?p:0)),s.length))===d)p=rb(s,p,u);else{if(yb(v,mb(s,d,p)),v.length===h)return v;for(var m=1;m<=y.length-1;m++)if(yb(v,y[m]),v.length===h)return v;p=d=g}}return yb(v,mb(s,d)),v}]}),!kb,hb);var bb=k,wb=T,Cb=Math.floor,_b=bb("".charAt),xb=bb("".replace),Sb=bb("".slice),Tb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Pb=/\$([$&'`]|\d{1,2})/g,Eb=vr,Rb=Ee,Ob=k,Ib=vm,Lb=d,Ab=Se,Db=ue,Mb=b,Nb=di,Fb=bi,Bb=Ko,jb=_,Hb=Tm,Ub=Ke,Vb=function(e,t,n,i,r,o){var s=n+e.length,a=i.length,c=Pb;return void 0!==r&&(r=wb(r),c=Tb),xb(o,c,(function(o,c){var u;switch(_b(c,0)){case"$":return"$";case"&":return e;case"`":return Sb(t,0,n);case"'":return Sb(t,s);case"<":u=r[Sb(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var f=Cb(l/10);return 0===f?o:f<=a?void 0===i[f-1]?_b(c,1):i[f-1]+_b(c,1):o}u=i[l-1]}return void 0===u?"":u}))},Gb=Am,Wb=ie("replace"),zb=Math.max,Kb=Math.min,Yb=Ob([].concat),Xb=Ob([].push),qb=Ob("".indexOf),$b=Ob("".slice),Jb="$0"==="a".replace(/./,"$0"),Zb=!!/./[Wb]&&""===/./[Wb]("a","$0");Ib("replace",(function(e,t,n){var i=Zb?"$":"$0";return[function(e,n){var i=jb(this),r=Mb(e)?void 0:Ub(e,Wb);return r?Rb(r,e,i,n):Rb(t,Bb(i),e,n)},function(e,r){var o=Ab(this),s=Bb(e);if("string"==typeof r&&-1===qb(r,i)&&-1===qb(r,"$<")){var a=n(t,o,s,r);if(a.done)return a.value}var c=Db(r);c||(r=Bb(r));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=Gb(o,s);if(null===h)break;if(Xb(f,h),!u)break;""===Bb(h[0])&&(o.lastIndex=Hb(s,Fb(o.lastIndex),l))}for(var d,p="",v=0,g=0;g<f.length;g++){for(var y=Bb((h=f[g])[0]),m=zb(Kb(Nb(h.index),s.length),0),k=[],b=1;b<h.length;b++)Xb(k,void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var C=Yb([y],k,m,s);void 0!==w&&Xb(C,w);var _=Bb(Eb(r,void 0,C))}else _=Vb(y,s,m,k,w,r);m>=v&&(p+=$b(s,v,m)+_,v=m+y.length)}return p+$b(s,v)}]}),!!Lb((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Jb||Zb);var Qb=St.PROPER,ew=d,tw=tv,nw=uv.trim;lr({target:"String",proto:!0,forced:function(e){return ew((function(){return!!tw[e]()||"
"!=="
"[e]()||Qb&&tw[e].name!==e}))}("trim")},{trim:function(){return nw(this)}});var iw=is,rw=Math.floor,ow=function(e,t){var n=e.length,i=rw(n/2);return n<8?sw(e,t):aw(e,ow(iw(e,0,i),t),ow(iw(e,i),t),t)},sw=function(e,t){for(var n,i,r=e.length,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}return e},aw=function(e,t,n,i){for(var r=t.length,o=n.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?i(t[s],n[a])<=0?t[s++]:n[a++]:s<r?t[s++]:n[a++];return e},cw=ow,uw=M.match(/firefox\/(\d+)/i),lw=!!uw&&+uw[1],fw=/MSIE|Trident/.test(M),hw=M.match(/AppleWebKit\/(\d+)\./),dw=!!hw&&+hw[1],pw=lr,vw=k,gw=Ge,yw=T,mw=Ci,kw=ml,bw=Ko,ww=d,Cw=cw,_w=$u,xw=lw,Sw=fw,Tw=V,Pw=dw,Ew=[],Rw=vw(Ew.sort),Ow=vw(Ew.push),Iw=ww((function(){Ew.sort(void 0)})),Lw=ww((function(){Ew.sort(null)})),Aw=_w("sort"),Dw=!ww((function(){if(Tw)return Tw<70;if(!(xw&&xw>3)){if(Sw)return!0;if(Pw)return Pw<603;var e,t,n,i,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)Ew.push({k:t+i,v:n})}for(Ew.sort((function(e,t){return t.v-e.v})),i=0;i<Ew.length;i++)t=Ew[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));pw({target:"Array",proto:!0,forced:Iw||!Lw||!Aw||!Dw},{sort:function(e){void 0!==e&&gw(e);var t=yw(this);if(Dw)return void 0===e?Rw(t):Rw(t,e);var n,i,r=[],o=mw(t);for(i=0;i<o;i++)i in t&&Ow(r,t[i]);for(Cw(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:bw(t)>bw(n)?1:-1}}(e)),n=mw(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)kw(t,i++);return t}});var Mw="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Nw={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Fw="%c[xgplayer]",Bw={config:{debug:Mw?3:1},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Fw,Nw.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Fw,Nw.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[Fw,Nw.error,e].concat(r))}}};var jw=function(){function e(t){Fo(this,e),this.bufferedList=t}return No(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}(),Hw={};function Uw(e){var t=Ao(e);return null!==e&&("object"===t||"function"===t)}function Vw(e,t,n){var i,r,o,s,a,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,s=e.apply(o,n)}function v(e,t){return d?(window.cancelAnimationFrame(a),window.requestAnimationFrame(e)):setTimeout(e,t)}function g(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function y(){var e=Date.now();if(g(e))return m(e);a=v(y,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function m(e){return a=void 0,h&&i?p(e):(i=r=void 0,s)}function k(){for(var e=Date.now(),n=g(e),o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i=h,r=this,c=e,n){if(void 0===a)return function(e){return u=e,a=v(y,t),l?p(e):s}(c);if(f)return a=v(y,t),p(c)}return void 0===a&&(a=v(y,t)),s}return t=+t||0,Uw(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==a&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,i=c=r=a=void 0},k.flush=function(){return void 0===a?s:m(Date.now())},k.pending=function(){return void 0!==a},k}Hw.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},Hw.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&Hw.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Bw.logError("util.createDomFromHtml",e),null}},Hw.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===Ao(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Hw.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(n){Hw.hasClass(e,t)||(e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Hw.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(n){Hw.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},Hw.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Hw.hasClass(e,t)?Hw.removeClass(e,t):Hw.addClass(e,t)}))},Hw.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===Hw.typeOf(e[n])?t.push(e[n]):"Object"===Hw.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},Hw.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(i){Bw.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},Hw.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Hw.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),s=[],a=String(e);o--;)s.push(i);return s.join("").substring(0,r-a.length)+a},Hw.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Hw.padStart(Math.floor(e/3600),2,0),n=Hw.padStart(Math.floor((e-3600*t)/60),2,0),i=Hw.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},Hw.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},Hw.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Hw.deepCopy=function(e,t){if("Object"===Hw.typeOf(t)&&"Object"===Hw.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==Hw.typeOf(t[n])||t[n]instanceof Node?"Array"===Hw.typeOf(t[n])?e[n]="Array"===Hw.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:Hw.deepCopy(e[n],t[n])})),e},Hw.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===Hw.typeOf(t[n])&&"Array"===Hw.typeOf(e[n])?"Array"===Hw.typeOf(e[n])&&(i=e[n]).push.apply(i,Ty(t[n])):Hw.typeOf(e[n])!==Hw.typeOf(t[n])||null===e[n]||"Object"!==Hw.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):Hw.deepMerge(e[n],t[n])})),e},Hw.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},Hw.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""},Hw.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},Hw.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Hw.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),Hw.clearTimeout(e,i)}),n);return e._timers.push(i),i},Hw.clearTimeout=function(e,t){var n=e._timers;if("Array"===Hw.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},Hw.clearAllTimers=function(e){var t=e._timers;"Array"===Hw.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Hw.createImgBtn=function(e,t,n,i){var r,o,s,a=Hw.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(a.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),s=e,!1)})),a.style.width="".concat(r).concat(s),a.style.height="".concat(o).concat(s),a.style.backgroundSize="".concat(r).concat(s," ").concat(o).concat(s),a.style.margin="start"===e?"-".concat(o/2).concat(s," auto auto -").concat(r/2).concat(s):"auto 5px auto 5px");return a},Hw.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Hw.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Hw.checkIsFunction=function(e){return e&&"function"==typeof e},Hw.checkIsObject=function(e){return null!==e&&"object"===Ao(e)},Hw.hide=function(e){e.style.display="none"},Hw.show=function(e,t){e.style.display=t||"block"},Hw.isUndefined=function(e){if(null==e)return!0},Hw.setStyleFromCsstext=function(e,t){t&&("String"===Hw.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},Hw.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(!function(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Hw.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},Hw.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},Hw.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},Hw.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Hw.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Hw.checkTouchSupport=function(){return"ontouchstart"in window},Hw.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var s=r.length;if(s){var a=r[s-1].end;n[o].start-a<t?n[o].end>a&&(r[s-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new jw(r)},Hw.getBufferByCurrentTime=function(e,t){var n={start:0,end:0,include:0,diff:0,cur:t};if(!e||e.length<1)return n;for(var i=-1,r=-1,o=parseInt(1e3*t,10),s=e.length-1;s>-1;s--){var a=parseInt(1e3*e.start(s),10),c=parseInt(1e3*e.end(s),10);if(o>=a&&o<=c){n.include=1,n.start=a/1e3,n.end=c/1e3,n.diff=(c-o)/1e3;break}o<a&&(i<0||a-o<i)?(i=(a-o)/1e3,r=s):o>c&&(i<0||o-c<i)&&(i=(o-c)/1e3,r=s)}return 1!==n.include&&(r<0&&(r=e.length-1),n.start=parseInt(1e3*e.start(r),10)/1e3,n.end=parseInt(1e3*e.end(r),10)/1e3,n.diff=(parseInt(1e3*n.end,10)-o)/1e3),n},Hw.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}},Hw.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Hw.getHostFromUrl=function(e){if("String"!==Hw.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},Hw.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Hw.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Hw.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Hw.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){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 n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Hw.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},Hw.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]:"",n={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(n).forEach((function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(n[e],")");i.test(t)?(i.lastIndex=-1,t=t.replace(i,r)):t+="".concat(r," ")})),t},Hw.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360};var Gw={1:"network",2:"network",3:"decoder",4:"format"},Ww=No((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};Fo(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(null!=t&&t.video){var r=n.mediaError?n.mediaError:t.video.error||{},o=t.duration,s=t.currentTime,a=t.ended,c=t.src,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:xy,domain:document.domain,currentTime:s,duration:o,ended:a,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:Hw.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:xy,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)p[v[g]]=arguments[g];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}})),zw="play",Kw="playing",Yw="ended",Xw="pause",qw="error",$w="seeking",Jw="seeked",Zw="timeupdate",Qw="waiting",eC="canplay",tC="durationchange",nC="volumechange",iC="loadeddata",rC="ratechange",oC="progress",sC="loadstart",aC="emptied",cC="focus",uC="blur",lC="ready",fC="urlNull",hC="autoplay_started",dC="autoplay_was_prevented",pC="complete",vC="replay",gC="destroy",yC="urlchange",mC="download_speed_change",kC="buffer_control",bC="AbortError",wC="fullscreen_change",CC="cssFullscreen_change",_C="mini_state_change",xC="definition_change",SC="after_definition_change",TC="video_resize",PC="pip_change",EC="rotate",RC="screenShot",OC="playnext",IC="shortcut",LC="xglog",AC="user_action",DC="reset",MC="source_error",NC="source_success",FC=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],BC={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},jC="fps_stuck",HC=Object.freeze({__proto__:null,PLAY:zw,PLAYING:Kw,ENDED:Yw,PAUSE:Xw,ERROR:qw,SEEKING:$w,SEEKED:Jw,TIME_UPDATE:Zw,WAITING:Qw,CANPLAY:eC,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:tC,VOLUME_CHANGE:nC,LOADED_DATA:iC,LOADED_METADATA:"loadedmetadata",RATE_CHANGE:rC,PROGRESS:oC,LOAD_START:sC,EMPTIED:aC,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:cC,PLAYER_BLUR:uC,READY:lC,URL_NULL:fC,AUTOPLAY_STARTED:hC,AUTOPLAY_PREVENTED:dC,COMPLETE:pC,REPLAY:vC,DESTROY:gC,URL_CHANGE:yC,DOWNLOAD_SPEED_CHANGE:mC,BUFFER_CONTROLS:kC,PLAY_ABORTED:bC,FULLSCREEN_CHANGE:wC,CSS_FULLSCREEN_CHANGE:CC,MINI_STATE_CHANGE:_C,DEFINITION_CHANGE:xC,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:SC,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:TC,PIP_CHANGE:PC,ROTATE:EC,SCREEN_SHOT:RC,PLAYNEXT:OC,SHORTCUT:IC,XGLOG:LC,USER_ACTION:AC,RESET:DC,SOURCE_ERROR:MC,SOURCE_SUCCESS:NC,SWITCH_SUBTITLE:"switch_subtitle",VIDEO_EVENTS:FC,STATS_EVENTS:BC,FPS_STUCK:jC,DEGRADE:"degrade"}),UC=/(Android)\s([\d.]+)/,VC=/(Version)\/([\d.]+)/,GC=["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"],WC={get device(){return WC.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!o,a=!(s||i||n||o),c=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:s,isIpad:c,isIos:s||c,isAndroid:i,isPc:a,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?VC:UC)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&GC.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}},isHdrSupported:function(){if("function"==typeof matchMedia){var e=matchMedia("(dynamic-range: high)"),t=matchMedia("not supported query");return e.media!==t.media&&!0===e.matches}return!1}},zC=WC;function KC(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function YC(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var XC=function(e){jo(n,e);var t=KC(n);function n(e){var i;Fo(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i.bizType="number"==typeof e.bizType&&e.bizType>=0?e.bizType:0,i._rate=-1,i.videoConfig=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 zC.isWeixin&&zC.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),e.loop&&(i.videoConfig.loop="loop"),i.video=Hw.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===Hw.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.video.muted=!0,i._lastMuted=!0),e.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return No(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.videoEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.videoEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(e){var t=this;this.evHandlers||(this._evHandlers=FC.map((function(e){return Go({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:Hw.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var s=i.video?i.video.playbackRate:0;if(s&&i._rate===s)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var a=YC.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,a)}catch(e){throw YC.call(i,r,o),e}}else YC.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0];e.addEventListener(n,t[n],!1)}))}},{key:"detachVideoEvents",value:function(e){e||(e=this.video),this._evHandlers.map((function(t){var n=Object.keys(t)[0];e.removeEventListener(Object.keys(t)[0],t[n],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(Hw.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit(NC,{src:e.target.currentSrc,host:Hw.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){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=Gw[4];n.emit(MC,new Ww(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var s=0;s<i.length;s++)i[s].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?Gw[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new Ww(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.video&&this.video.autoplay},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?Hw.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var t=this.video.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){if(!this.video||!this.video.error)return null;return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){this.video&&this.video.muted!==e&&(this._lastMuted=this.video.muted,this.video.muted=e)}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video.src=e}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){e!==1/0&&this.video&&(this.video.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=au(Vo(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){au(Vo(n.prototype),"removeAllListeners",this).call(this)}}]),n}(_y),qC=XC,$C=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"}};Fo(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return No(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),JC=$C,ZC=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],QC=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],e_=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],t_="data-xgplayerid",n_={BUFFER_CONTROLS:"buffer_control"},i_={PLAYING:"playing",WAITING:"waiting"},r_=lr,o_=$s.find,s_=Wv,a_="find",c_=!0;function u_(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var s=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(s&&s.then?s.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function l_(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var s,a=(s=this.__hooks[e]).call.apply(s,[this,this].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&u_.apply(void 0,[r,t,n.next].concat(Ty(i)))})).catch((function(e){throw e})):u_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&u_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else u_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function f_(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function h_(e,t){var n=this.__hooks;if(!n||!Array.isArray(n[e]))return-1;for(var i=n[e],r=0;r<i.length;r++)if(i[r]===t)return r;return-1}function d_(e,t){var n=this.__hooks;if(n)if(Array.isArray(n[e])){var i=n[e],r=h_.call(this,e,t);-1!==r&&i.splice(r,1)}else n[e]&&(n[e]=null)}function p_(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function v_(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function g_(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 y_(e){e.__hooks=null}function m_(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var s,a=(s=e.__hooks[t]).call.apply(s,[e,e].concat(r));if(a&&a.then)a.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==a)return n.call.apply(n,[e,e].concat(r))}function k_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function b_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k_(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w_(e,t){Bw.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}a_ in[]&&Array(1)[a_]((function(){c_=!1})),r_({target:"Array",proto:!0,forced:c_},{find:function(e){return o_(this,e,arguments.length>1?arguments[1]:void 0)}}),s_(a_);var C_=function(){function e(t){Fo(this,e),Hw.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),g_(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return No(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,t=Hw.checkTouchSupport()?"touch":"mouse";return["compatible","touch","mouse"].indexOf(null===(e=this.playerConfig)||void 0===e?void 0:e.domEventType)>-1&&(t=this.playerConfig.domEventType),t}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):w_(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):w_(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):w_(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=b_(b_({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return f_.call.apply(f_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return d_.call.apply(d_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),Hw.clearAllTimers(this),Hw.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),y_(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var __=Element.prototype;__.matches=__.matchesSelector||__.mozMatchesSelector||__.msMatchesSelector||__.oMatchesSelector||__.webkitMatchesSelector}var x_=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function S_(e,t,n,i,r){var o=T_.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function T_(e,t,n,i){return function(n){n.delegateTarget=x_(n.target,t),n.delegateTarget&&i.call(e,n)}}var P_=function(e,t,n,i,r){return"function"==typeof e.addEventListener?S_.apply(null,arguments):"function"==typeof n?S_.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return S_(e,t,n,i,r)})))};function E_(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var R_={CONTROLS:"controls",ROOT:"root"},O_={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"},I_="xg-icon-disable";function L_(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function A_(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Hw.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(L_(e)||L_(e.url))return i.src=L_(e)?e:e.url||"",o=Hw.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Hw.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Bw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Bw.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?Hw.createDomFromHtml(e,i,n):(Bw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function D_(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",s=r&&r.attr?r.attr:{},a=null;n&&n[i]&&(o=function(e,t){return"object"===Ao(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),s=function(e,t){return"object"===Ao(e)&&e.attr&&"object"===Ao(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],s),a=A_(n[i],i,o,s,t.pluginName)),!a&&r&&(a=A_(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[i]=a}))}var M_=function(e){jo(n,e);var t=E_(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fo(this,n),(e=t.call(this,i)).__delegates=[],e}return No(n,[{key:"__init",value:function(e){if(au(Vo(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,D_(this.registerIcons()||{},this),this.langText={};var r,o,s=this.registerLanguageTexts()||{};r=s,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var a="";try{a=this.render()}catch(e){throw Bw.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(a)(i=n.insert(a,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=Hw.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var c=this.config.attr||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Ao(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,s=t[o],a={root:e.root};"function"==typeof s?(i=e.config[o]||{},r=s):"object"===Ao(s)&&"function"==typeof s.plugin&&(i=s.options?Hw.deepCopy(e.config[o]||{},s.options):e.config[o]||{},r=s.plugin),a.config=i,void 0!==i.index&&(a.index=i.index),i.root&&(a.root=i.root),e.registerPlugin(r,a,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,Hw.addClass(this.find(".xgplayer-icon"),I_)}},{key:"enable",value:function(){this.config.disable=!1,Hw.removeClass(this.find(".xgplayer-icon"),I_)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=au(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===Hw.typeOf(e)?this.root.style[e]=t:void("Object"===Hw.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===Hw.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Hw.typeOf(e)&&Object.keys(e).map((function(t){n.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"unbindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,n)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return Bw.logError("Plugin:appendChild",e),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)),au(Vo(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var s=0,a=null,c="";s<i;s++){a=t.children[s];var u=Number(a.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<r&&(c="afterend")}return o?"afterend"===c?t.appendChild(e):t.insertBefore(e,a):a.insertAdjacentHTML(c,e),"afterend"===c?t.children[t.children.length-1]:t.children[s]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var s=P_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}));else{var s=P_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return R_}},{key:"POSITIONS",get:function(){return O_}}]),n}(C_),N_=xm.charAt,F_=Ko,B_=on,j_=Mg,H_=Ng,U_="String Iterator",V_=B_.set,G_=B_.getterFor(U_);j_(String,"String",(function(e){V_(this,{type:U_,string:F_(e),index:0})}),(function(){var e,t=G_(this),n=t.string,i=t.index;return i>=n.length?H_(void 0,!0):(e=N_(n,i),t.index+=e.length,H_(e,!1))}));var W_=function(){function e(){var t=this;if(Fo(this,e),Go(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Uw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Vw(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return No(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(t_),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(e){console.error(e)}return!0}return!1}}]),e}(),z_=null;var K_={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},z_||(z_=new W_),z_.addObserver(t,n)),this.pluginGroup[i]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===Hw.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=e;var s=n.pluginName||t.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var a=Object.keys(o),c=0;c<a.length;c++)if(s.toLowerCase()===a[c].toLowerCase()){var u=o[a[c]];"Object"===Hw.typeOf(u)&&(n.config=Object.assign({},n.config,o[a[c]]));break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var l=new t(n);return r[s.toLowerCase()]=l,r[s.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(s,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,s=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();s.push(n(t))}catch(e){throw s.push(n(null)),e}})),Promise.all([].concat(s)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,z_.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,s=Object.keys(r);o<s.length;o++){var a=s[o];this.unRegister(t,a)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Y_=K_,X_={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-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function q_(){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}function $_(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var J_=function(e){jo(n,e);var t=$_(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Ho(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Go(Ho(e),"onMouseLeave",(function(){Ho(e).player.focus()})),e}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==zC.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(X_.FLEX_CONTROLS),o&&this.player.addClass(X_.AUTOHIDE);var s={height:"".concat(i,"px")};Object.keys(s).map((function(t){e.root.style[t]=s[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(_C,(function(t){t?Hw.addClass(e.root,"mini-controls"):Hw.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==zC.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Hw.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){Hw.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case O_.CONTROLS_LEFT:t.root=this.left;break;case O_.CONTROLS_RIGHT:t.root=this.right;break;case O_.CONTROLS_CENTER:t.root=this.center;break;case O_.CONTROLS:t.root=this.root;break;default:t.root=this.left}return au(Vo(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==zC.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=Hw.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(M_),Z_=J_,Q_={lang:{},langKeys:[],textKeys:[]};function ex(e,t){return Object.keys(t).forEach((function(n){var i,r=Hw.typeOf(t[n]),o=Hw.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,Ty(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),ex(e[n],t[n])):e[n]=t[n]})),e}function tx(){Object.keys(Q_.lang.en).map((function(e){Q_.textKeys[e]=e}))}function nx(e,t){var n=e.LANG;if(t||(t=Q_),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?ex(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),tx()}}nx({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 ix={get textKeys(){return Q_.textKeys},get langKeys(){return Q_.langKeys},get lang(){var e={};return Q_.langKeys.map((function(t){e[t]=Q_.lang[t]})),Q_.lang["zh-cn"]&&(e.zh=Q_.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=Q_),t.lang){n="Array"!==Hw.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?ex(i[e.LANG]||{},e.TEXT||{}):nx(e,t)})),tx()}},use:nx,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return ex(n.lang,Q_.lang),(t=n.langKeys).push.apply(t,Ty(Q_.langKeys)),ex(n.textKeys,Q_.textKeys),n}},rx=ix;function ox(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var sx={},ax=null,cx=function(e){jo(n,e);var t=ox(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"add",value:function(e){e&&(sx[e.playerId]=e,1===Object.keys(sx).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete sx[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in sx)if(Object.prototype.hasOwnProperty.call(sx,n)){var i=sx[n];if(t){if(e(i))break}else e(i)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(n){var i=e(n);return i&&(t=n),i}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(n){e(n)&&t.push(n)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(sx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):sx[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(sx),t=0;t<e.length;t++){var n=sx[e[t]];if(n&&n.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(sx[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):sx[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return ax||(ax=new n),ax}}]),n}(Cy.exports.EventEmitter);function ux(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function lx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ux(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ux(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var hx=["play","pause","replay","retry","playnext"],dx=0,px=0,vx=null,gx=function(e){jo(n,e);var t=fx(n);function n(e){var i;Fo(this,n);var r,o=Hw.deepMerge(q_(),e);Go(Ho(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Bw.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(eC,i.canPlayFunc),i.removeClass(X_.ENTER)}})),Go(Ho(i),"onFullscreenChange",(function(e,t){var n=function(){Hw.setTimeout(Ho(i),(function(){i.getVideoSize()}),100)},r=Hw.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(AC,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,t_);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.emit(wC,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var s=Ho(i),a=s._fullScreenOffset;s.config.needFullscreenScroll?(window.scrollTo(a.left,a.top),Hw.setTimeout(Ho(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(X_.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,X_.FULLSCREEN),i._fullscreenEl=null,i.emit(wC,!1)}})),Go(Ho(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Go(Ho(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),g_(Ho(i),hx),i.config=o,i._pluginInfoId=Hw.generateSessionId(),(r=Ho(i)).logInfo=Bw.logInfo.bind(r),r.logWarn=Bw.logWarn.bind(r),r.logError=Bw.logError.bind(r);var s=i.constructor.defaultPreset;if(i.config.presets.length){var a=i.config.presets.indexOf("default");a>=0&&s&&(i.config.presets[a]=s)}else s&&i.config.presets.push(s);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isBufferControlPaused=!1,i.isCssfullScreen=!1,i.fullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},i.sizeInfo={width:0,height:0,left:0,top:0},i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=rx.init(),zC.os.isAndroid&&zC.osVersion>0&&zC.osVersion<6&&(i.config.autoplay=!1),i.database=new JC,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,i.innerStates={isActiveLocked:!1},i.instManager=vx,i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),Y_.onPluginsReady(Ho(i)),Hw.setTimeout(Ho(i),(function(){i.emit(lC),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Uo(i))}return No(n,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(!n||1!==n.nodeType)return this.emit(qw,new Ww("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=n}var i=function(e){for(var t=Object.keys(sx),n=0;n<t.length;n++){var i=sx[t[n]];if(i.root===e)return i}return null}(this.root);i&&(Bw.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),i.destroy()),this.root.setAttribute(t_,this.playerId),null===(e=vx)||void 0===e||e.add(this),Y_.init(this),this._initBaseDoms();var r=this.constructor.XgVideoProxy;if(r&&this.videoConfig.mediaType===r.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.video);var s=new r(o,this.config,this.videoConfig);this.attachVideoEvents(s),this.video=s}if(this.video.setAttribute(t_,this.playerId),this.config.controls){var a=Y_.register(this,Z_);this.controls=a}var c="mobile"===this.config.isMobileSimulateMode?"mobile":zC.device;if(this.addClass("".concat(X_.DEFAULT," ").concat(X_.ACTIVE," xgplayer-").concat(c," ").concat(this.config.controls?"":X_.NO_CONTROLS)),this.config.autoplay?this.addClass(X_.ENTER):this.addClass(X_.NO_START),this.config.fluid){var u={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(u).map((function(e){t.root.style[e]=u[e]}))}else["width","height"].map((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 l=this.root.getBoundingClientRect(),f=l.width,h=l.height,d=l.left,p=l.top;return this.sizeInfo.width=f,this.sizeInfo.height=h,this.sizeInfo.left=d,this.sizeInfo.top=p,!0}},{key:"_initBaseDoms",value:function(){this.topBar=Hw.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=Hw.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=Hw.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=Hw.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),ZC.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),zC.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on(kC,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),ZC.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==Hw.typeOf(e)||0!==e.length)||(e="",this.emit(fC),Bw.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===Hw.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===Hw.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild);var i=this.video.readyState;Bw.logInfo("_startInit readyState",i),this.config.autoplay&&(!Hw.isMSE(this.video)&&this.load(),(zC.os.isIpad||zC.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(eC,this.canPlayFunc),Hw.setTimeout(this,(function(){t.emit(pC)}),1),this.hasStart||Y_.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&rx.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),s=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),a=e.config[r]||e.config[i];if("Boolean"===Hw.typeOf(a)&&!a||o.indexOf(r)>-1)return;if(!t&&s[r])return;if(n.lazy&&n.loader){var c=Y_.lazyRegister(e,n);return void(n.forceBeforeInit&&(c.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})).catch((function(t){Bw.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})),e._loadingPlugins.push(c)))}return e.registerPlugin(n)}catch(e){Bw.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,s=void 0===o?[]:o,a=r.ignores,c=void 0===a?[]:a,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,Ty(s)),(i=e.config.ignores).push.apply(i,Ty(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,Ty(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case O_.ROOT_RIGHT:t=this.rightBar;break;case O_.ROOT_LEFT:t=this.leftBar;break;case O_.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=Y_.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!Y_.checkPluginIfExits(i.pluginName,o)&&o.push(i);var s=Y_.getRootByConfig(i.pluginName,this.config);s.root&&(r.root=s.root),s.position&&(r.position=s.position);var a=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof a&&a.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(a)),Y_.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?Y_.unRegister(this,e):e instanceof C_&&Y_.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 C_&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return Y_.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Y_.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Hw.hasClass(this.root,e)||Hw.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Hw.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Hw.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.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),Y_.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url)}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Bw.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===Hw.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};zC.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(X_.NO_START),!this.isCanplay&&this.addClass(X_.ENTER));var t=au(Vo(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(X_.NOT_ALLOW_AUTOPLAY),e.addClass(X_.PLAYING),e.isPlaying||(Bw.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(hC))})).catch((function(t){if(Bw.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(X_.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Hw.setTimeout(e,(function(){e._errorTimer=null,e.emit(dC),e.addClass(X_.NOT_ALLOW_AUTOPLAY),e.removeClass(X_.ENTER),e.pause()}),0)),"AbortError"===t.name&&(e._errorTimer=Hw.setTimeout(e,(function(){e._errorTimer=null,e.emit(bC)}),0))})):(Bw.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(X_.NOT_ALLOW_AUTOPLAY),this.removeClass(X_.NO_START),this.removeClass(X_.ENTER),this.addClass(X_.PLAYING),this.emit(hC))),t}this.removeClass(X_.NO_START),this.addClass(X_.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){au(Vo(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(X_.PAUSED),m_(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(e){var t=this;m_(this,"pause",(function(){e===n_.BUFFER_CONTROLS?t.isBufferControlPaused||(t.isBufferControlPaused=!0,t.emit(kC,{type:i_.WAITING})):t.isBufferControlPaused&&(t.isBufferControlPaused=!1,t.emit(kC,{type:i_.PLAYING})),au(Vo(n.prototype),"pause",t).call(t)}),e)}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,s=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(Jw,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(X_.ENTER),n.isSeeking=!1,s){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(Jw,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(X_.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(n.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(xC,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url);r&&r.then?r.then((function(){n.emit(SC,{from:t,to:e})})):this.emit(SC,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[X_.NOT_ALLOW_AUTOPLAY,X_.PLAYING,X_.NO_START,X_.PAUSED,X_.REPLAY,X_.ENTER,X_.ENDED,X_.ERROR,X_.LOADING];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(X_.ENTER),this.emit(DC)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=q_();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e,t=this,i=this.innerContainer,r=this.root,o=this.video;if(r&&o){if(r.removeAttribute(t_),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),Hw.clearAllTimers(this),this.emit(gC),null===(e=vx)||void 0===e||e.remove(this),Y_.destroy(this),y_(this),au(Vo(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(i)for(var s=i.children,a=0;a<s.length;a++)i.removeChild(s[a]);!i&&o instanceof window.Node&&r.contains(o)&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var c=r.className.split(" ");c.length>0?r.className=c.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(X_.ENDED),this.currentTime=0,this.isSeeking=!1,m_(this,"replay",(function(){e.once(Jw,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(vC),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(X_.ERROR),this.addClass(X_.LOADING),m_(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(eC,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=X_.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Hw.filterStyleFromText(e)),Hw.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Hw.filterStyleFromText(t),Hw.addClass(t,i),t.setAttribute(t_,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=X_.PARENT_FULLSCREEN),this._orgCss&&(Hw.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Hw.removeClass(e,n),t&&t!==e&&this._orgPCss&&(Hw.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Hw.removeClass(t,i),t.removeAttribute(t_))}},{key:"getFullscreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,n=this.root,i=this.video;if(t||(t=n),this._fullScreenOffset={top:Hw.scrollTop(),left:Hw.scrollLeft()},this._fullscreenEl=t,this._fullActionFrom="get",Hw.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=0;r<QC.length;r++){var o=QC[r];if(t[o]){var s="webkitRequestFullscreen"===o?t.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):t[o]();return s&&s.then?(s.then((function(){"get"===e._fullActionFrom&&e.changeFullStyle(e.root,t,X_.FULLSCREEN)})),s):(this.changeFullStyle(this.root,t,X_.FULLSCREEN),Promise.resolve())}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(e)}}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||Hw.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<e_.length;n++){var i=e_[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?X_.INNER_FULLSCREEN:X_.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(CC,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?X_.INNER_FULLSCREEN:X_.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(CC,!1)}},{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(cC,lx({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(uC,lx({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},n=this.innerStates;if(this.isActive=!0,this.removeClass(X_.ACTIVE),this.userTimer&&(Hw.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this.userTimer&&(Hw.clearTimeout(this,this.userTimer),this.userTimer=null);else{var i=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Hw.setTimeout(this,(function(){e.userTimer=null,e.blur()}),i)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive&&!this.innerStates.isActiveLocked){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(X_.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(X_.ENTER),!this.isBufferControlPaused&&this.removeClass(X_.LOADING),this.isCanplay=!0,this.waitTimer&&Hw.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(X_.PAUSED),this.ended&&this.removeClass(X_.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(X_.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(Hw.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(X_.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(X_.NOT_ALLOW_AUTOPLAY),this.removeClass(X_.NO_START),this.removeClass(X_.ENTER),this.removeClass(X_.LOADING),this.addClass(X_.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(X_.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Hw.clearTimeout(this,this.waitTimer),this.removeClass(X_.LOADING),this.removeClass(X_.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Hw.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Hw.setTimeout(this,(function(){e.addClass(X_.LOADING),Hw.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[X_.NO_START,X_.PAUSED,X_.ENDED,X_.ERROR,X_.REPLAY,X_.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(X_.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(X_.LOADING),Hw.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(hC)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Hw.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&("waiting"===e.type?(this.isBufferControlPaused=!0,this.addClass(X_.LOADING),this.removeClass(X_.PAUSED)):"playing"===e.type&&(this.isBufferControlPaused=!1,this.removeClass(X_.LOADING),this.paused&&this.addClass(X_.PAUSED)))}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===Hw.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===Hw.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(AC,lx({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime(),n=t-this._accPlayed.t;if(n<0)return;this._accPlayed.acc+=n,this._accPlayed.t="get"===e?t:0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>n)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.rotate,n=e.vy,i=e.vx,r=e.h,o=e.w;if(!(t<0&&r<0&&o<0)){var s=this.videoPos._pi;if(!s&&this.video.videoHeight&&(s=this.video.videoWidth/this.video.videoHeight*100),s){this.videoPos.pi=s;var a={},c=0,u=0,l=1,f=t<0?0:Math.abs(t/90),h=this.root,d=this.innerContainer,p=h.offsetWidth,v=d?d.offsetHeight:h.offsetHeight,g=v,y=p,m={width:p,height:v};if(f%2==0)l=r>0?100/r:o>0?100/o:1,a.scale=l,c=n>0?(100-r)/2-n:0,a.y=2===f?0-c:c,u=i>0?(100-o)/2-i:0,a.x=2===f?0-u:u,m.width=y,m.height=g;else if(f%2==1){g=p;var k=v-p;u=-k/2/(y=v)*100,a.x=3===f?u+n/2:u-n/2,c=k/2/g*100,a.y=3===f?c+i/2:c-i/2,a.scale=l,m.width=y,m.height=g}var b=this.video;t>=0&&["width","height"].forEach((function(e){b.style[e]="".concat(m[e],"px")})),a.rotate=t<0?0:t;var w=Hw.getTransformStyle(a,this.video.style.transform||this.video.style.webkitTransform);b.style.transform=w,b.style.webkitTransform=w}}}},{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.video&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===Hw.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),this.vtype="MP4",m_(this,"playnext",(function(){t.start(),t.emit(OC,e)}))}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var n=this.video,i=n.videoWidth,r=n.videoHeight,o=this.config,s=o.fitVideoSize,a=o.videoFillMode;if("fill"!==a&&"cover"!==a&&"contain"!==a||this.setAttribute("data-xgfill",a),r&&i){this._videoHeight=r,this._videoWidth=i;var c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=t.width,l=t.height-c,f=parseInt(i/r*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,v={};"auto"===s&&h>f||"fixWidth"===s?(p=u/f*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+c,"px")):("auto"===s&&h<f||"fixHeight"===s)&&(d=f*l/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||Object.keys(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===a&&h<f||"fillWidth"===a&&h>f)&&this.setAttribute("data-xgfill","cover");var g={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.resizePosition(),this.emit(TC,g)}}}},{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.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"preProcessUrl",value:function(e,t){var n=this.config,i=n.preProcessUrl,r=n.preProcessUrlOptions,o=Object.assign({},r,t);return Hw.isBlob(e)||"function"!=typeof i?{url:e}:i(e,o)}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(yC,e),this.emit(Qw),this._currentTime=0,this._duration=0,Hw.isMSE(this.video)?this.onWaiting():(e=this.preProcessUrl(e).url,this._detachSourceEvents(this.video),"Array"===Hw.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()))}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,r=null;e.map((function(e){t.curDefinition===e.definition&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.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!==rx.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,Y_.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(rx.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 xy}},{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(){var e=au(Vo(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=au(Vo(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=au(Vo(n.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=Hw.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return px},set:function(e){px=e}},{key:"realTimeSpeed",get:function(){return dx},set:function(e){dx=e}},{key:"hook",value:function(e,t){return l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return f_.call.apply(f_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return d_.call.apply(d_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return p_.call.apply(p_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return v_.call.apply(v_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var n;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),null===(n=vx)||void 0===n||n.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Bw.config.debug},set:function(e){Bw.config.debug=e}},{key:"instManager",get:function(){return vx},set:function(e){vx=e}},{key:"pluginsManager",get:function(){return Y_}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=vx)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var n;null===(n=vx)||void 0===n||n.setActive(e,t)}},{key:"isHevcSupported",value:function(){return zC.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return zC.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(qC);function yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function mx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yx(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function bx(){return(new Date).getTime()}Go(gx,"defaultPreset",null),Go(gx,"XgVideoProxy",null),gx.instManager=cx.getInstance();var wx="loadstart",Cx="loadeddata",_x="firstFrame",xx="waitingStart",Sx="waitingEnd",Tx="seekStart",Px="seekEnd",Ex="waitingEndExt",Rx="seekEndEndExt",Ox="[xgLogger]",Ix=function(e){jo(n,e);var t=kx(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_onLoadStart",(function(){var t=Ho(e)._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=bx()-e.newPointTime,Bw.logInfo(Ox,"LOAD_START","autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(wx,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=bx(),e.vt=0,e.fvt=0,e._initOnceEvents())})),Go(Ho(e),"_onLoadedData",(function(){e.vt=bx(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime,e._updateBuffer();var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Bw.logInfo(Ox,"LOADED_DATA","fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(Cx,{})})),Go(Ho(e),"_onTimeupdate",(function(){var t=Ho(e)._state;t.isTimeUpdate=!0,t.time=e.player.currentTime,e._state.autoplayStart&&!t.isFFSend&&e._sendFF("onTimeupdate")})),Go(Ho(e),"_onPlay",(function(){var t=e.player.buffered,n=Ho(e).levelInfo;Bw.logInfo(Ox,"_onPlay playPos:".concat(n.startBuffer)),n.startBuffer<0&&(n.startBuffer=t.length>0?parseInt(1e3*t.end(0),10):0,n.startType="onplay")})),Go(Ho(e),"_onAutoplayStart",(function(){Bw.logInfo(Ox,"_onAutoplayStart"),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Go(Ho(e),"_onReset",(function(){e._state={time:0,autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=bx(),e.loadedCostTime=0,e.startCostTime=0,e.seekingStart=0,e.seekData={startTime:0,lastTime:0,timeBefore:0,timeAfter:0,inBuffer:0,diffStart:0,interval:-1},e.waitData={startTime:0,lastTime:0,interval:-1,diffStart:0},e.waitingStart=0,e.fixedWaitingStart=0,e.ffsendTime=0,e.levelInfo={diff:0,buffer:-1,startBuffer:-1,startType:""},e._isWaiting=!1,e._waitTimer&&Hw.clearTimeout(Ho(e),e._waitTimer),e._waittTimer&&Hw.clearTimeout(Ho(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Go(Ho(e),"_onSeeking",(function(){var t=Ho(e),n=t.seekData,i=t._state;if(!n.startTime){var r=e.player,o=r.buffered,s=r.currentTime;n.startTime=bx(),n.timeBefore=i.time,n.timeAfter=s;var a=Hw.getBufferByCurrentTime(o,s);Bw.logInfo(Ox,"onSeeking",s,a),n.inBuffer=a.include,n.diffStart=1e3*a.diff,n.lastTime>0?n.interval=n.startTime-n.lastTime:n.interval=-1,Bw.logInfo(Ox,"onSeeking",n),e.suspendWaitingStatus("seek");var c=e._getSeekInfo();e.emitLog(Tx,mx({start:bx()},c))}})),Go(Ho(e),"_onSeeked",(function(){Bw.logInfo(Ox,"onSeeked"),e.suspendSeekingStatus("seeked")})),Go(Ho(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=bx(),e.fixedWaitingStart=bx(),e._waitType=1,e.emitLog(xx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Go(Ho(e),"_onWaiting",(function(){if(!e._isWaiting&&e.vt){e._isWaiting=!0;var t=Ho(e),n=t.waitData,i=t.seekData;t._state.isTimeUpdate||0!==i.startTime?i.startTime?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=bx(),Bw.logInfo(Ox,"_onWaiting"),n.lastTime>0?n.interval=e.fixedWaitingStart-n.lastTime:n.interval=-1;var r=e.player,o=r.buffered,s=r.currentTime,a=Hw.getBufferByCurrentTime(o,s);n.diffStart=1e3*a.diff,e._waitTimer=Hw.setTimeout(Ho(e),(function(){Bw.logInfo(Ox,"_onWaiting real");var t=Ho(e).waitData;e._isWaiting?(e.waitingStart=bx(),Hw.clearTimeout(Ho(e),e._waitTimer),t.lastTime=e.fixedWaitingStart,e._waitTimer=null,e._startWaitTimeout(),e.emitLog(xx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing",diffStart:t.diffStart,interval:t.interval})):(t.interval=-1,t.diffStart=0)}),200)}})),Go(Ho(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Go(Ho(e),"_onWaitingTimeout",(function(t){e.suspendWaitingStatus(t||"timeout"),Hw.clearTimeout(Ho(e),e._waittTimer),e._waittTimer=null})),Go(Ho(e),"_onProgress",(function(){Bw.logInfo(Ox,"_onProgress")})),Go(Ho(e),"_onPlaying",(function(){Bw.logInfo(Ox,"_onPlaying"),e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType=-1,this._initOnceEvents(),this.newPointTime=bx(),this.loadedCostTime=0,this.startCostTime=0,this.ffsendTime=0,this.on(sC,this._onLoadStart),this.on(iC,this._onLoadedData),this.on($w,this._onSeeking),this.on(Jw,this._onSeeked),this.on(gC,(function(){e.endState("destroy")})),this.on(Yw,(function(){e.endState("ended")})),this.on(Xw,(function(){e.endState("pause")})),this.on(zw,this._onPlay),this.on(yC,(function(){e.endState("urlChange"),Bw.logInfo(Ox,"URL_CHANGE"),e._state.isFFSend&&e._onReset()})),this.on([Kw,eC],this._onPlaying),this.on(Qw,this._onWaiting),this.on(qw,this._onError),this.on(DC,(function(){Bw.logInfo(Ox,"RESET"),e.endState("reset"),e._initOnceEvents(),e._onReset();var t=e.levelInfo;e.playerConfig.autoplay&&(t.startType="onreset",t.startBuffer=0)}))}},{key:"_initOnceEvents",value:function(){this.off(hC,this._onAutoplayStart),this.off(Zw,this._onTimeupdate),this.once(hC,this._onAutoplayStart),this.on(Zw,this._onTimeupdate)}},{key:"_sendFF",value:function(e){var t=this._state,n=t.isFFLoading,i=t.isFFSend;if(Bw.logInfo(Ox,"_sendFF","".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i){var r;this.ffsendTime=bx();var o=this.levelInfo,s=o.buffer,a=o.startBuffer,c=o.startType;Bw.logInfo(Ox,"emitLog_firstFrame",e,"startBuffer:".concat(a," startType:").concat(c," buffer:").concat(s," ")),this._state.isFFLoading=!1,this._state.isFFSend=!0;var u=this.fvt+((null===(r=this.player)||void 0===r?void 0:r.beforeLoadStartCostTime)||0);this.emitLog(_x,{fvt:this.fvt,costTime:u,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime,buffer:s,startBuffer:a,endType:e})}}},{key:"_updateBuffer",value:function(){var e=this.player,t=e.buffered,n=e.currentTime,i=Hw.getBufferByCurrentTime(t,n);Bw.logInfo(Ox,"_updateBuffer",i);var r=this.levelInfo;r.buffer=1e3*i.end,r.diff=1e3*i.diff}},{key:"_getSeekInfo",value:function(){var e=this.seekData;return{interval:e.interval,timeBefore:e.timeBefore,timeAfter:e.timeAfter,inBuffer:e.inBuffer,diffStart:e.diffStart}}},{key:"_startWaitTimeout",value:function(){this._waittTimer&&Hw.clearTimeout(this,this._waittTimer),this._waittTimer=Hw.setTimeout(this,this._onWaitingTimeout,this.config.waitTimeout)}},{key:"endState",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=i-n,o=!(i>0&&n>0&&r<1);Bw.logInfo(Ox,"endState:".concat(e," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(e,o),this.suspendSeekingStatus(e,o)}},{key:"suspendSeekingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.seekData;if(n.startTime){var i=bx(),r=i-n.startTime,o=this.player,s=o.buffered,a=o.currentTime,c=Hw.getBufferByCurrentTime(s,a);Bw.logInfo(Ox,"suspendSeekingStatus",a,r),n.lastTime=n.startTime,n.startTime=0;var u=t?Px:Rx,l=this._getSeekInfo();this.emitLog(u,mx(mx({end:i,costTime:r,endType:e},l),{},{diffEnd:1e3*c.diff}))}}},{key:"suspendWaitingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._waitTimer&&(Hw.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Hw.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var n=this.waitData,i=bx(),r=i-this.waitingStart,o=i-this.fixedWaitingStart,s=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var a=this.player,c=a.buffered,u=a.currentTime,l=Hw.getBufferByCurrentTime(c,u),f=t?Sx:Ex;this.emitLog(f,{fixedCostTime:o>s?s:o,costTime:r>s?s:r,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e,diffStart:n.diffStart,diffEnd:1e3*l.diff,interval:n.interval})}}},{key:"emitLog",value:function(e,t){var n=this.player,i=n.video,r=i.readyState,o=i.networkState;this.emit(LC,mx({t:bx(),host:Hw.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:n.currentTime,readyState:r,networkState:o},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(M_);function Lx(){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}function Ax(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Dx=function(e){jo(n,e);var t=Ax(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{replay:Lx}}},{key:"afterCreate",value:function(){var e=this;M_.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Yw,(function(){if(e.playerConfig.loop||Hw.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(zw,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Hw.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n}(M_),Mx=Dx;function Nx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Fx=function(e){jo(n,e);var t=Nx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){Hw.addClass(this.root,"hide")}},{key:"show",value:function(){Hw.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(Yw,(function(){e.isEndedShow&&Hw.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(Zw,(function(){e.onTimeUpdate()})),this.on(yC,(function(){Hw.removeClass(e.root,"hide"),Hw.addClass(e.root,"xg-showplay"),e.once(Zw,(function(){e.onTimeUpdate()}))}))):this.on(zw,(function(){Hw.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?Hw.removeClass(this.root,"xg-showplay"):this.once(Zw,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(M_),Bx=Fx;function jx(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Hx(){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}function Ux(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Vx={};var Gx=function(e){jo(n,e);var t=Ux(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),Hw.removeClass(i.root,e),i.show()})),Go(Ho(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";Hw.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i._lastState="",i}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(lC,(function(){n&&(n.lang&&"en"===n.lang?Hw.addClass(t.root,"lang-is-en"):"jp"===n.lang&&Hw.addClass(t.root,"lang-is-jp"))})),this.on(hC,this.onAutoplayStart),n.autoplay||this.show(),this.on(dC,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Hw.removeClass(e.root,t),e.show()})),this.on(zw,(function(){e.onPlayPause("play")})),this.on(Xw,(function(){e.onPlayPause("pause")})),this.on(kC,(function(){e.onPlayPause(t.paused?"pause":"play")})),this.on(DC,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:jx,class:"xg-icon-play"},startPause:{icon:Hx,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(){Hw.addClass(this.root,"hide")}},{key:"show",value:function(){Hw.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Hw.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Hw.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;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};Vx[e]&&window.clearTimeout(Vx[e].id),Vx[e]={},n.start&&n.start(),Vx[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Vx[e].id),delete Vx[e]}),t)}("pauseplay",400,{start:function(){Hw.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Hw.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart&&("pause"!==e||this._lastState!==e&&!n.isBufferControlPaused)){if(this._lastState=e,"show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(Vx).map((function(e){window.clearTimeout(Vx[e].id),delete Vx[e]}))}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(M_),Wx=Gx;function zx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var Kx=function(e){jo(n,e);var t=zx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=Hw.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(M_),Yx=Kx;function Xx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var qx=function(e){jo(n,e);var t=Xx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:10}}}]),n}(M_),$x=qx;function Jx(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function Zx(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var Qx=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],eS=Qx.length;function tS(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Ao(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<eS;t++)e[Qx[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<eS;r++){var o=Qx[r],s=t[o],a=parseFloat(s);n[o]=Number.isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,v=Zx(t.width);!1!==v&&(n.width=v+(p?0:c+h));var g=Zx(t.height);return!1!==g&&(n.height=g+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function nS(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var iS="dragStart",rS="dragMove",oS="dragEnded",sS={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},aS=function(e){jo(n,e);var t=Jx(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fo(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):Uo(i)}return No(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),sS[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=sS[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=nS(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=nS(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=nS(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=tS(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(iS,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(oS)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),s=o.x,a=o.y;s=this.checkContain("x",s,i),a=this.checkContain("y",a,r),this.position.x=i+s,this.position.y=r+a,this.dragPoint.x=s,this.dragPoint.y=a,this.emit(rS,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=tS(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(_y);function cS(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var uS=function(e){jo(n,e);var t=cS(n);function n(e){var i;Fo(this,n),Go(Ho(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Go(Ho(i),"onCenterClick",(function(e){var t=Ho(i).player;t.paused?t.play():t.pause()})),Go(Ho(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(Hw.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=Ho(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Xw,(function(){e.setAttr("data-state","pause")})),this.on(zw,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin($x,n,$x.pluginName)}var i=Hw.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new aS(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:jx,class:"xg-icon-play"},pause:{icon:Hx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},Hw.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(_C,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;Hw.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(_C,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Hw.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 <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(M_);function lS(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var fS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},hS=["videoClick","videoDbClick"],dS=function(e){jo(n,e);var t=lS(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Ho(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Go(Ho(e),"onMouseEnter",(function(t){var n=Ho(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Go(Ho(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Go(Ho(e),"onVideoClick",(function(t){var n=Ho(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.video&&t.target!==i.innerContainer&&t.target!==i.video.__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--,m_(Ho(e),hS[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Go(Ho(e),"onVideoDblClick",(function(t){var n=Ho(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),m_(Ho(e),hS[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,hS.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===zC.device&&!zC.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(fS).map((function(t){i.addEventListener(t,e[fS[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(fS).map((function(t){i.removeEventListener(t,e[fS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(C_),pS=di,vS=Ko,gS=_,yS=RangeError,mS=function(e){var t=vS(gS(this)),n="",i=pS(e);if(i<0||i==1/0)throw yS("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},kS=lr,bS=k,wS=di,CS=ev,_S=mS,xS=d,SS=RangeError,TS=String,PS=Math.floor,ES=bS(_S),RS=bS("".slice),OS=bS(1..toFixed),IS=function(e,t,n){return 0===t?n:t%2==1?IS(e,t-1,n*e):IS(e*e,t/2,n)},LS=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=PS(r/1e7)},AS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=PS(i/t),i=i%t*1e7},DS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=TS(e[t]);n=""===n?i:n+ES("0",7-i.length)+i}return n};kS({target:"Number",proto:!0,forced:xS((function(){return"0.000"!==OS(8e-5,3)||"1"!==OS(.9,0)||"1.25"!==OS(1.255,2)||"1000000000000000128"!==OS(0xde0b6b3a7640080,0)}))||!xS((function(){OS({})}))},{toFixed:function(e){var t,n,i,r,o=CS(this),s=wS(e),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw SS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return TS(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*IS(2,69,1))-69)<0?o*IS(2,-t,1):o/IS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(LS(a,0,n),i=s;i>=7;)LS(a,1e7,0),i-=7;for(LS(a,IS(10,i,1),0),i=t-1;i>=23;)AS(a,1<<23),i-=23;AS(a,1<<i),LS(a,1,1),AS(a,2),u=DS(a)}else LS(a,0,n),LS(a,1<<-t,0),u=DS(a)+ES("0",s);return u=s>0?c+((r=u.length)<=s?"0."+ES("0",s-r)+u:RS(u,0,r-s)+"."+RS(u,r-s)):c+u}});var MS="press",NS="pressend",FS="doubleclick",BS="click",jS="touchmove",HS="touchstart",US="touchend",VS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},GS={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function WS(e){return e&&e.length>0?e[e.length-1]:null}function zS(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var KS=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Fo(this,e),Go(this,"onTouchStart",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&zS(e);var r=WS(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,n.__setPress(e),i.addEventListener(n.events.end,n.onTouchEnd),i.addEventListener(n.events.cancel,n.onTouchCancel),i.addEventListener(n.events.move,n.onTouchMove),n.trigger(HS,e)})),Go(this,"onTouchCancel",(function(e){n.onTouchEnd(e)})),Go(this,"onTouchEnd",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&zS(e),n.__clearPress(),i.removeEventListener(n.events.cancel,n.onTouchCancel),i.removeEventListener(n.events.end,n.onTouchEnd),i.removeEventListener(n.events.move,n.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&n.trigger(NS,e),n.trigger(US,e),!t.press&&!t.moving&&n.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Go(this,"onTouchMove",(function(e){var t=n._pos,i=n.config,r=WS(e.touches),o=r?parseInt(r.pageX,10):e.pageX,s=r?parseInt(r.pageY,10):e.pageX,a=o-t.x,c=s-t.y;Math.abs(c)<i.miniStep&&Math.abs(a)<i.miniStep||(n.__clearPress(),t.press&&n.trigger(NS,e),t.press=!1,t.moving=!0,n.trigger(jS,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?GS:VS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return No(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(MS,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(FS,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(BS,e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}(),YS=KS;function XS(){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}function qS(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var $S="auto",JS="seeking",ZS="playbackrate",QS=["videoClick","videoDbClick"],eT=function(e){jo(n,e);var t=qS(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onTouchStart",(function(e){var t=Ho(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=i.getTouche(e);if(a&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,Hw.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=Hw.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height);var u=parseInt(a.pageX-o.left,10),l=parseInt(a.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,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}})),Go(Ho(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Ho(i),r=n.pos,o=n.config,s=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var a=o.miniMoveStep,c=o.hideControlsActive,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===s.rotateDeg?l:u,h=90===s.rotateDeg?u:l;if(Math.abs(f-r.x)>a||Math.abs(h-r.y)>a){var d=f-r.x,p=h-r.y,v=r.scope;if(-1===v&&(0===(v=i.checkScope(f,h,d,p,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,v,r.width,r.height),r.x=f,r.y=h}}})),Go(Ho(i),"onTouchEnd",(function(e){var t=Ho(i),n=t.player,r=t.pos,o=t.playerConfig;r.isStart&&(r.scope>-1&&e.cancelable&&e.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),Hw.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction($S))})),Go(Ho(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Go(Ho(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.recoverAutoHide()}})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return No(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:XS,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;QS.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),Hw.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Hw.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new YS(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(tC,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([eC,Yw],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).forEach((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var s=i.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),s.addCallBack("dragend",(function(){e.changeAction($S)})),s.addCallBack("click",(function(){e.changeAction($S)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&Hw.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,r){var o=r.width,s=-1;if(e<0||e>o)return s;var a=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&a>=1.73&&e>r.scopeM1&&e<r.scopeM2?s=0:(0===Math.abs(n)||a<=.57)&&(s=e<r.scopeL?1:e>r.scopeR?2:3),s}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:zC.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction($S)}},{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:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;m_(this,QS[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;m_(this,QS[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(ZS))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction($S))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),n.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(JS);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Hw.format(this.duration),this.find(".xg-cur").innerHTML=Hw.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Hw.removeClass(this.find(".xg-seek-show"),"xg-back"):Hw.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.hasStart)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(M_),tT=eT;function nT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function iT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}function oT(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}lr({target:"String",proto:!0},{repeat:mS});var sT=function(e){jo(n,e);var t=rT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n=t||window.event,i=n.keyCode,r=Ho(e),o=r._keyState,s=r.player,a=e.config,c=a.disable,u=a.disableBodyTrigger,l=a.isIgnoreUserActive;c||u||!s.isUserActive&&!l||oT(n.target)||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((n.target===document.body||e.config.isGlobalTrigger&&!oT(n.target))&&e.checkCode(i,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(n))}})),Go(Ho(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Go(Ho(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=Ho(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Go(Ho(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return No(n,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,s={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:s}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.fullscreen,i=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]];if(o){var s=o.action,a=o.keyCode,c=o.disable,u=o.pressAction,l=o.disablePress;if(a===e){if(!(c||n&&l)){var f=n&&u||s;"function"==typeof f?s(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(IC,iT({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(C_),aT=sT;function cT(){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}function uT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var lT=function(e){jo(n,e);var t=uT(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{loadingIcon:cT}}},{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:O_.ROOT}}}]),n}(M_),fT=lT,hT=lr,dT=$s.findIndex,pT=Wv,vT="findIndex",gT=!0;vT in[]&&Array(1)[vT]((function(){gT=!1})),hT({target:"Array",proto:!0,forced:gT},{findIndex:function(e){return dT(this,e,arguments.length>1?arguments[1]:void 0)}}),pT(vT);var yT=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],mT=function(){function e(t){Fo(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 No(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,s=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var a=i[r],c=0===s?0:(s-a.start)/a.duration;n[r][e].style.width=c<0?0:"".concat(100*c,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==Hw.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Hw.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Hw.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++)Hw.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Hw.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=Hw.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=Hw.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),yT.forEach((function(t){o.appendChild(Hw.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}();function kT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kT(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var CT={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},_T=function(e){jo(n,e);var t=wT(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Ho(i),r=n.pos,o=n.config,s=n.player,a=t;if(e){Hw.event(e);var c=Hw.getEventPos(e,s.zoom),u=90===s.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,a=i.computeTime(e,u)}i.triggerCallbacks("dragmove",a,e),i._updateInnerFocus(a)})),Go(Ho(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Go(Ho(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Go(Ho(i),"_mouseUpHandler",(function(e,t){Ho(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Go(Ho(i),"_mouseMoveHandler",(function(e,t){var n=Ho(i),r=n._state,o=n.pos,s=n.config,a=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,s.isPauseMoving&&a.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Go(Ho(i),"onMouseDown",(function(e){var t=Ho(i),n=t._state,r=t.player,o=t.pos,s=t.config,a=t.playerConfig,c=Hw.getEventPos(e,r.zoom),u=90===r.rotateDeg?c.clientY:c.clientX;if(!(r.isMini||s.closeMoveSeek||!a.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),Hw.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),Hw.checkIsFunction(s.onMoveStart)&&s.onMoveStart(),Hw.event(e),o.x=u,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,Hw.addClass(i.progressBtn,"active");var l=i.computeTime(e,u);return l.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,l),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp),i.root.addEventListener("touchcancel",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Go(Ho(i),"onMouseUp",(function(e){var t=Ho(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;e.stopPropagation(),e.preventDefault(),Hw.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),Hw.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Hw.event(e),Hw.removeClass(i.progressBtn,"active");var c=i.computeTime(e,o.x);c.prePlayTime=a.prePlayTime,o.moving?(i.triggerCallbacks("dragend",c,e),i.emitUserAction("drag","dragend",c)):(i.triggerCallbacks("click",c,e),i.emitUserAction("click","click",c)),i._mouseUpHandlerHook(e,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.prePlayTime=0,a.time=0;var u=e.type;"touchend"===u||"touchcancel"===u?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.root.removeEventListener("touchcancel",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),Hw.setTimeout(Ho(i),(function(){i.resetSeekState()}),10),n.focus()})),Go(Ho(i),"onMouseMove",(function(e){var t=Ho(i),n=t._state,r=t.pos,o=t.player,s=t.config;Hw.checkTouchSupport()&&e.preventDefault(),Hw.event(e);var a=Hw.getEventPos(e,o.zoom),c=90===o.rotateDeg?a.clientY:a.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<s.miniMoveStep||!r.moving&&u<s.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Go(Ho(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Go(Ho(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Go(Ho(i),"onMouseEnter",(function(e){var t=Ho(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),Hw.event(e);var o=Hw.getEventPos(e,n.zoom),s=90===n.rotateDeg?o.clientY:o.clientX,a=i.computeTime(e,s);i.triggerCallbacks("mouseenter",a,e),i.focus()}})),Go(Ho(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),Go(Ho(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return No(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=bT(bT({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new mT(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===zC.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(tC,(function(){e.onMouseLeave()})),this.on(Zw,(function(){e.onTimeupdate()})),this.on(Jw,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(oC,(function(){e.onCacheUpdate()})),this.on(Yw,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(aC,(function(){e.onReset()})),this.on(TC,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Ao(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),e)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",Hw.stopPropagation),t.center&&t.center.addEventListener("touchend",Hw.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Hw.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Hw.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=a,i=c):(n=s,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!(t.isSeeking&&t.video.seeking||this.isProgressMoving)&&t.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=Hw.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var s=this.player.plugins.miniprogress;s&&s.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=Hw.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",Hw.stopPropagation),t.center&&t.center.removeEventListener("touchend",Hw.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!1))}},{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:O_.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:CT.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return CT}}]),n}(M_),xT=_T;function ST(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var TT=function(e){jo(n,e);var t=ST(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Ho(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return No(n,[{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)}}]),n}(M_);function PT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var ET=function(e){jo(n,e);var t=PT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){var n=Ho(e),i=n.player;if(!n.config.disable)return t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this);var t=this.player;this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([Xw,aC,zw],(function(){e.animate(t.paused)})),this.on(kC,(function(){e.animate(t.paused)})),this.animate(this.player.paused)}},{key:"registerIcons",value:function(){return{play:{icon:jx,class:"xg-icon-play"},pause:{icon:Hx,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){var t=this.i18nKeys,n=this.player;e&&n.isBufferControlPaused||(e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS)))}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(TT),RT=ET;function OT(){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}function IT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var LT=function(e){jo(n,e);var t=IT(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:OT,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Hw.addClass(this.root,"show")}},{key:"hide",value:function(){Hw.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:O_.ROOT_TOP,index:0}}}]),n}(M_);function AT(){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 DT(){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}function MT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var NT=function(e){jo(n,e);var t=MT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Hw.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.config.disable||e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(wC,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:LT,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===zC.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:AT,class:"xg-get-fullscreen"},exitFullscreen:{icon:DT,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===zC.device?"touchend":"click",this.handleFullscreen),"mobile"===zC.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:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?X_.INNER_FULLSCREEN:X_.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,X_.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(wC,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?X_.INNER_FULLSCREEN:X_.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,X_.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(wC,!1)}},{key:"changeFullScreen",value:function(e){var t=this.player,n=this.config;if(!n.disable){e&&(e.preventDefault(),e.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(wC,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(wC,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(){}))}}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){au(Vo(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){au(Vo(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(TT);function FT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var BT=function(e){jo(n,e);var t=FT(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).isActiving=!1,i}return No(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on([tC,Jw,Zw],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(Yw,(function(){e.onTimeUpdate(!0)})),this.on(aC,(function(){e.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&au(Vo(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(!n.disable&&!this.isActiving&&t.hasStart){var r=t.currentTime+this.timeOffset;r=Hw.adjustTimeByDuration(r,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=Hw.format(r),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=Hw.format(i))):(this.timeDom.innerHTML=Hw.format(r),i!==1/0&&i>0&&(this.durationDom.innerHTML=Hw.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=Hw.format(0),this.centerDurDom.innerHTML=Hw.format(0)):(this.timeDom.innerHTML=Hw.format(0),this.durationDom.innerHTML=Hw.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Hw.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=Hw.createDom("xg-icon","00:00",{},"xgplayer-time right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Hw.hide(this.durationDom),Hw.hide(this.timeDom),Hw.hide(this.find(".time-separator")),Hw.show(this.find(".time-live-tag"))):Hw.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Hw.hide(this.durationDom),Hw.hide(this.timeDom),Hw.hide(this.find(".time-separator")),Hw.show(this.find(".time-live-tag"))):(Hw.hide(this.find(".time-live-tag")),Hw.show(this.find(".time-separator")),Hw.show(this.durationDom),Hw.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=Hw.format(e):this.centerCurDom.innerHTML=Hw.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(Jw,n),t.isSeeking&&t.video.seeking?this.once(Jw,n):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(M_);function jT(){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 HT(){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 UT(){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}function VT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var GT=function(e){jo(n,e);var t=VT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Ho(e).player,i=e.find(".xgplayer-bar");Hw.event(t);var r=i.getBoundingClientRect(),o=Hw.getEventPos(t,n.zoom),s=r.height-(o.clientY-r.top);if(o.h=s,o.barH=r.height,e.pos=o,!(s<-2))return e.updateVolumePos(s,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Go(Ho(e),"onBarMouseMove",(function(t){var n=Ho(e)._d;if(n.isStart){var i=Ho(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),Hw.event(t);var s=Hw.getEventPos(t,o.zoom);n.isMoving=!0;var a=r.h-s.clientY+r.clientY;a>r.barH||e.updateVolumePos(a,t)}})),Go(Ho(e),"onBarMouseUp",(function(t){Hw.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Ho(e)._d;n.isStart=!1,n.isMoving=!1})),Go(Ho(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Go(Ho(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Go(Ho(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return No(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:HT,class:"xg-volume-small"},volumeLarge:{icon:jT,class:"xg-volume"},volumeMuted:{icon:UT,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==zC.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(nC,this.onVolumeChange),this.once(iC,this.onVolumeChange),"Number"!==Hw.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=Math.max(Math.min(e/r.getBoundingClientRect().height,1),0),s=parseInt(1e3*o,10),a=s/1e3,c={volume:{from:n.volume,to:a}};i.style.height="".concat(100*o,"%"),n.muted&&(c.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:c}),n.volume=Math.max(Math.min(s/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.round(100*r)}},{key:"focus",value:function(){var e=this.player;this.config.disable||(e.focus({autoHide:!1}),this._timerId&&(Hw.clearTimeout(this,this._timerId),this._timerId=null),Hw.addClass(this.root,"slide-show"))}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Hw.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Hw.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),Hw.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){if(!this.config.disable){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&&(Hw.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"===zC.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){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:O_.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(M_),WT=GT;function zT(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}function KT(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var YT=function(e){jo(n,e);var t=KT(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onBtnClick",(function(e){i.config.disable||(e.preventDefault(),e.stopPropagation(),i.emitUserAction(e,"rotate"),i.rotate(i.config.clockwise,i.config.innerRotate,1))})),i.rotateDeg=i.config.rotateDeg||0,i}return No(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){au(Vo(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(TC,(function(){e.rotateDeg&&e.config.innerRotate&&Hw.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(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"updateRotateDeg",value:function(e,t){e||(e=0);var n=this.player,i=this.rootWidth,r=this.rootHeight;if(t)n.videoRotateDeg=e;else{var o=this.player,s=o.root,a=o.innerContainer,c=o.video,u=s.offsetWidth,l=a&&t?a.offsetHeight:s.offsetHeight,f=i,h=r,d=0,p=0;.75!==e&&.25!==e||(f="".concat(l,"px"),h="".concat(u,"px"),d=-(l-u)/2,p=-(u-l)/2);var v="translate(".concat(d,"px,").concat(p,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:v,webKitTransform:v,height:h,width:f},y=t?c:s,m=t?n.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],m&&m.root&&(m.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(EC,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:zT}}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(TT);function XT(){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 qT(){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}function $T(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var JT="picture-in-picture",ZT="inline",QT="fullscreen",eP=function(e){jo(n,e);var t=$T(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable()||e.config.disable)return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(au(Vo(n.prototype),"afterCreate",this).call(this),this.pMode=ZT,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(pC,(function(){e.config.showIcon&&(Hw.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:XT,class:"xg-get-pip"},pipIconExit:{icon:qT,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var n=t.paused;Hw.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(PC,!1)},this.enterPIPCallback=function(n){t.emit(PC,!0),null!=n&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===QT&&i!==QT&&t.onFullscreenChange(null,!1),e.pMode=i,i===JT?e.enterPIPCallback(n):i===ZT&&e.leavePIPCallback(n)},t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=Ty(document.styleSheets).map((function(t){try{return Ty(t.cssRules).map((function(e){return e.cssText})).join("")}catch(i){var n=document.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media,n.href=t.href,e.document.head.appendChild(n)}return""})).filter(Boolean).join("\n"),n=document.createElement("style");n.textContent=t,e.document.head.appendChild(n)}},{key:"requestPIP",value:function(){var e=this,t=this.player,i=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=i.poster;if(o&&(t.video.poster="String"===Hw.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var s={};if(r.width&&r.height)s.width=r.width,s.height=r.height;else{var a=t.root.getBoundingClientRect();s.width=a.width,s.height=a.height}documentPictureInPicture.requestWindow(s).then((function(n){var i=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var s=i||t.root,a=s.parentElement,c=s.previousSibling,u=s.nextSibling;e.copyStyleIntoPiPWindow(n);var l=document.createElement("style");if(l.append("body{padding:0; margin:0;}"),o){var f="";"string"==typeof o?f=o:"function"==typeof o&&(f=o.call(r)),f&&l.append(f)}else s===t.root&&l.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");n.document.head.append(l),n.document.body.append(s),n.addEventListener("pagehide",(function(t){a&&(u?a.insertBefore(s,u):c?a.insertBefore(s,c.nextSibling):a.appendChild(s)),e.leavePIPCallback()}),{once:!0})}))}else n.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("picture-in-picture"):t.video.requestPictureInPicture();return!0}catch(e){return console.error("requestPiP",e),!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():n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(e){return console.error("exitPIP",e),!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.video||t.video.webkitPresentationMode===JT}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==Hw.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===Hw.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Hw.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this);var e=this.player;e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:O_.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}}]),n}(TT),tP=eP;function nP(){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}function iP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var rP=function(e){jo(n,e);var t=iP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"playNext",(function(e){var t=Ho(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(OC,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(OC))})),i.idx=-1,i}return No(n,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:nP}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===zC.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.autoplay=!0,t.src=e)}},{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 <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(M_),oP={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=s.Blob||s.MozBlob||s.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var g=0,y=new Uint8Array(u.length),m=y.length;g<m;++g)y[g]=u.charCodeAt(g);u=new d([y],{type:c})}function k(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,s=new Uint8Array(r);o<r;++o)s[o]=i.charCodeAt(o);return new d([s],{type:n})}function b(e,t){if("download"in f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){s.URL.revokeObjectURL(f.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=u instanceof d?u:new d([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(s.URL)b(s.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===h)try{return b("data:"+c+";base64,"+s.btoa(r))}catch(e){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}}(oP);var sP=oP.exports;function aP(){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}function cP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var uP=function(e){jo(n,e);var t=cP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"download",(function(e){if(!i.isLock&&!i.config.disable){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);sP(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return No(n,[{key:"afterCreate",value:function(){au(Vo(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:aP}}},{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(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(TT);function lP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var fP=function(e){jo(n,e);var t=lP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){au(Vo(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(TC,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvans",value:function(e,t){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(RC,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,s=i.quality||r.quality,a=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvans(e,t),n.canvasCtx.drawImage(o.video,0,0,e||r.width,t||r.height);var u=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(TC,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:O_.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(TT),hP=function(){function e(t){Fo(this,e),this.config=t.config,this.parent=t.root,this.root=Hw.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touche"===this.config.domEventType?"touchend":"click";this._delegates=M_.delegate.call(this,this.root,"li",n,this.onItemClick)}return No(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(Hw.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Hw.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");Hw.addClass(t,"selected"),i&&Hw.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){Hw.removeClass(this.root,"hide"),Hw.addClass(this.root,"active")}},{key:"hide",value:function(){Hw.removeClass(this.root,"active"),Hw.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function dP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var pP="mobile"===zC.device,vP=function(e){jo(n,e);var t=dP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!0)})),Go(Ho(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return No(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),pP=pP||"touch"===this.domEventType,"mobile"===zC.device&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&Hw.addClass(this.root,"portrait"),this.once(eC,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),pP&&this.on(cC,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=pP?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",Hw.createDom("span","",{},"icon-text")),Hw.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||Hw.addClass(this.root,"show")}},{key:"hide",value:function(){Hw.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||Hw.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Ao(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?t.focus():t.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,r=n.list;(pP||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var s={config:{data:e||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(e,t){n.onItemClick(e,t)},domEventType:pP?"touche":"mouse"},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new hP(s),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),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:O_.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(M_);function gP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var yP=function(e){jo(n,e);var t=gP(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return No(n,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(xC,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,s=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!Hw.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));au(Vo(n.prototype),"renderItemList",this).call(this,s,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;au(Vo(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(vP);function mP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var kP=function(e){jo(n,e);var t=mP(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curRate=1,i}return No(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this),this.on(rC,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&au(Vo(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){au(Vo(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=0,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));au(Vo(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(vP);function bP(){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 wP(){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}function CP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var _P=function(e){jo(n,e);var t=CP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Vo(n.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(CC,(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){if(!this.config.disable){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;this.changeLangTextKey(this.find(".xg-tips"),e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:bP,class:"xg-get-cssfull"},exitCssFullscreen:{icon:wP,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){au(Vo(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:O_.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(TT);function xP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var SP=function(e){jo(n,e);var t=xP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(eC,(function(){e.handleCanPlay()})),this.on(qw,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){Hw.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),n}(M_);function TP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var PP=function(e){jo(n,e);var t=TP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),n.style&&this.setStyle(n.style),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),"arrow"===n.mode&&Hw.addClass(this.root,"arrow"),n.preventScreenOverflow){var o=this.root.getBoundingClientRect(),s=o.left,a=o.right,c=document.documentElement.clientWidth||document.body.clientWidth;if(s<0){var u=Number((Math.abs(s)/c*100).toFixed(2));if(n.style.left){var l=parseInt(n.style.left);this.setStyle({left:"".concat(l+u+.5,"%")})}}if(a>=c){var f=Number(((Math.abs(a)-c)/c*100).toFixed(2));if(n.style.left){var h=parseInt(n.style.left);this.setStyle({left:"".concat(h-f-.5,"%")})}}}if(Hw.addClass(this.root,"show"),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var d=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),d)}}}},{key:"hide",value:function(){Hw.removeClass(this.root,"show"),Hw.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(X_.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,preventScreenOverflow:!1,detail:{text:"",highlight:""},onClick:function(){}}}}]),n}(M_),EP=PP,RP={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function OP(e){Object.keys(RP).map((function(t){void 0===e[t]&&(e[t]=RP[t])}))}var IP={initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this._ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player.plugins.progress;if(n&&(t&&(OP(e),this._ispots.push(e)),this._ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),r=e.style||{},o=e.stylePreferred;r.left=o&&void 0!==r.left?r.left:"".concat(i.left,"%"),r.width=o&&void 0!==r.width?r.width:"".concat(i.width,"%");var s="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(s+=" mini");var a=Hw.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},s);Object.keys(r).map((function(e){a.style[e]=r[e]})),n.outer&&n.outer.appendChild(a)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this._ispotsInit){var r=n.find('xg-spot[data-id="'.concat(e.id,'"]'));if(r){var o=this.calcuPosition(e.time,e.duration),s=e.style||{};s.left="".concat(o.left,"%"),s.width="".concat(o.width,"%"),r.setAttribute("data-text",e.text),r.setAttribute("data-time",e.time),o.isMini?Hw.addClass(r,"mini"):Hw.removeClass(r,"mini"),Object.keys(s).map((function(e){r.style[e]=s[e]})),t&&this.showDot(e.id)}}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this._ispotsInit){var s=n.find('xg-spot[data-id="'.concat(e,'"]'));s&&s.parentElement.removeChild(s)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this._ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this._ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.map((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},updateAllDotsStyles:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.player.plugins.progress;if(null!=n&&n.root)for(var i,r=n.root.getElementsByTagName("xg-spot"),o=function(n){var o=(n=r[s]).getAttribute("data-id"),a=e.findDot(o);if(a&&a.activeStyle&&a.style&&a.stylePreferred){var c=t?null==a?void 0:a.activeStyle:null==a?void 0:a.style;c&&Object.keys(c).map((function(e){n.style[e]=c[e]}))}i=n},s=0;s<r.length;s++)o(i)},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};function LP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var AP={dragmove:"onProgressDragMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseEnter",mouseleave:"onProgressMouseLeave"},DP=function(e){jo(n,e);var t=LP(n);function n(e){var i;return Fo(this,n),Go(Ho(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(Hw.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||Hw.hasClass(e.target,"xg-spot-content"))&&(Hw.event(e),e.stopPropagation()))})),Go(Ho(i),"onMousedown",(function(e){i.config.disable||(i._state.f||Hw.hasClass(e.target,"xg-spot-content"))&&(Hw.event(e),e.stopPropagation())})),Go(Ho(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Go(Ho(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Go(Ho(i),"onProgressMouseLeave",(function(e,t){i.updateAllDotsStyles(!1)})),Go(Ho(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&Hw.hasClass(t.target,"xgplayer-spot")&&!i._curDot){i._curDot=t.target,i.focusDot(t.target),i._curDot.children.length>0&&i.hide();var n=i.player.plugins.progress;n&&n.disableBlur(),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave)}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i._state={now:0,f:!1},i}return No(n,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(IP).map((function(t){e[t]=IP[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return OP(e),e})),e._ispotsInit=!1,n.once(tC,(function(){e.initDots()}))}(this),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(AP).map((function(n){e[AP[n]]=e[AP[n]].bind(e),t.addCallBack(n,e[AP[n]])})),"mobile"!==zC.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMouseEnter",value:function(e,t){this.onProgressMove(e,t),this.updateAllDotsStyles(!0)}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.onProgressMove(e,t)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Hw.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Hw.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&Hw.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n=this.root,i=this.previewLine,r=this.timePoint,o=this.player,s=this.config,a="flex"===o.controls.mode,c=n.getBoundingClientRect().width;if(c||!this._hasThumnail){var u,l,f=r.getBoundingClientRect().width,h=e-(c=this._hasThumnail&&c<s.width?s.width:c)/2;h<0&&!a?(h=0,u=e-c/2,!this.thumbnail&&(l=e-c/2-f/2)):h>t-c&&!a?(u=h-(t-c),!this.thumbnail&&(l=h-(t-c)-f/2),h=t-c):(u=0,!this.thumbnail&&(l=-f/2)),void 0!==u&&(i.style.transform="translateX(".concat(u.toFixed(2),"px)")),void 0!==l&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,s=this._state;if(r){this.updateLinePos(e,t),s.now=n;var a=Hw.format(n);i&&i.target&&Hw.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,a),this.focusDot(i.target),s.f=!0,o.isFocusDots&&s.f&&(s.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(s.f=!1,this.showTips(o.defaultText,!0,a)):(s.f=!1,this.hideTips("")),this.updateTimeText(a),this.updateThumbnails(s.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==zC.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){Hw.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&Hw.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=Hw.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Hw.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player,r=n.root.getBoundingClientRect().width,o=i.duration/r*6;return e+t>i.duration&&(t=i.duration-e),i.duration,i.duration,{left:e/i.duration*100,width:t/i.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Hw.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Hw.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Hw.addClass(this.root,"no-timepoint"),e&&(Hw.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Hw.addClass(this.root,"product"),this.tipText.textContent=e):(Hw.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){Hw.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Hw.removeClass(this.find(".xg-spot-content"),"show-text"),Hw.removeClass(this.root,"product")}},{key:"hide",value:function(){Hw.addClass(this.root,"hide")}},{key:"show",value:function(){Hw.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(AP).map((function(n){t.removeCallBack(n,e[AP[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===zC.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n}(M_);function MP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var NP=function(e){jo(n,e);var t=MP(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return No(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([tC],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,Hw.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,s=i.col,a=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*s?0:Math.ceil(u/(o*s))-1,f=u-l*(s*o),h=f>0?Math.ceil(f/s)-1:0,d=f>0?f-h*s-1:0,p=0,v=0;t&&n?t/n<a/c?p=(v=n)*(a/c):v=(p=t)/(a/c):n?t||(p=(v=n||c)*(a/c)):v=(p=t||a)/(a/c);var g=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:g,height:v,width:p,style:{backgroundImage:"url(".concat(g,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*v,"px"),width:"".concat(p,"px"),height:"".concat(v,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,s=o.pic_num,a=o.urls;if(!(s<=0)&&a&&0!==a.length){var c=this.getPosition(t,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(t){e.style[t]=c.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=Hw.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(M_);function FP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var BP=function(e){jo(n,e);var t=FP(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(M_),jP=BP;function HP(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var UP="realtime",VP="firstframe",GP="poster";var WP=null,zP=function(e){jo(n,e);var t=HP(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(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(Zw,e.renderOnTimeupdate),e.on(Zw,e.renderOnTimeupdate))})),Go(Ho(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Go(Ho(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(Zw,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,n)}})),Go(Ho(e),"start",(function(t,n){var i=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),o=e.checkVideoIsSupport(i);o&&e.canvasCtx&&(n||(n=e.interval),e.stop(),i.videoWidth&&i.videoHeight&&(e.videoPI=i.videoHeight>0?parseInt(i.videoWidth/i.videoHeight*100,10):0,(e.config.mode===UP||r-e.preTime>=n)&&(i&&i.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Hw.setTimeout(Ho(e),e.start,n):Hw.requestAnimationFrame(e.start))})),Go(Ho(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Hw.clearTimeout(Ho(e),e.frameId):Hw.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;if(!i){this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==UP&&this.interval>=1e3?"timer":"animation";var s=function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())};this.player.hasStart?s():this.once(pC,s),r!==GP&&(r!==VP&&(this.on(aC,(function(){e.stop()})),this.on(zw,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Xw,(function(){e.stop()}))),this.on(iC,this.onLoadedData),this.on(sC,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange))}}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(n){"root"===n&&e[n]!==t.config[n]?t.reRender(e[n]):"frameRate"===n?t.interval=parseInt(1e3/e[n],10):"disable"===n&&e[n]&&t.stop(),t.config[n]=e[n]}))}},{key:"init",value:function(e){var t=this.player,i=this.config;this.canvasFilter=n.supportCanvasFilter();try{var r=e||i.root;r||(r=i.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(i.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=i.filter,this.canvas.style.webkitFilter=i.filter),this.mask=this.find("xgmask"),i.addMask&&(this.mask.style.background=i.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){Bw.logError("plugin:DynamicBg",e)}}},{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 n=this.config.startInterval;this._checkIfCanStart()&&this.start(0,n)}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"!==zC.browser||!Hw.isMSE(t)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Hw.typeOf(e)?e:"String"===Hw.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!==VP&&e!==GP}},{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 n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,s=r.height;if(o!==n.width||s!==n.height||n.pi!==t){var a=parseInt(o/s*100,10);n.pi=t,n.width!==o&&(n.width=this.canvas.width=o),n.height!==s&&(n.height=this.canvas.height=s);var c=s,u=o;a<t?u=parseInt(s*t/100,10):a>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(s-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Bw.logError("plugin:DynamicBg",e)}}},{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 WP?WP:WP=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===zC.browser||"firefox"===zC.browser)}}]),n}(M_),KP=zP,YP=d,XP=fe,qP=ie("iterator"),$P=!YP((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.size&&!XP||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[qP]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),JP=Se,ZP=Xd,QP=As,eE=Ee,tE=T,nE=function(e,t,n,i){try{return i?t(JP(n)[0],n[1]):t(n)}catch(t){ZP(e,"throw",t)}},iE=Id,rE=Ur,oE=Ci,sE=Jo,aE=Wd,cE=Fd,uE=Array,lE=k,fE=2147483647,hE=/[^\0-\u007E]/,dE=/[.\u3002\uFF0E\uFF61]/g,pE="Overflow: input needs wider integers to process",vE=RangeError,gE=lE(dE.exec),yE=Math.floor,mE=String.fromCharCode,kE=lE("".charCodeAt),bE=lE([].join),wE=lE([].push),CE=lE("".replace),_E=lE("".split),xE=lE("".toLowerCase),SE=function(e){return e+22+75*(e<26)},TE=function(e,t,n){var i=0;for(e=n?yE(e/700):e>>1,e+=yE(e/t);e>455;)e=yE(e/35),i+=36;return yE(i+36*e/(e+38))},PE=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=kE(e,n++);if(r>=55296&&r<=56319&&n<i){var o=kE(e,n++);56320==(64512&o)?wE(t,((1023&r)<<10)+(1023&o)+65536):(wE(t,r),n--)}else wE(t,r)}return t}(e);var n,i,r=e.length,o=128,s=0,a=72;for(n=0;n<e.length;n++)(i=e[n])<128&&wE(t,mE(i));var c=t.length,u=c;for(c&&wE(t,"-");u<r;){var l=fE;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<l&&(l=i);var f=u+1;if(l-o>yE((fE-s)/f))throw vE(pE);for(s+=(l-o)*f,o=l,n=0;n<e.length;n++){if((i=e[n])<o&&++s>fE)throw vE(pE);if(i==o){for(var h=s,d=36;;){var p=d<=a?1:d>=a+26?26:d-a;if(h<p)break;var v=h-p,g=36-p;wE(t,mE(SE(p+v%g))),h=yE(v/g),d+=36}wE(t,mE(SE(h))),a=TE(s,f,u==c),s=0,u++}}s++,o++}return bE(t,"")},EE=Pn,RE=lr,OE=n,IE=Ee,LE=k,AE=fe,DE=$P,ME=Pn,NE=fs,FE=function(e,t,n){for(var i in t)EE(e,i,t[i],n);return e},BE=Ts,jE=vg,HE=on,UE=Ql,VE=ue,GE=R,WE=As,zE=Bn,KE=Se,YE=pe,XE=Ko,qE=mo,$E=Nt,JE=Wd,ZE=Fd,QE=af,eR=cw,tR=ie("iterator"),nR="URLSearchParams",iR=nR+"Iterator",rR=HE.set,oR=HE.getterFor(nR),sR=HE.getterFor(iR),aR=Object.getOwnPropertyDescriptor,cR=function(e){if(!AE)return OE[e];var t=aR(OE,e);return t&&t.value},uR=cR("fetch"),lR=cR("Request"),fR=cR("Headers"),hR=lR&&lR.prototype,dR=fR&&fR.prototype,pR=OE.RegExp,vR=OE.TypeError,gR=OE.decodeURIComponent,yR=OE.encodeURIComponent,mR=LE("".charAt),kR=LE([].join),bR=LE([].push),wR=LE("".replace),CR=LE([].shift),_R=LE([].splice),xR=LE("".split),SR=LE("".slice),TR=/\+/g,PR=Array(4),ER=function(e){return PR[e-1]||(PR[e-1]=pR("((?:%[\\da-f]{2}){"+e+"})","gi"))},RR=function(e){try{return gR(e)}catch(t){return e}},OR=function(e){var t=wR(e,TR," "),n=4;try{return gR(t)}catch(e){for(;n;)t=wR(t,ER(n--),RR);return t}},IR=/[!'()~]|%20/g,LR={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},AR=function(e){return LR[e]},DR=function(e){return wR(yR(e),IR,AR)},MR=jE((function(e,t){rR(this,{type:iR,iterator:JE(oR(e).entries),kind:t})}),"Iterator",(function(){var e=sR(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),NR=function(e){this.entries=[],this.url=null,void 0!==e&&(YE(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===mR(e,0)?SR(e,1):e:XE(e)))};NR.prototype={type:nR,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,s,a,c=ZE(e);if(c)for(n=(t=JE(e,c)).next;!(i=IE(n,t)).done;){if(o=(r=JE(KE(i.value))).next,(s=IE(o,r)).done||(a=IE(o,r)).done||!IE(o,r).done)throw vR("Expected sequence with length 2");bR(this.entries,{key:XE(s.value),value:XE(a.value)})}else for(var u in e)GE(e,u)&&bR(this.entries,{key:u,value:XE(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=xR(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=xR(t,"="),bR(this.entries,{key:OR(CR(n)),value:OR(kR(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],bR(n,DR(e.key)+"="+DR(e.value));return kR(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var FR=function(){UE(this,BR);var e=rR(this,new NR(arguments.length>0?arguments[0]:void 0));AE||(this.length=e.entries.length)},BR=FR.prototype;if(FE(BR,{append:function(e,t){QE(arguments.length,2);var n=oR(this);bR(n.entries,{key:XE(e),value:XE(t)}),AE||this.length++,n.updateURL()},delete:function(e){QE(arguments.length,1);for(var t=oR(this),n=t.entries,i=XE(e),r=0;r<n.length;)n[r].key===i?_R(n,r,1):r++;AE||(this.length=n.length),t.updateURL()},get:function(e){QE(arguments.length,1);for(var t=oR(this).entries,n=XE(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){QE(arguments.length,1);for(var t=oR(this).entries,n=XE(e),i=[],r=0;r<t.length;r++)t[r].key===n&&bR(i,t[r].value);return i},has:function(e){QE(arguments.length,1);for(var t=oR(this).entries,n=XE(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){QE(arguments.length,1);for(var n,i=oR(this),r=i.entries,o=!1,s=XE(e),a=XE(t),c=0;c<r.length;c++)(n=r[c]).key===s&&(o?_R(r,c--,1):(o=!0,n.value=a));o||bR(r,{key:s,value:a}),AE||(this.length=r.length),i.updateURL()},sort:function(){var e=oR(this);eR(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=oR(this).entries,i=WE(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new MR(this,"keys")},values:function(){return new MR(this,"values")},entries:function(){return new MR(this,"entries")}},{enumerable:!0}),ME(BR,tR,BR.entries,{name:"entries"}),ME(BR,"toString",(function(){return oR(this).serialize()}),{enumerable:!0}),AE&&NE(BR,"size",{get:function(){return oR(this).entries.length},configurable:!0,enumerable:!0}),BE(FR,nR),RE({global:!0,constructor:!0,forced:!DE},{URLSearchParams:FR}),!DE&&VE(fR)){var jR=LE(dR.has),HR=LE(dR.set),UR=function(e){if(YE(e)){var t,n=e.body;if(zE(n)===nR)return t=e.headers?new fR(e.headers):new fR,jR(t,"content-type")||HR(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),qE(e,{body:$E(0,XE(n)),headers:$E(0,t)})}return e};if(VE(uR)&&RE({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return uR(e,arguments.length>1?UR(arguments[1]):{})}}),VE(lR)){var VR=function(e){return UE(this,hR),new lR(e,arguments.length>1?UR(arguments[1]):{})};hR.constructor=VR,VR.prototype=hR,RE({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:VR})}}var GR,WR=lr,zR=fe,KR=$P,YR=n,XR=As,qR=k,$R=Pn,JR=fs,ZR=Ql,QR=R,eO=by,tO=function(e){var t=tE(e),n=rE(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=QP(r,i>2?arguments[2]:void 0));var s,a,c,u,l,f,h=cE(t),d=0;if(!h||this===uE&&iE(h))for(s=oE(t),a=n?new this(s):uE(s);s>d;d++)f=o?r(t[d],d):t[d],sE(a,d,f);else for(l=(u=aE(t,h)).next,a=n?new this:[];!(c=eE(l,u)).done;d++)f=o?nE(u,r,[c.value,d],!0):c.value,sE(a,d,f);return a.length=d,a},nO=is,iO=xm.codeAt,rO=function(e){var t,n,i=[],r=_E(CE(xE(e),dE,"."),".");for(t=0;t<r.length;t++)n=r[t],wE(i,gE(hE,n)?"xn--"+PE(n):n);return bE(i,".")},oO=Ko,sO=Ts,aO=af,cO={URLSearchParams:FR,getState:oR},uO=on,lO=uO.set,fO=uO.getterFor("URL"),hO=cO.URLSearchParams,dO=cO.getState,pO=YR.URL,vO=YR.TypeError,gO=YR.parseInt,yO=Math.floor,mO=Math.pow,kO=qR("".charAt),bO=qR(/./.exec),wO=qR([].join),CO=qR(1..toString),_O=qR([].pop),xO=qR([].push),SO=qR("".replace),TO=qR([].shift),PO=qR("".split),EO=qR("".slice),RO=qR("".toLowerCase),OO=qR([].unshift),IO="Invalid scheme",LO="Invalid host",AO="Invalid port",DO=/[a-z]/i,MO=/[\d+-.a-z]/i,NO=/\d/,FO=/^0x/i,BO=/^[0-7]+$/,jO=/^\d+$/,HO=/^[\da-f]+$/i,UO=/[\0\t\n\r #%/:<>?@[\\\]^|]/,VO=/[\0\t\n\r #/:<>?@[\\\]^|]/,GO=/^[\u0000-\u0020]+/,WO=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,zO=/[\t\n\r]/g,KO=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)OO(t,e%256),e=yO(e/256);return wO(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=CO(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},YO={},XO=eO({},YO,{" ":1,'"':1,"<":1,">":1,"`":1}),qO=eO({},XO,{"#":1,"?":1,"{":1,"}":1}),$O=eO({},qO,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),JO=function(e,t){var n=iO(e,0);return n>32&&n<127&&!QR(t,e)?e:encodeURIComponent(e)},ZO={ftp:21,file:null,http:80,https:443,ws:80,wss:443},QO=function(e,t){var n;return 2==e.length&&bO(DO,kO(e,0))&&(":"==(n=kO(e,1))||!t&&"|"==n)},eI=function(e){var t;return e.length>1&&QO(EO(e,0,2))&&(2==e.length||"/"===(t=kO(e,2))||"\\"===t||"?"===t||"#"===t)},tI=function(e){return"."===e||"%2e"===RO(e)},nI={},iI={},rI={},oI={},sI={},aI={},cI={},uI={},lI={},fI={},hI={},dI={},pI={},vI={},gI={},yI={},mI={},kI={},bI={},wI={},CI={},_I=function(e,t,n){var i,r,o,s=oO(e);if(t){if(r=this.parse(s))throw vO(r);this.searchParams=null}else{if(void 0!==n&&(i=new _I(n,!0)),r=this.parse(s,null,i))throw vO(r);(o=dO(new hO)).bindURL(this),this.searchParams=o}};_I.prototype={type:"URL",parse:function(e,t,n){var i,r,o,s,a,c=this,u=t||nI,l=0,f="",h=!1,d=!1,p=!1;for(e=oO(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=SO(e,GO,""),e=SO(e,WO,"$1")),e=SO(e,zO,""),i=tO(e);l<=i.length;){switch(r=i[l],u){case nI:if(!r||!bO(DO,r)){if(t)return IO;u=rI;continue}f+=RO(r),u=iI;break;case iI:if(r&&(bO(MO,r)||"+"==r||"-"==r||"."==r))f+=RO(r);else{if(":"!=r){if(t)return IO;f="",u=rI,l=0;continue}if(t&&(c.isSpecial()!=QR(ZO,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&ZO[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?u=vI:c.isSpecial()&&n&&n.scheme==c.scheme?u=oI:c.isSpecial()?u=uI:"/"==i[l+1]?(u=sI,l++):(c.cannotBeABaseURL=!0,xO(c.path,""),u=bI)}break;case rI:if(!n||n.cannotBeABaseURL&&"#"!=r)return IO;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=nO(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=CI;break}u="file"==n.scheme?vI:aI;continue;case oI:if("/"!=r||"/"!=i[l+1]){u=aI;continue}u=lI,l++;break;case sI:if("/"==r){u=fI;break}u=kI;continue;case aI:if(c.scheme=n.scheme,r==GR)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=cI;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.query="",u=wI;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.path.length--,u=kI;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=nO(n.path),c.query=n.query,c.fragment="",u=CI}break;case cI:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=kI;continue}u=fI}else u=lI;break;case uI:if(u=lI,"/"!=r||"/"!=kO(f,l+1))continue;l++;break;case lI:if("/"!=r&&"\\"!=r){u=fI;continue}break;case fI:if("@"==r){h&&(f="%40"+f),h=!0,o=tO(f);for(var v=0;v<o.length;v++){var g=o[v];if(":"!=g||p){var y=JO(g,$O);p?c.password+=y:c.username+=y}else p=!0}f=""}else if(r==GR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==f)return"Invalid authority";l-=tO(f).length+1,f="",u=hI}else f+=r;break;case hI:case dI:if(t&&"file"==c.scheme){u=yI;continue}if(":"!=r||d){if(r==GR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==f)return LO;if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",u=mI,t)return;continue}"["==r?d=!0:"]"==r&&(d=!1),f+=r}else{if(""==f)return LO;if(s=c.parseHost(f))return s;if(f="",u=pI,t==dI)return}break;case pI:if(!bO(NO,r)){if(r==GR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=f){var m=gO(f,10);if(m>65535)return AO;c.port=c.isSpecial()&&m===ZO[c.scheme]?null:m,f=""}if(t)return;u=mI;continue}return AO}f+=r;break;case vI:if(c.scheme="file","/"==r||"\\"==r)u=gI;else{if(!n||"file"!=n.scheme){u=kI;continue}if(r==GR)c.host=n.host,c.path=nO(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=nO(n.path),c.query="",u=wI;else{if("#"!=r){eI(wO(nO(i,l),""))||(c.host=n.host,c.path=nO(n.path),c.shortenPath()),u=kI;continue}c.host=n.host,c.path=nO(n.path),c.query=n.query,c.fragment="",u=CI}}break;case gI:if("/"==r||"\\"==r){u=yI;break}n&&"file"==n.scheme&&!eI(wO(nO(i,l),""))&&(QO(n.path[0],!0)?xO(c.path,n.path[0]):c.host=n.host),u=kI;continue;case yI:if(r==GR||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&QO(f))u=kI;else if(""==f){if(c.host="",t)return;u=mI}else{if(s=c.parseHost(f))return s;if("localhost"==c.host&&(c.host=""),t)return;f="",u=mI}continue}f+=r;break;case mI:if(c.isSpecial()){if(u=kI,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=GR&&(u=kI,"/"!=r))continue}else c.fragment="",u=CI;else c.query="",u=wI;break;case kI:if(r==GR||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(a=RO(a=f))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||xO(c.path,"")):tI(f)?"/"==r||"\\"==r&&c.isSpecial()||xO(c.path,""):("file"==c.scheme&&!c.path.length&&QO(f)&&(c.host&&(c.host=""),f=kO(f,0)+":"),xO(c.path,f)),f="","file"==c.scheme&&(r==GR||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)TO(c.path);"?"==r?(c.query="",u=wI):"#"==r&&(c.fragment="",u=CI)}else f+=JO(r,qO);break;case bI:"?"==r?(c.query="",u=wI):"#"==r?(c.fragment="",u=CI):r!=GR&&(c.path[0]+=JO(r,YO));break;case wI:t||"#"!=r?r!=GR&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":JO(r,YO)):(c.fragment="",u=CI);break;case CI:r!=GR&&(c.fragment+=JO(r,XO))}l++}},parseHost:function(e){var t,n,i;if("["==kO(e,0)){if("]"!=kO(e,e.length-1))return LO;if(t=function(e){var t,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return kO(e,f)};if(":"==h()){if(":"!=kO(e,1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&bO(HO,h());)t=16*t+gO(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!bO(NO,h()))return;for(;bO(NO,h());){if(o=gO(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(s=u-l,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[l+s-1],c[l+--s]=a;else if(8!=u)return;return c}(EO(e,1,-1)),!t)return LO;this.host=t}else if(this.isSpecial()){if(e=rO(e),bO(UO,e))return LO;if(t=function(e){var t,n,i,r,o,s,a,c=PO(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(o=10,r.length>1&&"0"==kO(r,0)&&(o=bO(FO,r)?16:8,r=EO(r,8==o?1:2)),""===r)s=0;else{if(!bO(10==o?jO:8==o?BO:HO,r))return e;s=gO(r,o)}xO(n,s)}for(i=0;i<t;i++)if(s=n[i],i==t-1){if(s>=mO(256,5-t))return null}else if(s>255)return null;for(a=_O(n),i=0;i<n.length;i++)a+=n[i]*mO(256,3-i);return a}(e),null===t)return LO;this.host=t}else{if(bO(VO,e))return LO;for(t="",n=tO(e),i=0;i<n.length;i++)t+=JO(n[i],YO);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return QR(ZO,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&QO(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=KO(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+wO(s,"/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw vO(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new xI(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+KO(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(oO(e)+":",nI)},getUsername:function(){return this.username},setUsername:function(e){var t=tO(oO(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=JO(t[n],$O)}},getPassword:function(){return this.password},setPassword:function(e){var t=tO(oO(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=JO(t[n],$O)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?KO(e):KO(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,hI)},getHostname:function(){var e=this.host;return null===e?"":KO(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,dI)},getPort:function(){var e=this.port;return null===e?"":oO(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=oO(e))?this.port=null:this.parse(e,pI))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+wO(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,mI))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=oO(e))?this.query=null:("?"==kO(e,0)&&(e=EO(e,1)),this.query="",this.parse(e,wI)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=oO(e))?("#"==kO(e,0)&&(e=EO(e,1)),this.fragment="",this.parse(e,CI)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var xI=function(e){var t=ZR(this,SI),n=aO(arguments.length,1)>1?arguments[1]:void 0,i=lO(t,new _I(e,!1,n));zR||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},SI=xI.prototype,TI=function(e,t){return{get:function(){return fO(this)[e]()},set:t&&function(e){return fO(this)[t](e)},configurable:!0,enumerable:!0}};if(zR&&(JR(SI,"href",TI("serialize","setHref")),JR(SI,"origin",TI("getOrigin")),JR(SI,"protocol",TI("getProtocol","setProtocol")),JR(SI,"username",TI("getUsername","setUsername")),JR(SI,"password",TI("getPassword","setPassword")),JR(SI,"host",TI("getHost","setHost")),JR(SI,"hostname",TI("getHostname","setHostname")),JR(SI,"port",TI("getPort","setPort")),JR(SI,"pathname",TI("getPathname","setPathname")),JR(SI,"search",TI("getSearch","setSearch")),JR(SI,"searchParams",TI("getSearchParams")),JR(SI,"hash",TI("getHash","setHash"))),$R(SI,"toJSON",(function(){return fO(this).serialize()}),{enumerable:!0}),$R(SI,"toString",(function(){return fO(this).serialize()}),{enumerable:!0}),pO){var PI=pO.createObjectURL,EI=pO.revokeObjectURL;PI&&$R(xI,"createObjectURL",XR(PI,pO)),EI&&$R(xI,"revokeObjectURL",XR(EI,pO))}function RI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function OI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RI(Object(n),!0).forEach((function(t){Go(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function II(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}sO(xI,"URL"),WR({global:!0,constructor:!0,forced:!KR,sham:!zR},{URL:xI});var LI="info",AI=BC,DI=function(e){jo(n,e);var t=II(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats[LI].push(OI(OI({type:"userAction"},n),{},{payload:i}))})),Go(Ho(e),"_onReset",(function(){e.reset()})),Go(Ho(e),"_recordInfo",(function(t){e.info(t)})),Go(Ho(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return No(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(AC,this._recordUserActions),this.on(AI.STATS_INFO,this._recordInfo),this.on(AI.STATS_DOWNLOAD,this._downloadStats),this.on(AI.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[LI].push(OI(OI({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=OI({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=(Go(e={},LI,[]),Go(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.video,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[LI].map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}));return e}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[LI].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(C_);function MI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var NI=function(e){jo(n,e);var t=MI(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Ho(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,s=r.smallGapLimit||.5,a=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,a);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=s;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(Qw,this.onGapJump),this.on(zw,(function(){e.hasPlayed=!0})),this.on($w,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(M_);function FI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}NI.BROWSER_GAP_TOLERANCE=.001;var BI=function(e){jo(n,e);var t=FI(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Ho(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Go(Ho(e),"onJump",(function(){var t=Ho(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(e.jumpCnt++,n.currentTime=r)}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(Qw,this.onWaiting),this.on([Kw,eC],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(zw,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(M_);function jI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var HI="cdn",UI=["cdn"],VI=function(e){jo(n,e);var t=jI(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Go(Ho(e=t.call.apply(t,[this].concat(r))),"startTimer",(function(){Hw.isMSE(e.player.video)||(e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Go(Ho(e),"initSpeedList",(function(){UI.forEach((function(e){!n.speedListCache[e]&&(n.speedListCache[e]=[])}))})),Go(Ho(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.len,t.time,t.type||HI)})),Go(Ho(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,s=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var a=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",s);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=c-a,i=Math.round(1e3*t/n);e.appendList(i,t,n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Go(Ho(e),"appendList",(function(t,i,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:HI;if(n.speedListCache&&n.speedListCache[o]){var s=e.config.saveSpeedMax;n.speedListCache[o].length>=s&&n.speedListCache[o].shift(),n.speedListCache[o].push({speed:t,bytes:i,time:r});var a=Ho(e).player;a&&(o===HI?a.realTimeSpeed=t:a[e.getSpeedName("realTime",o)]=t),e.updateSpeed(o)}})),Go(Ho(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HI,i=n.getAvgSpeedKbs(t),r=Ho(e).player;if(r)if(t===HI)r.avgSpeed&&i===r.avgSpeed||(r.avgSpeed=i,r.emit(mC,{speed:i,realTimeSpeed:r.realTimeSpeed}));else{var o=e.getSpeedName("avg",t);r[o]&&i===r[o]||(r[o]=i,r.emit(mC,{speed:i,realTimeSpeed:r.realTimeSpeed}))}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList,i=e.testCnt;(null==n?void 0:n.length)>0&&UI.push.apply(UI,Ty(n)),this.initSpeedList(),t&&(this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i>0&&this.on([iC,vC],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(){this.off("real_time_speed",this._onRealSpeedChange),this.off([iC,vC],this.startTimer),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:"speedSampleList",get:function(){return n.speedListCache}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:20,addSpeedTypeList:[]}}},{key:"getAvgSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HI;if(!n.speedListCache||!n.speedListCache[e])return-1;if(n.speedListCache[e].length<=0)return-1;var t=0;return n.speedListCache[e].map((function(e){t+=e.speed})),Math.floor(t/n.speedListCache[e].length)}},{key:"getWeightedSpeedKbs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HI,t=-1;if(!n.speedListCache||!n.speedListCache[e])return t;if(n.speedListCache[e].length<=0)return t;var i=[];n.speedListCache[e].forEach((function(e){i.push(e)})),i.sort((function(e,t){return e.speed-t.speed}));for(var r=i.length,o=0,s=0;s<r;s++)o+=i[s].bytes;o/=2;for(var a=0;a<r;a++)(o-=i[a].bytes)<=0&&(t=i[a].speed);return t<0?-1:t}}]),n}(M_);function GI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}Go(VI,"speedListCache",{});var WI=function(e){jo(n,e);var t=GI(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config,i=t.media||t.video;!n.disabled&&i.getVideoPlaybackQuality&&(this.timer=null,this._resetData(),this.on(sC,(function(){e._resetData(),e._stopTick()})),this.on(zw,(function(){e._startTick()})),this.on(Xw,(function(){e._stopTick()})),this.on(Yw,(function(){e._stopTick()})),this.on(aC,(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 n=!1,i=[],r=0;r<t.length;r++){var o=t.start(r),s=t.end(r);if(i.push({start:o,end:s}),o<=e&&e<=s-1){n=!0;break}}return{enoughBuffer:n,buffers:i}}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.media||this.player.video,o=document.hidden,s=r.paused,a=r.readyState,c=r.currentTime,u=r.buffered;if(!(o||s||a<4)){var l=this._checkBuffer(c,u),f=l.enoughBuffer,h=l.buffers;f&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:c,buffers:h,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(jC,this._payload),this._resetCheck())):this._resetCheck())}}},{key:"_resetCheck",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_resetData",value:function(){this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[]}},{key:"_checkDecodeFPS",value:function(){var e,t,n=(null===(e=this.player)||void 0===e?void 0:e.media)||(null===(t=this.player)||void 0===t?void 0:t.video);if(n){var i=n.getVideoPlaybackQuality(),r=i.totalVideoFrames,o=i.droppedVideoFrames,s=performance.now();if(r&&this._lastCheckPoint){var a=r-this._lastDecodedFrames,c=s-this._lastCheckPoint;this._checkStuck(a,r,o,c)}this._lastDecodedFrames=r,this._lastCheckPoint=s}else this._stopTick()}},{key:"destroy",value:function(){this._stopTick(),this._resetData()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(M_);rx.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var zI=No((function e(t,n){var i,r,o;Fo(this,e);var s=n&&"mobile"===n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[xT,jP,DP,BT],[RT,NT,YT,rP,yP,kP,uP,fP,WT,tP]),u=[Mx,Bx,Wx,fT,Yx,SP,EP,NP,uS];this.plugins=[Ix,DI,BI,NI].concat(Ty(c),u);var l=s?"mobile":zC.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[aT,dS,_P,VI,WI]);break;case"mobile":(r=this.plugins).push.apply(r,[tT]);break;default:(o=this.plugins).push.apply(o,[aT,dS,_P])}(zC.os.isIpad||"pc"===l)&&this.plugins.push(KP),zC.os.isIpad&&this.plugins.push(dS),this.ignores=[],this.i18n=[]}));function KI(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 n,i=Vo(e);if(t){var r=Vo(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Uo(this,n)}}var YI=function(e){jo(n,e);var t=KI(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n)}(gx);return Go(YI,"defaultPreset",zI),Go(YI,"Util",Hw),Go(YI,"Sniffer",zC),Go(YI,"Errors",Ww),Go(YI,"Events",HC),Go(YI,"Plugin",M_),Go(YI,"BasePlugin",C_),Go(YI,"I18N",rx),Go(YI,"STATE_CLASS",X_),Go(YI,"PAUSE_TYPES",n_),Go(YI,"BUFFER_CONTROL_TYPES",i_),Go(YI,"InstManager",cx),Go(YI,"TestSpeed",VI),YI}));
|